code_text
stringlengths
604
999k
repo_name
stringlengths
4
100
file_path
stringlengths
4
873
language
stringclasses
23 values
license
stringclasses
15 values
size
int32
1.02k
999k
/*! responsive-nav.js v1.08 * https://github.com/viljamis/responsive-nav.js * http://responsive-nav.com * * Copyright (c) 2013 @viljamis * Available under the MIT license */ /* jshint strict:false, forin:false, noarg:true, noempty:true, eqeqeq:true, boss:true, bitwise:true, browser:true, devel:true, indent:2 */ /* exported responsiveNav */ var responsiveNav = (function (window, document) { var computed = !!window.getComputedStyle; // getComputedStyle polyfill if (!window.getComputedStyle) { window.getComputedStyle = function(el) { this.el = el; this.getPropertyValue = function(prop) { var re = /(\-([a-z]){1})/g; if (prop === "float") { prop = "styleFloat"; } if (re.test(prop)) { prop = prop.replace(re, function () { return arguments[2].toUpperCase(); }); } return el.currentStyle[prop] ? el.currentStyle[prop] : null; }; return this; }; } var nav, opts, navToggle, docEl = document.documentElement, head = document.getElementsByTagName("head")[0], styleElement = document.createElement("style"), navOpen = false, // fn arg can be an object or a function, thanks to handleEvent // read more at: http://www.thecssninja.com/javascript/handleevent addEvent = function (el, evt, fn, bubble) { if ("addEventListener" in el) { // BBOS6 doesn't support handleEvent, catch and polyfill try { el.addEventListener(evt, fn, bubble); } catch (e) { if (typeof fn === "object" && fn.handleEvent) { el.addEventListener(evt, function (e) { // Bind fn as this and set first arg as event object fn.handleEvent.call(fn, e); }, bubble); } else { throw e; } } } else if ("attachEvent" in el) { // check if the callback is an object and contains handleEvent if (typeof fn === "object" && fn.handleEvent) { el.attachEvent("on" + evt, function () { // Bind fn as this fn.handleEvent.call(fn); }); } else { el.attachEvent("on" + evt, fn); } } }, removeEvent = function (el, evt, fn, bubble) { if ("removeEventListener" in el) { try { el.removeEventListener(evt, fn, bubble); } catch (e) { if (typeof fn === "object" && fn.handleEvent) { el.removeEventListener(evt, function (e) { fn.handleEvent.call(fn, e); }, bubble); } else { throw e; } } } else if ("detachEvent" in el) { if (typeof fn === "object" && fn.handleEvent) { el.detachEvent("on" + evt, function () { fn.handleEvent.call(fn); }); } else { el.detachEvent("on" + evt, fn); } } }, getFirstChild = function (e) { var firstChild = e.firstChild; // skip TextNodes while (firstChild !== null && firstChild.nodeType !== 1) { firstChild = firstChild.nextSibling; } return firstChild; }, setAttributes = function (el, attrs) { for (var key in attrs) { el.setAttribute(key, attrs[key]); } }, addClass = function (el, cls) { el.className += " " + cls; el.className = el.className.replace(/(^\s*)|(\s*$)/g,""); }, removeClass = function (el, cls) { var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); el.className = el.className.replace(reg, " ").replace(/(^\s*)|(\s*$)/g,""); }, log = function () {}, ResponsiveNav = function (el, options) { var i; // Default options this.options = { animate: true, // Boolean: Use CSS3 transitions, true or false transition: 400, // Integer: Speed of the transition, in milliseconds label: "Menu", // String: Label for the navigation toggle insert: "after", // String: Insert the toggle before or after the navigation customToggle: "", // Selector: Specify the ID of a custom toggle tabIndex: 1, // Integer: Specify the default toggle's tabindex openPos: "relative", // String: Position of the opened nav, relative or static jsClass: "js", // String: 'JS enabled' class which is added to <html> el debug: false, // Boolean: Log debug messages to console, true or false init: function(){}, // Function: Init callback open: function(){}, // Function: Open callback close: function(){} // Function: Close callback }; // User defined options for (i in options) { this.options[i] = options[i]; } // Adds "js" class for <html> addClass(docEl, this.options.jsClass); // Debug logger if (this.options.debug) { log = function (s) { try { console.log(s); } catch (e) { alert(s); } }; } // Wrapper this.wrapperEl = el.replace("#", ""); if (document.getElementById(this.wrapperEl)) { this.wrapper = document.getElementById(this.wrapperEl); } else { // If el doesn't exists, stop here. log("The nav element you are trying to select doesn't exist"); return; } // Inner wrapper this.wrapper.inner = getFirstChild(this.wrapper); // For minification opts = this.options; nav = this.wrapper; // Init this._init(this); }; ResponsiveNav.prototype = { // Public methods destroy: function () { this._removeStyles(); removeClass(nav, "closed"); removeClass(nav, "opened"); nav.removeAttribute("style"); nav.removeAttribute("aria-hidden"); nav = null; _instance = null; removeEvent(window, "load", this, false); removeEvent(window, "resize", this, false); removeEvent(navToggle, "mousedown", this, false); removeEvent(navToggle, "touchstart", this, false); removeEvent(navToggle, "keyup", this, false); removeEvent(navToggle, "click", this, false); if (!opts.customToggle) { navToggle.parentNode.removeChild(navToggle); } else { navToggle.removeAttribute("aria-hidden"); } log("Destroyed!"); }, toggle: function () { if (!navOpen) { removeClass(nav, "closed"); addClass(nav, "opened"); nav.style.position = opts.openPos; setAttributes(nav, {"aria-hidden": "false"}); navOpen = true; opts.open(); log("Opened nav"); } else { removeClass(nav, "opened"); addClass(nav, "closed"); setAttributes(nav, {"aria-hidden": "true"}); if (opts.animate) { setTimeout(function () { nav.style.position = "absolute"; }, opts.transition + 10); } else { nav.style.position = "absolute"; } navOpen = false; opts.close(); log("Closed nav"); } }, handleEvent: function (e) { var evt = e || window.event; switch (evt.type) { case "mousedown": this._onmousedown(evt); break; case "touchstart": this._ontouchstart(evt); break; case "keyup": this._onkeyup(evt); break; case "click": this._onclick(evt); break; case "load": this._transitions(evt); this._resize(evt); break; case "resize": this._resize(evt); break; } }, // Private methods _init: function () { log("Inited Responsive Nav"); addClass(nav, "closed"); this._createToggle(); addEvent(window, "load", this, false); addEvent(window, "resize", this, false); addEvent(navToggle, "mousedown", this, false); addEvent(navToggle, "touchstart", this, false); addEvent(navToggle, "keyup", this, false); addEvent(navToggle, "click", this, false); }, _createStyles: function () { if (!styleElement.parentNode) { head.appendChild(styleElement); log("Created 'styleElement' to <head>"); } }, _removeStyles: function () { if (styleElement.parentNode) { styleElement.parentNode.removeChild(styleElement); log("Removed 'styleElement' from <head>"); } }, _createToggle: function () { if (!opts.customToggle) { var toggle = document.createElement("a"); toggle.innerHTML = opts.label; setAttributes(toggle, { "href": "#", "id": "nav-toggle", "tabindex": opts.tabIndex }); if (opts.insert === "after") { nav.parentNode.insertBefore(toggle, nav.nextSibling); } else { nav.parentNode.insertBefore(toggle, nav); } navToggle = document.getElementById("nav-toggle"); log("Default nav toggle created"); } else { var toggleEl = opts.customToggle.replace("#", ""); if (document.getElementById(toggleEl)) { navToggle = document.getElementById(toggleEl); log("Custom nav toggle created"); } else { log("The custom nav toggle you are trying to select doesn't exist"); return; } } }, _preventDefault: function(e) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }, _onmousedown: function (e) { this._preventDefault(e); this.toggle(e); }, _ontouchstart: function (e) { // Touchstart event fires before // the mousedown and can wipe it navToggle.onmousedown = null; this._preventDefault(e); this.toggle(e); }, _onkeyup: function (e) { var evt = e || window.event; if (evt.keyCode === 13) { this.toggle(e); } }, _onclick: function (e) { this._preventDefault(e); }, _transitions: function () { if (opts.animate) { var objStyle = nav.style, transition = "max-height " + opts.transition + "ms"; objStyle.WebkitTransition = transition; objStyle.MozTransition = transition; objStyle.OTransition = transition; objStyle.transition = transition; } }, _calcHeight: function () { var savedHeight = nav.inner.offsetHeight, innerStyles = "#" + this.wrapperEl + ".opened{max-height:" + savedHeight + "px}"; // Hide from old IE if (computed) { styleElement.innerHTML = innerStyles; innerStyles = ""; } log("Calculated max-height of " + savedHeight + "px and updated 'styleElement'"); }, _resize: function () { if (window.getComputedStyle(navToggle, null).getPropertyValue("display") !== "none") { setAttributes(navToggle, {"aria-hidden": "false"}); // If the navigation is hidden if (nav.className.match(/(^|\s)closed(\s|$)/)) { setAttributes(nav, {"aria-hidden": "true"}); nav.style.position = "absolute"; } this._createStyles(); this._calcHeight(); } else { setAttributes(navToggle, {"aria-hidden": "true"}); setAttributes(nav, {"aria-hidden": "false"}); nav.style.position = opts.openPos; this._removeStyles(); } // Init callback opts.init(); } }; var _instance; function rn (el, options) { if (!_instance) { _instance = new ResponsiveNav(el, options); } return _instance; } return rn; })(window, document);
ZDroid/cdnjs
ajax/libs/responsive-nav.js/1.08/responsive-nav.js
JavaScript
mit
11,788
/*! responsive-nav.js v1.09 * https://github.com/viljamis/responsive-nav.js * http://responsive-nav.com * * Copyright (c) 2013 @viljamis * Available under the MIT license */ /* jshint strict:false, forin:false, noarg:true, noempty:true, eqeqeq:true, boss:true, bitwise:true, browser:true, devel:true, indent:2 */ /* exported responsiveNav */ var responsiveNav = (function (window, document) { var computed = !!window.getComputedStyle; // getComputedStyle polyfill if (!window.getComputedStyle) { window.getComputedStyle = function(el) { this.el = el; this.getPropertyValue = function(prop) { var re = /(\-([a-z]){1})/g; if (prop === "float") { prop = "styleFloat"; } if (re.test(prop)) { prop = prop.replace(re, function () { return arguments[2].toUpperCase(); }); } return el.currentStyle[prop] ? el.currentStyle[prop] : null; }; return this; }; } var nav, opts, navToggle, docEl = document.documentElement, head = document.getElementsByTagName("head")[0], styleElement = document.createElement("style"), navOpen = false, // fn arg can be an object or a function, thanks to handleEvent // read more at: http://www.thecssninja.com/javascript/handleevent addEvent = function (el, evt, fn, bubble) { if ("addEventListener" in el) { // BBOS6 doesn't support handleEvent, catch and polyfill try { el.addEventListener(evt, fn, bubble); } catch (e) { if (typeof fn === "object" && fn.handleEvent) { el.addEventListener(evt, function (e) { // Bind fn as this and set first arg as event object fn.handleEvent.call(fn, e); }, bubble); } else { throw e; } } } else if ("attachEvent" in el) { // check if the callback is an object and contains handleEvent if (typeof fn === "object" && fn.handleEvent) { el.attachEvent("on" + evt, function () { // Bind fn as this fn.handleEvent.call(fn); }); } else { el.attachEvent("on" + evt, fn); } } }, removeEvent = function (el, evt, fn, bubble) { if ("removeEventListener" in el) { try { el.removeEventListener(evt, fn, bubble); } catch (e) { if (typeof fn === "object" && fn.handleEvent) { el.removeEventListener(evt, function (e) { fn.handleEvent.call(fn, e); }, bubble); } else { throw e; } } } else if ("detachEvent" in el) { if (typeof fn === "object" && fn.handleEvent) { el.detachEvent("on" + evt, function () { fn.handleEvent.call(fn); }); } else { el.detachEvent("on" + evt, fn); } } }, getFirstChild = function (e) { var firstChild = e.firstChild; // skip TextNodes while (firstChild !== null && firstChild.nodeType !== 1) { firstChild = firstChild.nextSibling; } return firstChild; }, setAttributes = function (el, attrs) { for (var key in attrs) { el.setAttribute(key, attrs[key]); } }, addClass = function (el, cls) { el.className += " " + cls; el.className = el.className.replace(/(^\s*)|(\s*$)/g,""); }, removeClass = function (el, cls) { var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); el.className = el.className.replace(reg, " ").replace(/(^\s*)|(\s*$)/g,""); }, log = function () {}, ResponsiveNav = function (el, options) { var i; // Default options this.options = { animate: true, // Boolean: Use CSS3 transitions, true or false transition: 400, // Integer: Speed of the transition, in milliseconds label: "Menu", // String: Label for the navigation toggle insert: "after", // String: Insert the toggle before or after the navigation customToggle: "", // Selector: Specify the ID of a custom toggle tabIndex: 1, // Integer: Specify the default toggle's tabindex openPos: "relative", // String: Position of the opened nav, relative or static jsClass: "js", // String: 'JS enabled' class which is added to <html> el debug: false, // Boolean: Log debug messages to console, true or false init: function(){}, // Function: Init callback open: function(){}, // Function: Open callback close: function(){} // Function: Close callback }; // User defined options for (i in options) { this.options[i] = options[i]; } // Adds "js" class for <html> addClass(docEl, this.options.jsClass); // Debug logger if (this.options.debug) { log = function (s) { try { console.log(s); } catch (e) { alert(s); } }; } // Wrapper this.wrapperEl = el.replace("#", ""); if (document.getElementById(this.wrapperEl)) { this.wrapper = document.getElementById(this.wrapperEl); } else { // If el doesn't exists, stop here. throw new Error("The nav element you are trying to select doesn't exist"); } // Inner wrapper this.wrapper.inner = getFirstChild(this.wrapper); // For minification opts = this.options; nav = this.wrapper; // Init this._init(this); }; ResponsiveNav.prototype = { // Public methods destroy: function () { this._removeStyles(); removeClass(nav, "closed"); removeClass(nav, "opened"); nav.removeAttribute("style"); nav.removeAttribute("aria-hidden"); nav = null; _instance = null; removeEvent(window, "load", this, false); removeEvent(window, "resize", this, false); removeEvent(navToggle, "mousedown", this, false); removeEvent(navToggle, "touchstart", this, false); removeEvent(navToggle, "keyup", this, false); removeEvent(navToggle, "click", this, false); if (!opts.customToggle) { navToggle.parentNode.removeChild(navToggle); } else { navToggle.removeAttribute("aria-hidden"); } log("Destroyed!"); }, toggle: function () { if (!navOpen) { removeClass(nav, "closed"); addClass(nav, "opened"); nav.style.position = opts.openPos; setAttributes(nav, {"aria-hidden": "false"}); navOpen = true; opts.open(); log("Opened nav"); } else { removeClass(nav, "opened"); addClass(nav, "closed"); setAttributes(nav, {"aria-hidden": "true"}); if (opts.animate) { setTimeout(function () { nav.style.position = "absolute"; }, opts.transition + 10); } else { nav.style.position = "absolute"; } navOpen = false; opts.close(); log("Closed nav"); } }, handleEvent: function (e) { var evt = e || window.event; switch (evt.type) { case "mousedown": this._onmousedown(evt); break; case "touchstart": this._ontouchstart(evt); break; case "keyup": this._onkeyup(evt); break; case "click": this._onclick(evt); break; case "load": this._transitions(evt); this._resize(evt); break; case "resize": this._resize(evt); break; } }, // Private methods _init: function () { log("Inited Responsive Nav"); addClass(nav, "closed"); this._createToggle(); addEvent(window, "load", this, false); addEvent(window, "resize", this, false); addEvent(navToggle, "mousedown", this, false); addEvent(navToggle, "touchstart", this, false); addEvent(navToggle, "keyup", this, false); addEvent(navToggle, "click", this, false); }, _createStyles: function () { if (!styleElement.parentNode) { head.appendChild(styleElement); log("Created 'styleElement' to <head>"); } }, _removeStyles: function () { if (styleElement.parentNode) { styleElement.parentNode.removeChild(styleElement); log("Removed 'styleElement' from <head>"); } }, _createToggle: function () { if (!opts.customToggle) { var toggle = document.createElement("a"); toggle.innerHTML = opts.label; setAttributes(toggle, { "href": "#", "id": "nav-toggle", "tabindex": opts.tabIndex }); if (opts.insert === "after") { nav.parentNode.insertBefore(toggle, nav.nextSibling); } else { nav.parentNode.insertBefore(toggle, nav); } navToggle = document.getElementById("nav-toggle"); log("Default nav toggle created"); } else { var toggleEl = opts.customToggle.replace("#", ""); if (document.getElementById(toggleEl)) { navToggle = document.getElementById(toggleEl); log("Custom nav toggle created"); } else { throw new Error("The custom nav toggle you are trying to select doesn't exist"); } } }, _preventDefault: function(e) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }, _onmousedown: function (e) { this._preventDefault(e); this.toggle(e); }, _ontouchstart: function (e) { // Touchstart event fires before // the mousedown and can wipe it navToggle.onmousedown = null; this._preventDefault(e); this.toggle(e); }, _onkeyup: function (e) { var evt = e || window.event; if (evt.keyCode === 13) { this.toggle(e); } }, _onclick: function (e) { this._preventDefault(e); }, _transitions: function () { if (opts.animate) { var objStyle = nav.style, transition = "max-height " + opts.transition + "ms"; objStyle.WebkitTransition = transition; objStyle.MozTransition = transition; objStyle.OTransition = transition; objStyle.transition = transition; } }, _calcHeight: function () { var savedHeight = nav.inner.offsetHeight, innerStyles = "#" + this.wrapperEl + ".opened{max-height:" + savedHeight + "px}"; // Hide from old IE if (computed) { styleElement.innerHTML = innerStyles; innerStyles = ""; } log("Calculated max-height of " + savedHeight + "px and updated 'styleElement'"); }, _resize: function () { if (window.getComputedStyle(navToggle, null).getPropertyValue("display") !== "none") { setAttributes(navToggle, {"aria-hidden": "false"}); // If the navigation is hidden if (nav.className.match(/(^|\s)closed(\s|$)/)) { setAttributes(nav, {"aria-hidden": "true"}); nav.style.position = "absolute"; } this._createStyles(); this._calcHeight(); } else { setAttributes(navToggle, {"aria-hidden": "true"}); setAttributes(nav, {"aria-hidden": "false"}); nav.style.position = opts.openPos; this._removeStyles(); } // Init callback opts.init(); } }; var _instance; function rn (el, options) { if (!_instance) { _instance = new ResponsiveNav(el, options); } return _instance; } return rn; })(window, document);
dada0423/cdnjs
ajax/libs/responsive-nav.js/1.09/responsive-nav.js
JavaScript
mit
11,778
"use strict";angular.module("ngLocale",[],["$provide",function($provide){var PLURAL_CATEGORY={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};function getDecimals(n){n=n+"";var i=n.indexOf(".");return i==-1?0:n.length-i-1}function getVF(n,opt_precision){var v=opt_precision;if(undefined===v){v=Math.min(getDecimals(n),3)}var base=Math.pow(10,v);var f=(n*base|0)%base;return{v:v,f:f}}$provide.value("$locale",{DATETIME_FORMATS:{AMPMS:["subaka","kikiiɗe"],DAY:["dewo","aaɓnde","mawbaare","njeslaare","naasaande","mawnde","hoore-biir"],ERANAMES:["Hade Iisa","Caggal Iisa"],ERAS:["H-I","C-I"],FIRSTDAYOFWEEK:0,MONTH:["siilo","colte","mbooy","seeɗto","duujal","korse","morso","juko","siilto","yarkomaa","jolal","bowte"],SHORTDAY:["dew","aaɓ","maw","nje","naa","mwd","hbi"],SHORTMONTH:["sii","col","mbo","see","duu","kor","mor","juk","slt","yar","jol","bow"],STANDALONEMONTH:["siilo","colte","mbooy","seeɗto","duujal","korse","morso","juko","siilto","yarkomaa","jolal","bowte"],WEEKENDRANGE:[5,6],fullDate:"EEEE d MMMM y",longDate:"d MMMM y",medium:"d MMM, y HH:mm:ss",mediumDate:"d MMM, y",mediumTime:"HH:mm:ss","short":"d/M/y HH:mm",shortDate:"d/M/y",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"MRO",DECIMAL_SEP:",",GROUP_SEP:" ",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:" ¤",posPre:"",posSuf:" ¤"}]},id:"ff-mr",localeID:"ff_MR",pluralCat:function(n,opt_precision){var i=n|0;var vf=getVF(n,opt_precision);if(i==1&&vf.v==0){return PLURAL_CATEGORY.ONE}return PLURAL_CATEGORY.OTHER}})}]);
sashberd/cdnjs
ajax/libs/angular.js/1.4.10/i18n/angular-locale_ff-mr.min.js
JavaScript
mit
1,640
<?php //============================================================+ // File name : tcpdf_barcodes_1d_include.php // Begin : 2013-05-19 // Last Update : 2013-05-19 // // Description : Search and include the TCPDF Barcode 1D class. // // Author: Nicola Asuni // // (c) Copyright: // Nicola Asuni // Tecnick.com LTD // www.tecnick.com // info@tecnick.com //============================================================+ /** * Search and include the TCPDF Barcode 1D class. * @package com.tecnick.tcpdf * @abstract TCPDF - Include the main class. * @author Nicola Asuni * @since 2013-05-19 */ // Include the TCPDF 1D barcode class (search the class on the following directories). $tcpdf_barcodes_1d_include_dirs = array(realpath('../../tcpdf_barcodes_1d.php'), '/usr/share/php/tcpdf/tcpdf_barcodes_1d.php', '/usr/share/tcpdf/tcpdf_barcodes_1d.php', '/usr/share/php-tcpdf/tcpdf_barcodes_1d.php', '/var/www/tcpdf/tcpdf_barcodes_1d.php', '/var/www/html/tcpdf/tcpdf_barcodes_1d.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf_barcodes_1d.php'); foreach ($tcpdf_barcodes_1d_include_dirs as $tcpdf_barcodes_1d_include_path) { if (@file_exists($tcpdf_barcodes_1d_include_path)) { require_once($tcpdf_barcodes_1d_include_path); break; } } //============================================================+ // END OF FILE //============================================================+
gauravmobileyug/ts
system/helpers/tcpdf/examples/barcodes/tcpdf_barcodes_1d_include.php
PHP
mit
1,447
/* Phaser v2.0.2 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */ (function(){var a=this,b=b||{};b.WEBGL_RENDERER=0,b.CANVAS_RENDERER=1,b.VERSION="v1.5.0",b.blendModes={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},b.scaleModes={DEFAULT:0,LINEAR:0,NEAREST:1},b.INTERACTION_FREQUENCY=30,b.AUTO_PREVENT_DEFAULT=!0,b.RAD_TO_DEG=180/Math.PI,b.DEG_TO_RAD=Math.PI/180,b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.constructor=b.Point,b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype.clone=function(){for(var a=[],c=0;c<this.points.length;c++)a.push(this.points[c].clone());return new b.Polygon(a)},b.Polygon.prototype.contains=function(a,b){for(var c=!1,d=0,e=this.points.length-1;d<this.points.length;e=d++){var f=this.points[d].x,g=this.points[d].y,h=this.points[e].x,i=this.points[e].y,j=g>b!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.determineMatrixArrayType=function(){return"undefined"!=typeof Float32Array?Float32Array:Array},b.Matrix2=b.determineMatrixArrayType(),b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new Float32Array(9));var b=this.array;return a?(this.array[0]=this.a,this.array[1]=this.c,this.array[2]=0,this.array[3]=this.b,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty,this.array[8]=1):(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0,this.array[8]=1),b},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new b.Rectangle(0,0,1,1),this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,b.DisplayObject.prototype.setInteractive=function(a){this.interactive=a},Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c<a.length;c++)for(var d=a[c].passes,e=0;e<d.length;e++)b.push(d[e]);this._filterBlock={target:this,filterPasses:b}}this._filters=a}}),Object.defineProperty(b.DisplayObject.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap!==a&&(a?this._generateCachedSprite():this._destroyCachedSprite(),this._cacheAsBitmap=a)}}),b.DisplayObject.prototype.updateTransform=function(){this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation));var a=this.parent.worldTransform,b=this.worldTransform,c=this.pivot.x,d=this.pivot.y,e=this._cr*this.scale.x,f=-this._sr*this.scale.y,g=this._sr*this.scale.x,h=this._cr*this.scale.y,i=this.position.x-e*c-d*f,j=this.position.y-h*d-c*g,k=a.a,l=a.b,m=a.c,n=a.d;b.a=k*e+l*g,b.b=k*f+l*h,b.tx=k*i+l*j+a.tx,b.c=m*e+n*g,b.d=m*f+n*h,b.ty=m*i+n*j+a.ty,this.worldAlpha=this.alpha*this.parent.worldAlpha},b.DisplayObject.prototype.getBounds=function(a){return a=a,b.EmptyRectangle},b.DisplayObject.prototype.getLocalBounds=function(){return this.getBounds(b.identityMatrix)},b.DisplayObject.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0)},b.DisplayObject.prototype.generateTexture=function(a){var c=this.getLocalBounds(),d=new b.RenderTexture(0|c.width,0|c.height,a);return d.render(this),d},b.DisplayObject.prototype.updateCache=function(){this._generateCachedSprite()},b.DisplayObject.prototype._renderCachedSprite=function(a){a.gl?b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a):b.Sprite.prototype._renderCanvas.call(this._cachedSprite,a)},b.DisplayObject.prototype._generateCachedSprite=function(){this._cacheAsBitmap=!1;var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.texture.resize(0|a.width,0|a.height);else{var c=new b.RenderTexture(0|a.width,0|a.height);this._cachedSprite=new b.Sprite(c),this._cachedSprite.worldTransform=this.worldTransform}var d=this._filters;this._filters=null,this._cachedSprite.filters=d,this._cachedSprite.texture.render(this),this._filters=d,this._cacheAsBitmap=!0},b.DisplayObject.prototype._destroyCachedSprite=function(){this._cachedSprite&&(this._cachedSprite.texture.destroy(!0),this._cachedSprite=null)},b.DisplayObject.prototype._renderWebGL=function(a){a=a},b.DisplayObject.prototype._renderCanvas=function(a){a=a},Object.defineProperty(b.DisplayObject.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.DisplayObject.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.DisplayObjectContainer=function(){b.DisplayObject.call(this),this.children=[]},b.DisplayObjectContainer.prototype=Object.create(b.DisplayObject.prototype),b.DisplayObjectContainer.prototype.constructor=b.DisplayObjectContainer,b.DisplayObjectContainer.prototype.addChild=function(a){this.addChildAt(a,this.children.length)},b.DisplayObjectContainer.prototype.addChildAt=function(a,b){if(!(b>=0&&b<=this.children.length))throw new Error(a+" The index "+b+" supplied is out of bounds "+this.children.length);a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.children.indexOf(a),d=this.children.indexOf(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(a>=0&&a<this.children.length)return this.children[a];throw new Error("The supplied DisplayObjects must be a child of the caller "+this)},b.DisplayObjectContainer.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error(a+" The supplied DisplayObject must be a child of the caller "+this);this.stage&&a.removeStageReference(),a.parent=void 0,this.children.splice(b,1)},b.DisplayObjectContainer.prototype.updateTransform=function(){if(this.visible&&(b.DisplayObject.prototype.updateTransform.call(this),!this._cacheAsBitmap))for(var a=0,c=this.children.length;c>a;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.getBounds=function(a){if(0===this.children.length)return b.EmptyRectangle;if(a){var c=this.worldTransform;this.worldTransform=a,this.updateTransform(),this.worldTransform=c}for(var d,e,f,g=1/0,h=1/0,i=-1/0,j=-1/0,k=!1,l=0,m=this.children.length;m>l;l++){var n=this.children[l];n.visible&&(k=!0,d=this.children[l].getBounds(a),g=g<d.x?g:d.x,h=h<d.y?h:d.y,e=d.width+d.x,f=d.height+d.y,i=i>e?i:e,j=j>f?j:f)}if(!k)return b.EmptyRectangle;var o=this._bounds;return o.x=g,o.y=h,o.width=i-g,o.height=j-h,o},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a.context);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,a.baseTexture.hasLoaded?this.onTextureUpdate():(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture.baseTexture!==a.baseTexture?(this.textureChange=!0,this.texture=a):this.texture=a,this.cachedTint=16777215,this.updateFrame=!0},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.c,k=h.b,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=-1/0,x=-1/0,y=1/0,z=1/0;y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>p?p:z,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=p>x?p:x,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x;var A=this._bounds;return A.x=y,A.width=w-y,A.y=z,A.height=x-z,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=this.texture.frame,d=a.context,e=this.texture;if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,d.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a.context),c&&c.width&&c.height&&e.baseTexture.source){d.globalAlpha=this.worldAlpha;var f=this.worldTransform;if(a.roundPixels?d.setTransform(f.a,f.c,f.b,f.d,0|f.tx,0|f.ty):d.setTransform(f.a,f.c,f.b,f.d,f.tx,f.ty),a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,d[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR),16777215!==this.tint){if(this.cachedTint!==this.tint){if(!e.baseTexture.hasLoaded)return;this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)}d.drawImage(this.tintedTexture,0,0,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}else if(e.trim){var g=e.trim;d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,g.x-this.anchor.x*g.width,g.y-this.anchor.y*g.height,c.width,c.height)}else d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}for(var h=0,i=this.children.length;i>h;h++){var j=this.children[h];j._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){b.DisplayObject.prototype.updateTransform.call(this)},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),a.spriteBatch.stop(),a.shaderManager.activateShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.shaderManager.activateShader(a.shaderManager.defaultShader),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){var c=a.context;c.globalAlpha=this.worldAlpha,b.DisplayObject.prototype.updateTransform.call(this);for(var d=this.worldTransform,e=!0,f=0;f<this.children.length;f++){var g=this.children[f];if(g.visible){var h=g.texture,i=h.frame;if(c.globalAlpha=this.worldAlpha*g.alpha,g.rotation%(2*Math.PI)===0)e&&(c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),e=!1),c.drawImage(h.baseTexture.source,i.x,i.y,i.width,i.height,g.anchor.x*-i.width*g.scale.x+g.position.x+.5|0,g.anchor.y*-i.height*g.scale.y+g.position.y+.5|0,i.width*g.scale.x,i.height*g.scale.y);else{e||(e=!0),b.DisplayObject.prototype.updateTransform.call(g);var j=g.worldTransform;a.roundPixels?c.setTransform(j.a,j.c,j.b,j.d,0|j.tx,0|j.ty):c.setTransform(j.a,j.c,j.b,j.d,j.tx,j.ty),c.drawImage(h.baseTexture.source,i.x,i.y,i.width,i.height,g.anchor.x*-i.width+.5|0,g.anchor.y*-i.height+.5|0,i.width,i.height)}}}},b.FilterBlock=function(){this.visible=!0,this.renderable=!0},b.Text=function(a,c){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),b.Sprite.call(this,b.Texture.fromCanvas(this.canvas)),this.setText(a),this.setStyle(c),this.updateText(),this.dirty=!1},b.Text.prototype=Object.create(b.Sprite.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,this.style=a,this.dirty=!0},b.Text.prototype.setText=function(a){this.text=a.toString()||" ",this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.wordWrap(this.text));for(var c=a.split(/(?:\r\n|\r|\n)/),d=[],e=0,f=0;f<c.length;f++){var g=this.context.measureText(c[f]).width;d[f]=g,e=Math.max(e,g)}this.canvas.width=e+this.style.strokeThickness;var h=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness;for(this.canvas.height=h*c.length,navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.textBaseline="top",f=0;f<c.length;f++){var i=new b.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+f*h);"right"===this.style.align?i.x+=e-d[f]:"center"===this.style.align&&(i.x+=(e-d[f])/2),this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(c[f],i.x,i.y),this.style.fill&&this.context.fillText(c[f],i.x,i.y)}this.updateTexture()},b.Text.prototype.updateTexture=function(){this.texture.baseTexture.width=this.canvas.width,this.texture.baseTexture.height=this.canvas.height,this.texture.frame.width=this.canvas.width,this.texture.frame.height=this.canvas.height,this._width=this.canvas.width,this._height=this.canvas.height,this.requiresUpdate=!0},b.Text.prototype._renderWebGL=function(a){this.requiresUpdate&&(this.requiresUpdate=!1,b.updateWebGLTexture(this.texture.baseTexture,a.gl)),b.Sprite.prototype._renderWebGL.call(this,a)},b.Text.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.Sprite.prototype.updateTransform.call(this)},b.Text.prototype.determineFontHeight=function(a){var c=b.Text.heightCache[a];if(!c){var d=document.getElementsByTagName("body")[0],e=document.createElement("div"),f=document.createTextNode("M");e.appendChild(f),e.setAttribute("style",a+";position:absolute;top:0;left:0"),d.appendChild(e),c=e.offsetHeight,b.Text.heightCache[a]=c,d.removeChild(e)}return c},b.Text.prototype.wordWrap=function(a){for(var b="",c=a.split("\n"),d=0;d<c.length;d++){for(var e=this.style.wordWrapWidth,f=c[d].split(" "),g=0;g<f.length;g++){var h=this.context.measureText(f[g]).width,i=h+this.context.measureText(" ").width;i>e?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d<c.length-1&&(b+="\n")}return b},b.Text.prototype.destroy=function(a){a&&this.texture.destroy()},b.Text.heightCache={},b.BitmapText=function(a,c){b.DisplayObjectContainer.call(this),this._pool=[],this.setText(a),this.setStyle(c),this.updateText(),this.dirty=!1},b.BitmapText.prototype=Object.create(b.DisplayObjectContainer.prototype),b.BitmapText.prototype.constructor=b.BitmapText,b.BitmapText.prototype.setText=function(a){this.text=a||" ",this.dirty=!0},b.BitmapText.prototype.setStyle=function(a){a=a||{},a.align=a.align||"left",this.style=a;var c=a.font.split(" ");this.fontName=c[c.length-1],this.fontSize=c.length>=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j<this.text.length;j++){var k=this.text.charCodeAt(j);if(/(?:\r\n|\r|\n)/.test(this.text.charAt(j)))g.push(c.x),f=Math.max(f,c.x),h++,c.x=0,c.y+=a.lineHeight,d=null;else{var l=a.chars[k];l&&(d&&l[d]&&(c.x+=l.kerning[d]),e.push({texture:l.texture,line:h,charCode:k,position:new b.Point(c.x+l.xOffset,c.y+l.yOffset)}),c.x+=l.xAdvance,d=k)}}g.push(c.x),f=Math.max(f,c.x);var m=[];for(j=0;h>=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.Sprite(e[j].texture),r.position.x=(e[j].position.x+m[e[j].line])*i,r.position.y=e[j].position.y*i,r.scale.x=r.scale.y=i,r.tint=q,r.parent||this.addChild(r)}for(;this.children.length>p;){var s=this.getChildAt(this.children.length-1);this._pool.push(s),this.removeChild(s)}this.textWidth=f*i,this.textHeight=(c.y+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var c=0,d=["ms","moz","webkit","o"],e=0;e<d.length&&!window.requestAnimationFrame;++e)window.requestAnimationFrame=window[d[e]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[d[e]+"CancelAnimationFrame"]||window[d[e]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(a){var b=(new Date).getTime(),d=Math.max(0,16-(b-c)),e=window.setTimeout(function(){a(b+d)},d);return c=b+d,e}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)}),window.requestAnimFrame=window.requestAnimationFrame,b.hex2rgb=function(a){return[(a>>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b<a.length;b++)try{return new window.ActiveXObject(a[b])}catch(c){}},b.canUseNewCanvasBlendModes=function(){var a=document.createElement("canvas");a.width=1,a.height=1;var b=a.getContext("2d");return b.fillStyle="#000",b.fillRect(0,0,1,1),b.globalCompositeOperation="multiply",b.fillStyle="#fff",b.fillRect(0,0,1,1),0===b.getImageData(0,0,1,1).data[0]},b.getNextPowerOfTwo=function(a){if(a>0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.EventTarget=function(){var a={};this.addEventListener=this.on=function(b,c){void 0===a[b]&&(a[b]=[]),-1===a[b].indexOf(c)&&a[b].push(c)},this.dispatchEvent=this.emit=function(b){if(a[b.type]&&a[b.type].length)for(var c=0,d=a[b.type].length;d>c;c++)a[b.type][c](b)},this.removeEventListener=this.off=function(b,c){var d=a[b].indexOf(c);-1!==d&&a[b].splice(d,1)},this.removeAllEventListeners=function(b){var c=a[b];c&&(c.length=0)}},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.length>>1;if(3>d)return[];for(var e=[],f=[],g=0;d>g;g++)f.push(g);g=0;for(var h=d;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.PolyK._convex(l,m,n,o,p,q,c)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&b.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!c)return window.console.log("PIXI Warning: shape too complex to fill"),[];for(e=[],f=[],g=0;d>g;g++)f.push(g);g=0,h=d,c=!1}}return e.push(f[0],f[1],f[2]),e},b.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},b.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},b.initDefaultShaders=function(){},b.CompileVertexShader=function(a,c){return b._CompileShader(a,c,a.VERTEX_SHADER)},b.CompileFragmentShader=function(a,c){return b._CompileShader(a,c,a.FRAGMENT_SHADER)},b._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},b.compileProgram=function(a,c,d){var e=b.CompileFragmentShader(a,d),f=b.CompileVertexShader(a,c),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},b.PixiShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.attributes=[],this.init()},b.PixiShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc||b.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var d in this.uniforms)this.uniforms[d].uniformLocation=a.getUniformLocation(c,d);this.initUniforms(),this.program=c},b.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},b.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!!c.flipY),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},b.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,c=this.gl;for(var d in this.uniforms)a=this.uniforms[d],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]||b.createWebGLTexture(a.value.baseTexture,c)),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec2 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;"," vColor = vec4(color * aColor.x, aColor.x);","}"],b.PixiFastShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init() },b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(){this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));"," gl_FragColor = gl_FragColor * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","uniform vec2 offsetVector;","varying float vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"]},b.StripShader.prototype.init=function(){var a=b.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d=c.gl,e=c.projection,f=c.offset,g=c.shaderManager.primitiveShader;a._webGL[d.id]||(a._webGL[d.id]={points:[],indices:[],lastIndex:0,buffer:d.createBuffer(),indexBuffer:d.createBuffer()});var h=a._webGL[d.id];a.dirty&&(a.dirty=!1,a.clearDirty&&(a.clearDirty=!1,h.lastIndex=0,h.points=[],h.indices=[]),b.WebGLGraphics.updateGraphics(a,d)),c.shaderManager.activatePrimitiveShader(),d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),d.uniformMatrix3fv(g.translationMatrix,!1,a.worldTransform.toArray(!0)),d.uniform2f(g.projectionVector,e.x,-e.y),d.uniform2f(g.offsetVector,-f.x,-f.y),d.uniform3fv(g.tintColor,b.hex2rgb(a.tint)),d.uniform1f(g.alpha,a.worldAlpha),d.bindBuffer(d.ARRAY_BUFFER,h.buffer),d.vertexAttribPointer(g.aVertexPosition,2,d.FLOAT,!1,24,0),d.vertexAttribPointer(g.colorAttribute,4,d.FLOAT,!1,24,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,h.indexBuffer),d.drawElements(d.TRIANGLE_STRIP,h.indices.length,d.UNSIGNED_SHORT,0),c.shaderManager.deactivatePrimitiveShader()},b.WebGLGraphics.updateGraphics=function(a,c){for(var d=a._webGL[c.id],e=d.lastIndex;e<a.graphicsData.length;e++){var f=a.graphicsData[e];f.type===b.Graphics.POLY?(f.fill&&f.points.length>3&&b.WebGLGraphics.buildPoly(f,d),f.lineWidth>0&&b.WebGLGraphics.buildLine(f,d)):f.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(f,d):(f.type===b.Graphics.CIRC||f.type===b.Graphics.ELIP)&&b.WebGLGraphics.buildCircle(f,d)}d.lastIndex=a.graphicsData.length,d.glPoints=new Float32Array(d.points),c.bindBuffer(c.ARRAY_BUFFER,d.buffer),c.bufferData(c.ARRAY_BUFFER,d.glPoints,c.STATIC_DRAW),d.glIndicies=new Uint16Array(d.indices),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,d.indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,d.glIndicies,c.STATIC_DRAW)},b.WebGLGraphics.buildRectangle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3];if(a.fill){var i=b.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=c.points,o=c.indices,p=n.length/6;n.push(e,f),n.push(k,l,m,j),n.push(e+g,f),n.push(k,l,m,j),n.push(e,f+h),n.push(k,l,m,j),n.push(e+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[e,f,e+g,f,e+g,f+h,e,f+h,e,f],b.WebGLGraphics.buildLine(a,c),a.points=q}},b.WebGLGraphics.buildCircle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3],i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(e,f,n,o,p,m),q.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h,n,o,p,m),r.push(s++,s++);r.push(s-1)}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;d<e.length;d++)e[d]+=.5;var f=new b.Point(e[0],e[1]),g=new b.Point(e[e.length-2],e[e.length-1]);if(f.x===g.x&&f.y===g.y){e.pop(),e.pop(),g=new b.Point(e[e.length-2],e[e.length-1]);var h=g.x+.5*(f.x-g.x),i=g.y+.5*(f.y-g.y);e.unshift(h,i),e.push(h,i)}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G=c.points,H=c.indices,I=e.length/2,J=e.length,K=G.length/6,L=a.lineWidth/2,M=b.hex2rgb(a.lineColor),N=a.lineAlpha,O=M[0]*N,P=M[1]*N,Q=M[2]*N;for(l=e[0],m=e[1],n=e[2],o=e[3],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(l-r,m-s,O,P,Q,N),G.push(l+r,m+s,O,P,Q,N),d=1;I-1>d;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d),n=e.length/6,o=0;for(o=0;o<m.length;o+=3)f.push(m[o]+n),f.push(m[o]+n),f.push(m[o+1]+n),f.push(m[o+2]+n),f.push(m[o+2]+n);for(o=0;g>o;o++)e.push(d[2*o],d[2*o+1],j,k,l,i)}},b.glContexts=[],b.WebGLRenderer=function(a,c,d,e,f){b.defaultRenderer||(b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.transparent=!!e,this.width=a||800,this.height=c||600,this.view=d||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.contextLost=this.handleContextLost.bind(this),this.contextRestoredLost=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLost,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredLost,!1),this.options={alpha:this.transparent,antialias:!!f,premultipliedAlpha:!!e,stencil:!0};try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(g){try{this.gl=this.view.getContext("webgl",this.options)}catch(h){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var i=this.gl;this.glContextId=i.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=i,b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[i.SRC_ALPHA,i.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[i.SRC_ALPHA,i.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA]),this.projection=new b.Point,this.projection.x=this.width/2,this.projection.y=-this.height/2,this.offset=new b.Point(0,0),this.resize(this.width,this.height),this.contextLost=!1,this.shaderManager=new b.WebGLShaderManager(i),this.spriteBatch=new b.WebGLSpriteBatch(i),this.maskManager=new b.WebGLMaskManager(i),this.filterManager=new b.WebGLFilterManager(i,this.transparent),this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.renderer=this,i.useProgram(this.shaderManager.defaultShader.program),i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.colorMask(!0,!0,!0,this.transparent)},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),b.WebGLRenderer.updateTextures(),a.updateTransform(),a._interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)));var c=this.gl;c.viewport(0,0,this.width,this.height),c.bindFramebuffer(c.FRAMEBUFFER,null),this.transparent?c.clearColor(0,0,0,0):c.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),c.clear(c.COLOR_BUFFER_BIT),this.renderDisplayObject(a,this.projection),a.interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this))}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,b,c){this.renderSession.drawCount=0,this.renderSession.currentBlendMode=9999,this.renderSession.projection=b,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,c),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.updateTextures=function(){var a=0;for(a=0;a<b.Texture.frameUpdates.length;a++)b.WebGLRenderer.updateTextureFrame(b.Texture.frameUpdates[a]);for(a=0;a<b.texturesToDestroy.length;a++)b.WebGLRenderer.destroyTexture(b.texturesToDestroy[a]);b.texturesToUpdate.length=0,b.texturesToDestroy.length=0,b.Texture.frameUpdates.length=0},b.WebGLRenderer.destroyTexture=function(a){for(var c=a._glTextures.length-1;c>=0;c--){var d=a._glTextures[c],e=b.glContexts[c];e&&d&&e.deleteTexture(d)}a._glTextures.length=0},b.WebGLRenderer.updateTextureFrame=function(a){a.updateFrame=!1,a._updateWebGLuvs()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b,this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2,this.projection.y=-this.height/2},b.createWebGLTexture=function(a,c){return a.hasLoaded&&(a._glTextures[c.id]=c.createTexture(),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null)),a._glTextures[c.id]},b.updateWebGLTexture=function(a,c){a._glTextures[c.id]&&(c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null))},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(a){try{this.gl=this.view.getContext("webgl",this.options)}catch(c){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var d=this.gl;d.id=b.WebGLRenderer.glContextId++,this.shaderManager.setContext(d),this.spriteBatch.setContext(d),this.maskManager.setContext(d),this.filterManager.setContext(d),this.renderSession.gl=this.gl,d.disable(d.DEPTH_TEST),d.disable(d.CULL_FACE),d.enable(d.BLEND),d.colorMask(!0,!0,!0,this.transparent),this.gl.viewport(0,0,this.width,this.height);for(var e in b.TextureCache){var f=b.TextureCache[e].baseTexture;f._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLost),this.view.removeEventListener("webglcontextrestored",this.contextRestoredLost),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.glContextId=0,b.WebGLMaskManager=function(a){this.maskStack=[],this.maskPosition=0,this.setContext(a)},b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=this.gl;0===this.maskStack.length&&(d.enable(d.STENCIL_TEST),d.stencilFunc(d.ALWAYS,1,1)),this.maskStack.push(a),d.colorMask(!1,!1,!1,!0),d.stencilOp(d.KEEP,d.KEEP,d.INCR),b.WebGLGraphics.renderGraphics(a,c),d.colorMask(!0,!0,!0,!0),d.stencilFunc(d.NOTEQUAL,0,this.maskStack.length),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)},b.WebGLMaskManager.prototype.popMask=function(a){var c=this.gl,d=this.maskStack.pop();d&&(c.colorMask(!1,!1,!1,!1),c.stencilOp(c.KEEP,c.KEEP,c.DECR),b.WebGLGraphics.renderGraphics(d,a),c.colorMask(!0,!0,!0,!0),c.stencilFunc(c.NOTEQUAL,0,this.maskStack.length),c.stencilOp(c.KEEP,c.KEEP,c.KEEP)),0===this.maskStack.length&&c.disable(c.STENCIL_TEST)},b.WebGLMaskManager.prototype.destroy=function(){this.maskStack=null,this.gl=null},b.WebGLShaderManager=function(a){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var b=0;b<this.maxAttibs;b++)this.attribState[b]=!1;this.setContext(a)},b.WebGLShaderManager.prototype.setContext=function(a){this.gl=a,this.primitiveShader=new b.PrimitiveShader(a),this.defaultShader=new b.PixiShader(a),this.fastShader=new b.PixiFastShader(a),this.activateShader(this.defaultShader)},b.WebGLShaderManager.prototype.setAttribs=function(a){var b;for(b=0;b<this.tempAttribState.length;b++)this.tempAttribState[b]=!1;for(b=0;b<a.length;b++){var c=a[b];this.tempAttribState[c]=!0}var d=this.gl;for(b=0;b<this.attribState.length;b++)this.attribState[b]!==this.tempAttribState[b]&&(this.attribState[b]=this.tempAttribState[b],this.tempAttribState[b]?d.enableVertexAttribArray(b):d.disableVertexAttribArray(b))},b.WebGLShaderManager.prototype.activateShader=function(a){this.currentShader=a,this.gl.useProgram(a.program),this.setAttribs(a.attributes)},b.WebGLShaderManager.prototype.activatePrimitiveShader=function(){var a=this.gl;a.useProgram(this.primitiveShader.program),this.setAttribs(this.primitiveShader.attributes)},b.WebGLShaderManager.prototype.deactivatePrimitiveShader=function(){var a=this.gl;a.useProgram(this.defaultShader.program),this.setAttribs(this.defaultShader.attributes)},b.WebGLShaderManager.prototype.destroy=function(){this.attribState=null,this.tempAttribState=null,this.primitiveShader.destroy(),this.defaultShader.destroy(),this.fastShader.destroy(),this.gl=null},b.WebGLSpriteBatch=function(a){this.vertSize=6,this.size=2e3;var b=4*this.size*this.vertSize,c=6*this.size;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.lastIndexCount=0;for(var d=0,e=0;c>d;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.setContext(a)},b.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},b.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},b.WebGLSpriteBatch.prototype.end=function(){this.flush()},b.WebGLSpriteBatch.prototype.render=function(a){var b=a.texture;(b.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=b.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var c=a._uvs||a.texture._uvs;if(c){var d,e,f,g,h=a.worldAlpha,i=a.tint,j=this.vertices,k=a.anchor.x,l=a.anchor.y;if(a.texture.trim){var m=a.texture.trim;e=m.x-k*m.width,d=e+b.frame.width,g=m.y-l*m.height,f=g+b.frame.height}else d=b.frame.width*(1-k),e=b.frame.width*-k,f=b.frame.height*(1-l),g=b.frame.height*-l;var n=4*this.currentBatchSize*this.vertSize,o=a.worldTransform,p=o.a,q=o.c,r=o.b,s=o.d,t=o.tx,u=o.ty;j[n++]=p*e+r*g+t,j[n++]=s*g+q*e+u,j[n++]=c.x0,j[n++]=c.y0,j[n++]=h,j[n++]=i,j[n++]=p*d+r*g+t,j[n++]=s*g+q*d+u,j[n++]=c.x1,j[n++]=c.y1,j[n++]=h,j[n++]=i,j[n++]=p*d+r*f+t,j[n++]=s*f+q*d+u,j[n++]=c.x2,j[n++]=c.y2,j[n++]=h,j[n++]=i,j[n++]=p*e+r*f+t,j[n++]=s*f+q*e+u,j[n++]=c.x3,j[n++]=c.y3,j[n++]=h,j[n++]=i,this.currentBatchSize++}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;(c.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=c.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode),a._uvs||(a._uvs=new b.TextureUvs);var d=a._uvs;a.tilePosition.x%=c.baseTexture.width*a.tileScaleOffset.x,a.tilePosition.y%=c.baseTexture.height*a.tileScaleOffset.y;var e=a.tilePosition.x/(c.baseTexture.width*a.tileScaleOffset.x),f=a.tilePosition.y/(c.baseTexture.height*a.tileScaleOffset.y),g=a.width/c.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),h=a.height/c.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);d.x0=0-e,d.y0=0-f,d.x1=1*g-e,d.y1=0-f,d.x2=1*g-e,d.y2=1*h-f,d.x3=0-e,d.y3=1*h-f;var i=a.worldAlpha,j=a.tint,k=this.vertices,l=a.width,m=a.height,n=a.anchor.x,o=a.anchor.y,p=l*(1-n),q=l*-n,r=m*(1-o),s=m*-o,t=4*this.currentBatchSize*this.vertSize,u=a.worldTransform,v=u.a,w=u.c,x=u.b,y=u.d,z=u.tx,A=u.ty;k[t++]=v*q+x*s+z,k[t++]=y*s+w*q+A,k[t++]=d.x0,k[t++]=d.y0,k[t++]=i,k[t++]=j,k[t++]=v*p+x*s+z,k[t++]=y*s+w*p+A,k[t++]=d.x1,k[t++]=d.y1,k[t++]=i,k[t++]=j,k[t++]=v*p+x*r+z,k[t++]=y*r+w*p+A,k[t++]=d.x2,k[t++]=d.y2,k[t++]=i,k[t++]=j,k[t++]=v*q+x*r+z,k[t++]=y*r+w*q+A,k[t++]=d.x3,k[t++]=d.y3,k[t++]=i,k[t++]=j,this.currentBatchSize++},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a)),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.colorAttribute,2,a.FLOAT,!1,d,16),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var b=4*this.size*this.vertSize,c=6*this.maxSize;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var d=0,e=0;c>d;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.currentBlendMode&&this.setBlendMode(c.blendMode);for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.frame.width,h=k.y-a.anchor.y*k.height,g=h+a.texture.frame.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x0,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x1,j[i++]=b.y1,j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x2,j[i++]=b.y2,j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b.x3,j[i++]=b.y3,j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,d,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,d,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,d,36),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLFastSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLFilterManager=function(a,b){this.transparent=b,this.filterStack=[],this.offsetX=0,this.offsetY=0,this.setContext(a)},b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a.target.filterArea.x,this.offsetY+=a.target.filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture),a.target.filterArea=a.target.getBounds();var h=a.target.filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.uniform2f(this.defaultShader.projectionVector,h.width/2,-h.height/2),c.uniform2f(this.defaultShader.offsetVector,-h.x,-h.y),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c.target.filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;j<c.filterPasses.length-1;j++){var k=c.filterPasses[j];a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,h.texture),this.applyFilterPass(k,d,d.width,d.height);var l=h;h=i,i=l}a.enable(a.BLEND),e=h,this.texturePool.push(i)}var m=c.filterPasses[c.filterPasses.length-1];this.offsetX-=d.x,this.offsetY-=d.y;var n=this.width,o=this.height,p=0,q=0,r=this.buffer;if(0===this.filterStack.length)a.colorMask(!0,!0,!0,!0);else{var s=this.filterStack[this.filterStack.length-1];d=s.target.filterArea,n=d.width,o=d.height,p=d.x,q=d.y,r=s._glFilterTexture.frameBuffer}f.x=n/2,f.y=-o/2,g.x=p,g.y=q,d=c.target.filterArea;var t=d.x-p,u=d.y-q;a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=t,this.vertexArray[1]=u+d.height,this.vertexArray[2]=t+d.width,this.vertexArray[3]=u+d.height,this.vertexArray[4]=t,this.vertexArray[5]=u,this.vertexArray[6]=t+d.width,this.vertexArray[7]=u,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray),a.viewport(0,0,n,o),a.bindFramebuffer(a.FRAMEBUFFER,r),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,e.texture),this.applyFilterPass(m,d,n,o),a.useProgram(this.defaultShader.program),a.uniform2f(this.defaultShader.projectionVector,n/2,-o/2),a.uniform2f(this.defaultShader.offsetVector,-p,-q),this.texturePool.push(e),c._glFilterTexture=null },b.WebGLFilterManager.prototype.applyFilterPass=function(a,c,d,e){var f=this.gl,g=a.shaders[f.id];g||(g=new b.PixiShader(f),g.fragmentSrc=a.fragmentSrc,g.uniforms=a.uniforms,g.init(),a.shaders[f.id]=g),f.useProgram(g.program),f.uniform2f(g.projectionVector,d/2,-e/2),f.uniform2f(g.offsetVector,0,0),a.uniforms.dimensions&&(a.uniforms.dimensions.value[0]=this.width,a.uniforms.dimensions.value[1]=this.height,a.uniforms.dimensions.value[2]=this.vertexArray[0],a.uniforms.dimensions.value[3]=this.vertexArray[5]),g.syncUniforms(),f.bindBuffer(f.ARRAY_BUFFER,this.vertexBuffer),f.vertexAttribPointer(g.aVertexPosition,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.uvBuffer),f.vertexAttribPointer(g.aTextureCoord,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.colorBuffer),f.vertexAttribPointer(g.colorAttribute,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,this.indexBuffer),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),this.renderSession.drawCount++},b.WebGLFilterManager.prototype.initShaderBuffers=function(){var a=this.gl;this.vertexBuffer=a.createBuffer(),this.uvBuffer=a.createBuffer(),this.colorBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.vertexArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertexArray,a.STATIC_DRAW),this.uvArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),a.bufferData(a.ARRAY_BUFFER,this.uvArray,a.STATIC_DRAW),this.colorArray=new Float32Array([1,16777215,1,16777215,1,16777215,1,16777215]),a.bindBuffer(a.ARRAY_BUFFER,this.colorBuffer),a.bufferData(a.ARRAY_BUFFER,this.colorArray,a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,1,3,2]),a.STATIC_DRAW)},b.WebGLFilterManager.prototype.destroy=function(){var a=this.gl;this.filterStack=null,this.offsetX=0,this.offsetY=0;for(var b=0;b<this.texturePool.length;b++)this.texturePool.destroy();this.texturePool=null,a.deleteBuffer(this.vertexBuffer),a.deleteBuffer(this.uvBuffer),a.deleteBuffer(this.colorBuffer),a.deleteBuffer(this.indexBuffer)},b.FilterTexture=function(a,b,c){this.gl=a,this.frameBuffer=a.createFramebuffer(),this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.bindFramebuffer(a.FRAMEBUFFER,this.framebuffer),a.bindFramebuffer(a.FRAMEBUFFER,this.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this.texture,0),this.resize(b,c)},b.FilterTexture.prototype.clear=function(){var a=this.gl;a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT)},b.FilterTexture.prototype.resize=function(a,b){if(this.width!==a||this.height!==b){this.width=a,this.height=b;var c=this.gl;c.bindTexture(c.TEXTURE_2D,this.texture),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,a,b,0,c.RGBA,c.UNSIGNED_BYTE,null)}},b.FilterTexture.prototype.destroy=function(){var a=this.gl;a.deleteFramebuffer(this.frameBuffer),a.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null},b.CanvasMaskManager=function(){},b.CanvasMaskManager.prototype.pushMask=function(a,c){c.save();var d=a.alpha,e=a.worldTransform;c.setTransform(e.a,e.c,e.b,e.d,e.tx,e.ty),b.CanvasGraphics.renderGraphicsMask(a,c),c.clip(),a.worldAlpha=d},b.CanvasMaskManager.prototype.popMask=function(a){a.restore()},b.CanvasTinter=function(){},b.CanvasTinter.getTintedTexture=function(a,c){var d=a.texture;c=b.CanvasTinter.roundColor(c);var e="#"+("00000"+(0|c).toString(16)).substr(-6);if(d.tintCache=d.tintCache||{},d.tintCache[e])return d.tintCache[e];var f=b.CanvasTinter.canvas||document.createElement("canvas");if(b.CanvasTinter.tintMethod(d,c,f),b.CanvasTinter.convertTintToImage){var g=new Image;g.src=f.toDataURL(),d.tintCache[e]=g}else d.tintCache[e]=f,b.CanvasTinter.canvas=null;return f},b.CanvasTinter.tintWithMultiply=function(a,b,c){var d=c.getContext("2d"),e=a.frame;c.width=e.width,c.height=e.height,d.fillStyle="#"+("00000"+(0|b).toString(16)).substr(-6),d.fillRect(0,0,e.width,e.height),d.globalCompositeOperation="multiply",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height),d.globalCompositeOperation="destination-atop",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height)},b.CanvasTinter.tintWithOverlay=function(a,b,c){var d=c.getContext("2d"),e=a.frame;c.width=e.width,c.height=e.height,d.globalCompositeOperation="copy",d.fillStyle="#"+("00000"+(0|b).toString(16)).substr(-6),d.fillRect(0,0,e.width,e.height),d.globalCompositeOperation="destination-atop",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height)},b.CanvasTinter.tintWithPerPixel=function(a,c,d){var e=d.getContext("2d"),f=a.frame;d.width=f.width,d.height=f.height,e.globalCompositeOperation="copy",e.drawImage(a.baseTexture.source,f.x,f.y,f.width,f.height,0,0,f.width,f.height);for(var g=b.hex2rgb(c),h=g[0],i=g[1],j=g[2],k=e.getImageData(0,0,f.width,f.height),l=k.data,m=0;m<l.length;m+=4)l[m+0]*=h,l[m+1]*=i,l[m+2]*=j;e.putImageData(k,0,0)},b.CanvasTinter.roundColor=function(a){var c=b.CanvasTinter.cacheStepsPerColorChannel,d=b.hex2rgb(a);return d[0]=Math.min(255,d[0]/c*c),d[1]=Math.min(255,d[1]/c*c),d[2]=Math.min(255,d[2]/c*c),b.rgb2hex(d)},b.CanvasTinter.cacheStepsPerColorChannel=8,b.CanvasTinter.convertTintToImage=!1,b.CanvasTinter.canUseMultiply=b.canUseNewCanvasBlendModes(),b.CanvasTinter.tintMethod=b.CanvasTinter.canUseMultiply?b.CanvasTinter.tintWithMultiply:b.CanvasTinter.tintWithPerPixel,b.CanvasRenderer=function(a,c,d,e){b.defaultRenderer=b.defaultRenderer||this,this.type=b.CANVAS_RENDERER,this.clearBeforeRender=!0,this.roundPixels=!1,this.transparent=!!e,b.blendModesCanvas||(b.blendModesCanvas=[],b.canUseNewCanvasBlendModes()?(b.blendModesCanvas[b.blendModes.NORMAL]="source-over",b.blendModesCanvas[b.blendModes.ADD]="lighter",b.blendModesCanvas[b.blendModes.MULTIPLY]="multiply",b.blendModesCanvas[b.blendModes.SCREEN]="screen",b.blendModesCanvas[b.blendModes.OVERLAY]="overlay",b.blendModesCanvas[b.blendModes.DARKEN]="darken",b.blendModesCanvas[b.blendModes.LIGHTEN]="lighten",b.blendModesCanvas[b.blendModes.COLOR_DODGE]="color-dodge",b.blendModesCanvas[b.blendModes.COLOR_BURN]="color-burn",b.blendModesCanvas[b.blendModes.HARD_LIGHT]="hard-light",b.blendModesCanvas[b.blendModes.SOFT_LIGHT]="soft-light",b.blendModesCanvas[b.blendModes.DIFFERENCE]="difference",b.blendModesCanvas[b.blendModes.EXCLUSION]="exclusion",b.blendModesCanvas[b.blendModes.HUE]="hue",b.blendModesCanvas[b.blendModes.SATURATION]="saturation",b.blendModesCanvas[b.blendModes.COLOR]="color",b.blendModesCanvas[b.blendModes.LUMINOSITY]="luminosity"):(b.blendModesCanvas[b.blendModes.NORMAL]="source-over",b.blendModesCanvas[b.blendModes.ADD]="lighter",b.blendModesCanvas[b.blendModes.MULTIPLY]="source-over",b.blendModesCanvas[b.blendModes.SCREEN]="source-over",b.blendModesCanvas[b.blendModes.OVERLAY]="source-over",b.blendModesCanvas[b.blendModes.DARKEN]="source-over",b.blendModesCanvas[b.blendModes.LIGHTEN]="source-over",b.blendModesCanvas[b.blendModes.COLOR_DODGE]="source-over",b.blendModesCanvas[b.blendModes.COLOR_BURN]="source-over",b.blendModesCanvas[b.blendModes.HARD_LIGHT]="source-over",b.blendModesCanvas[b.blendModes.SOFT_LIGHT]="source-over",b.blendModesCanvas[b.blendModes.DIFFERENCE]="source-over",b.blendModesCanvas[b.blendModes.EXCLUSION]="source-over",b.blendModesCanvas[b.blendModes.HUE]="source-over",b.blendModesCanvas[b.blendModes.SATURATION]="source-over",b.blendModesCanvas[b.blendModes.COLOR]="source-over",b.blendModesCanvas[b.blendModes.LUMINOSITY]="source-over")),this.width=a||800,this.height=c||600,this.view=d||document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.view.width=this.width,this.view.height=this.height,this.count=0,this.maskManager=new b.CanvasMaskManager,this.renderSession={context:this.context,maskManager:this.maskManager,scaleMode:null,smoothProperty:null},"imageSmoothingEnabled"in this.context?this.renderSession.smoothProperty="imageSmoothingEnabled":"webkitImageSmoothingEnabled"in this.context?this.renderSession.smoothProperty="webkitImageSmoothingEnabled":"mozImageSmoothingEnabled"in this.context?this.renderSession.smoothProperty="mozImageSmoothingEnabled":"oImageSmoothingEnabled"in this.context&&(this.renderSession.smoothProperty="oImageSmoothingEnabled")},b.CanvasRenderer.prototype.constructor=b.CanvasRenderer,b.CanvasRenderer.prototype.render=function(a){b.texturesToUpdate.length=0,b.texturesToDestroy.length=0,a.updateTransform(),this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,!this.transparent&&this.clearBeforeRender?(this.context.fillStyle=a.backgroundColorString,this.context.fillRect(0,0,this.width,this.height)):this.transparent&&this.clearBeforeRender&&this.context.clearRect(0,0,this.width,this.height),this.renderDisplayObject(a),a.interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this))),b.Texture.frameUpdates.length>0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},b.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},b.CanvasRenderer.prototype.renderStripFlat=function(a){var b=this.context,c=a.verticies,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},b.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},b.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},b.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},b.CanvasGraphics=function(){},b.CanvasGraphics.renderGraphics=function(a,c){for(var d=a.worldAlpha,e="",f=0;f<a.graphicsData.length;f++){var g=a.graphicsData[f],h=g.points;if(c.strokeStyle=e="#"+("00000"+(0|g.lineColor).toString(16)).substr(-6),c.lineWidth=g.lineWidth,g.type===b.Graphics.POLY){c.beginPath(),c.moveTo(h[0],h[1]);for(var i=1;i<h.length/2;i++)c.lineTo(h[2*i],h[2*i+1]);h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&c.closePath(),g.fill&&(c.globalAlpha=g.fillAlpha*d,c.fillStyle=e="#"+("00000"+(0|g.fillColor).toString(16)).substr(-6),c.fill()),g.lineWidth&&(c.globalAlpha=g.lineAlpha*d,c.stroke())}else if(g.type===b.Graphics.RECT)(g.fillColor||0===g.fillColor)&&(c.globalAlpha=g.fillAlpha*d,c.fillStyle=e="#"+("00000"+(0|g.fillColor).toString(16)).substr(-6),c.fillRect(h[0],h[1],h[2],h[3])),g.lineWidth&&(c.globalAlpha=g.lineAlpha*d,c.strokeRect(h[0],h[1],h[2],h[3]));else if(g.type===b.Graphics.CIRC)c.beginPath(),c.arc(h[0],h[1],h[2],0,2*Math.PI),c.closePath(),g.fill&&(c.globalAlpha=g.fillAlpha*d,c.fillStyle=e="#"+("00000"+(0|g.fillColor).toString(16)).substr(-6),c.fill()),g.lineWidth&&(c.globalAlpha=g.lineAlpha*d,c.stroke());else if(g.type===b.Graphics.ELIP){var j=g.points,k=2*j[2],l=2*j[3],m=j[0]-k/2,n=j[1]-l/2;c.beginPath();var o=.5522848,p=k/2*o,q=l/2*o,r=m+k,s=n+l,t=m+k/2,u=n+l/2;c.moveTo(m,u),c.bezierCurveTo(m,u-q,t-p,n,t,n),c.bezierCurveTo(t+p,n,r,u-q,r,u),c.bezierCurveTo(r,u+q,t+p,s,t,s),c.bezierCurveTo(t-p,s,m,u+q,m,u),c.closePath(),g.fill&&(c.globalAlpha=g.fillAlpha*d,c.fillStyle=e="#"+("00000"+(0|g.fillColor).toString(16)).substr(-6),c.fill()),g.lineWidth&&(c.globalAlpha=g.lineAlpha*d,c.stroke())}}},b.CanvasGraphics.renderGraphicsMask=function(a,c){var d=a.graphicsData.length;if(0!==d){d>1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===b.Graphics.POLY){c.beginPath(),c.moveTo(g[0],g[1]);for(var h=1;h<g.length/2;h++)c.lineTo(g[2*h],g[2*h+1]);g[0]===g[g.length-2]&&g[1]===g[g.length-1]&&c.closePath()}else if(f.type===b.Graphics.RECT)c.beginPath(),c.rect(g[0],g[1],g[2],g[3]),c.closePath();else if(f.type===b.Graphics.CIRC)c.beginPath(),c.arc(g[0],g[1],g[2],0,2*Math.PI),c.closePath();else if(f.type===b.Graphics.ELIP){var i=f.points,j=2*i[2],k=2*i[3],l=i[0]-j/2,m=i[1]-k/2;c.beginPath();var n=.5522848,o=j/2*n,p=k/2*n,q=l+j,r=m+k,s=l+j/2,t=m+k/2;c.moveTo(l,t),c.bezierCurveTo(l,t-p,s-o,m,s,m),c.bezierCurveTo(s+o,m,q,t-p,q,t),c.bezierCurveTo(q,t+p,s+o,r,s,r),c.bezierCurveTo(s-o,r,l,t+p,l,t),c.closePath()}}}},b.Graphics=function(){b.DisplayObjectContainer.call(this),this.renderable=!0,this.fillAlpha=1,this.lineWidth=0,this.lineColor="black",this.graphicsData=[],this.tint=16777215,this.blendMode=b.blendModes.NORMAL,this.currentPath={points:[]},this._webGL=[],this.isMask=!1,this.bounds=null,this.boundsPadding=10},b.Graphics.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Graphics.prototype.constructor=b.Graphics,Object.defineProperty(b.Graphics.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(a){this._cacheAsBitmap=a,this._cacheAsBitmap?this._generateCachedSprite():(this.destroyCachedSprite(),this.dirty=!0)}}),b.Graphics.prototype.lineStyle=function(a,c,d){return this.currentPath.points.length||this.graphicsData.pop(),this.lineWidth=a||0,this.lineColor=c||0,this.lineAlpha=arguments.length<3?1:d,this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:b.Graphics.POLY},this.graphicsData.push(this.currentPath),this},b.Graphics.prototype.moveTo=function(a,c){return this.currentPath.points.length||this.graphicsData.pop(),this.currentPath=this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[],type:b.Graphics.POLY},this.currentPath.points.push(a,c),this.graphicsData.push(this.currentPath),this},b.Graphics.prototype.lineTo=function(a,b){return this.currentPath.points.push(a,b),this.dirty=!0,this},b.Graphics.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=arguments.length<2?1:b,this},b.Graphics.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},b.Graphics.prototype.drawRect=function(a,c,d,e){return this.currentPath.points.length||this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[a,c,d,e],type:b.Graphics.RECT},this.graphicsData.push(this.currentPath),this.dirty=!0,this},b.Graphics.prototype.drawCircle=function(a,c,d){return this.currentPath.points.length||this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[a,c,d,d],type:b.Graphics.CIRC},this.graphicsData.push(this.currentPath),this.dirty=!0,this},b.Graphics.prototype.drawEllipse=function(a,c,d,e){return this.currentPath.points.length||this.graphicsData.pop(),this.currentPath={lineWidth:this.lineWidth,lineColor:this.lineColor,lineAlpha:this.lineAlpha,fillColor:this.fillColor,fillAlpha:this.fillAlpha,fill:this.filling,points:[a,c,d,e],type:b.Graphics.ELIP},this.graphicsData.push(this.currentPath),this.dirty=!0,this},b.Graphics.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this.bounds=null,this},b.Graphics.prototype.generateTexture=function(){var a=this.getBounds(),c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);return c.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,c.context),d},b.Graphics.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){if(this._cacheAsBitmap)return this.dirty&&(this._generateCachedSprite(),b.updateWebGLTexture(this._cachedSprite.texture.baseTexture,a.gl),this.dirty=!1),void b.Sprite.prototype._renderWebGL.call(this._cachedSprite,a);if(a.spriteBatch.stop(),this._mask&&a.maskManager.pushMask(this.mask,a),this._filters&&a.filterManager.pushFilter(this._filterBlock),this.blendMode!==a.spriteBatch.currentBlendMode){a.spriteBatch.currentBlendMode=this.blendMode;var c=b.blendModesWebGL[a.spriteBatch.currentBlendMode];a.spriteBatch.gl.blendFunc(c[0],c[1])}if(b.WebGLGraphics.renderGraphics(this,a),this.children.length){a.spriteBatch.start();for(var d=0,e=this.children.length;e>d;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),b.CanvasGraphics.renderGraphics(this,c);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},b.Graphics.prototype.getBounds=function(a){this.bounds||this.updateBounds();var b=this.bounds.x,c=this.bounds.width+this.bounds.x,d=this.bounds.y,e=this.bounds.height+this.bounds.y,f=a||this.worldTransform,g=f.a,h=f.c,i=f.b,j=f.d,k=f.tx,l=f.ty,m=g*c+i*e+k,n=j*e+h*c+l,o=g*b+i*e+k,p=j*e+h*b+l,q=g*b+i*d+k,r=j*d+h*b+l,s=g*c+i*d+k,t=j*d+h*c+l,u=-1/0,v=-1/0,w=1/0,x=1/0;w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v;var y=this._bounds;return y.x=w,y.width=u-w,y.y=x,y.height=v-x,y},b.Graphics.prototype.updateBounds=function(){for(var a,c,d,e,f,g=1/0,h=-1/0,i=1/0,j=-1/0,k=0;k<this.graphicsData.length;k++){var l=this.graphicsData[k],m=l.type,n=l.lineWidth;if(a=l.points,m===b.Graphics.RECT)c=a[0]-n/2,d=a[1]-n/2,e=a[2]+n,f=a[3]+n,g=g>c?c:g,h=c+e>h?c+e:h,i=i>d?c:i,j=d+f>j?d+f:j;else if(m===b.Graphics.CIRC||m===b.Graphics.ELIP)c=a[0],d=a[1],e=a[2]+n/2,f=a[3]+n/2,g=g>c-e?c-e:g,h=c+e>h?c+e:h,i=i>d-f?d-f:i,j=d+f>j?d+f:j;else for(var o=0;o<a.length;o+=2)c=a[o],d=a[o+1],g=g>c-n?c-n:g,h=c+n>h?c+n:h,i=i>d-n?d-n:i,j=d+n>j?d+n:j}var p=this.boundsPadding;this.bounds=new b.Rectangle(g-p,i-p,h-g+2*p,j-i+2*p)},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.TilingSprite=function(a,c,d){b.Sprite.call(this,a),this.width=c||100,this.height=d||100,this.tileScale=new b.Point(1,1),this.tileScaleOffset=new b.Point(1,1),this.tilePosition=new b.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL},b.TilingSprite.prototype=Object.create(b.Sprite.prototype),b.TilingSprite.prototype.constructor=b.TilingSprite,Object.defineProperty(b.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(b.TilingSprite.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a}}),b.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},b.TilingSprite.prototype.setTexture=function(a){this.texture!==a&&(this.texture=a,this.refreshTexture=!0,this.cachedTint=16777215)},b.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var c,d;for(this.mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this.filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),!this.tilingTexture||this.refreshTexture?(this.generateTilingTexture(!0),this.tilingTexture&&this.tilingTexture.needsUpdate&&(b.updateWebGLTexture(this.tilingTexture.baseTexture,a.gl),this.tilingTexture.needsUpdate=!1)):a.spriteBatch.renderTilingSprite(this),c=0,d=this.children.length;d>c;c++)this.children[c]._renderWebGL(a);a.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,c),c.globalAlpha=this.worldAlpha;var d=this.worldTransform;c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),(!this.__tilePattern||this.refreshTexture)&&(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.beginPath();var e=this.tilePosition,f=this.tileScale;e.x%=this.tilingTexture.baseTexture.width,e.y%=this.tilingTexture.baseTexture.height,c.scale(f.x,f.y),c.translate(e.x,e.y),c.fillStyle=this.__tilePattern,c.fillRect(-e.x,-e.y,this.width/f.x,this.height/f.y),c.scale(1/f.x,1/f.y),c.translate(-e.x,-e.y),c.closePath(),this._mask&&a.maskManager.popMask(a.context)}},b.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g.a,i=g.c,j=g.b,k=g.d,l=g.tx,m=g.ty,n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},b.TilingSprite.prototype.generateTilingTexture=function(a){var c=this.texture;if(c.baseTexture.hasLoaded){var d,e,f=c.baseTexture,g=c.frame,h=g.width!==f.width||g.height!==f.height,i=!1;if(a?(d=b.getNextPowerOfTwo(g.width),e=b.getNextPowerOfTwo(g.height),g.width!==d&&g.height!==e&&(i=!0)):h&&(d=g.width,e=g.height,i=!0),i){var j;this.tilingTexture&&this.tilingTexture.isTiling?(j=this.tilingTexture.canvasBuffer,j.resize(d,e),this.tilingTexture.baseTexture.width=d,this.tilingTexture.baseTexture.height=e,this.tilingTexture.needsUpdate=!0):(j=new b.CanvasBuffer(d,e),this.tilingTexture=b.Texture.fromCanvas(j.canvas),this.tilingTexture.canvasBuffer=j,this.tilingTexture.isTiling=!0),j.context.drawImage(c.baseTexture.source,g.x,g.y,g.width,g.height,0,0,d,e),this.tileScaleOffset.x=g.width/d,this.tileScaleOffset.y=g.height/e}else this.tilingTexture&&this.tilingTexture.isTiling&&this.tilingTexture.destroy(!0),this.tileScaleOffset.x=1,this.tileScaleOffset.y=1,this.tilingTexture=c;this.refreshTexture=!1,this.tilingTexture.baseTexture._powerOf2=!0}},b.BaseTextureCache={},b.texturesToUpdate=[],b.texturesToDestroy=[],b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(b.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this.id=b.BaseTextureCacheIdGenerator++,this._glTextures=[],a){if(this.source.complete||this.source.getContext)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,b.texturesToUpdate.push(this);else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.width,d.height=d.source.height,b.texturesToUpdate.push(d),d.dispatchEvent({type:"loaded",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.BaseTexture.prototype.destroy=function(){this.imageUrl&&(delete b.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,b.texturesToDestroy.push(this)},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c){if(b.EventTarget.call(this),c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=null,this.scope=this,this._uvs=null,a.hasLoaded)this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var d=this;a.addEventListener("loaded",function(){d.onBaseTextureLoaded()})}},b.Texture.prototype.constructor=b.Texture,b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},b.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,b.Texture.frameUpdates.push(this)},b.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.frame,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.Texture.frameUpdates=[],b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y4=0},b.RenderTexture=function(a,c,d){if(b.EventTarget.call(this),this.width=a||100,this.height=c||100,this.frame=new b.Rectangle(0,0,this.width,this.height),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new b.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(this.width/2,-this.height/2)}else console.log("renderer canvas"),this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c){if(this.width=a,this.height=c,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===b.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var d=this.renderer.gl;d.bindTexture(d.TEXTURE_2D,this.baseTexture._glTextures[d.id]),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.width,this.height,0,d.RGBA,d.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype.renderWebGL=function(a,c,d){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),d&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,a.worldTransform.d=-1,a.worldTransform.ty=-2*this.projection.y,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty-=c.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();b.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},b.RenderTexture.prototype.renderCanvas=function(a,c,d){var e=a.children,f=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty=c.y);for(var g=0,h=e.length;h>g;g++)e[g].updateTransform();d&&this.textureBuffer.clear();var i=this.textureBuffer.context;this.renderer.renderDisplayObject(a,i),i.setTransform(1,0,0,1,0,0),a.worldTransform=f},b.RenderTexture.tempMatrix=new b.Matrix,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define("PIXI",function(){return a.PIXI=b}()):a.PIXI=b}).call(this),function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,blendModes:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle:function(a){for(var b=a.length-1;b>0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=new Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f; a=new Array(g+1).join(c)+a+new Array(f+1).join(c);break;default:a+=new Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!{}.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){a<this.x?(this._radius=0,this._diameter=0):this.radius=a-this.x}}),Object.defineProperty(b.Circle.prototype,"top",{get:function(){return this.y-this._radius},set:function(a){a>this.y?(this._radius=0,this._diameter=0):this.radius=this.y-a}}),Object.defineProperty(b.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(a){a<this.y?(this._radius=0,this._diameter=0):this.radius=a-this.y}}),Object.defineProperty(b.Circle.prototype,"area",{get:function(){return this._radius>0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.y=a.y+a.radius*Math.sin(c),e},b.Circle.intersectsRectangle=function(a,b){var c=Math.abs(a.x-b.x-b.halfWidth),d=b.halfWidth+a.radius;if(c>d)return!1;var e=Math.abs(a.y-b.y-b.halfHeight),f=b.halfHeight+a.radius;if(e>f)return!1;if(c<=b.halfWidth||e<=b.halfHeight)return!0;var g=c-b.halfWidth,h=e-b.halfHeight,i=g*g,j=h*h,k=a.radius*a.radius;return k>=i+j},PIXI.Circle=b.Circle,b.Point=function(a,b){a=a||0,b=b||0,this.x=a,this.y=b},b.Point.prototype={copyFrom:function(a){return this.setTo(a.x,a.y)},invert:function(){return this.setTo(this.y,this.x)},setTo:function(a,b){return this.x=a||0,this.y=b||(0!==b?this.x:0),this},set:function(a,b){return this.x=a||0,this.y=b||(0!==b?this.x:0),this},add:function(a,b){return this.x+=a,this.y+=b,this},subtract:function(a,b){return this.x-=a,this.y-=b,this},multiply:function(a,b){return this.x*=a,this.y*=b,this},divide:function(a,b){return this.x/=a,this.y/=b,this},clampX:function(a,c){return this.x=b.Math.clamp(this.x,a,c),this},clampY:function(a,c){return this.y=b.Math.clamp(this.y,a,c),this},clamp:function(a,c){return this.x=b.Math.clamp(this.x,a,c),this.y=b.Math.clamp(this.y,a,c),this},clone:function(a){return"undefined"==typeof a?a=new b.Point(this.x,this.y):a.setTo(this.x,this.y),a},copyTo:function(a){return a.x=this.x,a.y=this.y,a},distance:function(a,c){return b.Point.distance(this,a,c)},equals:function(a){return a.x==this.x&&a.y==this.y},rotate:function(a,c,d,e,f){return b.Point.rotate(this,a,c,d,e,f)},getMagnitude:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setMagnitude:function(a){return this.normalize().multiply(a,a)},normalize:function(){if(!this.isZero()){var a=this.getMagnitude();this.x/=a,this.y/=a}return this},isZero:function(){return 0===this.x&&0===this.y},toString:function(){return"[{Point (x="+this.x+" y="+this.y+")}]"}},b.Point.prototype.constructor=b.Point,b.Point.add=function(a,c,d){return"undefined"==typeof d&&(d=new b.Point),d.x=a.x+c.x,d.y=a.y+c.y,d},b.Point.subtract=function(a,c,d){return"undefined"==typeof d&&(d=new b.Point),d.x=a.x-c.x,d.y=a.y-c.y,d},b.Point.multiply=function(a,c,d){return"undefined"==typeof d&&(d=new b.Point),d.x=a.x*c.x,d.y=a.y*c.y,d},b.Point.divide=function(a,c,d){return"undefined"==typeof d&&(d=new b.Point),d.x=a.x/c.x,d.y=a.y/c.y,d},b.Point.equals=function(a,b){return a.x==b.x&&a.y==b.y},b.Point.distance=function(a,c,d){return"undefined"==typeof d&&(d=!1),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(a){a===!0&&this.setTo(0,0,0,0)}}),b.Rectangle.prototype.constructor=b.Rectangle,b.Rectangle.inflate=function(a,b,c){return a.x-=b,a.width+=2*b,a.y-=c,a.height+=2*c,a},b.Rectangle.inflatePoint=function(a,c){return b.Rectangle.inflate(a,c.x,c.y)},b.Rectangle.size=function(a,c){return"undefined"==typeof c?c=new b.Point(a.width,a.height):c.setTo(a.width,a.height),c},b.Rectangle.clone=function(a,c){return"undefined"==typeof c?c=new b.Rectangle(a.x,a.y,a.width,a.height):c.setTo(a.x,a.y,a.width,a.height),c},b.Rectangle.contains=function(a,b,c){return a.width<=0||a.height<=0?!1:b>=a.x&&b<=a.right&&c>=a.y&&c<=a.bottom},b.Rectangle.containsRaw=function(a,b,c,d,e,f){return e>=a&&a+c>=e&&f>=b&&b+d>=f},b.Rectangle.containsPoint=function(a,c){return b.Rectangle.contains(a,c.x,c.y)},b.Rectangle.containsRect=function(a,b){return a.volume>b.volume?!1:a.x>=b.x&&a.y>=b.y&&a.right<=b.right&&a.bottom<=b.bottom},b.Rectangle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.width==b.width&&a.height==b.height},b.Rectangle.intersection=function(a,c,d){return"undefined"==typeof d&&(d=new b.Rectangle),b.Rectangle.intersects(a,c)&&(d.x=Math.max(a.x,c.x),d.y=Math.max(a.y,c.y),d.width=Math.min(a.right,c.right)-d.x,d.height=Math.min(a.bottom,c.bottom)-d.y),d},b.Rectangle.intersects=function(a,b){return a.width<=0||a.height<=0||b.width<=0||b.height<=0?!1:!(a.right<b.x||a.bottom<b.y||a.x>b.right||a.y>b.bottom)},b.Rectangle.intersectsRaw=function(a,b,c,d,e,f){return"undefined"==typeof f&&(f=0),!(b>a.right+f||c<a.left-f||d>a.bottom+f||e<a.top-f)},b.Rectangle.union=function(a,c,d){return"undefined"==typeof d&&(d=new b.Rectangle),d.setTo(Math.min(a.x,c.x),Math.min(a.y,c.y),Math.max(a.right,c.right)-Math.min(a.left,c.left),Math.max(a.bottom,c.bottom)-Math.min(a.top,c.top))},PIXI.Rectangle=b.Rectangle,PIXI.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Line=function(a,c,d,e){a=a||0,c=c||0,d=d||0,e=e||0,this.start=new b.Point(a,c),this.end=new b.Point(d,e)},b.Line.prototype={setTo:function(a,b,c,d){return this.start.setTo(a,b),this.end.setTo(c,d),this},fromSprite:function(a,b,c){return"undefined"==typeof c&&(c=!1),c?this.setTo(a.center.x,a.center.y,b.center.x,b.center.y):this.setTo(a.x,a.y,b.x,b.y)},intersects:function(a,c,d){return b.Line.intersectsPoints(this.start,this.end,a.start,a.end,c,d)},pointOnLine:function(a,b){return(a-this.start.x)*(this.end.y-this.end.y)===(this.end.x-this.start.x)*(b-this.end.y)},pointOnSegment:function(a,b){var c=Math.min(this.start.x,this.end.x),d=Math.max(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),f=Math.max(this.start.y,this.end.y);return this.pointOnLine(a,b)&&a>=c&&d>=a&&b>=e&&f>=b},coordinatesOnLine:function(a,b){"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b=[]);var c=Math.round(this.start.x),d=Math.round(this.start.y),e=Math.round(this.end.x),f=Math.round(this.end.y),g=Math.abs(e-c),h=Math.abs(f-d),i=e>c?1:-1,j=f>d?1:-1,k=g-h;b.push([c,d]);for(var l=1;c!=e||d!=f;){var m=k<<1;m>-h&&(k-=h,c+=i),g>m&&(k+=g,d+=j),l%a===0&&b.push([c,d]),l++}return b}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<this.x?0:this.x+a}}),Object.defineProperty(b.Ellipse.prototype,"top",{get:function(){return this.y},set:function(a){this.y=a}}),Object.defineProperty(b.Ellipse.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<this.y?0:this.y+a}}),Object.defineProperty(b.Ellipse.prototype,"empty",{get:function(){return 0===this.width||0===this.height},set:function(a){a===!0&&this.setTo(0,0,0,0)}}),b.Ellipse.contains=function(a,b,c){if(a.width<=0||a.height<=0)return!1;var d=(b-a.x)/a.width-.5,e=(c-a.y)/a.height-.5;return d*=d,e*=e,.25>d+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;c<this.points.length;c++)a.push(this.points[c].clone());return new b.Polygon(a)},contains:function(a,b){for(var c=!1,d=0,e=this.points.length-1;d<this.points.length;e=d++){var f=this.points[d].x,g=this.points[d].y,h=this.points[e].x,i=this.points[e].y,j=g>b!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.x<this._edge&&(this.view.x=this._edge),this._edge=this.target.y-this.deadzone.y,this.view.y>this._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y<this._edge&&(this.view.y=this._edge)):this.focusOnXY(this.target.x,this.target.y)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},checkBounds:function(){this.atLimit.x=!1,this.atLimit.y=!1,this.view.x<=this.bounds.x&&(this.atLimit.x=!0,this.view.x=this.bounds.x),this.view.right>=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",b))},_registerListener:function(a,c,d,e){var f,g=this._indexOfListener(a,d);if(-1!==g){if(f=this._bindings[g],f.isOnce()!==c)throw new Error("You cannot add"+(c?"":"Once")+"() then add"+(c?"Once":"")+"() the same listener without removing the relationship first.")}else f=new b.SignalBinding(this,a,c,d,e),this._addBinding(f);return this.memorize&&this._prevParams&&f.execute(this._prevParams),f},_addBinding:function(a){var b=this._bindings.length;do--b;while(this._bindings[b]&&a._priority<=this._bindings[b]._priority);this._bindings.splice(b+1,0,a)},_indexOfListener:function(a,b){for(var c,d=this._bindings.length;d--;)if(c=this._bindings[d],c._listener===a&&c.context===b)return d;return-1},has:function(a,b){return-1!==this._indexOfListener(a,b)},add:function(a,b,c){return this.validateListener(a,"add"),this._registerListener(a,!1,b,c)},addOnce:function(a,b,c){return this.validateListener(a,"addOnce"),this._registerListener(a,!0,b,c)},remove:function(a,b){this.validateListener(a,"remove");var c=this._indexOfListener(a,b);return-1!==c&&(this._bindings[c]._destroy(),this._bindings.splice(c,1)),a},removeAll:function(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(){if(this.active){var a,b=Array.prototype.slice.call(arguments),c=this._bindings.length;if(this.memorize&&(this._prevParams=b),c){a=this._bindings.slice(),this._shouldPropagate=!0;do c--;while(a[c]&&this._shouldPropagate&&a[c].execute(b)!==!1)}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll(),delete this._bindings,delete this._prevParams},toString:function(){return"[Phaser.Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}},b.Signal.prototype.constructor=b.Signal,b.SignalBinding=function(a,b,c,d,e){this._listener=b,this._isOnce=c,this.context=d,this._signal=a,this._priority=e||0},b.SignalBinding.prototype={active:!0,params:null,execute:function(a){var b,c;return this.active&&this._listener&&(c=this.params?this.params.concat(a):a,b=this._listener.apply(this.context,c),this._isOnce&&this.detach()),b},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a }}),b.Plugin=function(a,b){"undefined"==typeof b&&(b=null),this.game=a,this.parent=b,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},b.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},b.Plugin.prototype.constructor=b.Plugin,b.PluginManager=function(a,b){this.game=a,this._parent=b,this.plugins=[],this._pluginsLength=0},b.PluginManager.prototype={add:function(a){var b=!1;return"function"==typeof a?a=new a(this.game,this._parent):(a.game=this.game,a.parent=this._parent),"function"==typeof a.preUpdate&&(a.hasPreUpdate=!0,b=!0),"function"==typeof a.update&&(a.hasUpdate=!0,b=!0),"function"==typeof a.postUpdate&&(a.hasPostUpdate=!0,b=!0),"function"==typeof a.render&&(a.hasRender=!0,b=!0),"function"==typeof a.postRender&&(a.hasPostRender=!0,b=!0),b?((a.hasPreUpdate||a.hasUpdate||a.hasPostUpdate)&&(a.active=!0),(a.hasRender||a.hasPostRender)&&(a.visible=!0),this._pluginsLength=this.plugins.push(a),"function"==typeof a.init&&a.init(),a):null},remove:function(a){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)if(this.plugins[this._p]===a)return a.destroy(),this.plugins.splice(this._p,1),void this._pluginsLength--},removeAll:function(){for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].destroy();this.plugins.length=0,this._pluginsLength=0},preUpdate:function(){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].active&&this.plugins[this._p].hasPreUpdate&&this.plugins[this._p].preUpdate()},update:function(){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].active&&this.plugins[this._p].hasUpdate&&this.plugins[this._p].update()},postUpdate:function(){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].active&&this.plugins[this._p].hasPostUpdate&&this.plugins[this._p].postUpdate()},render:function(){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].visible&&this.plugins[this._p].hasRender&&this.plugins[this._p].render()},postRender:function(){if(0!==this._pluginsLength)for(this._p=0;this._p<this._pluginsLength;this._p++)this.plugins[this._p].visible&&this.plugins[this._p].hasPostRender&&this.plugins[this._p].postRender()},destroy:function(){this.plugins.length=0,this._pluginsLength=0,this.game=null,this._parent=null}},b.PluginManager.prototype.constructor=b.PluginManager,b.Stage=function(a,c,d){this.game=a,this.offset=new b.Point,PIXI.Stage.call(this,0,!1),this.name="_stage_root",this.interactive=!1,this.disableVisibilityChange=!1,this.checkOffsetInterval=2500,this.exists=!0,this.currentRenderOrderID=0,this._hiddenVar="hidden",this._nextOffsetCheck=0,this._backgroundColor=0,a.config?this.parseConfig(a.config):(this.game.canvas=b.Canvas.create(c,d),this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%")},b.Stage.prototype=Object.create(PIXI.Stage.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.preUpdate=function(){this.currentRenderOrderID=0;for(var a=this.children.length,b=0;a>b;b++)this.children[b].preUpdate()},b.Stage.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Stage.prototype.postUpdate=function(){if(this.game.world.camera.target){this.game.world.camera.target.postUpdate(),this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a]!==this.game.world.camera.target&&this.children[a].postUpdate()}else{this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a].postUpdate()}this.checkOffsetInterval!==!1&&this.game.time.now>this._nextOffsetCheck&&(b.Canvas.getOffset(this.game.canvas,this.offset),this._nextOffsetCheck=this.game.time.now+this.checkOffsetInterval)},b.Stage.prototype.parseConfig=function(a){this.game.canvas=a.canvasID?b.Canvas.create(this.game.width,this.game.height,a.canvasID):b.Canvas.create(this.game.width,this.game.height),a.canvasStyle?this.game.canvas.stlye=a.canvasStyle:this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",a.checkOffsetInterval&&(this.checkOffsetInterval=a.checkOffsetInterval),a.disableVisibilityChange&&(this.disableVisibilityChange=a.disableVisibilityChange),a.fullScreenScaleMode&&(this.fullScreenScaleMode=a.fullScreenScaleMode),a.scaleMode&&(this.scaleMode=a.scaleMode),a.backgroundColor&&(this.backgroundColor=a.backgroundColor)},b.Stage.prototype.boot=function(){b.Canvas.getOffset(this.game.canvas,this.offset),this.bounds=new b.Rectangle(this.offset.x,this.offset.y,this.game.width,this.game.height);var a=this;this._onChange=function(b){return a.visibilityChange(b)},b.Canvas.setUserSelect(this.game.canvas,"none"),b.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},b.Stage.prototype.checkVisibility=function(){this._hiddenVar=void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.hidden?"visibilitychange":null,this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.onblur=this._onChange,window.onfocus=this._onChange},b.Stage.prototype.visibilityChange=function(a){return this.disableVisibilityChange?void 0:"pagehide"===a.type||"blur"===a.type||"pageshow"===a.type||"focus"===a.type?void("pagehide"===a.type||"blur"===a.type?this.game.focusLoss(a):("pageshow"===a.type||"focus"===a.type)&&this.game.focusGain(a)):void(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden?this.game.gamePaused(a):this.game.gameResumed(a))},b.Stage.prototype.setBackgroundColor=function(a){this._backgroundColor=a||0,this.backgroundColorSplit=PIXI.hex2rgb(this.backgroundColor);var b=this._backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},Object.defineProperty(b.Stage.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this.game.transparent===!1&&("string"==typeof a&&(a=b.Color.hexToRGB(a)),this.setBackgroundColor(a))}}),Object.defineProperty(b.Stage.prototype,"smoothed",{get:function(){return!PIXI.scaleModes.LINEAR},set:function(a){PIXI.scaleModes.LINEAR=a?0:1}}),b.Group=function(a,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=b.Physics.ARCADE),this.game=a,"undefined"==typeof c&&(c=a.world),this.name=d||"group",PIXI.DisplayObjectContainer.call(this),e?this.game.stage.addChild(this):c&&c.addChild(this),this.z=0,this.type=b.GROUP,this.alive=!0,this.exists=!0,this.scale=new b.Point(1,1),this.cursor=null,this.cameraOffset=new b.Point,this.enableBody=f,this.enableBodyDebug=!1,this.physicsBodyType=g,this._sortProperty="z",this._cache=[0,0,0,0,1,0,1,0,0,0]},b.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),b.Group.prototype.constructor=b.Group,b.Group.RETURN_NONE=0,b.Group.RETURN_TOTAL=1,b.Group.RETURN_CHILD=2,b.Group.SORT_ASCENDING=-1,b.Group.SORT_DESCENDING=1,b.Group.prototype.add=function(a){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChild(a),a.z=this.children.length,a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.addAt=function(a,b){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChildAt(a,b),this.updateZ(),a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.getAt=function(a){return 0>a||a>=this.children.length?-1:this.getChildAt(a)},b.Group.prototype.create=function(a,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new b.Sprite(this.game,a,c,d,e);return this.enableBody&&this.game.physics.enable(g,this.physicsBodyType),g.exists=f,g.visible=f,g.alive=f,this.addChild(g),g.z=this.children.length,g.events&&g.events.onAddedToGroup.dispatch(g,this),null===this.cursor&&(this.cursor=g),g},b.Group.prototype.createMultiple=function(a,b,c,d){"undefined"==typeof d&&(d=!1);for(var e=0;a>e;e++)this.create(0,0,b,c,d)},b.Group.prototype.updateZ=function(){for(var a=this.children.length;a--;)this.children[a].z=a},b.Group.prototype.next=function(){this.cursor&&(this._cache[8]===this.children.length?this._cache[8]=0:this._cache[8]++,this.cursor=this.children[this._cache[8]])},b.Group.prototype.previous=function(){this.cursor&&(0===this._cache[8]?this._cache[8]=this.children.length-1:this._cache[8]--,this.cursor=this.children[this._cache[8]])},b.Group.prototype.swap=function(a,b){var c=this.swapChildren(a,b);return c&&this.updateZ(),c},b.Group.prototype.bringToTop=function(a){return a.parent===this&&this.getIndex(a)<this.children.length&&(this.remove(a),this.add(a)),a},b.Group.prototype.sendToBack=function(a){return a.parent===this&&this.getIndex(a)>0&&(this.remove(a),this.addAt(a,0)),a},b.Group.prototype.moveUp=function(a){if(a.parent===this&&this.getIndex(a)<this.children.length-1){var b=this.getIndex(a),c=this.getAt(b+1);c&&this.swap(b,c)}return a},b.Group.prototype.moveDown=function(a){if(a.parent===this&&this.getIndex(a)>0){var b=this.getIndex(a),c=this.getAt(b-1);c&&this.swap(b,c)}return a},b.Group.prototype.xy=function(a,b,c){return 0>a||a>this.children.length?-1:(this.getChildAt(a).x=b,void(this.getChildAt(a).y=c))},b.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},b.Group.prototype.getIndex=function(a){return this.children.indexOf(a)},b.Group.prototype.replace=function(a,c){var d=this.getIndex(a);if(-1!==d){void 0!==c.parent&&(c.events.onRemovedFromGroup.dispatch(c,this),c.parent.removeChild(c),c.parent instanceof b.Group&&c.parent.updateZ());var e=a;return this.remove(e),this.addAt(c,d),e}},b.Group.prototype.setProperty=function(a,b,c,d){d=d||0;var e=b.length;1==e?0===d?a[b[0]]=c:1==d?a[b[0]]+=c:2==d?a[b[0]]-=c:3==d?a[b[0]]*=c:4==d&&(a[b[0]]/=c):2==e?0===d?a[b[0]][b[1]]=c:1==d?a[b[0]][b[1]]+=c:2==d?a[b[0]][b[1]]-=c:3==d?a[b[0]][b[1]]*=c:4==d&&(a[b[0]][b[1]]/=c):3==e?0===d?a[b[0]][b[1]][b[2]]=c:1==d?a[b[0]][b[1]][b[2]]+=c:2==d?a[b[0]][b[1]][b[2]]-=c:3==d?a[b[0]][b[1]][b[2]]*=c:4==d&&(a[b[0]][b[1]][b[2]]/=c):4==e&&(0===d?a[b[0]][b[1]][b[2]][b[3]]=c:1==d?a[b[0]][b[1]][b[2]][b[3]]+=c:2==d?a[b[0]][b[1]][b[2]][b[3]]-=c:3==d?a[b[0]][b[1]][b[2]][b[3]]*=c:4==d&&(a[b[0]][b[1]][b[2]][b[3]]/=c))},b.Group.prototype.set=function(a,b,c,d,e,f){b=b.split("."),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),(d===!1||d&&a.alive)&&(e===!1||e&&a.visible)&&this.setProperty(a,b,c,f)},b.Group.prototype.setAll=function(a,b,c,d,e){a=a.split("."),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),e=e||0;for(var f=0,g=this.children.length;g>f;f++)(!c||c&&this.children[f].alive)&&(!d||d&&this.children[f].visible)&&this.setProperty(this.children[f],a,b,e)},b.Group.prototype.setAllChildren=function(a,c,d,e,f){"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),f=f||0;for(var g=0,h=this.children.length;h>g;g++)(!d||d&&this.children[g].alive)&&(!e||e&&this.children[g].visible)&&(this.children[g]instanceof b.Group?this.children[g].setAllChildren(a,c,d,e,f):this.setProperty(this.children[g],a.split("."),c,f))},b.Group.prototype.addAll=function(a,b,c,d){this.setAll(a,b,c,d,1)},b.Group.prototype.subAll=function(a,b,c,d){this.setAll(a,b,c,d,2)},b.Group.prototype.multiplyAll=function(a,b,c,d){this.setAll(a,b,c,d,3)},b.Group.prototype.divideAll=function(a,b,c,d){this.setAll(a,b,c,d,4)},b.Group.prototype.callAllExists=function(a,b){for(var c=Array.prototype.splice.call(arguments,2),d=0,e=this.children.length;e>d;d++)this.children[d].exists===b&&this.children[d][a]&&this.children[d][a].apply(this.children[d],c)},b.Group.prototype.callbackFromArray=function(a,b,c){if(1==c){if(a[b[0]])return a[b[0]]}else if(2==c){if(a[b[0]][b[1]])return a[b[0]][b[1]]}else if(3==c){if(a[b[0]][b[1]][b[2]])return a[b[0]][b[1]][b[2]]}else if(4==c){if(a[b[0]][b[1]][b[2]][b[3]])return a[b[0]][b[1]][b[2]][b[3]]}else if(a[b])return a[b];return!1},b.Group.prototype.callAll=function(a,b){if("undefined"!=typeof a){a=a.split(".");var c=a.length;if("undefined"==typeof b||null===b||""===b)b=null;else if("string"==typeof b){b=b.split(".");var d=b.length}for(var e=Array.prototype.splice.call(arguments,2),f=null,g=null,h=0,i=this.children.length;i>h;h++)f=this.callbackFromArray(this.children[h],a,c),b&&f?(g=this.callbackFromArray(this.children[h],b,d),f&&f.apply(g,e)):f&&f.apply(this.children[h],e)}},b.Group.prototype.preUpdate=function(){if(!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;for(var a=this.children.length;a--;)this.children[a].preUpdate();return!0},b.Group.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Group.prototype.postUpdate=function(){1===this._cache[7]&&(this.x=this.game.camera.view.x+this.cameraOffset.x,this.y=this.game.camera.view.y+this.cameraOffset.y);for(var a=this.children.length;a--;)this.children[a].postUpdate()},b.Group.prototype.forEach=function(a,b,c){"undefined"==typeof c&&(c=!1);var d=Array.prototype.splice.call(arguments,3);d.unshift(null);for(var e=0,f=this.children.length;f>e;e++)(!c||c&&this.children[e].exists)&&(d[0]=this.children[e],a.apply(b,d))},b.Group.prototype.forEachExists=function(a,c){var d=Array.prototype.splice.call(arguments,2);d.unshift(null),this.iterate("exists",!0,b.Group.RETURN_TOTAL,a,c,d)},b.Group.prototype.forEachAlive=function(a,c){var d=Array.prototype.splice.call(arguments,2);d.unshift(null),this.iterate("alive",!0,b.Group.RETURN_TOTAL,a,c,d)},b.Group.prototype.forEachDead=function(a,c){var d=Array.prototype.splice.call(arguments,2);d.unshift(null),this.iterate("alive",!1,b.Group.RETURN_TOTAL,a,c,d)},b.Group.prototype.sort=function(a,c){this.children.length<2||("undefined"==typeof a&&(a="z"),"undefined"==typeof c&&(c=b.Group.SORT_ASCENDING),this._sortProperty=a,this.children.sort(c===b.Group.SORT_ASCENDING?this.ascendingSortHandler.bind(this):this.descendingSortHandler.bind(this)),this.updateZ())},b.Group.prototype.ascendingSortHandler=function(a,b){return a[this._sortProperty]<b[this._sortProperty]?-1:a[this._sortProperty]>b[this._sortProperty]?1:a.z<b.z?-1:1},b.Group.prototype.descendingSortHandler=function(a,b){return a[this._sortProperty]<b[this._sortProperty]?1:a[this._sortProperty]>b[this._sortProperty]?-1:0},b.Group.prototype.iterate=function(a,c,d,e,f,g){if(d===b.Group.RETURN_TOTAL&&0===this.children.length)return 0;"undefined"==typeof e&&(e=!1);for(var h=0,i=0,j=this.children.length;j>i;i++)if(this.children[i][a]===c&&(h++,e&&(g[0]=this.children[i],e.apply(f,g)),d===b.Group.RETURN_CHILD))return this.children[i];return d===b.Group.RETURN_TOTAL?h:d===b.Group.RETURN_CHILD?null:void 0},b.Group.prototype.getFirstExists=function(a){return"boolean"!=typeof a&&(a=!0),this.iterate("exists",a,b.Group.RETURN_CHILD)},b.Group.prototype.getFirstAlive=function(){return this.iterate("alive",!0,b.Group.RETURN_CHILD)},b.Group.prototype.getFirstDead=function(){return this.iterate("alive",!1,b.Group.RETURN_CHILD)},b.Group.prototype.getTop=function(){return this.children.length>0?this.children[this.children.length-1]:void 0},b.Group.prototype.getBottom=function(){return this.children.length>0?this.children[0]:void 0},b.Group.prototype.countLiving=function(){return this.iterate("alive",!0,b.Group.RETURN_TOTAL)},b.Group.prototype.countDead=function(){return this.iterate("alive",!1,b.Group.RETURN_TOTAL)},b.Group.prototype.getRandom=function(a,b){return 0===this.children.length?null:(a=a||0,b=b||this.children.length,this.game.math.getRandom(this.children,a,b))},b.Group.prototype.remove=function(a){return 0!==this.children.length?(a.events&&a.events.onRemovedFromGroup.dispatch(a,this),this.removeChild(a),this.updateZ(),this.cursor===a&&this.next(),!0):void 0},b.Group.prototype.removeAll=function(){if(0!==this.children.length){do this.children[0].events&&this.children[0].events.onRemovedFromGroup.dispatch(this.children[0],this),this.removeChild(this.children[0]);while(this.children.length>0);this.cursor=null}},b.Group.prototype.removeBetween=function(a,b){if(0!==this.children.length){if(a>b||0>a||b>this.children.length)return!1;for(var c=a;b>c;c++)this.children[c].events&&this.children[c].events.onRemovedFromGroup.dispatch(this.children[c],this),this.removeChild(this.children[c]),this.cursor===this.children[c]&&(this.cursor=null);this.updateZ()}},b.Group.prototype.destroy=function(a,b){if(null!==this.game){if("undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!1),a){if(this.children.length>0)do this.children[0].parent&&this.children[0].destroy(a);while(this.children.length>0)}else this.removeAll();this.cursor=null,b||(this.parent.removeChild(this),this.game=null,this.exists=!1)}},Object.defineProperty(b.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,b.Group.RETURN_TOTAL)}}),Object.defineProperty(b.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(b.Group.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Group.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.World=function(a){b.Group.call(this,a,null,"__world",!1),this.bounds=new b.Rectangle(0,0,a.width,a.height),this.camera=null},b.World.prototype=Object.create(b.Group.prototype),b.World.prototype.constructor=b.World,b.World.prototype.boot=function(){this.camera=new b.Camera(this.game,0,0,0,this.game.width,this.game.height),this.camera.displayObject=this,this.camera.scale=this.scale,this.game.camera=this.camera,this.game.stage.addChild(this)},b.World.prototype.setBounds=function(a,b,c,d){c<this.game.width&&(c=this.game.width),d<this.game.height&&(d=this.game.height),this.bounds.setTo(a,b,c,d),this.camera.bounds&&this.camera.bounds.setTo(a,b,c,d),this.game.physics.setBoundsToWorld()},b.World.prototype.shutdown=function(){this.destroy(!0,!0)},Object.defineProperty(b.World.prototype,"width",{get:function(){return this.bounds.width},set:function(a){this.bounds.width=a}}),Object.defineProperty(b.World.prototype,"height",{get:function(){return this.bounds.height},set:function(a){this.bounds.height=a}}),Object.defineProperty(b.World.prototype,"centerX",{get:function(){return this.bounds.halfWidth}}),Object.defineProperty(b.World.prototype,"centerY",{get:function(){return this.bounds.halfHeight}}),Object.defineProperty(b.World.prototype,"randomX",{get:function(){return this.bounds.x<0?this.game.rnd.integerInRange(this.bounds.x,this.bounds.width-Math.abs(this.bounds.x)):this.game.rnd.integerInRange(this.bounds.x,this.bounds.width)}}),Object.defineProperty(b.World.prototype,"randomY",{get:function(){return this.bounds.y<0?this.game.rnd.integerInRange(this.bounds.y,this.bounds.height-Math.abs(this.bounds.y)):this.game.rnd.integerInRange(this.bounds.y,this.bounds.height)}}),b.ScaleManager=function(a,c,d){this.game=a,this.width=c,this.height=d,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this.pageAlignHorizontally=!1,this.pageAlignVertically=!1,this.maxIterations=5,this.orientationSprite=null,this.enterLandscape=new b.Signal,this.enterPortrait=new b.Signal,this.enterIncorrectOrientation=new b.Signal,this.leaveIncorrectOrientation=new b.Signal,this.hasResized=new b.Signal,this.fullScreenTarget=this.game.canvas,this.enterFullScreen=new b.Signal,this.leaveFullScreen=new b.Signal,this.orientation=0,window.orientation?this.orientation=window.orientation:window.outerWidth>window.outerHeight&&(this.orientation=90),this.scaleFactor=new b.Point(1,1),this.scaleFactorInversed=new b.Point(1,1),this.margin=new b.Point(0,0),this.aspectRatio=0,this.sourceAspectRatio=c/d,this.event=null,this.scaleMode=b.ScaleManager.NO_SCALE,this.fullScreenScaleMode=b.ScaleManager.NO_SCALE,this._startHeight=0,this._width=0,this._height=0;var e=this;window.addEventListener("orientationchange",function(a){return e.checkOrientation(a)},!1),window.addEventListener("resize",function(a){return e.checkResize(a)},!1),document.addEventListener("webkitfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("mozfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("fullscreenchange",function(a){return e.fullScreenChange(a)},!1)},b.ScaleManager.EXACT_FIT=0,b.ScaleManager.NO_SCALE=1,b.ScaleManager.SHOW_ALL=2,b.ScaleManager.prototype={startFullScreen:function(a){!this.isFullScreen&&this.game.device.fullscreen&&("undefined"!=typeof a&&this.game.renderType===b.CANVAS&&(this.game.stage.smoothed=a),this._width=this.width,this._height=this.height,this.game.device.fullscreenKeyboard?this.fullScreenTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):this.fullScreenTarget[this.game.device.requestFullscreen]())},stopFullScreen:function(){this.fullScreenTarget[this.game.device.cancelFullscreen]()},fullScreenChange:function(a){this.event=a,this.isFullScreen?(this.fullScreenScaleMode===b.ScaleManager.EXACT_FIT?(this.fullScreenTarget.style.width="100%",this.fullScreenTarget.style.height="100%",this.width=window.outerWidth,this.height=window.outerHeight,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.checkResize()):this.fullScreenScaleMode===b.ScaleManager.SHOW_ALL&&(this.setShowAll(),this.refresh()),this.enterFullScreen.dispatch(this.width,this.height)):(this.fullScreenTarget.style.width=this.game.width+"px",this.fullScreenTarget.style.height=this.game.height+"px",this.width=this._width,this.height=this._height,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.leaveFullScreen.dispatch(this.width,this.height))},forceOrientation:function(a,c,d){"undefined"==typeof c&&(c=!1),this.forceLandscape=a,this.forcePortrait=c,"undefined"!=typeof d&&((null==d||this.game.cache.checkImageKey(d)===!1)&&(d="__default"),this.orientationSprite=new b.Image(this.game,this.game.width/2,this.game.height/2,PIXI.TextureCache[d]),this.orientationSprite.anchor.set(.5),this.checkOrientationState(),this.incorrectOrientation?(this.orientationSprite.visible=!0,this.game.world.visible=!1):(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.game.stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()):(this.forceLandscape&&window.innerWidth<window.innerHeight||this.forcePortrait&&window.innerHeight<window.innerWidth)&&(this.incorrectOrientation=!0,this.enterIncorrectOrientation.dispatch(),this.orientationSprite&&this.orientationSprite.visible===!1&&(this.orientationSprite.visible=!0,this.game.world.visible=!1),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh())},checkOrientation:function(a){this.event=a,this.orientation=window.orientation,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()},checkResize:function(a){this.event=a,this.orientation=window.outerWidth>window.outerHeight?90:0,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh(),this.checkOrientationState()},refresh:function(){if(this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),null==this._check&&this.maxIterations>0){this._iterations=this.maxIterations;var a=this;this._check=window.setInterval(function(){return a.setScreenSize()},10),this.setScreenSize()}},setScreenSize:function(a){"undefined"==typeof a&&(a=!1),this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),this._iterations--,(a||window.innerHeight>this._startHeight||this._iterations<0)&&(document.documentElement.style.minHeight=window.innerHeight+"px",this.incorrectOrientation===!0?this.setMaximum():this.isFullScreen?this.fullScreenScaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.fullScreenScaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll():this.scaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.scaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll(),this.setSize(),clearInterval(this._check),this._check=null)},setSize:function(){this.incorrectOrientation===!1&&(this.maxWidth&&this.width>this.maxWidth&&(this.width=this.maxWidth),this.maxHeight&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.minWidth&&this.width<this.minWidth&&(this.width=this.minWidth),this.minHeight&&this.height<this.minHeight&&(this.height=this.minHeight)),this.game.canvas.style.width=this.width+"px",this.game.canvas.style.height=this.height+"px",this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.pageAlignHorizontally&&(this.width<window.innerWidth&&this.incorrectOrientation===!1?(this.margin.x=Math.round((window.innerWidth-this.width)/2),this.game.canvas.style.marginLeft=this.margin.x+"px"):(this.margin.x=0,this.game.canvas.style.marginLeft="0px")),this.pageAlignVertically&&(this.height<window.innerHeight&&this.incorrectOrientation===!1?(this.margin.y=Math.round((window.innerHeight-this.height)/2),this.game.canvas.style.marginTop=this.margin.y+"px"):(this.margin.y=0,this.game.canvas.style.marginTop="0px")),b.Canvas.getOffset(this.game.canvas,this.game.stage.offset),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.scaleFactorInversed.x=this.width/this.game.width,this.scaleFactorInversed.y=this.height/this.game.height,this.hasResized.dispatch(this.width,this.height),this.checkOrientationState()},setMaximum:function(){this.width=window.innerWidth,this.height=window.innerHeight},setShowAll:function(){var a=Math.min(window.innerHeight/this.game.height,window.innerWidth/this.game.width);this.width=Math.round(this.game.width*a),this.height=Math.round(this.game.height*a)},setExactFit:function(){var a=window.innerWidth,b=window.innerHeight;this.width=this.maxWidth&&a>this.maxWidth?this.maxWidth:a,this.height=this.maxHeight&&b>this.maxHeight?this.maxHeight:b}},b.ScaleManager.prototype.constructor=b.ScaleManager,Object.defineProperty(b.ScaleManager.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(b.ScaleManager.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(b.ScaleManager.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),b.Game=function(a,c,d,e,f,g,h,i){this.id=b.GAMES.push(this)-1,this.config=null,this.physicsConfig=i,this.parent="",this.width=800,this.height=600,this.transparent=!1,this.antialias=!0,this.renderer=b.AUTO,this.renderType=b.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.rnd=null,this.device=null,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof c&&(this.height=c),"undefined"!=typeof d&&(this.renderer=d,this.renderType=d),"undefined"!=typeof e&&(this.parent=e),"undefined"!=typeof g&&(this.transparent=g),"undefined"!=typeof h&&(this.antialias=h),this.rnd=new b.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new b.StateManager(this,f));var j=this;return this._onBoot=function(){return j.boot()},"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(this._onBoot,0):(document.addEventListener("DOMContentLoaded",this._onBoot,!1),window.addEventListener("load",this._onBoot,!1)),this},b.Game.prototype={parseConfig:function(a){this.config=a,a.width&&(this.width=b.Utils.parseDimension(a.width,0)),a.height&&(this.height=b.Utils.parseDimension(a.height,1)),a.renderer&&(this.renderer=a.renderer,this.renderType=a.renderer),a.parent&&(this.parent=a.parent),a.transparent&&(this.transparent=a.transparent),a.antialias&&(this.antialias=a.antialias),a.physicsConfig&&(this.physicsConfig=a.physicsConfig);var c=[(Date.now()*Math.random()).toString()];a.seed&&(c=a.seed),this.rnd=new b.RandomDataGenerator(c);var d=null;a.state&&(d=a.state),this.state=new b.StateManager(this,d)},boot:function(){this.isBooted||(document.body?(document.removeEventListener("DOMContentLoaded",this._onBoot),window.removeEventListener("load",this._onBoot),this.onPause=new b.Signal,this.onResume=new b.Signal,this.onBlur=new b.Signal,this.onFocus=new b.Signal,this.isBooted=!0,this.device=new b.Device(this),this.math=b.Math,this.stage=new b.Stage(this,this.width,this.height),this.scale=new b.ScaleManager(this,this.width,this.height),this.setUpRenderer(),this.device.checkFullScreenSupport(),this.world=new b.World(this),this.add=new b.GameObjectFactory(this),this.make=new b.GameObjectCreator(this),this.cache=new b.Cache(this),this.load=new b.Loader(this),this.time=new b.Time(this),this.tweens=new b.TweenManager(this),this.input=new b.Input(this),this.sound=new b.SoundManager(this),this.physics=new b.Physics(this,this.physicsConfig),this.particles=new b.Particles(this),this.plugins=new b.PluginManager(this,this),this.net=new b.Net(this),this.debug=new b.Utils.Debug(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.debug.boot(),this.showDebugHeader(),this.isRunning=!0,this.raf=this.config&&this.config.forceSetTimeOut?new b.RequestAnimationFrame(this,this.config.forceSetTimeOut):new b.RequestAnimationFrame(this,!1),this.raf.start()):window.setTimeout(this._onBoot,20))},showDebugHeader:function(){var a=b.DEV_VERSION,c="Canvas",d="HTML Audio",e=1;if(this.renderType===b.WEBGL?(c="WebGL",e++):this.renderType==b.HEADLESS&&(c="Headless"),this.device.webAudio&&(d="WebAudio",e++),this.device.chrome){for(var f=["%c %c %c Phaser v"+a+" - "+c+" - "+d+" %c %c http://phaser.io %c %c ♥%c♥%c♥ ","background: #0cf300","background: #00bc17","color: #ffffff; background: #00711f;","background: #00bc17","background: #0cf300","background: #00bc17"],g=0;3>g;g++)f.push(e>g?"color: #ff2424; background: #fff":"color: #959595; background: #fff");console.log.apply(console,f)}else console.log("Phaser v"+a+" - Renderer: "+c+" - Audio: "+d+" - http://phaser.io") },setUpRenderer:function(){if(this.device.trident&&(this.renderType=b.CANVAS),this.renderType===b.HEADLESS||this.renderType===b.CANVAS||this.renderType===b.AUTO&&this.device.webGL===!1){if(!this.device.canvas)throw new Error("Phaser.Game - cannot create Canvas or WebGL context, aborting.");this.renderType===b.AUTO&&(this.renderType=b.CANVAS),this.renderer=new PIXI.CanvasRenderer(this.width,this.height,this.canvas,this.transparent),this.context=this.renderer.context}else this.renderType=b.WEBGL,this.renderer=new PIXI.WebGLRenderer(this.width,this.height,this.canvas,this.transparent,this.antialias),this.context=null;this.renderType!==b.HEADLESS&&(this.stage.smoothed=this.antialias,b.Canvas.addToDOM(this.canvas,this.parent,!0),b.Canvas.setTouchAction(this.canvas))},update:function(a){this.time.update(a),this._paused||this.pendingStep?this.debug.preUpdate():(this.stepping&&(this.pendingStep=!0),this.debug.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(),this.plugins.preUpdate(),this.stage.preUpdate(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.state.update(),this.physics.update(),this.particles.update(),this.plugins.update(),this.stage.postUpdate(),this.plugins.postUpdate()),this.renderType!=b.HEADLESS&&(this.renderer.render(this.stage),this.plugins.render(),this.state.render(),this.plugins.postRender())},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.input.destroy(),this.state.destroy(),this.physics.destroy(),this.state=null,this.cache=null,this.input=null,this.load=null,this.sound=null,this.stage=null,this.time=null,this.world=null,this.isBooted=!1},gamePaused:function(a){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.setMute(),this.onPause.dispatch(a))},gameResumed:function(a){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.unsetMute(),this.onResume.dispatch(a))},focusLoss:function(a){this.onBlur.dispatch(a),this.gamePaused(a)},focusGain:function(a){this.onFocus.dispatch(a),this.gameResumed(a)}},b.Game.prototype.constructor=b.Game,Object.defineProperty(b.Game.prototype,"paused",{get:function(){return this._paused},set:function(a){a===!0?this._paused===!1&&(this._paused=!0,this._codePaused=!0,this.sound.mute=!0,this.time.gamePaused(),this.onPause.dispatch(this)):this._paused&&(this._paused=!1,this._codePaused=!1,this.input.reset(),this.sound.mute=!1,this.time.gameResumed(),this.onResume.dispatch(this))}}),b.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.disabled=!1,this.multiInputOverride=b.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=10,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.interactiveItems=new b.LinkedList,this._localPoint=new b.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},b.Input.MOUSE_OVERRIDES_TOUCH=0,b.Input.TOUCH_OVERRIDES_MOUSE=1,b.Input.MOUSE_TOUCH_COMBINE=2,b.Input.prototype={boot:function(){this.mousePointer=new b.Pointer(this.game,0),this.pointer1=new b.Pointer(this.game,1),this.pointer2=new b.Pointer(this.game,2),this.mouse=new b.Mouse(this.game),this.keyboard=new b.Keyboard(this.game),this.touch=new b.Touch(this.game),this.mspointer=new b.MSPointer(this.game),this.gamepad=new b.Gamepad(this.game),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.scale=new b.Point(1,1),this.speed=new b.Point,this.position=new b.Point,this._oldPosition=new b.Point,this.circle=new b.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallback=null},setMoveCallback:function(a,b){this.moveCallback=a,this.moveCallbackContext=b},addPointer:function(){for(var a=0,c=10;c>0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter<this.pollRate?void this._pollCounter++:(this.speed.x=this.position.x-this._oldPosition.x,this.speed.y=this.position.y-this._oldPosition.y,this._oldPosition.copyFrom(this.position),this.mousePointer.update(),this.gamepad.active&&this.gamepad.update(),this.pointer1.update(),this.pointer2.update(),this.pointer3&&this.pointer3.update(),this.pointer4&&this.pointer4.update(),this.pointer5&&this.pointer5.update(),this.pointer6&&this.pointer6.update(),this.pointer7&&this.pointer7.update(),this.pointer8&&this.pointer8.update(),this.pointer9&&this.pointer9.update(),this.pointer10&&this.pointer10.update(),void(this._pollCounter=0))},reset:function(a){if(this.game.isBooted!==!1){"undefined"==typeof a&&(a=!1),this.keyboard.reset(),this.mousePointer.reset(),this.gamepad.reset();for(var c=1;10>=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(this.onDown.dispose(),this.onUp.dispose(),this.onTap.dispose(),this.onHold.dispose(),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].start(a);return null},updatePointer:function(a){if(this.pointer1.active&&this.pointer1.identifier==a.identifier)return this.pointer1.move(a);if(this.pointer2.active&&this.pointer2.identifier==a.identifier)return this.pointer2.move(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].move(a);return null},stopPointer:function(a){if(this.pointer1.active&&this.pointer1.identifier==a.identifier)return this.pointer1.stop(a);if(this.pointer2.active&&this.pointer2.identifier==a.identifier)return this.pointer2.stop(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];return null},getLocalPosition:function(a,c,d){"undefined"==typeof d&&(d=new b.Point);var e=a.worldTransform,f=1/(e.a*e.d+e.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*f)},hitTest:function(a,c,d){if(!a.worldVisible)return!1;if(this.getLocalPosition(a,c,this._localPoint),d.copyFrom(this._localPoint),a.hitArea&&a.hitArea.contains)return a.hitArea.contains(this._localPoint.x,this._localPoint.y)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.x<g+e){var h=-f*a.anchor.y;if(this._localPoint.y>h&&this._localPoint.y<h+f)return!0}}else if(a instanceof PIXI.Sprite){var e=a.texture.frame.width,f=a.texture.frame.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.x<g+e){var h=-f*a.anchor.y;if(this._localPoint.y>h&&this._localPoint.y<h+f)return!0}}for(var i=0,j=a.children.length;j>i;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},b.Input.prototype.constructor=b.Input,Object.defineProperty(b.Input.prototype,"x",{get:function(){return this._x},set:function(a){this._x=Math.floor(a)}}),Object.defineProperty(b.Input.prototype,"y",{get:function(){return this._y},set:function(a){this._y=Math.floor(a)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter<this.pollRate}}),Object.defineProperty(b.Input.prototype,"totalInactivePointers",{get:function(){return 10-this.currentPointers}}),Object.defineProperty(b.Input.prototype,"totalActivePointers",{get:function(){this.currentPointers=0;for(var a=1;10>=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&this.duration<a},justReleased:function(a){return"undefined"==typeof a&&(a=2500),!this.isDown&&this.game.time.now-this.timeUp<a}},b.Key.prototype.constructor=b.Key,b.Keyboard=function(a){this.game=a,this.disabled=!1,this.event=null,this.callbackContext=this,this.onDownCallback=null,this.onUpCallback=null,this._keys=[],this._capture=[],this._onKeyDown=null,this._onKeyUp=null,this._i=0},b.Keyboard.prototype={addCallbacks:function(a,b,c){this.callbackContext=a,this.onDownCallback=b,"undefined"!=typeof c&&(this.onUpCallback=c)},addKey:function(a){return this._keys[a]||(this._keys[a]=new b.Key(this.game,a),this.addKeyCapture(a)),this._keys[a]},removeKey:function(a){this._keys[a]&&(this._keys[a]=null,this.removeKeyCapture(a))},createCursorKeys:function(){return{up:this.addKey(b.Keyboard.UP),down:this.addKey(b.Keyboard.DOWN),left:this.addKey(b.Keyboard.LEFT),right:this.addKey(b.Keyboard.RIGHT)}},start:function(){if(null===this._onKeyDown){var a=this;this._onKeyDown=function(b){return a.processKeyDown(b)},this._onKeyUp=function(b){return a.processKeyUp(b)},window.addEventListener("keydown",this._onKeyDown,!1),window.addEventListener("keyup",this._onKeyUp,!1)}},stop:function(){this._onKeyDown=null,this._onKeyUp=null,window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp)},destroy:function(){this.stop(),this.clearCaptures(),this._keys.length=0,this._i=0},addKeyCapture:function(a){if("object"==typeof a)for(var b in a)this._capture[a[b]]=!0;else this._capture[a]=!0},removeKeyCapture:function(a){delete this._capture[a]},clearCaptures:function(){this._capture={}},update:function(){for(this._i=this._keys.length;this._i--;)this._keys[this._i]&&this._keys[this._i].update()},processKeyDown:function(a){this.event=a,this.game.input.disabled||this.disabled||(this._capture[a.keyCode]&&a.preventDefault(),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,a),this._keys[a.keyCode]||(this._keys[a.keyCode]=new b.Key(this.game,a.keyCode)),this._keys[a.keyCode].processKeyDown(a))},processKeyUp:function(a){this.event=a,this.game.input.disabled||this.disabled||(this._capture[a.keyCode]&&a.preventDefault(),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,a),this._keys[a.keyCode]||(this._keys[a.keyCode]=new b.Key(this.game,a.keyCode)),this._keys[a.keyCode].processKeyUp(a))},reset:function(){this.event=null;for(var a=this._keys.length;a--;)this._keys[a]&&this._keys[a].reset()},justPressed:function(a,b){return this._keys[a]?this._keys[a].justPressed(b):!1},justReleased:function(a,b){return this._keys[a]?this._keys[a].justReleased(b):!1},isDown:function(a){return this._keys[a]?this._keys[a].isDown:!1}},b.Keyboard.prototype.constructor=b.Keyboard,b.Keyboard.A="A".charCodeAt(0),b.Keyboard.B="B".charCodeAt(0),b.Keyboard.C="C".charCodeAt(0),b.Keyboard.D="D".charCodeAt(0),b.Keyboard.E="E".charCodeAt(0),b.Keyboard.F="F".charCodeAt(0),b.Keyboard.G="G".charCodeAt(0),b.Keyboard.H="H".charCodeAt(0),b.Keyboard.I="I".charCodeAt(0),b.Keyboard.J="J".charCodeAt(0),b.Keyboard.K="K".charCodeAt(0),b.Keyboard.L="L".charCodeAt(0),b.Keyboard.M="M".charCodeAt(0),b.Keyboard.N="N".charCodeAt(0),b.Keyboard.O="O".charCodeAt(0),b.Keyboard.P="P".charCodeAt(0),b.Keyboard.Q="Q".charCodeAt(0),b.Keyboard.R="R".charCodeAt(0),b.Keyboard.S="S".charCodeAt(0),b.Keyboard.T="T".charCodeAt(0),b.Keyboard.U="U".charCodeAt(0),b.Keyboard.V="V".charCodeAt(0),b.Keyboard.W="W".charCodeAt(0),b.Keyboard.X="X".charCodeAt(0),b.Keyboard.Y="Y".charCodeAt(0),b.Keyboard.Z="Z".charCodeAt(0),b.Keyboard.ZERO="0".charCodeAt(0),b.Keyboard.ONE="1".charCodeAt(0),b.Keyboard.TWO="2".charCodeAt(0),b.Keyboard.THREE="3".charCodeAt(0),b.Keyboard.FOUR="4".charCodeAt(0),b.Keyboard.FIVE="5".charCodeAt(0),b.Keyboard.SIX="6".charCodeAt(0),b.Keyboard.SEVEN="7".charCodeAt(0),b.Keyboard.EIGHT="8".charCodeAt(0),b.Keyboard.NINE="9".charCodeAt(0),b.Keyboard.NUMPAD_0=96,b.Keyboard.NUMPAD_1=97,b.Keyboard.NUMPAD_2=98,b.Keyboard.NUMPAD_3=99,b.Keyboard.NUMPAD_4=100,b.Keyboard.NUMPAD_5=101,b.Keyboard.NUMPAD_6=102,b.Keyboard.NUMPAD_7=103,b.Keyboard.NUMPAD_8=104,b.Keyboard.NUMPAD_9=105,b.Keyboard.NUMPAD_MULTIPLY=106,b.Keyboard.NUMPAD_ADD=107,b.Keyboard.NUMPAD_ENTER=108,b.Keyboard.NUMPAD_SUBTRACT=109,b.Keyboard.NUMPAD_DECIMAL=110,b.Keyboard.NUMPAD_DIVIDE=111,b.Keyboard.F1=112,b.Keyboard.F2=113,b.Keyboard.F3=114,b.Keyboard.F4=115,b.Keyboard.F5=116,b.Keyboard.F6=117,b.Keyboard.F7=118,b.Keyboard.F8=119,b.Keyboard.F9=120,b.Keyboard.F10=121,b.Keyboard.F11=122,b.Keyboard.F12=123,b.Keyboard.F13=124,b.Keyboard.F14=125,b.Keyboard.F15=126,b.Keyboard.COLON=186,b.Keyboard.EQUALS=187,b.Keyboard.UNDERSCORE=189,b.Keyboard.QUESTION_MARK=191,b.Keyboard.TILDE=192,b.Keyboard.OPEN_BRACKET=219,b.Keyboard.BACKWARD_SLASH=220,b.Keyboard.CLOSED_BRACKET=221,b.Keyboard.QUOTES=222,b.Keyboard.BACKSPACE=8,b.Keyboard.TAB=9,b.Keyboard.CLEAR=12,b.Keyboard.ENTER=13,b.Keyboard.SHIFT=16,b.Keyboard.CONTROL=17,b.Keyboard.ALT=18,b.Keyboard.CAPS_LOCK=20,b.Keyboard.ESC=27,b.Keyboard.SPACEBAR=32,b.Keyboard.PAGE_UP=33,b.Keyboard.PAGE_DOWN=34,b.Keyboard.END=35,b.Keyboard.HOME=36,b.Keyboard.LEFT=37,b.Keyboard.UP=38,b.Keyboard.RIGHT=39,b.Keyboard.DOWN=40,b.Keyboard.INSERT=45,b.Keyboard.DELETE=46,b.Keyboard.HELP=47,b.Keyboard.NUM_LOCK=144,b.Mouse=function(a){this.game=a,this.callbackContext=this.game,this.mouseDownCallback=null,this.mouseMoveCallback=null,this.mouseUpCallback=null,this.capture=!1,this.button=-1,this.disabled=!1,this.locked=!1,this.pointerLock=new b.Signal,this.event=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null},b.Mouse.NO_BUTTON=-1,b.Mouse.LEFT_BUTTON=0,b.Mouse.MIDDLE_BUTTON=1,b.Mouse.RIGHT_BUTTON=2,b.Mouse.prototype={start:function(){if((!this.game.device.android||this.game.device.chrome!==!1)&&null===this._onMouseDown){var a=this;this._onMouseDown=function(b){return a.onMouseDown(b)},this._onMouseMove=function(b){return a.onMouseMove(b)},this._onMouseUp=function(b){return a.onMouseUp(b)},this.game.canvas.addEventListener("mousedown",this._onMouseDown,!0),this.game.canvas.addEventListener("mousemove",this._onMouseMove,!0),this.game.canvas.addEventListener("mouseup",this._onMouseUp,!0)}},onMouseDown:function(a){this.event=a,this.capture&&a.preventDefault(),this.button=a.button,this.mouseDownCallback&&this.mouseDownCallback.call(this.callbackContext,a),this.game.input.disabled||this.disabled||(a.identifier=0,this.game.input.mousePointer.start(a))},onMouseMove:function(a){this.event=a,this.capture&&a.preventDefault(),this.mouseMoveCallback&&this.mouseMoveCallback.call(this.callbackContext,a),this.game.input.disabled||this.disabled||(a.identifier=0,this.game.input.mousePointer.move(a))},onMouseUp:function(a){this.event=a,this.capture&&a.preventDefault(),this.button=b.Mouse.NO_BUTTON,this.mouseUpCallback&&this.mouseUpCallback.call(this.callbackContext,a),this.game.input.disabled||this.disabled||(a.identifier=0,this.game.input.mousePointer.stop(a))},requestPointerLock:function(){if(this.game.device.pointerLock){var a=this.game.canvas;a.requestPointerLock=a.requestPointerLock||a.mozRequestPointerLock||a.webkitRequestPointerLock,a.requestPointerLock();var b=this;this._pointerLockChange=function(a){return b.pointerLockChange(a)},document.addEventListener("pointerlockchange",this._pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this._pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this._pointerLockChange,!0)}},pointerLockChange:function(a){var b=this.game.canvas;document.pointerLockElement===b||document.mozPointerLockElement===b||document.webkitPointerLockElement===b?(this.locked=!0,this.pointerLock.dispatch(!0,a)):(this.locked=!1,this.pointerLock.dispatch(!1,a))},releasePointerLock:function(){document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock(),document.removeEventListener("pointerlockchange",this._pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this._pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this._pointerLockChange,!0)},stop:function(){this.game.canvas.removeEventListener("mousedown",this._onMouseDown,!0),this.game.canvas.removeEventListener("mousemove",this._onMouseMove,!0),this.game.canvas.removeEventListener("mouseup",this._onMouseUp,!0)}},b.Mouse.prototype.constructor=b.Mouse,b.MSPointer=function(a){this.game=a,this.callbackContext=this.game,this.disabled=!1,this._onMSPointerDown=null,this._onMSPointerMove=null,this._onMSPointerUp=null},b.MSPointer.prototype={start:function(){if(null===this._onMSPointerDown){var a=this;this.game.device.mspointer===!0&&(this._onMSPointerDown=function(b){return a.onPointerDown(b)},this._onMSPointerMove=function(b){return a.onPointerMove(b)},this._onMSPointerUp=function(b){return a.onPointerUp(b)},this.game.renderer.view.addEventListener("MSPointerDown",this._onMSPointerDown,!1),this.game.renderer.view.addEventListener("MSPointerMove",this._onMSPointerMove,!1),this.game.renderer.view.addEventListener("MSPointerUp",this._onMSPointerUp,!1),this.game.renderer.view.addEventListener("pointerDown",this._onMSPointerDown,!1),this.game.renderer.view.addEventListener("pointerMove",this._onMSPointerMove,!1),this.game.renderer.view.addEventListener("pointerUp",this._onMSPointerUp,!1),this.game.renderer.view.style["-ms-content-zooming"]="none",this.game.renderer.view.style["-ms-touch-action"]="none")}},onPointerDown:function(a){this.game.input.disabled||this.disabled||(a.preventDefault(),a.identifier=a.pointerId,this.game.input.startPointer(a))},onPointerMove:function(a){this.game.input.disabled||this.disabled||(a.preventDefault(),a.identifier=a.pointerId,this.game.input.updatePointer(a))},onPointerUp:function(a){this.game.input.disabled||this.disabled||(a.preventDefault(),a.identifier=a.pointerId,this.game.input.stopPointer(a))},stop:function(){this.game.canvas.removeEventListener("MSPointerDown",this._onMSPointerDown),this.game.canvas.removeEventListener("MSPointerMove",this._onMSPointerMove),this.game.canvas.removeEventListener("MSPointerUp",this._onMSPointerUp),this.game.canvas.removeEventListener("pointerDown",this._onMSPointerDown),this.game.canvas.removeEventListener("pointerMove",this._onMSPointerMove),this.game.canvas.removeEventListener("pointerUp",this._onMSPointerUp)}},b.MSPointer.prototype.constructor=b.MSPointer,b.Pointer=function(a,c){this.game=a,this.id=c,this._holdSent=!1,this._history=[],this._nextDrop=0,this._stateReset=!1,this.withinGame=!1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.x=-1,this.y=-1,this.isMouse=!1,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.previousTapTime=0,this.totalTouches=0,this.msSinceLastClick=Number.MAX_VALUE,this.targetObject=null,this.active=!1,this.position=new b.Point,this.positionDown=new b.Point,this.circle=new b.Circle(0,0,44),0===c&&(this.isMouse=!0)},b.Pointer.prototype={start:function(a){return this.identifier=a.identifier,this.target=a.target,"undefined"!=typeof a.button&&(this.button=a.button),this._history.length=0,this.active=!0,this.withinGame=!0,this.isDown=!0,this.isUp=!1,this.msSinceLastClick=this.game.time.now-this.timeDown,this.timeDown=this.game.time.now,this._holdSent=!1,this.move(a,!0),this.positionDown.setTo(this.x,this.y),(this.game.input.multiInputOverride===b.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride===b.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride===b.Input.TOUCH_OVERRIDES_MOUSE&&0===this.game.input.currentPointers)&&(this.game.input.x=this.x,this.game.input.y=this.y,this.game.input.position.setTo(this.x,this.y),this.game.input.onDown.dispatch(this,a),this.game.input.resetSpeed(this.x,this.y)),this._stateReset=!1,this.totalTouches++,this.isMouse||this.game.input.currentPointers++,null!==this.targetObject&&this.targetObject._touchedHandler(this),this},update:function(){this.active&&(this._holdSent===!1&&this.duration>=this.game.input.holdRate&&((this.game.input.multiInputOverride==b.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==b.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==b.Input.TOUCH_OVERRIDES_MOUSE&&0===this.game.input.currentPointers)&&this.game.input.onHold.dispatch(this),this._holdSent=!0),this.game.input.recordPointerHistory&&this.game.time.now>=this._nextDrop&&(this._nextDrop=this.game.time.now+this.game.input.recordRate,this._history.push({x:this.position.x,y:this.position.y}),this._history.length>this.game.input.recordLimit&&this._history.shift()))},move:function(a,c){if(!this.game.input.pollLocked){if("undefined"==typeof c&&(c=!1),"undefined"!=typeof a.button&&(this.button=a.button),this.clientX=a.clientX,this.clientY=a.clientY,this.pageX=a.pageX,this.pageY=a.pageY,this.screenX=a.screenX,this.screenY=a.screenY,this.x=(this.pageX-this.game.stage.offset.x)*this.game.input.scale.x,this.y=(this.pageY-this.game.stage.offset.y)*this.game.input.scale.y,this.position.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,(this.game.input.multiInputOverride==b.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==b.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==b.Input.TOUCH_OVERRIDES_MOUSE&&0===this.game.input.currentPointers)&&(this.game.input.activePointer=this,this.game.input.x=this.x,this.game.input.y=this.y,this.game.input.position.setTo(this.game.input.x,this.game.input.y),this.game.input.circle.x=this.game.input.x,this.game.input.circle.y=this.game.input.y),this.game.paused)return this;if(this.game.input.moveCallback&&this.game.input.moveCallback.call(this.game.input.moveCallbackContext,this,this.x,this.y),null!==this.targetObject&&this.targetObject.isDragged===!0)return this.targetObject.update(this)===!1&&(this.targetObject=null),this;if(this._highestRenderOrderID=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],this._highestInputPriorityID=d.priorityID,this._highestRenderObject=d),d=d.next;while(null!=d)}return null===this._highestRenderObject?this.targetObject&&(this.targetObject._pointerOutHandler(this),this.targetObject=null):null===this.targetObject?(this.targetObject=this._highestRenderObject,this._highestRenderObject._pointerOverHandler(this)):this.targetObject===this._highestRenderObject?this._highestRenderObject.update(this)===!1&&(this.targetObject=null):(this.targetObject._pointerOutHandler(this),this.targetObject=this._highestRenderObject,this.targetObject._pointerOverHandler(this)),this}},leave:function(a){this.withinGame=!1,this.move(a,!1)},stop:function(a){if(this._stateReset)return void a.preventDefault();if(this.timeUp=this.game.time.now,(this.game.input.multiInputOverride==b.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==b.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==b.Input.TOUCH_OVERRIDES_MOUSE&&0===this.game.input.currentPointers)&&(this.game.input.onUp.dispatch(this,a),this.duration>=0&&this.duration<=this.game.input.tapRate&&(this.timeUp-this.previousTapTime<this.game.input.doubleTapRate?this.game.input.onTap.dispatch(this,!0):this.game.input.onTap.dispatch(this,!1),this.previousTapTime=this.timeUp)),this.id>0&&(this.active=!1),this.withinGame=!1,this.isDown=!1,this.isUp=!0,this.isMouse===!1&&this.game.input.currentPointers--,this.game.input.interactiveItems.total>0){var c=this.game.input.interactiveItems.next;do c&&c._releasedHandler(this),c=c.next;while(null!=c)}return this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null,this},justPressed:function(a){return a=a||this.game.input.justPressedRate,this.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b<a.changedTouches.length;b++)this.game.input.startPointer(a.changedTouches[b])}},onTouchCancel:function(a){if(this.event=a,this.touchCancelCallback&&this.touchCancelCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b<a.changedTouches.length;b++)this.game.input.stopPointer(a.changedTouches[b])}},onTouchEnter:function(a){this.event=a,this.touchEnterCallback&&this.touchEnterCallback.call(this.callbackContext,a),this.game.input.disabled||this.disabled||this.preventDefault&&a.preventDefault()},onTouchLeave:function(a){this.event=a,this.touchLeaveCallback&&this.touchLeaveCallback.call(this.callbackContext,a),this.preventDefault&&a.preventDefault()},onTouchMove:function(a){this.event=a,this.touchMoveCallback&&this.touchMoveCallback.call(this.callbackContext,a),this.preventDefault&&a.preventDefault();for(var b=0;b<a.changedTouches.length;b++)this.game.input.updatePointer(a.changedTouches[b])},onTouchEnd:function(a){this.event=a,this.touchEndCallback&&this.touchEndCallback.call(this.callbackContext,a),this.preventDefault&&a.preventDefault();for(var b=0;b<a.changedTouches.length;b++)this.game.input.stopPointer(a.changedTouches[b])},stop:function(){this.game.device.touch&&(this.game.canvas.removeEventListener("touchstart",this._onTouchStart),this.game.canvas.removeEventListener("touchmove",this._onTouchMove),this.game.canvas.removeEventListener("touchend",this._onTouchEnd),this.game.canvas.removeEventListener("touchenter",this._onTouchEnter),this.game.canvas.removeEventListener("touchleave",this._onTouchLeave),this.game.canvas.removeEventListener("touchcancel",this._onTouchCancel))}},b.Touch.prototype.constructor=b.Touch,b.Gamepad=function(a){this.game=a,this._gamepads=[new b.SinglePad(a,this),new b.SinglePad(a,this),new b.SinglePad(a,this),new b.SinglePad(a,this)],this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.disabled=!1,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!=navigator.userAgent.indexOf("Firefox/")||!!navigator.getGamepads,this._prevRawGamepadTypes=[],this._prevTimestamps=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null},b.Gamepad.prototype={addCallbacks:function(a,b){"undefined"!=typeof b&&(this.onConnectCallback="function"==typeof b.onConnect?b.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof b.onDisconnect?b.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof b.onDown?b.onDown:this.onDownCallback,this.onUpCallback="function"==typeof b.onUp?b.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof b.onAxis?b.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof b.onFloat?b.onFloat:this.onFloatCallback) },start:function(){if(!this._active){this._active=!0;var a=this;this._ongamepadconnected=function(b){var c=b.gamepad;a._rawPads.push(c),a._gamepads[c.index].connect(c)},window.addEventListener("gamepadconnected",this._ongamepadconnected,!1),this._ongamepaddisconnected=function(b){var c=b.gamepad;for(var d in a._rawPads)a._rawPads[d].index===c.index&&a._rawPads.splice(d,1);a._gamepads[c.index].disconnect()},window.addEventListener("gamepaddisconnected",this._ongamepaddisconnected,!1)}},update:function(){this._pollGamepads();for(var a=0;a<this._gamepads.length;a++)this._gamepads[a]._connected&&this._gamepads[a].pollStatus()},_pollGamepads:function(){var a=navigator.getGamepads||navigator.webkitGetGamepads&&navigator.webkitGetGamepads()||navigator.webkitGamepads;if(a){this._rawPads=[];for(var b=!1,c=0;c<a.length&&(typeof a[c]!==this._prevRawGamepadTypes[c]&&(b=!0,this._prevRawGamepadTypes[c]=typeof a[c]),a[c]&&this._rawPads.push(a[c]),3!==c);c++);if(b){for(var d,e={rawIndices:{},padIndices:{}},f=0;f<this._gamepads.length;f++)if(d=this._gamepads[f],d.connected)for(var g=0;g<this._rawPads.length;g++)this._rawPads[g].index===d.index&&(e.rawIndices[d.index]=!0,e.padIndices[f]=!0);for(var h=0;h<this._gamepads.length;h++)if(d=this._gamepads[h],!e.padIndices[h]){this._rawPads.length<1&&d.disconnect();for(var i=0;i<this._rawPads.length&&!e.padIndices[h];i++){var j=this._rawPads[i];if(j){if(e.rawIndices[j.index]){d.disconnect();continue}d.connect(j),e.rawIndices[j.index]=!0,e.padIndices[h]=!0}else d.disconnect()}}}}},setDeadZones:function(a){for(var b=0;b<this._gamepads.length;b++)this._gamepads[b].deadZone=a},stop:function(){this._active=!1,window.removeEventListener("gamepadconnected",this._ongamepadconnected),window.removeEventListener("gamepaddisconnected",this._ongamepaddisconnected)},reset:function(){this.update();for(var a=0;a<this._gamepads.length;a++)this._gamepads[a].reset()},justPressed:function(a,b){for(var c=0;c<this._gamepads.length;c++)if(this._gamepads[c].justPressed(a,b)===!0)return!0;return!1},justReleased:function(a,b){for(var c=0;c<this._gamepads.length;c++)if(this._gamepads[c].justReleased(a,b)===!0)return!0;return!1},isDown:function(a){for(var b=0;b<this._gamepads.length;b++)if(this._gamepads[b].isDown(a)===!0)return!0;return!1}},b.Gamepad.prototype.constructor=b.Gamepad,Object.defineProperty(b.Gamepad.prototype,"active",{get:function(){return this._active}}),Object.defineProperty(b.Gamepad.prototype,"supported",{get:function(){return this._gamepadSupportAvailable}}),Object.defineProperty(b.Gamepad.prototype,"padsConnected",{get:function(){return this._rawPads.length}}),Object.defineProperty(b.Gamepad.prototype,"pad1",{get:function(){return this._gamepads[0]}}),Object.defineProperty(b.Gamepad.prototype,"pad2",{get:function(){return this._gamepads[1]}}),Object.defineProperty(b.Gamepad.prototype,"pad3",{get:function(){return this._gamepads[2]}}),Object.defineProperty(b.Gamepad.prototype,"pad4",{get:function(){return this._gamepads[3]}}),b.Gamepad.BUTTON_0=0,b.Gamepad.BUTTON_1=1,b.Gamepad.BUTTON_2=2,b.Gamepad.BUTTON_3=3,b.Gamepad.BUTTON_4=4,b.Gamepad.BUTTON_5=5,b.Gamepad.BUTTON_6=6,b.Gamepad.BUTTON_7=7,b.Gamepad.BUTTON_8=8,b.Gamepad.BUTTON_9=9,b.Gamepad.BUTTON_10=10,b.Gamepad.BUTTON_11=11,b.Gamepad.BUTTON_12=12,b.Gamepad.BUTTON_13=13,b.Gamepad.BUTTON_14=14,b.Gamepad.BUTTON_15=15,b.Gamepad.AXIS_0=0,b.Gamepad.AXIS_1=1,b.Gamepad.AXIS_2=2,b.Gamepad.AXIS_3=3,b.Gamepad.AXIS_4=4,b.Gamepad.AXIS_5=5,b.Gamepad.AXIS_6=6,b.Gamepad.AXIS_7=7,b.Gamepad.AXIS_8=8,b.Gamepad.AXIS_9=9,b.Gamepad.XBOX360_A=0,b.Gamepad.XBOX360_B=1,b.Gamepad.XBOX360_X=2,b.Gamepad.XBOX360_Y=3,b.Gamepad.XBOX360_LEFT_BUMPER=4,b.Gamepad.XBOX360_RIGHT_BUMPER=5,b.Gamepad.XBOX360_LEFT_TRIGGER=6,b.Gamepad.XBOX360_RIGHT_TRIGGER=7,b.Gamepad.XBOX360_BACK=8,b.Gamepad.XBOX360_START=9,b.Gamepad.XBOX360_STICK_LEFT_BUTTON=10,b.Gamepad.XBOX360_STICK_RIGHT_BUTTON=11,b.Gamepad.XBOX360_DPAD_LEFT=14,b.Gamepad.XBOX360_DPAD_RIGHT=15,b.Gamepad.XBOX360_DPAD_UP=12,b.Gamepad.XBOX360_DPAD_DOWN=13,b.Gamepad.XBOX360_STICK_LEFT_X=0,b.Gamepad.XBOX360_STICK_LEFT_Y=1,b.Gamepad.XBOX360_STICK_RIGHT_X=2,b.Gamepad.XBOX360_STICK_RIGHT_Y=3,b.SinglePad=function(a,b){this.game=a,this._padParent=b,this._index=null,this._rawPad=null,this._connected=!1,this._prevTimestamp=null,this._rawButtons=[],this._buttons=[],this._axes=[],this._hotkeys=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this.deadZone=.26},b.SinglePad.prototype={addCallbacks:function(a,b){"undefined"!=typeof b&&(this.onConnectCallback="function"==typeof b.onConnect?b.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof b.onDisconnect?b.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof b.onDown?b.onDown:this.onDownCallback,this.onUpCallback="function"==typeof b.onUp?b.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof b.onAxis?b.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof b.onFloat?b.onFloat:this.onFloatCallback)},addButton:function(a){return this._hotkeys[a]=new b.GamepadButton(this.game,a),this._hotkeys[a]},pollStatus:function(){if(!this._rawPad.timestamp||this._rawPad.timestamp!=this._prevTimestamp){for(var a=0;a<this._rawPad.buttons.length;a+=1){var b=this._rawPad.buttons[a];this._rawButtons[a]!==b&&(1===b?this.processButtonDown(a,b):0===b?this.processButtonUp(a,b):this.processButtonFloat(a,b),this._rawButtons[a]=b)}for(var c=this._rawPad.axes,d=0;d<c.length;d+=1){var e=c[d];this.processAxisChange(e>0&&e>this.deadZone||0>e&&e<-this.deadZone?{axis:d,value:e}:{axis:d,value:0})}this._prevTimestamp=this._rawPad.timestamp}},connect:function(a){var b=!this._connected;this._index=a.index,this._connected=!0,this._rawPad=a,this._rawButtons=a.buttons,this._axes=a.axes,b&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this._index),b&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var a=this._connected;this._connected=!1,this._rawPad=void 0,this._rawButtons=[],this._buttons=[];var b=this._index;this._index=null,a&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,b),a&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},processAxisChange:function(a){this.game.input.disabled||this.game.input.gamepad.disabled||this._axes[a.axis]!==a.value&&(this._axes[a.axis]=a.value,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,a,this._index),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,a))},processButtonDown:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,a,b,this._index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,a,b),this._buttons[a]&&this._buttons[a].isDown?this._buttons[a].duration=this.game.time.now-this._buttons[a].timeDown:this._buttons[a]?(this._buttons[a].isDown=!0,this._buttons[a].timeDown=this.game.time.now,this._buttons[a].duration=0,this._buttons[a].value=b):this._buttons[a]={isDown:!0,timeDown:this.game.time.now,timeUp:0,duration:0,value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonDown(b))},processButtonUp:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,a,b,this._index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,a,b),this._hotkeys[a]&&this._hotkeys[a].processButtonUp(b),this._buttons[a]?(this._buttons[a].isDown=!1,this._buttons[a].timeUp=this.game.time.now,this._buttons[a].value=b):this._buttons[a]={isDown:!1,timeDown:this.game.time.now,timeUp:this.game.time.now,duration:0,value:b})},processButtonFloat:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,a,b,this._index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,a,b),this._buttons[a]?this._buttons[a].value=b:this._buttons[a]={value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonFloat(b))},axis:function(a){return this._axes[a]?this._axes[a]:!1},isDown:function(a){return this._buttons[a]?this._buttons[a].isDown:!1},justReleased:function(a,b){return"undefined"==typeof b&&(b=250),this._buttons[a]&&this._buttons[a].isDown===!1&&this.game.time.now-this._buttons[a].timeUp<b},justPressed:function(a,b){return"undefined"==typeof b&&(b=250),this._buttons[a]&&this._buttons[a].isDown&&this._buttons[a].duration<b},buttonValue:function(a){return this._buttons[a]?this._buttons[a].value:!1},reset:function(){for(var a=0;a<this._buttons.length;a++)this._buttons[a]=0;for(var b=0;b<this._axes.length;b++)this._axes[b]=0}},b.SinglePad.prototype.constructor=b.SinglePad,Object.defineProperty(b.SinglePad.prototype,"connected",{get:function(){return this._connected}}),Object.defineProperty(b.SinglePad.prototype,"index",{get:function(){return this._index}}),b.GamepadButton=function(a,c){this.game=a,this.isDown=!1,this.isUp=!0,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this.value=0,this.buttonCode=c,this.onDown=new b.Signal,this.onUp=new b.Signal,this.onFloat=new b.Signal},b.GamepadButton.prototype={processButtonDown:function(a){this.isDown?(this.duration=this.game.time.now-this.timeDown,this.repeats++):(this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.value=a,this.onDown.dispatch(this,a))},processButtonUp:function(a){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.value=a,this.onUp.dispatch(this,a)},processButtonFloat:function(a){this.value=a,this.onFloat.dispatch(this,a)},justPressed:function(a){return"undefined"==typeof a&&(a=250),this.isDown&&this.duration<a},justReleased:function(a){return"undefined"==typeof a&&(a=250),this.isDown===!1&&this.game.time.now-this.timeUp<a}},b.GamepadButton.prototype.constructor=b.GamepadButton,b.InputHandler=function(a){this.sprite=a,this.game=a.game,this.enabled=!1,this.priorityID=0,this.useHandCursor=!1,this._setHandCursor=!1,this.isDragged=!1,this.allowHorizontalDrag=!0,this.allowVerticalDrag=!0,this.bringToTop=!1,this.snapOffset=null,this.snapOnDrag=!1,this.snapOnRelease=!1,this.snapX=0,this.snapY=0,this.snapOffsetX=0,this.snapOffsetY=0,this.pixelPerfectOver=!1,this.pixelPerfectClick=!1,this.pixelPerfectAlpha=255,this.draggable=!1,this.boundsRect=null,this.boundsSprite=null,this.consumePointerEvent=!1,this._tempPoint=new b.Point,this._pointerData=[],this._pointerData.push({id:0,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1})},b.InputHandler.prototype={start:function(a,c){if(a=a||0,"undefined"==typeof c&&(c=!1),this.enabled===!1){this.game.input.interactiveItems.add(this),this.useHandCursor=c,this.priorityID=a;for(var d=0;10>d;d++)this._pointerData[d]={id:d,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new b.Point,this.enabled=!0,this.sprite.events&&null===this.sprite.events.onInputOver&&(this.sprite.events.onInputOver=new b.Signal,this.sprite.events.onInputOut=new b.Signal,this.sprite.events.onInputDown=new b.Signal,this.sprite.events.onInputUp=new b.Signal,this.sprite.events.onDragStart=new b.Signal,this.sprite.events.onDragStop=new b.Signal)}return this.sprite},reset:function(){this.enabled=!1;for(var a=0;10>a;a++)this._pointerData[a]={id:a,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){this.enabled!==!1&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.enabled&&(this._setHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(a,b){return 0===this.sprite.scale.x||0===this.sprite.scale.y?!1:this.pixelPerfectClick||this.pixelPerfectOver?!0:this.priorityID>a||this.priorityID===a&&this.sprite._cache[3]<b?!0:!1},pointerX:function(a){return a=a||0,this._pointerData[a].x},pointerY:function(a){return a=a||0,this._pointerData[a].y},pointerDown:function(a){return a=a||0,this._pointerData[a].isDown},pointerUp:function(a){return a=a||0,this._pointerData[a].isUp},pointerTimeDown:function(a){return a=a||0,this._pointerData[a].timeDown},pointerTimeUp:function(a){return a=a||0,this._pointerData[a].timeUp},pointerOver:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOver;for(var b=0;10>b;b++)if(this._pointerData[b].isOver)return!0}return!1},pointerOut:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOut;for(var b=0;10>b;b++)if(this._pointerData[b].isOut)return!0}return!1},pointerTimeOver:function(a){return a=a||0,this._pointerData[a].timeOver},pointerTimeOut:function(a){return a=a||0,this._pointerData[a].timeOut},pointerDragged:function(a){return a=a||0,this._pointerData[a].isDragged},checkPointerDown:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectClick?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPointerOver:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectOver?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPixel:function(a,b,c){if(this.sprite.texture.baseTexture.source){if(this.game.input.hitContext.clearRect(0,0,1,1),null===a&&null===b){this.game.input.getLocalPosition(this.sprite,c,this._tempPoint);var a=this._tempPoint.x,b=this._tempPoint.y}0!==this.sprite.anchor.x&&(a-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(b-=-this.sprite.texture.frame.height*this.sprite.anchor.y),a+=this.sprite.texture.frame.x,b+=this.sprite.texture.frame.y,this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,a,b,1,1,0,0,1,1);var d=this.game.input.hitContext.getImageData(0,0,1,1);if(d.data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(a){return null!==this.sprite?this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this.draggable&&this._draggedPointerID==a.id?this.updateDrag(a):this._pointerData[a.id].isOver===!0?this.checkPointerOver(a)?(this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,!0):(this._pointerOutHandler(a),!1):void 0:(this._pointerOutHandler(a),!1):void 0},_pointerOverHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isOver===!1&&(this._pointerData[a.id].isOver=!0,this._pointerData[a.id].isOut=!1,this._pointerData[a.id].timeOver=this.game.time.now,this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!1),this.sprite.events.onInputOver.dispatch(this.sprite,a))},_pointerOutHandler:function(a){null!==this.sprite&&(this._pointerData[a.id].isOver=!1,this._pointerData[a.id].isOut=!0,this._pointerData[a.id].timeOut=this.game.time.now,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.sprite&&this.sprite.events&&this.sprite.events.onInputOut.dispatch(this.sprite,a))},_touchedHandler:function(a){if(null!==this.sprite){if(this._pointerData[a.id].isDown===!1&&this._pointerData[a.id].isOver===!0){if(this.pixelPerfectClick&&!this.checkPixel(null,null,a))return;this._pointerData[a.id].isDown=!0,this._pointerData[a.id].isUp=!1,this._pointerData[a.id].timeDown=this.game.time.now,this.sprite.events.onInputDown.dispatch(this.sprite,a),this.draggable&&this.isDragged===!1&&this.startDrag(a),this.bringToTop&&this.sprite.bringToTop()}return this.consumePointerEvent}},_releasedHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isDown&&a.isUp&&(this._pointerData[a.id].isDown=!1,this._pointerData[a.id].isUp=!0,this._pointerData[a.id].timeUp=this.game.time.now,this._pointerData[a.id].downDuration=this._pointerData[a.id].timeUp-this._pointerData[a.id].timeDown,this.checkPointerOver(a)?this.sprite.events.onInputUp.dispatch(this.sprite,a,!0):(this.sprite.events.onInputUp.dispatch(this.sprite,a,!1),this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1)),this.draggable&&this.isDragged&&this._draggedPointerID==a.id&&this.stopDrag(a))},updateDrag:function(a){return a.isUp?(this.stopDrag(a),!1):(this.sprite.fixedToCamera?(this.allowHorizontalDrag&&(this.sprite.cameraOffset.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.cameraOffset.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)):(this.allowHorizontalDrag&&(this.sprite.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),!0)},justOver:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isOver&&this.overDuration(a)<b},justOut:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isOut&&this.game.time.now-this._pointerData[a].timeOut<b},justPressed:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isDown&&this.downDuration(a)<b},justReleased:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isUp&&this.game.time.now-this._pointerData[a].timeUp<b},overDuration:function(a){return a=a||0,this._pointerData[a].isOver?this.game.time.now-this._pointerData[a].timeOver:-1},downDuration:function(a){return a=a||0,this._pointerData[a].isDown?this.game.time.now-this._pointerData[a].timeDown:-1},enableDrag:function(a,c,d,e,f,g){"undefined"==typeof a&&(a=!1),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=255),"undefined"==typeof f&&(f=null),"undefined"==typeof g&&(g=null),this._dragPoint=new b.Point,this.draggable=!0,this.bringToTop=c,this.dragOffset=new b.Point,this.dragFromCenter=a,this.pixelPerfect=d,this.pixelPerfectAlpha=e,f&&(this.boundsRect=f),g&&(this.boundsSprite=g)},disableDrag:function(){if(this._pointerData)for(var a=0;10>a;a++)this._pointerData[a].isDragged=!1;this.draggable=!1,this.isDragged=!1,this._draggedPointerID=-1},startDrag:function(a){if(this.isDragged=!0,this._draggedPointerID=a.id,this._pointerData[a.id].isDragged=!0,this.sprite.fixedToCamera)this.dragFromCenter?(this.sprite.centerOn(a.x,a.y),this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y)):this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y);else if(this.dragFromCenter){var b=this.sprite.getBounds();this.sprite.x=a.x+(this.sprite.x-b.centerX),this.sprite.y=a.y+(this.sprite.y-b.centerY),this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y)}else this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y);this.updateDrag(a),this.bringToTop&&this.sprite.bringToTop(),this.sprite.events.onDragStart.dispatch(this.sprite,a)},stopDrag:function(a){this.isDragged=!1,this._draggedPointerID=-1,this._pointerData[a.id].isDragged=!1,this.snapOnRelease&&(this.sprite.fixedToCamera?(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY):(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),this.sprite.events.onDragStop.dispatch(this.sprite,a),this.checkPointerOver(a)===!1&&this._pointerOutHandler(a)},setDragLock:function(a,b){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!0),this.allowHorizontalDrag=a,this.allowVerticalDrag=b},enableSnap:function(a,b,c,d,e,f){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.snapX=a,this.snapY=b,this.snapOffsetX=e,this.snapOffsetY=f,this.snapOnDrag=c,this.snapOnRelease=d},disableSnap:function(){this.snapOnDrag=!1,this.snapOnRelease=!1},checkBoundsRect:function(){this.sprite.fixedToCamera?(this.sprite.cameraOffset.x<this.boundsRect.left?this.sprite.cameraOffset.x=this.boundsRect.cameraOffset.x:this.sprite.cameraOffset.x+this.sprite.width>this.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.y<this.boundsRect.top?this.sprite.cameraOffset.y=this.boundsRect.top:this.sprite.cameraOffset.y+this.sprite.height>this.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.x<this.boundsRect.left?this.sprite.x=this.boundsRect.x:this.sprite.x+this.sprite.width>this.boundsRect.right&&(this.sprite.x=this.boundsRect.right-this.sprite.width),this.sprite.y<this.boundsRect.top?this.sprite.y=this.boundsRect.top:this.sprite.y+this.sprite.height>this.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-this.sprite.height))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.x<this.boundsSprite.camerOffset.x?this.sprite.cameraOffset.x=this.boundsSprite.camerOffset.x:this.sprite.cameraOffset.x+this.sprite.width>this.boundsSprite.camerOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.camerOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.y<this.boundsSprite.camerOffset.y?this.sprite.cameraOffset.y=this.boundsSprite.camerOffset.y:this.sprite.cameraOffset.y+this.sprite.height>this.boundsSprite.camerOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.camerOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.x<this.boundsSprite.x?this.sprite.x=this.boundsSprite.x:this.sprite.x+this.sprite.width>this.boundsSprite.x+this.boundsSprite.width&&(this.sprite.x=this.boundsSprite.x+this.boundsSprite.width-this.sprite.width),this.sprite.y<this.boundsSprite.y?this.sprite.y=this.boundsSprite.y:this.sprite.y+this.sprite.height>this.boundsSprite.y+this.boundsSprite.height&&(this.sprite.y=this.boundsSprite.y+this.boundsSprite.height-this.sprite.height))}},b.InputHandler.prototype.constructor=b.InputHandler,b.Events=function(a){this.parent=a,this.onAddedToGroup=new b.Signal,this.onRemovedFromGroup=new b.Signal,this.onKilled=new b.Signal,this.onRevived=new b.Signal,this.onOutOfBounds=new b.Signal,this.onEnterBounds=new b.Signal,this.onInputOver=null,this.onInputOut=null,this.onInputDown=null,this.onInputUp=null,this.onDragStart=null,this.onDragStop=null,this.onAnimationStart=null,this.onAnimationComplete=null,this.onAnimationLoop=null},b.Events.prototype={destroy:function(){this.parent=null,this.onAddedToGroup.dispose(),this.onRemovedFromGroup.dispose(),this.onKilled.dispose(),this.onRevived.dispose(),this.onOutOfBounds.dispose(),this.onInputOver&&(this.onInputOver.dispose(),this.onInputOut.dispose(),this.onInputDown.dispose(),this.onInputUp.dispose(),this.onDragStart.dispose(),this.onDragStop.dispose()),this.onAnimationStart&&(this.onAnimationStart.dispose(),this.onAnimationComplete.dispose(),this.onAnimationLoop.dispose())}},b.Events.prototype.constructor=b.Events,b.GameObjectFactory=function(a){this.game=a,this.world=this.game.world},b.GameObjectFactory.prototype={existing:function(a){return this.world.add(a)},image:function(a,c,d,e,f){return"undefined"==typeof f&&(f=this.world),f.add(new b.Image(this.game,a,c,d,e))},sprite:function(a,b,c,d,e){return"undefined"==typeof e&&(e=this.world),e.create(a,b,c,d)},tween:function(a){return this.game.tweens.create(a)},group:function(a,c,d,e,f){return new b.Group(this.game,a,c,d,e,f)},physicsGroup:function(a,c,d,e){return new b.Group(this.game,c,d,e,!0,a)},spriteBatch:function(a,c,d){return"undefined"==typeof c&&(c="group"),"undefined"==typeof d&&(d=!1),new b.SpriteBatch(this.game,a,c,d)},audio:function(a,b,c,d){return this.game.sound.add(a,b,c,d)},sound:function(a,b,c,d){return this.game.sound.add(a,b,c,d)},tileSprite:function(a,c,d,e,f,g,h){return"undefined"==typeof h&&(h=this.world),h.add(new b.TileSprite(this.game,a,c,d,e,f,g))},text:function(a,c,d,e,f){return"undefined"==typeof f&&(f=this.world),f.add(new b.Text(this.game,a,c,d,e))},button:function(a,c,d,e,f,g,h,i,j,k){return"undefined"==typeof k&&(k=this.world),k.add(new b.Button(this.game,a,c,d,e,f,g,h,i,j))},graphics:function(a,c,d){return"undefined"==typeof d&&(d=this.world),d.add(new b.Graphics(this.game,a,c))},emitter:function(a,c,d){return this.game.particles.add(new b.Particles.Arcade.Emitter(this.game,a,c,d))},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(this.game,a,c,d,e,f,g,h,i,j)},bitmapText:function(a,c,d,e,f,g){return"undefined"==typeof g&&(g=this.world),g.add(new b.BitmapText(this.game,a,c,d,e,f))},tilemap:function(a,c,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},renderTexture:function(a,c,d,e){("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid()),"undefined"==typeof e&&(e=!1);var f=new b.RenderTexture(this.game,a,c,d);return e&&this.game.cache.addRenderTexture(d,f),f},bitmapData:function(a,c,d,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},filter:function(a){var c=Array.prototype.splice.call(arguments,1),a=new b.Filter[a](this.game);return a.init.apply(a,c),a}},b.GameObjectFactory.prototype.constructor=b.GameObjectFactory,b.GameObjectCreator=function(a){this.game=a,this.world=this.game.world},b.GameObjectCreator.prototype={image:function(a,c,d,e){return new b.Image(this.game,a,c,d,e)},sprite:function(a,c,d,e){return new b.Sprite(this.game,a,c,d,e)},tween:function(a){return new b.Tween(a,this.game)},group:function(a,c,d,e,f){return new b.Group(this.game,null,c,d,e,f)},spriteBatch:function(a,c,d){return"undefined"==typeof c&&(c="group"),"undefined"==typeof d&&(d=!1),new b.SpriteBatch(this.game,a,c,d)},audio:function(a,b,c,d){return this.game.sound.add(a,b,c,d)},sound:function(a,b,c,d){return this.game.sound.add(a,b,c,d)},tileSprite:function(a,c,d,e,f,g){return new b.TileSprite(this.game,a,c,d,e,f,g)},text:function(a,c,d,e){return new b.Text(this.game,a,c,d,e)},button:function(a,c,d,e,f,g,h,i,j){return new b.Button(this.game,a,c,d,e,f,g,h,i,j)},graphics:function(a,c){return new b.Graphics(this.game,a,c)},emitter:function(a,c,d){return new b.Particles.Arcade.Emitter(this.game,a,c,d)},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(this.game,a,c,d,e,f,g,h,i,j)},bitmapText:function(a,c,d,e,f){return new b.BitmapText(this.game,a,c,d,e,f)},tilemap:function(a,c,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},renderTexture:function(a,c,d,e){("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid()),"undefined"==typeof e&&(e=!1);var f=new b.RenderTexture(this.game,a,c,d);return e&&this.game.cache.addRenderTexture(d,f),f},bitmapData:function(a,c,d,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},filter:function(a){var c=Array.prototype.splice.call(arguments,1),a=new b.Filter[a](this.game);return a.init.apply(a,c),a}},b.GameObjectCreator.prototype.constructor=b.GameObjectCreator,b.BitmapData=function(a,c,d,e){"undefined"==typeof d&&(d=100),"undefined"==typeof e&&(e=100),this.game=a,this.key=c,this.width=d,this.height=e,this.canvas=b.Canvas.create(d,e,"",!0),this.context=this.canvas.getContext("2d"),this.ctx=this.context,this.imageData=this.context.getImageData(0,0,d,e),this.pixels=this.imageData.data.buffer?this.imageData.data.buffer:this.imageData.data,this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,d,e,"bitmapData",a.rnd.uuid()),this.type=b.BITMAPDATA,this.dirty=!1},b.BitmapData.prototype={add:function(a){if(Array.isArray(a))for(var b=0;b<a.length;b++)a[b].loadTexture&&a[b].loadTexture(this);else a.loadTexture(this)},clear:function(){this.context.clearRect(0,0,this.width,this.height),this.dirty=!0},resize:function(a,b){(a!==this.width||b!==this.height)&&(this.width=a,this.height=b,this.canvas.width=a,this.canvas.height=b,this.textureFrame.width=a,this.textureFrame.height=b,this.imageData=this.context.getImageData(0,0,a,b)),this.dirty=!0},refreshBuffer:function(){this.imageData=this.context.getImageData(0,0,this.width,this.height),this.pixels=new Int32Array(this.imageData.data.buffer)},setPixel32:function(a,b,c,d,e,f){a>=0&&a<=this.width&&b>=0&&b<=this.height&&(this.pixels[b*this.width+a]=f<<24|e<<16|d<<8|c,this.context.putImageData(this.imageData,0,0),this.dirty=!0)},setPixel:function(a,b,c,d,e){this.setPixel32(a,b,c,d,e,255)},getPixel:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixel32:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixels:function(a){return this.context.getImageData(a.x,a.y,a.width,a.height)},copyPixels:function(a,b,c,d){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,b.x,b.y,b.width,b.height,c,d,b.width,b.height)},draw:function(a,b,c){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0,a.width,a.height,b,c,a.width,a.height)},alphaMask:function(a,b){var c=this.context.globalCompositeOperation;"string"==typeof b&&(b=this.game.cache.getImage(b)),b&&this.context.drawImage(b,0,0),this.context.globalCompositeOperation="source-atop","string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0),this.context.globalCompositeOperation=c},render:function(){this.game.renderType===b.WEBGL&&this.dirty&&(PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1)}},b.BitmapData.prototype.constructor=b.BitmapData,b.Sprite=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.name="",this.type=b.SPRITE,this.z=0,this.events=new b.Events(this),this.animations=new b.AnimationManager(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.body=null,this.health=1,this.lifespan=0,this.checkWorldBounds=!1,this.outOfBoundsKill=!1,this.debug=!1,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0],this._bounds=new b.Rectangle},b.Sprite.prototype=Object.create(PIXI.Sprite.prototype),b.Sprite.prototype.constructor=b.Sprite,b.Sprite.prototype.preUpdate=function(){if(1===this._cache[4]&&this.exists)return this.world.setTo(this.parent.position.x+this.position.x,this.parent.position.y+this.position.y),this.worldTransform.tx=this.world.x,this.worldTransform.ty=this.world.y,this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,this.body&&this.body.preUpdate(),this._cache[4]=0,!1; if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},b.Sprite.prototype.overlap=function(a){return b.Rectangle.intersects(this.getBounds(),a.getBounds())},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),Object.defineProperty(b.Sprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&a<b.total&&b.getFrame(a)&&(this.setTexture(PIXI.TextureCache[b.getFrame(a).uuid]),this._frame=a)}}}),Object.defineProperty(b.Image.prototype,"frameName",{get:function(){return this._frameName},set:function(a){if(a!==this.frameName&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&b.getFrameByName(a)&&(this.setTexture(PIXI.TextureCache[b.getFrameByName(a).uuid]),this._frameName=a)}}}),Object.defineProperty(b.Image.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Image.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Image.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Image.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),b.TileSprite=function(a,c,d,e,f,g,h){c=c||0,d=d||0,e=e||256,f=f||256,g=g||null,h=h||null,this.game=a,this.name="",this.type=b.TILESPRITE,this.z=0,this.events=new b.Events(this),this.animations=new b.AnimationManager(this),this.key=g,this._frame=0,this._frameName="",this._scroll=new b.Point,PIXI.TilingSprite.call(this,PIXI.TextureCache.__default,e,f),this.loadTexture(g,h),this.position.set(c,d),this.input=null,this.world=new b.Point(c,d),this.autoCull=!1,this.checkWorldBounds=!1,this.cameraOffset=new b.Point,this.body=null,this._cache=[0,0,0,0,1,0,1,0]},b.TileSprite.prototype=Object.create(PIXI.TilingSprite.prototype),b.TileSprite.prototype.constructor=b.TileSprite,b.TileSprite.prototype.preUpdate=function(){if(1===this._cache[4]&&this.exists)return this.world.setTo(this.parent.position.x+this.position.x,this.parent.position.y+this.position.y),this.worldTransform.tx=this.world.x,this.worldTransform.ty=this.world.y,this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,this.body&&this.body.preUpdate(),this._cache[4]=0,!1;if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;(this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds&&(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds)?(this._cache[5]=0,this.events.onEnterBounds.dispatch(this)):0!==this._cache[5]||this.game.world.bounds.intersects(this._bounds)||(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this))),this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),0!==this._scroll.x&&(this.tilePosition.x+=this._scroll.x*this.game.time.physicsElapsed),0!==this._scroll.y&&(this.tilePosition.y+=this._scroll.y*this.game.time.physicsElapsed),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.TileSprite.prototype.update=function(){},b.TileSprite.prototype.postUpdate=function(){this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=this.game.camera.view.x+this.cameraOffset.x,this.position.y=this.game.camera.view.y+this.cameraOffset.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.TileSprite.prototype.autoScroll=function(a,b){this._scroll.set(a,b)},b.TileSprite.prototype.stopScroll=function(){this._scroll.set(0,0)},b.TileSprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.filters&&(this.filters=null),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.animations.destroy(),this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.TileSprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.TileSprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;e<b.length;e++){var f=this.context.measureText(b[e]).width;c[e]=f,d=Math.max(d,f)}this.canvas.width=d+this.style.strokeThickness;var g=this.determineFontHeight("font: "+this.style.font+";")+this.style.strokeThickness+this._lineSpacing+this.style.shadowOffsetY;for(this.canvas.height=g*b.length,navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.style.fill,this.context.font=this.style.font,this.context.strokeStyle=this.style.stroke,this.context.lineWidth=this.style.strokeThickness,this.context.shadowOffsetX=this.style.shadowOffsetX,this.context.shadowOffsetY=this.style.shadowOffsetY,this.context.shadowColor=this.style.shadowColor,this.context.shadowBlur=this.style.shadowBlur,this.context.textBaseline="top",e=0;e<b.length;e++){var h=new PIXI.Point(this.style.strokeThickness/2,this.style.strokeThickness/2+e*g);"right"===this.style.align?h.x+=d-c[e]:"center"===this.style.align&&(h.x+=(d-c[e])/2),h.y+=this._lineSpacing,this.style.stroke&&this.style.strokeThickness&&this.context.strokeText(b[e],h.x,h.y),this.style.fill&&this.context.fillText(b[e],h.x,h.y)}this.updateTexture()},b.Text.prototype.runWordWrap=function(a){for(var b="",c=a.split("\n"),d=0;d<c.length;d++){for(var e=this.style.wordWrapWidth,f=c[d].split(" "),g=0;g<f.length;g++){var h=this.context.measureText(f[g]).width,i=h+this.context.measureText(" ").width;i>e?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d<c.length-1&&(b+="\n")}return b},Object.defineProperty(b.Text.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Text.prototype,"text",{get:function(){return this._text},set:function(a){a!==this._text&&(this._text=a.toString()||" ",this.dirty=!0,this.updateTransform())}}),Object.defineProperty(b.Text.prototype,"font",{get:function(){return this._font},set:function(a){a!==this._font&&(this._font=a.trim(),this.style.font=this._fontWeight+" "+this._fontSize+"px '"+this._font+"'",this.dirty=!0,this.updateTransform())}}),Object.defineProperty(b.Text.prototype,"fontSize",{get:function(){return this._fontSize},set:function(a){a=parseInt(a,10),a!==this._fontSize&&(this._fontSize=a,this.style.font=this._fontWeight+" "+this._fontSize+"px '"+this._font+"'",this.dirty=!0,this.updateTransform())}}),Object.defineProperty(b.Text.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(a){a!==this._fontWeight&&(this._fontWeight=a,this.style.font=this._fontWeight+" "+this._fontSize+"px '"+this._font+"'",this.dirty=!0,this.updateTransform())}}),Object.defineProperty(b.Text.prototype,"fill",{get:function(){return this.style.fill},set:function(a){a!==this.style.fill&&(this.style.fill=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"align",{get:function(){return this.style.align},set:function(a){a!==this.style.align&&(this.style.align=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"stroke",{get:function(){return this.style.stroke},set:function(a){a!==this.style.stroke&&(this.style.stroke=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"strokeThickness",{get:function(){return this.style.strokeThickness},set:function(a){a!==this.style.strokeThickness&&(this.style.strokeThickness=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"wordWrap",{get:function(){return this.style.wordWrap},set:function(a){a!==this.style.wordWrap&&(this.style.wordWrap=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"wordWrapWidth",{get:function(){return this.style.wordWrapWidth},set:function(a){a!==this.style.wordWrapWidth&&(this.style.wordWrapWidth=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(a){a!==this._lineSpacing&&(this._lineSpacing=parseFloat(a),this.dirty=!0,this.updateTransform())}}),Object.defineProperty(b.Text.prototype,"shadowOffsetX",{get:function(){return this.style.shadowOffsetX},set:function(a){a!==this.style.shadowOffsetX&&(this.style.shadowOffsetX=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"shadowOffsetY",{get:function(){return this.style.shadowOffsetY},set:function(a){a!==this.style.shadowOffsetY&&(this.style.shadowOffsetY=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"shadowColor",{get:function(){return this.style.shadowColor},set:function(a){a!==this.style.shadowColor&&(this.style.shadowColor=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"shadowBlur",{get:function(){return this.style.shadowBlur},set:function(a){a!==this.style.shadowBlur&&(this.style.shadowBlur=a,this.dirty=!0)}}),Object.defineProperty(b.Text.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Text.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.BitmapText=function(a,c,d,e,f,g){c=c||0,d=d||0,e=e||"",f=f||"",g=g||32,this.game=a,this.exists=!0,this.name="",this.type=b.BITMAPTEXT,this.z=0,this.world=new b.Point(c,d),this._text=f,this._font=e,this._fontSize=g,this._align="left",this._tint=16777215,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,PIXI.BitmapText.call(this,f),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.BitmapText.prototype=Object.create(PIXI.BitmapText.prototype),b.BitmapText.prototype.constructor=b.BitmapText,b.BitmapText.prototype.setStyle=function(){this.style={align:this._align},this.fontName=this._font,this.fontSize=this._fontSize,this.dirty=!0},b.BitmapText.prototype.preUpdate=function(){return this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,this.exists&&this.parent.exists?(this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),!0):(this.renderOrderID=-1,!1)},b.BitmapText.prototype.update=function(){},b.BitmapText.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.BitmapText.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this));var c=this.children.length;if(a)for(;c--;)this.children[c].destroy?this.children[c].destroy(a):this.removeChild(this.children[c]);else for(;c--;)this.removeChild(this.children[c]);this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},Object.defineProperty(b.BitmapText.prototype,"align",{get:function(){return this._align},set:function(a){a!==this._align&&(this._align=a,this.setStyle())}}),Object.defineProperty(b.BitmapText.prototype,"tint",{get:function(){return this._tint},set:function(a){a!==this._tint&&(this._tint=a,this.dirty=!0)}}),Object.defineProperty(b.BitmapText.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.BitmapText.prototype,"font",{get:function(){return this._font},set:function(a){a!==this._font&&(this._font=a.trim(),this.style.font=this._fontSize+"px '"+this._font+"'",this.dirty=!0)}}),Object.defineProperty(b.BitmapText.prototype,"fontSize",{get:function(){return this._fontSize},set:function(a){a=parseInt(a,10),a!==this._fontSize&&(this._fontSize=a,this.style.font=this._fontSize+"px '"+this._font+"'",this.dirty=!0)}}),Object.defineProperty(b.BitmapText.prototype,"text",{get:function(){return this._text},set:function(a){a!==this._text&&(this._text=a.toString()||" ",this.dirty=!0)}}),Object.defineProperty(b.BitmapText.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.BitmapText.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.Button=function(a,c,d,e,f,g,h,i,j,k){c=c||0,d=d||0,e=e||null,f=f||null,g=g||this,b.Image.call(this,a,c,d,e,i),this.type=b.BUTTON,this._onOverFrameName=null,this._onOutFrameName=null,this._onDownFrameName=null,this._onUpFrameName=null,this._onOverFrameID=null,this._onOutFrameID=null,this._onDownFrameID=null,this._onUpFrameID=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new b.Signal,this.onInputOut=new b.Signal,this.onInputDown=new b.Signal,this.onInputUp=new b.Signal,this.freezeFrames=!1,this.forceOut=!1,this.inputEnabled=!0,this.input.start(0,!0),this.setFrames(h,i,j,k),null!==f&&this.onInputUp.add(f,g),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this)},b.Button.prototype=Object.create(b.Image.prototype),b.Button.prototype.constructor=b.Button,b.Button.prototype.clearFrames=function(){this._onOverFrameName=null,this._onOverFrameID=null,this._onOutFrameName=null,this._onOutFrameID=null,this._onDownFrameName=null,this._onDownFrameID=null,this._onUpFrameName=null,this._onUpFrameID=null},b.Button.prototype.setFrames=function(a,b,c,d){this.clearFrames(),null!==a&&("string"==typeof a?(this._onOverFrameName=a,this.input.pointerOver()&&(this.frameName=a)):(this._onOverFrameID=a,this.input.pointerOver()&&(this.frame=a))),null!==b&&("string"==typeof b?(this._onOutFrameName=b,this.input.pointerOver()===!1&&(this.frameName=b)):(this._onOutFrameID=b,this.input.pointerOver()===!1&&(this.frame=b))),null!==c&&("string"==typeof c?(this._onDownFrameName=c,this.input.pointerDown()&&(this.frameName=c)):(this._onDownFrameID=c,this.input.pointerDown()&&(this.frame=c))),null!==d&&("string"==typeof d?(this._onUpFrameName=d,this.input.pointerUp()&&(this.frameName=d)):(this._onUpFrameID=d,this.input.pointerUp()&&(this.frame=d))) },b.Button.prototype.setSounds=function(a,b,c,d,e,f,g,h){this.setOverSound(a,b),this.setOutSound(e,f),this.setDownSound(c,d),this.setUpSound(g,h)},b.Button.prototype.setOverSound=function(a,c){this.onOverSound=null,this.onOverSoundMarker="",a instanceof b.Sound&&(this.onOverSound=a),"string"==typeof c&&(this.onOverSoundMarker=c)},b.Button.prototype.setOutSound=function(a,c){this.onOutSound=null,this.onOutSoundMarker="",a instanceof b.Sound&&(this.onOutSound=a),"string"==typeof c&&(this.onOutSoundMarker=c)},b.Button.prototype.setDownSound=function(a,c){this.onDownSound=null,this.onDownSoundMarker="",a instanceof b.Sound&&(this.onDownSound=a),"string"==typeof c&&(this.onDownSoundMarker=c)},b.Button.prototype.setUpSound=function(a,c){this.onUpSound=null,this.onUpSoundMarker="",a instanceof b.Sound&&(this.onUpSound=a),"string"==typeof c&&(this.onUpSoundMarker=c)},b.Button.prototype.onInputOverHandler=function(a,b){this.freezeFrames===!1&&this.setState(1),this.onOverSound&&this.onOverSound.play(this.onOverSoundMarker),this.onInputOver&&this.onInputOver.dispatch(this,b)},b.Button.prototype.onInputOutHandler=function(a,b){this.freezeFrames===!1&&this.setState(2),this.onOutSound&&this.onOutSound.play(this.onOutSoundMarker),this.onInputOut&&this.onInputOut.dispatch(this,b)},b.Button.prototype.onInputDownHandler=function(a,b){this.freezeFrames===!1&&this.setState(3),this.onDownSound&&this.onDownSound.play(this.onDownSoundMarker),this.onInputDown&&this.onInputDown.dispatch(this,b)},b.Button.prototype.onInputUpHandler=function(a,b,c){this.onUpSound&&this.onUpSound.play(this.onUpSoundMarker),this.onInputUp&&this.onInputUp.dispatch(this,b,c),this.freezeFrames||this.setState(this.forceOut?2:null!==this._onUpFrameName||null!==this._onUpFrameID?4:c?1:2)},b.Button.prototype.setState=function(a){1===a?null!=this._onOverFrameName?this.frameName=this._onOverFrameName:null!=this._onOverFrameID&&(this.frame=this._onOverFrameID):2===a?null!=this._onOutFrameName?this.frameName=this._onOutFrameName:null!=this._onOutFrameID&&(this.frame=this._onOutFrameID):3===a?null!=this._onDownFrameName?this.frameName=this._onDownFrameName:null!=this._onDownFrameID&&(this.frame=this._onDownFrameID):4===a&&(null!=this._onUpFrameName?this.frameName=this._onUpFrameName:null!=this._onUpFrameID&&(this.frame=this._onUpFrameID))},b.Graphics=function(a,c,d){c=c||0,d=d||0,this.game=a,this.exists=!0,this.name="",this.type=b.GRAPHICS,this.z=0,this.world=new b.Point(c,d),this.cameraOffset=new b.Point,PIXI.Graphics.call(this),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Graphics.prototype=Object.create(PIXI.Graphics.prototype),b.Graphics.prototype.constructor=b.Graphics,b.Graphics.prototype.preUpdate=function(){return this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,this.exists&&this.parent.exists?(this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),!0):(this.renderOrderID=-1,!1)},b.Graphics.prototype.update=function(){},b.Graphics.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.Graphics.prototype.destroy=function(a){"undefined"==typeof a&&(a=!0),this.clear(),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this));var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.exists=!1,this.visible=!1,this.game=null},b.Graphics.prototype.drawPolygon=function(a){this.moveTo(a.points[0].x,a.points[0].y);for(var b=1;b<a.points.length;b+=1)this.lineTo(a.points[b].x,a.points[b].y);this.lineTo(a.points[0].x,a.points[0].y)},Object.defineProperty(b.Graphics.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Graphics.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.RenderTexture=function(a,c,d,e){this.game=a,this.key=e,this.type=b.RENDERTEXTURE,this._temp=new b.Point,PIXI.RenderTexture.call(this,c,d)},b.RenderTexture.prototype=Object.create(PIXI.RenderTexture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.renderXY=function(a,b,c,d){this._temp.set(b,c),this.render(a,this._temp,d)},b.SpriteBatch=function(a,c,d,e){PIXI.SpriteBatch.call(this),b.Group.call(this,a,c,d,e),this.type=b.SPRITEBATCH},b.SpriteBatch.prototype=b.Utils.extend(!0,b.SpriteBatch.prototype,b.Group.prototype,PIXI.SpriteBatch.prototype),b.SpriteBatch.prototype.constructor=b.SpriteBatch,b.RetroFont=function(a,c,d,e,f,g,h,i,j,k){this.characterWidth=d,this.characterHeight=e,this.characterSpacingX=h||0,this.characterSpacingY=i||0,this.characterPerRow=g,this.offsetX=j||0,this.offsetY=k||0,this.align="left",this.multiLine=!1,this.autoUpperCase=!0,this.customSpacingX=0,this.customSpacingY=0,this.fixedWidth=0,this.fontSet=a.cache.getImage(c),this._text="",this.grabData=[];for(var l=this.offsetX,m=this.offsetY,n=0,o=new b.FrameData,p=0;p<f.length;p++){var q=a.rnd.uuid(),r=o.addFrame(new b.Frame(p,l,m,this.characterWidth,this.characterHeight,"",q));this.grabData[f.charCodeAt(p)]=r.index,PIXI.TextureCache[q]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:l,y:m,width:this.characterWidth,height:this.characterHeight}),n++,n==this.characterPerRow?(n=0,l=this.offsetX,m+=this.characterHeight+this.characterSpacingY):l+=this.characterWidth+this.characterSpacingX}a.cache.updateFrameData(c,o),this.stamp=new b.Image(a,0,0,c,0),b.RenderTexture.call(this,a),this.type=b.RETROFONT},b.RetroFont.prototype=Object.create(b.RenderTexture.prototype),b.RetroFont.prototype.constructor=b.RetroFont,b.RetroFont.ALIGN_LEFT="left",b.RetroFont.ALIGN_RIGHT="right",b.RetroFont.ALIGN_CENTER="center",b.RetroFont.TEXT_SET1=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",b.RetroFont.TEXT_SET2=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",b.RetroFont.TEXT_SET3="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",b.RetroFont.TEXT_SET4="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",b.RetroFont.TEXT_SET5="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",b.RetroFont.TEXT_SET6="ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",b.RetroFont.TEXT_SET7="AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",b.RetroFont.TEXT_SET8="0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",b.RetroFont.TEXT_SET9="ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",b.RetroFont.TEXT_SET10="ABCDEFGHIJKLMNOPQRSTUVWXYZ",b.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;e<d.length;e++){switch(this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-d[e].length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-d[e].length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}0>a&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g<a.length;g++)if(" "==a.charAt(g))c+=this.characterWidth+e;else if(this.grabData[a.charCodeAt(g)]>=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;c<b.length;c++)b[c].length>a&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c<this._text.length;c++){var d=this._text[c],e=d.charCodeAt(0);(this.grabData[e]>=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b<a.length;b++)this.game.canvas[a[b]]&&(this.fullscreen=!0,this.requestFullscreen=a[b]);var c=["cancelFullScreen","exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","msCancelFullScreen","msExitFullscreen","mozCancelFullScreen","mozExitFullscreen"];if(this.fullscreen)for(var b=0;b<c.length;b++)this.game.canvas[c[b]]&&(this.cancelFullscreen=c[b]);window.Element&&Element.ALLOW_KEYBOARD_INPUT&&(this.fullscreenKeyboard=!0)},_checkBrowser:function(){var a=navigator.userAgent;/Arora/.test(a)?this.arora=!0:/Chrome/.test(a)?this.chrome=!0:/Epiphany/.test(a)?this.epiphany=!0:/Firefox/.test(a)?this.firefox=!0:/Mobile Safari/.test(a)?this.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(a)?(this.ie=!0,this.ieVersion=parseInt(RegExp.$1,10)):/Midori/.test(a)?this.midori=!0:/Opera/.test(a)?this.opera=!0:/Safari/.test(a)?this.safari=!0:/Silk/.test(a)?this.silk=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(a)&&(this.ie=!0,this.trident=!0,this.tridentVersion=parseInt(RegExp.$1,10),this.ieVersion=parseInt(RegExp.$3,10)),navigator.standalone&&(this.webApp=!0),navigator.isCocoonJS&&(this.cocoonJS=!0),"undefined"!=typeof window.ejecta&&(this.ejecta=!0)},_checkAudio:function(){this.audioData=!!window.Audio,this.webAudio=!(!window.webkitAudioContext&&!window.AudioContext);var a=document.createElement("audio"),b=!1;try{(b=!!a.canPlayType)&&(a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.ogg=!0),a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")&&(this.opus=!0),a.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(this.mp3=!0),a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(this.wav=!0),(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;").replace(/^no$/,""))&&(this.m4a=!0),a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(this.webm=!0))}catch(c){}},_checkDevice:function(){this.pixelRatio=window.devicePixelRatio||1,this.iPhone=-1!=navigator.userAgent.toLowerCase().indexOf("iphone"),this.iPhone4=2==this.pixelRatio&&this.iPhone,this.iPad=-1!=navigator.userAgent.toLowerCase().indexOf("ipad"),"undefined"!=typeof Int8Array?(this.littleEndian=new Int8Array(new Int16Array([1]).buffer)[0]>0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;d<c.length&&!window.requestAnimationFrame;d++)window.requestAnimationFrame=window[c[d]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[c[d]+"CancelAnimationFrame"];this._isSetTimeOut=!1,this._onLoop=null,this._timeOutID=null},b.RequestAnimationFrame.prototype={start:function(){this.isRunning=!0;var a=this;!window.requestAnimationFrame||this.forceSetTimeOut?(this._isSetTimeOut=!0,this._onLoop=function(){return a.updateSetTimeout()},this._timeOutID=window.setTimeout(this._onLoop,0)):(this._isSetTimeOut=!1,this._onLoop=function(b){return a.updateRAF(b)},this._timeOutID=window.requestAnimationFrame(this._onLoop))},updateRAF:function(){this.game.update(Date.now()),this._timeOutID=window.requestAnimationFrame(this._onLoop)},updateSetTimeout:function(){this.game.update(Date.now()),this._timeOutID=window.setTimeout(this._onLoop,this.game.time.timeToCall)},stop:function(){this._isSetTimeOut?clearTimeout(this._timeOutID):window.cancelAnimationFrame(this._timeOutID),this.isRunning=!1},isSetTimeOut:function(){return this._isSetTimeOut},isRAF:function(){return this._isSetTimeOut===!1}},b.RequestAnimationFrame.prototype.constructor=b.RequestAnimationFrame,b.Math={PI2:2*Math.PI,fuzzyEqual:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)<c},fuzzyLessThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),b+c>a},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b<arguments.length-0;b++)a[b]=arguments[b+0];for(var c=0,d=0;d<a.length;d++)c+=a[d];return c/a.length},truncate:function(a){return a>0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a<b[0])return b[0];for(var d=1;b[d]<a;)d++;var e=b[d-1],f=d<b.length?b[d]:Number.POSITIVE_INFINITY;return a-e>=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]<a[c]&&(c=b);return a[c]},max:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]<b[d][a]&&(d=c);return b[d][a]},maxProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b:b},sinCosGenerator:function(a,b,c,d){"undefined"==typeof b&&(b=1),"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1);for(var e=b,f=c,g=d*Math.PI/a,h=[],i=[],j=0;a>j;j++)f-=e*g,e+=f*g,h[j]=f,i[j]=e;return{sin:i,cos:h,length:a}},shift:function(a){var b=a.shift();return a.push(b),b},shuffleArray:function(a){for(var b=a.length-1;b>0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},distance:function(a,b,c,d){var e=a-c,f=b-d;return Math.sqrt(e*e+f*f)},distancePow:function(a,b,c,d,e){return"undefined"==typeof e&&(e=2),Math.sqrt(Math.pow(c-a,e)+Math.pow(d-b,e))},distanceRounded:function(a,c,d,e){return Math.round(b.Math.distance(a,c,d,e))},clamp:function(a,b,c){return b>a?b:a>c?c:a},clampBottom:function(a,b){return b>a?b:a},within:function(a,b,c){return Math.abs(a-b)<=c},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*(3-2*a))},smootherstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*a*(a*(6*a-15)+10))},sign:function(a){return 0>a?-1:a>0?1:0},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}()},b.RandomDataGenerator=function(a){"undefined"==typeof a&&(a=[]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.sow(a)},b.RandomDataGenerator.prototype={rnd:function(){var a=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|a,this.s0=this.s1,this.s1=this.s2,this.s2=a-this.c,this.s2},sow:function(a){"undefined"==typeof a&&(a=[]),this.s0=this.hash(" "),this.s1=this.hash(this.s0),this.s2=this.hash(this.s1),this.c=1;for(var b,c=0;b=a[c++];)this.s0-=this.hash(b),this.s0+=~~(this.s0<0),this.s1-=this.hash(b),this.s1+=~~(this.s1<0),this.s2-=this.hash(b),this.s2+=~~(this.s2<0)},hash:function(a){var b,c,d;for(d=4022871197,a=a.toString(),c=0;c<a.length;c++)d+=a.charCodeAt(c),b=.02519603282416938*d,d=b>>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(this.realInRange(a,b))},realInRange:function(a,b){return this.frac()*(b-a)+a},normal:function(){return 1-2*this.frac()},uuid:function(){var a="",b="";for(b=a="";a++<36;b+=~a%5|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},timestamp:function(a,b){return this.realInRange(a||9466848e5,b||1577862e6)},angle:function(){return this.integerInRange(-180,180)}},b.RandomDataGenerator.prototype.constructor=b.RandomDataGenerator,b.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.level<this.maxLevels)for(null==this.nodes[0]&&this.split();c<this.objects.length;)b=this.getIndex(this.objects[c]),-1!==b?this.nodes[b].insert(this.objects.splice(c,1)[0]):c++},getIndex:function(a){var b=-1;return a.x<this.bounds.right&&a.right<this.bounds.right?a.y<this.bounds.bottom&&a.bottom<this.bounds.bottom?b=1:a.y>this.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.y<this.bounds.bottom&&a.bottom<this.bounds.bottom?b=0:a.y>this.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},b.Net.prototype.constructor=b.Net,b.TweenManager=function(a){this.game=a,this._tweens=[],this._add=[],this.game.onPause.add(this._pauseAll,this),this.game.onResume.add(this._resumeAll,this)},b.TweenManager.prototype={getAll:function(){return this._tweens},removeAll:function(){for(var a=0;a<this._tweens.length;a++)this._tweens[a].pendingDelete=!0;this._add=[]},add:function(a){a._manager=this,this._add.push(a) },create:function(a){return new b.Tween(a,this.game,this)},remove:function(a){var b=this._tweens.indexOf(a);-1!==b&&(this._tweens[b].pendingDelete=!0)},update:function(){if(0===this._tweens.length&&0===this._add.length)return!1;for(var a=0,b=this._tweens.length;b>a;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>0&&(this._tweens=this._tweens.concat(this._add),this._add.length=0),!0},isTweening:function(a){return this._tweens.some(function(b){return b._object===a})},_pauseAll:function(){for(var a=this._tweens.length-1;a>=0;a--)this._tweens[a]._pause()},_resumeAll:function(){for(var a=this._tweens.length-1;a>=0;a--)this._tweens[a]._resume()},pauseAll:function(){for(var a=this._tweens.length-1;a>=0;a--)this._tweens[a].pause()},resumeAll:function(){for(var a=this._tweens.length-1;a>=0;a--)this._tweens[a].resume(!0)}},b.TweenManager.prototype.constructor=b.TweenManager,b.Tween=function(a,c,d){this._object=a,this.game=c,this._manager=d,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._yoyo=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=b.Easing.Linear.None,this._interpolationFunction=b.Math.linearInterpolation,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,this._paused=!1,this._pausedTime=0,this._codePaused=!1,this.pendingDelete=!1,this.onStart=new b.Signal,this.onLoop=new b.Signal,this.onComplete=new b.Signal,this.isRunning=!1},b.Tween.prototype={to:function(a,b,c,d,e,f,g){b=b||1e3,c=c||null,d=d||!1,e=e||0,f=f||0,g=g||!1;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=Math.floor(a*(this._duration/1e3)),f=this._duration/e,g=[];e--;){var c,h=(d-this._startTime)/this._duration;h=h>1?1:h;var i=this._easingFunction(h),j={};for(c in this._valuesEnd){var k=this._valuesStart[c]||0,l=this._valuesEnd[c];l instanceof Array?j[c]=this._interpolationFunction(l,i):("string"==typeof l&&(l=k+parseFloat(l,10)),"number"==typeof l&&(j[c]=k+(l-k)*i))}g.push(j),d+=f}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a<this._startTime)return!0;var b;if(a<this._startTime)return!0;this._onStartCallbackFired===!1&&(this.onStart.dispatch(this._object),this._onStartCallbackFired=!0);var c=(a-this._startTime)/this._duration;c=c>1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a<this._timers.length;a++)this._timers[a].destroy();this._timers=[],this.events.removeAll()},update:function(a){if(this.now=a,this._justResumed){this.time=this.now,this._justResumed=!1,this.events.resume();for(var b=0;b<this._timers.length;b++)this._timers[b]._resume()}if(this.timeToCall=this.game.math.max(0,16-(a-this.lastTime)),this.elapsed=this.now-this.time,this.physicsElapsed=this.elapsed/1e3,this.deltaCap>0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i<this._len;)this._timers[this._i].update(this.now)?this._i++:(this._timers.splice(this._i,1),this._len--)},gamePaused:function(){this._pauseStarted=this.now,this.events.pause();for(var a=this._timers.length;a--;)this._timers[a]._pause()},gameResumed:function(){this.pauseDuration=Date.now()-this._pauseStarted,this.time=Date.now(),this._justResumed=!0},totalElapsedSeconds:function(){return.001*(this.now-this._started)},elapsedSince:function(a){return this.now-a},elapsedSecondsSince:function(a){return.001*(this.now-a)},reset:function(){this._started=this.now,this.removeAll()}},b.Time.prototype.constructor=b.Time,b.Timer=function(a,c){"undefined"==typeof c&&(c=!0),this.game=a,this.running=!1,this.autoDestroy=c,this.expired=!1,this.events=[],this.onComplete=new b.Signal,this.nextTick=0,this.paused=!1,this._codePaused=!1,this._started=0,this._pauseStarted=0,this._pauseTotal=0,this._now=0,this._len=0,this._i=0},b.Timer.MINUTE=6e4,b.Timer.SECOND=1e3,b.Timer.HALF=500,b.Timer.QUARTER=250,b.Timer.prototype={create:function(a,c,d,e,f,g){var h=a;h+=0===this._now?this.game.time.now:this._now;var i=new b.TimerEvent(this,a,h,d,c,e,f,g);return this.events.push(i),this.order(),this.expired=!1,i},add:function(a,b,c){return this.create(a,!1,0,b,c,Array.prototype.splice.call(arguments,3))},repeat:function(a,b,c,d){return this.create(a,!1,b,c,d,Array.prototype.splice.call(arguments,4))},loop:function(a,b,c){return this.create(a,!0,0,b,c,Array.prototype.splice.call(arguments,3))},start:function(){if(!this.running){this._started=this.game.time.now,this.running=!0;for(var a=0;a<this.events.length;a++)this.events[a].tick=this.events[a].delay+this._started}},stop:function(a){this.running=!1,"undefined"==typeof a&&(a=!0),a&&(this.events.length=0)},remove:function(a){for(var b=0;b<this.events.length;b++)if(this.events[b]===a)return this.events[b].pendingDelete=!0,!0;return!1},order:function(){this.events.length>0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tick<b.tick?-1:a.tick>b.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i<this._len;)this.events[this._i].pendingDelete&&(this.events.splice(this._i,1),this._len--),this._i++;if(this._len=this.events.length,this.running&&this._now>=this.nextTick&&this._len>0){for(this._i=0;this._i<this._len&&this.running&&this._now>=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;b<this.events.length;b++)this.events[b].tick+=a;this.nextTick+=a,this.paused=!1,this._codePaused=!1}},_resume:function(){this._codePaused||this.resume()},removeAll:function(){this.onComplete.removeAll(),this.events.length=0,this._len=0,this._i=0},destroy:function(){this.onComplete.removeAll(),this.running=!1,this.events=[],this._len=0,this._i=0}},Object.defineProperty(b.Timer.prototype,"next",{get:function(){return this.nextTick}}),Object.defineProperty(b.Timer.prototype,"duration",{get:function(){return this.running&&this.nextTick>this._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;c<a.length;c++)if(b===!0){if(a[c]>this._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;d<this._frames.length;d++)c.push(this._frames[d]);else for(var d=0,e=a.length;e>d;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h<g.length;h++){var i=a.rnd.uuid();e=f.addFrame(new b.Frame(h,g[h].frame.x,g[h].frame.y,g[h].frame.w,g[h].frame.h,g[h].filename,i)),PIXI.TextureCache[i]=new PIXI.Texture(PIXI.BaseTextureCache[d],{x:g[h].frame.x,y:g[h].frame.y,width:g[h].frame.w,height:g[h].frame.h}),g[h].trimmed&&(e.setTrim(g[h].trimmed,g[h].sourceSize.w,g[h].sourceSize.h,g[h].spriteSourceSize.x,g[h].spriteSourceSize.y,g[h].spriteSourceSize.w,g[h].spriteSourceSize.h),PIXI.TextureCache[i].trim=new b.Rectangle(g[h].spriteSourceSize.x,g[h].spriteSourceSize.y,g[h].sourceSize.w,g[h].sourceSize.h))}return f},JSONDataHash:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object"),void console.log(c);var e,f=new b.FrameData,g=c.frames,h=0;for(var i in g){var j=a.rnd.uuid();e=f.addFrame(new b.Frame(h,g[i].frame.x,g[i].frame.y,g[i].frame.w,g[i].frame.h,i,j)),PIXI.TextureCache[j]=new PIXI.Texture(PIXI.BaseTextureCache[d],{x:g[i].frame.x,y:g[i].frame.y,width:g[i].frame.w,height:g[i].frame.h}),g[i].trimmed&&(e.setTrim(g[i].trimmed,g[i].sourceSize.w,g[i].sourceSize.h,g[i].spriteSourceSize.x,g[i].spriteSourceSize.y,g[i].spriteSourceSize.w,g[i].spriteSourceSize.h),PIXI.TextureCache[j].trim=new b.Rectangle(g[i].spriteSourceSize.x,g[i].spriteSourceSize.y,g[i].sourceSize.w,g[i].sourceSize.h)),h++}return f},XMLData:function(a,c,d){if(!c.getElementsByTagName("TextureAtlas"))return void console.warn("Phaser.AnimationParser.XMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag");for(var e,f,g,h,i,j,k,l,m,n,o,p,q=new b.FrameData,r=c.getElementsByTagName("SubTexture"),s=0;s<r.length;s++)f=a.rnd.uuid(),h=r[s].attributes,g=h.name.nodeValue,i=parseInt(h.x.nodeValue,10),j=parseInt(h.y.nodeValue,10),k=parseInt(h.width.nodeValue,10),l=parseInt(h.height.nodeValue,10),m=null,n=null,h.frameX&&(m=Math.abs(parseInt(h.frameX.nodeValue,10)),n=Math.abs(parseInt(h.frameY.nodeValue,10)),o=parseInt(h.frameWidth.nodeValue,10),p=parseInt(h.frameHeight.nodeValue,10)),e=q.addFrame(new b.Frame(s,i,j,k,l,g,f)),PIXI.TextureCache[f]=new PIXI.Texture(PIXI.BaseTextureCache[d],{x:i,y:j,width:k,height:l}),(null!==m||null!==n)&&(e.setTrim(!0,k,l,m,n,o,p),PIXI.TextureCache[f].trim=new b.Rectangle(m,n,k,l));return q}},b.Cache=function(a){this.game=a,this._canvases={},this._images={},this._textures={},this._sounds={},this._text={},this._json={},this._physics={},this._tilemaps={},this._binary={},this._bitmapDatas={},this._bitmapFont={},this.addDefaultImage(),this.addMissingImage(),this.onSoundUnlock=new b.Signal},b.Cache.CANVAS=1,b.Cache.IMAGE=2,b.Cache.TEXTURE=3,b.Cache.SOUND=4,b.Cache.TEXT=5,b.Cache.PHYSICS=6,b.Cache.TILEMAP=7,b.Cache.BINARY=8,b.Cache.BITMAPDATA=9,b.Cache.BITMAPFONT=10,b.Cache.JSON=11,b.Cache.prototype={addCanvas:function(a,b,c){this._canvases[a]={canvas:b,context:c}},addBinary:function(a,b){this._binary[a]=b},addBitmapData:function(a,b){return this._bitmapDatas[a]=b,b},addRenderTexture:function(a,c){var d=new b.Frame(0,0,0,c.width,c.height,"","");this._textures[a]={texture:c,frame:d}},addSpriteSheet:function(a,c,d,e,f,g,h,i){this._images[a]={url:c,data:d,spriteSheet:!0,frameWidth:e,frameHeight:f,margin:h,spacing:i},PIXI.BaseTextureCache[a]=new PIXI.BaseTexture(d),PIXI.TextureCache[a]=new PIXI.Texture(PIXI.BaseTextureCache[a]),this._images[a].frameData=b.AnimationParser.spriteSheet(this.game,a,e,f,g,h,i)},addTilemap:function(a,b,c,d){this._tilemaps[a]={url:b,data:c,format:d}},addTextureAtlas:function(a,c,d,e,f){this._images[a]={url:c,data:d,spriteSheet:!0},PIXI.BaseTextureCache[a]=new PIXI.BaseTexture(d),PIXI.TextureCache[a]=new PIXI.Texture(PIXI.BaseTextureCache[a]),f==b.Loader.TEXTURE_ATLAS_JSON_ARRAY?this._images[a].frameData=b.AnimationParser.JSONData(this.game,e,a):f==b.Loader.TEXTURE_ATLAS_JSON_HASH?this._images[a].frameData=b.AnimationParser.JSONDataHash(this.game,e,a):f==b.Loader.TEXTURE_ATLAS_XML_STARLING&&(this._images[a].frameData=b.AnimationParser.XMLData(this.game,e,a))},addBitmapFont:function(a,c,d,e,f,g){this._images[a]={url:c,data:d,spriteSheet:!0},PIXI.BaseTextureCache[a]=new PIXI.BaseTexture(d),PIXI.TextureCache[a]=new PIXI.Texture(PIXI.BaseTextureCache[a]),b.LoaderParser.bitmapFont(this.game,e,a,f,g)},addPhysicsData:function(a,b,c,d){this._physics[a]={url:b,data:c,format:d}},addDefaultImage:function(){var a=new Image;a.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==",this._images.__default={url:null,data:a,spriteSheet:!1},this._images.__default.frame=new b.Frame(0,0,0,32,32,"",""),PIXI.BaseTextureCache.__default=new PIXI.BaseTexture(a),PIXI.TextureCache.__default=new PIXI.Texture(PIXI.BaseTextureCache.__default)},addMissingImage:function(){var a=new Image;a.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==",this._images.__missing={url:null,data:a,spriteSheet:!1},this._images.__missing.frame=new b.Frame(0,0,0,32,32,"",""),PIXI.BaseTextureCache.__missing=new PIXI.BaseTexture(a),PIXI.TextureCache.__missing=new PIXI.Texture(PIXI.BaseTextureCache.__missing)},addText:function(a,b,c){this._text[a]={url:b,data:c}},addJSON:function(a,b,c){this._json[a]={url:b,data:c}},addImage:function(a,c,d){this._images[a]={url:c,data:d,spriteSheet:!1},this._images[a].frame=new b.Frame(0,0,0,d.width,d.height,a,this.game.rnd.uuid()),PIXI.BaseTextureCache[a]=new PIXI.BaseTexture(d),PIXI.TextureCache[a]=new PIXI.Texture(PIXI.BaseTextureCache[a]) },addSound:function(a,b,c,d,e){d=d||!0,e=e||!1;var f=!1;e&&(f=!0),this._sounds[a]={url:b,data:c,isDecoding:!1,decoded:f,webAudio:d,audioTag:e,locked:this.game.sound.touchLocked}},reloadSound:function(a){var b=this;this._sounds[a]&&(this._sounds[a].data.src=this._sounds[a].url,this._sounds[a].data.addEventListener("canplaythrough",function(){return b.reloadSoundComplete(a)},!1),this._sounds[a].data.load())},reloadSoundComplete:function(a){this._sounds[a]&&(this._sounds[a].locked=!1,this.onSoundUnlock.dispatch(a))},updateSound:function(a,b,c){this._sounds[a]&&(this._sounds[a][b]=c)},decodedSound:function(a,b){this._sounds[a].data=b,this._sounds[a].decoded=!0,this._sounds[a].isDecoding=!1},getCanvas:function(a){return this._canvases[a]?this._canvases[a].canvas:void console.warn('Phaser.Cache.getCanvas: Invalid key: "'+a+'"')},getBitmapData:function(a){return this._bitmapDatas[a]?this._bitmapDatas[a]:void console.warn('Phaser.Cache.getBitmapData: Invalid key: "'+a+'"')},getBitmapFont:function(a){return this._bitmapFont[a]?this._bitmapFont[a]:void console.warn('Phaser.Cache.getBitmapFont: Invalid key: "'+a+'"')},getPhysicsData:function(a,b){if("undefined"==typeof b||null===b){if(this._physics[a])return this._physics[a].data;console.warn('Phaser.Cache.getPhysicsData: Invalid key: "'+a+'"')}else{if(this._physics[a]&&this._physics[a].data[b])return this._physics[a].data[b];console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "'+a+" / "+b+'"')}return null},checkImageKey:function(a){return this._images[a]?!0:!1},getImage:function(a){return this._images[a]?this._images[a].data:void console.warn('Phaser.Cache.getImage: Invalid key: "'+a+'"')},getTilemapData:function(a){return this._tilemaps[a]?this._tilemaps[a]:void console.warn('Phaser.Cache.getTilemapData: Invalid key: "'+a+'"')},getFrameData:function(a){return this._images[a]&&this._images[a].frameData?this._images[a].frameData:null},updateFrameData:function(a,b){this._images[a]&&(this._images[a].spriteSheet=!0,this._images[a].frameData=b)},getFrameByIndex:function(a,b){return this._images[a]&&this._images[a].frameData?this._images[a].frameData.getFrame(b):null},getFrameByName:function(a,b){return this._images[a]&&this._images[a].frameData?this._images[a].frameData.getFrameByName(b):null},getFrame:function(a){return this._images[a]&&this._images[a].spriteSheet===!1?this._images[a].frame:null},getTextureFrame:function(a){return this._textures[a]?this._textures[a].frame:null},getTexture:function(a){return this._textures[a]?this._textures[a]:void console.warn('Phaser.Cache.getTexture: Invalid key: "'+a+'"')},getSound:function(a){return this._sounds[a]?this._sounds[a]:void console.warn('Phaser.Cache.getSound: Invalid key: "'+a+'"')},getSoundData:function(a){return this._sounds[a]?this._sounds[a].data:void console.warn('Phaser.Cache.getSoundData: Invalid key: "'+a+'"')},isSoundDecoded:function(a){return this._sounds[a]?this._sounds[a].decoded:void 0},isSoundReady:function(a){return this._sounds[a]&&this._sounds[a].decoded&&this.game.sound.touchLocked===!1},isSpriteSheet:function(a){return this._images[a]?this._images[a].spriteSheet:!1},getText:function(a){return this._text[a]?this._text[a].data:void console.warn('Phaser.Cache.getText: Invalid key: "'+a+'"')},getJSON:function(a){return this._json[a]?this._json[a].data:void console.warn('Phaser.Cache.getJSON: Invalid key: "'+a+'"')},getBinary:function(a){return this._binary[a]?this._binary[a]:void console.warn('Phaser.Cache.getBinary: Invalid key: "'+a+'"')},getKeys:function(a){var c=null;switch(a){case b.Cache.CANVAS:c=this._canvases;break;case b.Cache.IMAGE:c=this._images;break;case b.Cache.TEXTURE:c=this._textures;break;case b.Cache.SOUND:c=this._sounds;break;case b.Cache.TEXT:c=this._text;break;case b.Cache.PHYSICS:c=this._physics;break;case b.Cache.TILEMAP:c=this._tilemaps;break;case b.Cache.BINARY:c=this._binary;break;case b.Cache.BITMAPDATA:c=this._bitmapDatas;break;case b.Cache.BITMAPFONT:c=this._bitmapFont;break;case b.Cache.JSON:c=this._json}if(c){var d=[];for(var e in c)"__default"!==e&&"__missing"!==e&&d.push(e);return d}},removeCanvas:function(a){delete this._canvases[a]},removeImage:function(a){delete this._images[a]},removeSound:function(a){delete this._sounds[a]},removeText:function(a){delete this._text[a]},removeJSON:function(a){delete this._json[a]},removePhysics:function(a){delete this._physics[a]},removeTilemap:function(a){delete this._tilemaps[a]},removeBinary:function(a){delete this._binary[a]},removeBitmapData:function(a){delete this._bitmapDatas[a]},removeBitmapFont:function(a){delete this._bitmapFont[a]},destroy:function(){for(var a in this._canvases)delete this._canvases[a];for(var a in this._images)"__default"!==a&&"__missing"!==a&&delete this._images[a];for(var a in this._sounds)delete this._sounds[a];for(var a in this._text)delete this._text[a];for(var a in this._json)delete this._json[a];for(var a in this._textures)delete this._textures[a];for(var a in this._physics)delete this._physics[a];for(var a in this._tilemaps)delete this._tilemaps[a];for(var a in this._binary)delete this._binary[a];for(var a in this._bitmapDatas)delete this._bitmapDatas[a];for(var a in this._bitmapFont)delete this._bitmapFont[a]}},b.Cache.prototype.constructor=b.Cache,b.Loader=function(a){this.game=a,this._fileList=[],this._fileIndex=0,this._progressChunk=0,this._xhr=new XMLHttpRequest,this.isLoading=!1,this.hasLoaded=!1,this.progress=0,this.progressFloat=0,this.preloadSprite=null,this.crossOrigin=!1,this.baseURL="",this.onFileComplete=new b.Signal,this.onFileError=new b.Signal,this.onLoadStart=new b.Signal,this.onLoadComplete=new b.Signal},b.Loader.TEXTURE_ATLAS_JSON_ARRAY=0,b.Loader.TEXTURE_ATLAS_JSON_HASH=1,b.Loader.TEXTURE_ATLAS_XML_STARLING=2,b.Loader.PHYSICS_LIME_CORONA=3,b.Loader.prototype={setPreloadSprite:function(a,c){c=c||0,this.preloadSprite={sprite:a,direction:c,width:a.width,height:a.height,rect:null},this.preloadSprite.rect=0===c?new b.Rectangle(0,0,1,a.height):new b.Rectangle(0,0,a.width,1),a.crop(this.preloadSprite.rect),a.visible=!0},checkKeyExists:function(a,b){if(this._fileList.length>0)for(var c=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)return!0;return!1},getAssetIndex:function(a,b){if(this._fileList.length>0)for(var c=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)return c;return-1},getAsset:function(a,b){if(this._fileList.length>0)for(var c=0;c<this._fileList.length;c++)if(this._fileList[c].type===a&&this._fileList[c].key===b)return{index:c,file:this._fileList[c]};return!1},reset:function(){this.preloadSprite=null,this.isLoading=!1,this._fileList.length=0,this._fileIndex=0},addToFileList:function(a,b,c,d){var e={type:a,key:b,url:c,data:null,error:!1,loaded:!1};if("undefined"!=typeof d)for(var f in d)e[f]=d[f];this.checkKeyExists(a,b)===!1&&this._fileList.push(e)},replaceInFileList:function(a,b,c,d){var e={type:a,key:b,url:c,data:null,error:!1,loaded:!1};if("undefined"!=typeof d)for(var f in d)e[f]=d[f];var g=this.getAssetIndex(a,b);-1===g?this._fileList.push(e):this._fileList[g]=e},image:function(a,b,c){return"undefined"==typeof c&&(c=!1),c?this.replaceInFileList("image",a,b):this.addToFileList("image",a,b),this},text:function(a,b,c){return"undefined"==typeof c&&(c=!1),c?this.replaceInFileList("text",a,b):this.addToFileList("text",a,b),this},json:function(a,b,c){return"undefined"==typeof c&&(c=!1),c?this.replaceInFileList("json",a,b):this.addToFileList("json",a,b),this},script:function(a,b,c,d){return"undefined"==typeof c&&(c=!1),c!==!1&&"undefined"==typeof d&&(d=c),this.addToFileList("script",a,b,{callback:c,callbackContext:d}),this},binary:function(a,b,c,d){return"undefined"==typeof c&&(c=!1),c!==!1&&"undefined"==typeof d&&(d=c),this.addToFileList("binary",a,b,{callback:c,callbackContext:d}),this},spritesheet:function(a,b,c,d,e,f,g){return"undefined"==typeof e&&(e=-1),"undefined"==typeof f&&(f=0),"undefined"==typeof g&&(g=0),this.addToFileList("spritesheet",a,b,{frameWidth:c,frameHeight:d,frameMax:e,margin:f,spacing:g}),this},audio:function(a,b,c){return"undefined"==typeof c&&(c=!0),this.addToFileList("audio",a,b,{buffer:null,autoDecode:c}),this},tilemap:function(a,c,d,e){if("undefined"==typeof c&&(c=null),"undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=b.Tilemap.CSV),null==c&&null==d)return console.warn("Phaser.Loader.tilemap - Both mapDataURL and mapData are null. One must be set."),this;if(d){switch(e){case b.Tilemap.CSV:break;case b.Tilemap.TILED_JSON:"string"==typeof d&&(d=JSON.parse(d))}this.game.cache.addTilemap(a,null,d,e)}else this.addToFileList("tilemap",a,c,{format:e});return this},physics:function(a,c,d,e){return"undefined"==typeof c&&(c=null),"undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=b.Physics.LIME_CORONA_JSON),null==c&&null==d?(console.warn("Phaser.Loader.physics - Both dataURL and jsonData are null. One must be set."),this):(d?("string"==typeof d&&(d=JSON.parse(d)),this.game.cache.addPhysicsData(a,null,d,e)):this.addToFileList("physics",a,c,{format:e}),this)},bitmapFont:function(a,b,c,d,e,f){if("undefined"==typeof c&&(c=null),"undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),c)this.addToFileList("bitmapfont",a,b,{xmlURL:c,xSpacing:e,ySpacing:f});else if("string"==typeof d){var g;try{if(window.DOMParser){var h=new DOMParser;g=h.parseFromString(d,"text/xml")}else g=new ActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(d)}catch(i){g=void 0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)throw new Error("Phaser.Loader. Invalid Bitmap Font XML given");this.addToFileList("bitmapfont",a,b,{xmlURL:null,xmlData:g,xSpacing:e,ySpacing:f})}return this},atlasJSONArray:function(a,c,d,e){return this.atlas(a,c,d,e,b.Loader.TEXTURE_ATLAS_JSON_ARRAY)},atlasJSONHash:function(a,c,d,e){return this.atlas(a,c,d,e,b.Loader.TEXTURE_ATLAS_JSON_HASH)},atlasXML:function(a,c,d,e){return this.atlas(a,c,d,e,b.Loader.TEXTURE_ATLAS_XML_STARLING)},atlas:function(a,c,d,e,f){if("undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=null),"undefined"==typeof f&&(f=b.Loader.TEXTURE_ATLAS_JSON_ARRAY),d)this.addToFileList("textureatlas",a,c,{atlasURL:d,format:f});else{switch(f){case b.Loader.TEXTURE_ATLAS_JSON_ARRAY:"string"==typeof e&&(e=JSON.parse(e));break;case b.Loader.TEXTURE_ATLAS_XML_STARLING:if("string"==typeof e){var g;try{if(window.DOMParser){var h=new DOMParser;g=h.parseFromString(e,"text/xml")}else g=new ActiveXObject("Microsoft.XMLDOM"),g.async="false",g.loadXML(e)}catch(i){g=void 0}if(!g||!g.documentElement||g.getElementsByTagName("parsererror").length)throw new Error("Phaser.Loader. Invalid Texture Atlas XML given");e=g}}this.addToFileList("textureatlas",a,c,{atlasURL:null,atlasData:e,format:f})}return this},removeFile:function(a,b){var c=this.getAsset(a,b);c!==!1&&this._fileList.splice(c.index,1)},removeAll:function(){this._fileList.length=0},start:function(){this.isLoading||(this.progress=0,this.progressFloat=0,this.hasLoaded=!1,this.isLoading=!0,this.onLoadStart.dispatch(this._fileList.length),this._fileList.length>0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c<a.length;c++)if(b=a[c].toLowerCase(),b=b.substr((Math.max(0,b.lastIndexOf("."))||1/0)+1),this.game.device.canPlayAudio(b))return a[c];return null},fileError:function(a){this._fileList[a].loaded=!0,this._fileList[a].error=!0,this.onFileError.dispatch(this._fileList[a].key,this._fileList[a]),console.warn("Phaser.Loader error loading file: "+this._fileList[a].key+" from URL "+this._fileList[a].url),this.nextFile(a,!1)},fileComplete:function(a){if(!this._fileList[a])return void console.warn("Phaser.Loader fileComplete invalid index "+a);var c=this._fileList[a];c.loaded=!0;var d=!0,e=this;switch(c.type){case"image":this.game.cache.addImage(c.key,c.url,c.data);break;case"spritesheet":this.game.cache.addSpriteSheet(c.key,c.url,c.data,c.frameWidth,c.frameHeight,c.frameMax,c.margin,c.spacing);break;case"textureatlas":if(null==c.atlasURL)this.game.cache.addTextureAtlas(c.key,c.url,c.data,c.atlasData,c.format);else{if(d=!1,this._xhr.open("GET",this.baseURL+c.atlasURL,!0),this._xhr.responseType="text",c.format==b.Loader.TEXTURE_ATLAS_JSON_ARRAY||c.format==b.Loader.TEXTURE_ATLAS_JSON_HASH)this._xhr.onload=function(){return e.jsonLoadComplete(a)};else{if(c.format!=b.Loader.TEXTURE_ATLAS_XML_STARLING)throw new Error("Phaser.Loader. Invalid Texture Atlas format: "+c.format);this._xhr.onload=function(){return e.xmlLoadComplete(a)}}this._xhr.onerror=function(){return e.dataLoadError(a)},this._xhr.send()}break;case"bitmapfont":null==c.xmlURL?this.game.cache.addBitmapFont(c.key,c.url,c.data,c.xmlData,c.xSpacing,c.ySpacing):(d=!1,this._xhr.open("GET",this.baseURL+c.xmlURL,!0),this._xhr.responseType="text",this._xhr.onload=function(){return e.xmlLoadComplete(a)},this._xhr.onerror=function(){return e.dataLoadError(a)},this._xhr.send());break;case"audio":if(this.game.sound.usingWebAudio){if(c.data=this._xhr.response,this.game.cache.addSound(c.key,c.url,c.data,!0,!1),c.autoDecode){var f=this,g=c.key;this.game.cache.updateSound(g,"isDecoding",!0),this.game.sound.context.decodeAudioData(c.data,function(a){a&&(f.game.cache.decodedSound(g,a),f.game.sound.onSoundDecode.dispatch(g,f.game.cache.getSound(g)))})}}else c.data.removeEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete),this.game.cache.addSound(c.key,c.url,c.data,!1,!0);break;case"text":c.data=this._xhr.responseText,this.game.cache.addText(c.key,c.url,c.data);break;case"physics":var h=JSON.parse(this._xhr.responseText);this.game.cache.addPhysicsData(c.key,c.url,h,c.format);break;case"script":c.data=document.createElement("script"),c.data.language="javascript",c.data.type="text/javascript",c.data.defer=!1,c.data.text=this._xhr.responseText,document.head.appendChild(c.data),c.callback&&(c.data=c.callback.call(c.callbackContext,c.key,this._xhr.responseText));break;case"binary":c.data=c.callback?c.callback.call(c.callbackContext,c.key,this._xhr.response):this._xhr.response,this.game.cache.addBinary(c.key,c.data)}d&&this.nextFile(a,!0)},jsonLoadComplete:function(a){if(!this._fileList[a])return void console.warn("Phaser.Loader jsonLoadComplete invalid index "+a);var b=this._fileList[a],c=JSON.parse(this._xhr.responseText);b.loaded=!0,"tilemap"===b.type?this.game.cache.addTilemap(b.key,b.url,c,b.format):"json"===b.type?this.game.cache.addJSON(b.key,b.url,c):this.game.cache.addTextureAtlas(b.key,b.url,b.data,c,b.format),this.nextFile(a,!0)},csvLoadComplete:function(a){if(!this._fileList[a])return void console.warn("Phaser.Loader csvLoadComplete invalid index "+a);var b=this._fileList[a],c=this._xhr.responseText;b.loaded=!0,this.game.cache.addTilemap(b.key,b.url,c,b.format),this.nextFile(a,!0)},dataLoadError:function(a){var b=this._fileList[a];b.loaded=!0,b.error=!0,console.warn("Phaser.Loader dataLoadError: "+b.key),this.nextFile(a,!0)},xmlLoadComplete:function(a){var b,c=this._xhr.responseText;try{if(window.DOMParser){var d=new DOMParser;b=d.parseFromString(c,"text/xml")}else b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(c)}catch(e){b=void 0}if(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)throw new Error("Phaser.Loader. Invalid XML given");var f=this._fileList[a];f.loaded=!0,"bitmapfont"==f.type?this.game.cache.addBitmapFont(f.key,f.url,f.data,b,f.xSpacing,f.ySpacing):"textureatlas"==f.type&&this.game.cache.addTextureAtlas(f.key,f.url,f.data,b,f.format),this.nextFile(a,!0)},nextFile:function(a,b){this.progressFloat+=this._progressChunk,this.progress=Math.round(this.progressFloat),this.progress>100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b<this._fileList.length;b++)this._fileList[b].loaded&&a++;return a},totalQueuedFiles:function(){for(var a=0,b=0;b<this._fileList.length;b++)this._fileList[b].loaded===!1&&a++;return a}},b.Loader.prototype.constructor=b.Loader,b.LoaderParser={bitmapFont:function(a,b,c,d,e){if(!b||/MSIE 9/i.test(navigator.userAgent))if("function"==typeof window.DOMParser){var f=new DOMParser;b=f.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var g=document.createElement("div");g.innerHTML=this.ajaxRequest.responseText,b=g}var h={},i=b.getElementsByTagName("info")[0],j=b.getElementsByTagName("common")[0];h.font=i.getAttribute("face"),h.size=parseInt(i.getAttribute("size"),10),h.lineHeight=parseInt(j.getAttribute("lineHeight"),10)+e,h.chars={};for(var k=b.getElementsByTagName("char"),l=PIXI.TextureCache[c],m=0;m<k.length;m++){var n=parseInt(k[m].getAttribute("id"),10),o=new PIXI.Rectangle(parseInt(k[m].getAttribute("x"),10),parseInt(k[m].getAttribute("y"),10),parseInt(k[m].getAttribute("width"),10),parseInt(k[m].getAttribute("height"),10));h.chars[n]={xOffset:parseInt(k[m].getAttribute("xoffset"),10),yOffset:parseInt(k[m].getAttribute("yoffset"),10),xAdvance:parseInt(k[m].getAttribute("xadvance"),10)+d,kerning:{},texture:PIXI.TextureCache[c]=new PIXI.Texture(l,o)}}var p=b.getElementsByTagName("kerning");for(m=0;m<p.length;m++){var q=parseInt(p[m].getAttribute("first"),10),r=parseInt(p[m].getAttribute("second"),10),s=parseInt(p[m].getAttribute("amount"),10);h.chars[r].kerning[q]=s}PIXI.BitmapText.fonts[c]=h}},b.Sound=function(a,c,d,e,f){"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=a.sound.connectToMaster),this.game=a,this.name=c,this.key=c,this.loop=e,this._volume=d,this.markers={},this.context=null,this._buffer=null,this._muted=!1,this.autoplay=!1,this.totalDuration=0,this.startTime=0,this.currentTime=0,this.duration=0,this.stopTime=0,this.paused=!1,this.pausedPosition=0,this.pausedTime=0,this.isPlaying=!1,this.currentMarker="",this.pendingPlayback=!1,this.override=!1,this.usingWebAudio=this.game.sound.usingWebAudio,this.usingAudioTag=this.game.sound.usingAudioTag,this.externalNode=null,this.usingWebAudio?(this.context=this.game.sound.context,this.masterGainNode=this.game.sound.masterGain,this.gainNode="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.gainNode.gain.value=d*this.game.sound.volume,f&&this.gainNode.connect(this.masterGainNode)):this.game.cache.getSound(c)&&this.game.cache.isSoundReady(c)?(this._sound=this.game.cache.getSoundData(c),this.totalDuration=0,this._sound.duration&&(this.totalDuration=this._sound.duration)):this.game.cache.onSoundUnlock.add(this.soundHasUnlocked,this),this.onDecoded=new b.Signal,this.onPlay=new b.Signal,this.onPause=new b.Signal,this.onResume=new b.Signal,this.onLoop=new b.Signal,this.onStop=new b.Signal,this.onMute=new b.Signal,this.onMarkerComplete=new b.Signal},b.Sound.prototype={soundHasUnlocked:function(a){a==this.key&&(this._sound=this.game.cache.getSoundData(this.key),this.totalDuration=this._sound.duration)},addMarker:function(a,b,c,d,e){"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=!1),this.markers[a]={name:a,start:b,stop:b+c,volume:d,duration:c,durationMS:1e3*c,loop:e}},removeMarker:function(a){delete this.markers[a]},update:function(){this.pendingPlayback&&this.game.cache.isSoundReady(this.key)&&(this.pendingPlayback=!1,this.play(this._tempMarker,this._tempPosition,this._tempVolume,this._tempLoop)),this.isPlaying&&(this.currentTime=this.game.time.now-this.startTime,this.currentTime>=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(this.onMarkerComplete.dispatch(this.currentMarker,this),this.play(this.currentMarker,0,this.volume,!0,!0))):this.stop():this.loop?(this.onLoop.dispatch(this),this.play(this.currentMarker,0,this.volume,!0,!0)):this.stop()))},play:function(a,b,c,d,e){if("undefined"==typeof a&&(a=""),"undefined"==typeof e&&(e=!0),this.isPlaying!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(this.usingWebAudio?"undefined"==typeof this._sound.stop?this._sound.noteOff(0):this._sound.stop(0):this.usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0)),this.currentMarker=a,""!==a){if(!this.markers[a])return void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");this.position=this.markers[a].start,this.volume=this.markers[a].volume,this.loop=this.markers[a].loop,this.duration=this.markers[a].duration,this.durationMS=this.markers[a].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(this.usingWebAudio?"undefined"==typeof this._sound.stop?this._sound.noteOff(0):this._sound.stop(0):this.usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0)),this.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].stop()},pauseAll:function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].pause()},resumeAll:function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].resume()},decode:function(a,b){b=b||null;var c=this.game.cache.getSoundData(a);if(c&&this.game.cache.isSoundDecoded(a)===!1){this.game.cache.updateSound(a,"isDecoding",!0);var d=this;this.context.decodeAudioData(c,function(c){d.game.cache.decodedSound(a,c),b&&d.onSoundDecode.dispatch(a,b)})}},update:function(){this.touchLocked&&this.game.device.webAudio&&null!==this._unlockSource&&(this._unlockSource.playbackState===this._unlockSource.PLAYING_STATE||this._unlockSource.playbackState===this._unlockSource.FINISHED_STATE)&&(this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null);for(var a=0;a<this._sounds.length;a++)this._sounds[a].update()},add:function(a,c,d,e){"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=this.connectToMaster);var f=new b.Sound(this.game,a,c,d,e);return this._sounds.push(f),f},play:function(a,b,c){var d=this.add(a,b,c);return d.play(),d},setMute:function(){if(!this._muted){this._muted=!0,this.usingWebAudio&&(this._muteVolume=this.masterGain.gain.value,this.masterGain.gain.value=0);for(var a=0;a<this._sounds.length;a++)this._sounds[a].usingAudioTag&&(this._sounds[a].mute=!0)}},unsetMute:function(){if(this._muted&&!this._codeMuted){this._muted=!1,this.usingWebAudio&&(this.masterGain.gain.value=this._muteVolume);for(var a=0;a<this._sounds.length;a++)this._sounds[a].usingAudioTag&&(this._sounds[a].mute=!1)}}},b.SoundManager.prototype.constructor=b.SoundManager,Object.defineProperty(b.SoundManager.prototype,"mute",{get:function(){return this._muted},set:function(a){if(a=a||null){if(this._muted)return;this._codeMuted=!0,this.setMute()}else{if(this._muted===!1)return;this._codeMuted=!1,this.unsetMute()}}}),Object.defineProperty(b.SoundManager.prototype,"volume",{get:function(){return this.usingWebAudio?this.masterGain.gain.value:this._volume },set:function(a){if(this._volume=a,this.usingWebAudio)this.masterGain.gain.value=a;else for(var b=0;b<this._sounds.length;b++)this._sounds[b].usingAudioTag&&(this._sounds[b].volume=this._sounds[b].volume*a)}}),b.Utils.Debug=function(a){this.game=a,this.sprite=null,this.canvas=null,this.baseTexture=null,this.texture=null,this.textureFrame=null,this.context=null,this.font="14px Courier",this.columnWidth=100,this.lineHeight=16,this.renderShadow=!0,this.currentX=0,this.currentY=0,this.currentAlpha=1,this.dirty=!1},b.Utils.Debug.prototype={boot:function(){this.game.renderType===b.CANVAS?this.context=this.game.context:(this.canvas=b.Canvas.create(this.game.width,this.game.height,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,this.game.width,this.game.height,"debug",this.game.rnd.uuid()),this.sprite=this.game.make.image(0,0,this.texture,this.textureFrame),this.game.stage.addChild(this.sprite))},preUpdate:function(){this.dirty&&this.sprite&&(this.context.clearRect(0,0,this.game.width,this.game.height),this.dirty=!1)},start:function(a,b,c,d){"number"!=typeof a&&(a=0),"number"!=typeof b&&(b=0),c=c||"rgb(255,255,255)","undefined"==typeof d&&(d=0),this.currentX=a,this.currentY=b,this.currentColor=c,this.currentAlpha=this.context.globalAlpha,this.columnWidth=d,this.sprite&&(this.dirty=!0),this.context.save(),this.context.setTransform(1,0,0,1,0,0),this.context.strokeStyle=c,this.context.fillStyle=c,this.context.font=this.font,this.context.globalAlpha=1},stop:function(){this.context.restore(),this.context.globalAlpha=this.currentAlpha,this.sprite&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl)},line:function(){for(var a=this.currentX,b=0;b<arguments.length;b++)this.renderShadow&&(this.context.fillStyle="rgb(0,0,0)",this.context.fillText(arguments[b],a+1,this.currentY+1),this.context.fillStyle=this.currentColor),this.context.fillText(arguments[b],a,this.currentY),a+=this.columnWidth;this.currentY+=this.lineHeight},soundInfo:function(a,b,c,d){this.start(b,c,d),this.line("Sound: "+a.key+" Locked: "+a.game.sound.touchLocked),this.line("Is Ready?: "+this.game.cache.isSoundReady(a.key)+" Pending Playback: "+a.pendingPlayback),this.line("Decoded: "+a.isDecoded+" Decoding: "+a.isDecoding),this.line("Total Duration: "+a.totalDuration+" Playing: "+a.isPlaying),this.line("Time: "+a.currentTime),this.line("Volume: "+a.volume+" Muted: "+a.mute),this.line("WebAudio: "+a.usingWebAudio+" Audio: "+a.usingAudioTag),""!==a.currentMarker&&(this.line("Marker: "+a.currentMarker+" Duration: "+a.duration),this.line("Start: "+a.markers[a.currentMarker].start+" Stop: "+a.markers[a.currentMarker].stop),this.line("Position: "+a.position)),this.stop()},cameraInfo:function(a,b,c,d){this.start(b,c,d),this.line("Camera ("+a.width+" x "+a.height+")"),this.line("X: "+a.x+" Y: "+a.y),this.line("Bounds x: "+a.bounds.x+" Y: "+a.bounds.y+" w: "+a.bounds.width+" h: "+a.bounds.height),this.line("View x: "+a.view.x+" Y: "+a.view.y+" w: "+a.view.width+" h: "+a.view.height),this.stop()},pointer:function(a,b,c,d,e){null!=a&&("undefined"==typeof b&&(b=!1),c=c||"rgba(0,255,0,0.5)",d=d||"rgba(255,0,0,0.5)",(b!==!0||a.isUp!==!0)&&(this.start(a.x,a.y-100,e),this.context.beginPath(),this.context.arc(a.x,a.y,a.circle.radius,0,2*Math.PI),this.context.fillStyle=a.active?c:d,this.context.fill(),this.context.closePath(),this.context.beginPath(),this.context.moveTo(a.positionDown.x,a.positionDown.y),this.context.lineTo(a.position.x,a.position.y),this.context.lineWidth=2,this.context.stroke(),this.context.closePath(),this.line("ID: "+a.id+" Active: "+a.active),this.line("World X: "+a.worldX+" World Y: "+a.worldY),this.line("Screen X: "+a.x+" Screen Y: "+a.y),this.line("Duration: "+a.duration+" ms"),this.line("is Down: "+a.isDown+" is Up: "+a.isUp),this.stop()))},spriteInputInfo:function(a,b,c,d){this.start(b,c,d),this.line("Sprite Input: ("+a.width+" x "+a.height+")"),this.line("x: "+a.input.pointerX().toFixed(1)+" y: "+a.input.pointerY().toFixed(1)),this.line("over: "+a.input.pointerOver()+" duration: "+a.input.overDuration().toFixed(0)),this.line("down: "+a.input.pointerDown()+" duration: "+a.input.downDuration().toFixed(0)),this.line("just over: "+a.input.justOver()+" just out: "+a.input.justOut()),this.stop()},key:function(a,b,c,d){this.start(b,c,d,150),this.line("Key:",a.keyCode,"isDown:",a.isDown),this.line("justPressed:",a.justPressed(),"justReleased:",a.justReleased()),this.line("Time Down:",a.timeDown.toFixed(0),"duration:",a.duration.toFixed(0)),this.stop()},inputInfo:function(a,b,c){this.start(a,b,c),this.line("Input"),this.line("X: "+this.game.input.x+" Y: "+this.game.input.y),this.line("World X: "+this.game.input.worldX+" World Y: "+this.game.input.worldY),this.line("Scale X: "+this.game.input.scale.x.toFixed(1)+" Scale Y: "+this.game.input.scale.x.toFixed(1)),this.line("Screen X: "+this.game.input.activePointer.screenX+" Screen Y: "+this.game.input.activePointer.screenY),this.stop()},spriteBounds:function(a,b,c){var d=a.getBounds();d.x+=this.game.camera.x,d.y+=this.game.camera.y,this.rectangle(d,b,c)},spriteInfo:function(a,b,c,d){this.start(b,c,d),this.line("Sprite: ("+a.width+" x "+a.height+") anchor: "+a.anchor.x+" x "+a.anchor.y),this.line("x: "+a.x.toFixed(1)+" y: "+a.y.toFixed(1)),this.line("angle: "+a.angle.toFixed(1)+" rotation: "+a.rotation.toFixed(1)),this.line("visible: "+a.visible+" in camera: "+a.inCamera),this.stop()},spriteCoords:function(a,b,c,d){this.start(b,c,d,100),a.name&&this.line(a.name),this.line("x:",a.x.toFixed(2),"y:",a.y.toFixed(2)),this.line("pos x:",a.position.x.toFixed(2),"pos y:",a.position.y.toFixed(2)),this.line("world x:",a.world.x.toFixed(2),"world y:",a.world.y.toFixed(2)),this.stop()},lineInfo:function(a,b,c,d){this.start(b,c,d,80),this.line("start.x:",a.start.x.toFixed(2),"start.y:",a.start.y.toFixed(2)),this.line("end.x:",a.end.x.toFixed(2),"end.y:",a.end.y.toFixed(2)),this.line("length:",a.length.toFixed(2),"angle:",a.angle),this.stop()},pixel:function(a,b,c,d){d=d||2,this.start(),this.context.fillStyle=c,this.context.fillRect(a,b,d,d),this.stop()},geom:function(a,c,d,e){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=0),c=c||"rgba(0,255,0,0.4)",this.start(),this.context.fillStyle=c,this.context.strokeStyle=c,a instanceof b.Rectangle||1===e?d?this.context.fillRect(a.x-this.game.camera.x,a.y-this.game.camera.y,a.width,a.height):this.context.strokeRect(a.x-this.game.camera.x,a.y-this.game.camera.y,a.width,a.height):a instanceof b.Circle||2===e?(this.context.beginPath(),this.context.arc(a.x-this.game.camera.x,a.y-this.game.camera.y,a.radius,0,2*Math.PI,!1),this.context.closePath(),d?this.context.fill():this.context.stroke()):a instanceof b.Point||3===e?this.context.fillRect(a.x-this.game.camera.x,a.y-this.game.camera.y,4,4):(a instanceof b.Line||4===e)&&(this.context.lineWidth=1,this.context.beginPath(),this.context.moveTo(a.start.x+.5-this.game.camera.x,a.start.y+.5-this.game.camera.y),this.context.lineTo(a.end.x+.5-this.game.camera.x,a.end.y+.5-this.game.camera.y),this.context.closePath(),this.context.stroke()),this.stop()},rectangle:function(a,b,c){"undefined"==typeof c&&(c=!0),b=b||"rgba(0, 255, 0, 0.4)",this.start(),c?(this.context.fillStyle=b,this.context.fillRect(a.x-this.game.camera.x,a.y-this.game.camera.y,a.width,a.height)):(this.context.strokeStyle=b,this.context.strokeRect(a.x-this.game.camera.x,a.y-this.game.camera.y,a.width,a.height)),this.stop()},text:function(a,b,c,d,e){d=d||"rgb(255,255,255)",e=e||"16px Courier",this.start(),this.context.font=e,this.renderShadow&&(this.context.fillStyle="rgb(0,0,0)",this.context.fillText(a,b+1,c+1)),this.context.fillStyle=d,this.context.fillText(a,b,c),this.stop()},quadTree:function(a,b){b=b||"rgba(255,0,0,0.3)",this.start();var c=a.bounds;if(0===a.nodes.length){this.context.strokeStyle=b,this.context.strokeRect(c.x,c.y,c.width,c.height),this.text("size: "+a.objects.length,c.x+4,c.y+16,"rgb(0,200,0)","12px Courier"),this.context.strokeStyle="rgb(0,255,0)";for(var d=0;d<a.objects.length;d++)this.context.strokeRect(a.objects[d].x,a.objects[d].y,a.objects[d].width,a.objects[d].height)}else for(var d=0;d<a.nodes.length;d++)this.quadTree(a.nodes[d]);this.stop()},body:function(a,c,d){a.body&&a.body.type===b.Physics.ARCADE&&(this.start(),b.Physics.Arcade.Body.render(this.context,a.body,c,d),this.stop())},bodyInfo:function(a,c,d,e){a.body&&a.body.type===b.Physics.ARCADE&&(this.start(c,d,e,210),b.Physics.Arcade.Body.renderBodyInfo(this,a.body),this.stop())}},b.Utils.Debug.prototype.constructor=b.Utils.Debug,b.Color={getColor32:function(a,b,c,d){return a<<24|b<<16|c<<8|d},getColor:function(a,b,c){return a<<16|b<<8|c},hexToRGB:function(a){var b="#"==a.charAt(0)?a.substring(1,7):a;3==b.length&&(b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2));var c=parseInt(b.substring(0,2),16),d=parseInt(b.substring(2,4),16),e=parseInt(b.substring(4,6),16);return c<<16|d<<8|e},getColorInfo:function(a){var c=b.Color.getRGB(a),d=b.Color.RGBtoHSV(a),e=b.Color.RGBtoHexstring(a)+"\n";return e=e.concat("Alpha: "+c.alpha+" Red: "+c.red+" Green: "+c.green+" Blue: "+c.blue)+"\n",e=e.concat("Hue: "+d.hue+" Saturation: "+d.saturation+" Lightnes: "+d.lightness)},RGBtoHexstring:function(a){var c=b.Color.getRGB(a);return"0x"+b.Color.colorToHexstring(c.alpha)+b.Color.colorToHexstring(c.red)+b.Color.colorToHexstring(c.green)+b.Color.colorToHexstring(c.blue)},RGBtoWebstring:function(a){var c=b.Color.getRGB(a);return"#"+b.Color.colorToHexstring(c.red)+b.Color.colorToHexstring(c.green)+b.Color.colorToHexstring(c.blue)},colorToHexstring:function(a){var b="0123456789ABCDEF",c=a%16,d=(a-c)/16,e=b.charAt(d)+b.charAt(c);return e},interpolateColor:function(a,c,d,e,f){"undefined"==typeof f&&(f=255);var g=b.Color.getRGB(a),h=b.Color.getRGB(c),i=(h.red-g.red)*e/d+g.red,j=(h.green-g.green)*e/d+g.green,k=(h.blue-g.blue)*e/d+g.blue;return b.Color.getColor32(f,i,j,k)},interpolateColorWithRGB:function(a,c,d,e,f,g){var h=b.Color.getRGB(a),i=(c-h.red)*g/f+h.red,j=(d-h.green)*g/f+h.green,k=(e-h.blue)*g/f+h.blue;return b.Color.getColor(i,j,k)},interpolateRGB:function(a,c,d,e,f,g,h,i){var j=(e-a)*i/h+a,k=(f-c)*i/h+c,l=(g-d)*i/h+d;return b.Color.getColor(j,k,l)},getRandomColor:function(a,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof c&&(c=255),"undefined"==typeof d&&(d=255),c>255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){if(a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA)this.ninja=new b.Physics.Ninja(this.game);else{if(a===b.Physics.BOX2D&&null===this.box2d)throw new Error("The Box2D physics system has not been implemented yet.");if(a===b.Physics.CHIPMUNK&&null===this.chipmunk)throw new Error("The Chipmunk physics system has not been implemented yet.")}},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},b.Physics.Arcade.prototype.constructor=b.Physics.Arcade,b.Physics.Arcade.prototype={setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},enable:function(a,c){"undefined"==typeof c&&(c=!0);var d=1;if(Array.isArray(a))for(d=a.length;d--;)a[d]instanceof b.Group?this.enable(a[d].children,c):(this.enableBody(a[d]),c&&a[d].hasOwnProperty("children")&&a[d].children.length>0&&this.enable(a[d],!0));else a instanceof b.Group?this.enable(a.children,c):(this.enableBody(a),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,!0))},enableBody:function(a){a.hasOwnProperty("body")&&null===a.body&&(a.body=new b.Physics.Arcade.Body(a))},updateMotion:function(a){this._velocityDelta=this.computeVelocity(0,a,a.angularVelocity,a.angularAcceleration,a.angularDrag,a.maxAngular)-a.angularVelocity,a.angularVelocity+=this._velocityDelta,a.rotation+=a.angularVelocity*this.game.time.physicsElapsed,a.velocity.x=this.computeVelocity(1,a,a.velocity.x,a.acceleration.x,a.drag.x,a.maxVelocity.x),a.velocity.y=this.computeVelocity(2,a,a.velocity.y,a.acceleration.y,a.drag.y,a.maxVelocity.y)},computeVelocity:function(a,b,c,d,e,f){return f=f||1e4,1==a&&b.allowGravity?c+=(this.gravity.x+b.gravity.x)*this.game.time.physicsElapsed:2==a&&b.allowGravity&&(c+=(this.gravity.y+b.gravity.y)*this.game.time.physicsElapsed),d?c+=d*this.game.time.physicsElapsed:e&&(this._drag=e*this.game.time.physicsElapsed,c-this._drag>0?c-=this._drag:c+this._drag<0?c+=this._drag:c=0),c>f?c=f:-f>c&&(c=-f),c},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,c,d,e,f,g){return"undefined"!=typeof c||a.type!==b.GROUP&&a.type!==b.EMITTER?void(a&&c&&a.exists&&c.exists&&(a.type==b.SPRITE||a.type==b.TILESPRITE?c.type==b.SPRITE||c.type==b.TILESPRITE?this.collideSpriteVsSprite(a,c,d,e,f,g):c.type==b.GROUP||c.type==b.EMITTER?this.collideSpriteVsGroup(a,c,d,e,f,g):c.type==b.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,c,d,e,f):a.type==b.GROUP?c.type==b.SPRITE||c.type==b.TILESPRITE?this.collideSpriteVsGroup(c,a,d,e,f,g):c.type==b.GROUP||c.type==b.EMITTER?this.collideGroupVsGroup(a,c,d,e,f,g):c.type==b.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,c,d,e,f):a.type==b.TILEMAPLAYER?c.type==b.SPRITE||c.type==b.TILESPRITE?this.collideSpriteVsTilemapLayer(c,a,d,e,f):(c.type==b.GROUP||c.type==b.EMITTER)&&this.collideGroupVsTilemapLayer(c,a,d,e,f):a.type==b.EMITTER&&(c.type==b.SPRITE||c.type==b.TILESPRITE?this.collideSpriteVsGroup(c,a,d,e,f,g):c.type==b.GROUP||c.type==b.EMITTER?this.collideGroupVsGroup(a,c,d,e,f,g):c.type==b.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,c,d,e,f)))):void this.collideGroupVsSelf(a,d,e,f,g)},collideSpriteVsSprite:function(a,b,c,d,e,f){return a.body&&b.body?(this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++),!0):!1},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;f<this._mapData.length;f++)this.separateTile(f,a.body,this._mapData[f])&&(d?d.call(e,a,this._mapData[f])&&(this._total++,c&&c.call(e,a,this._mapData[f])):(this._total++,c&&c.call(e,a,this._mapData[f])))},collideGroupVsTilemapLayer:function(a,b,c,d,e){if(0!==a.length)for(var f=0,g=a.children.length;g>f;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)<Math.abs(this.gravity.x+a.gravity.x)?this.separateX(a,b,e)||this.separateY(a,b,e):this.separateY(a,b,e)||this.separateX(a,b,e),this._result):!1},intersects:function(a,b){return a.right<=b.position.x?!1:a.bottom<=b.position.y?!1:a.position.x>=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()<b.deltaX()&&(this._overlap=a.x-b.width-b.x,-this._overlap>this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()<b.deltaY()&&(this._overlap=a.y-b.bottom,-this._overlap>this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()<b.deltaAbsY()&&(g=-1),0!==b.deltaX()&&0!==b.deltaY()&&(c.faceLeft||c.faceRight)&&(c.faceTop||c.faceBottom)&&(f=Math.min(Math.abs(b.position.x-c.right),Math.abs(b.right-c.left)),g=Math.min(Math.abs(b.position.y-c.bottom),Math.abs(b.bottom-c.top))),g>f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x<b.right&&(c=a.x-b.right,c<-this.TILE_BIAS&&(c=0)):a.deltaX()>0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y<b.bottom&&(c=a.y-b.bottom,c<-this.TILE_BIAS&&(c=0)):a.deltaY()>0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this.phase=0,this._reset=!0,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);(a!==this._sx||b!==this._sy)&&(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this._reset=!0)},preUpdate:function(){this.phase=1,this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.updateBounds(),this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this._reset||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds()),this._dx=this.deltaX(),this._dy=this.deltaY(),this._reset=!1},postUpdate:function(){this.phase=2,this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.x<this.game.physics.arcade.bounds.x&&this.game.physics.arcade.checkCollision.left?(this.position.x=this.game.physics.arcade.bounds.x,this.velocity.x*=-this.bounce.x,this.blocked.left=!0):this.right>this.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.y<this.game.physics.arcade.bounds.y&&this.game.physics.arcade.checkCollision.up?(this.position.y=this.game.physics.arcade.bounds.y,this.velocity.y*=-this.bounce.y,this.blocked.up=!0):this.bottom>this.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0) },setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"deltaX: "+b._dx.toFixed(2),"deltaY: "+b._dy.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter<this._quantity);this.on=!1}else this.game.time.now>=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(a<this.worldX||b<this.worldY||a>this.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.faceTop||this.faceBottom||this.faceLeft||this.faceRight||this.collisionCallback:a?this.collideLeft||this.collideRight||this.collideUp||this.collideDown:b?this.faceTop||this.faceBottom||this.faceLeft||this.faceRight:!1},copy:function(a){this.index=a.index,this.alpha=a.alpha,this.properties=a.properties,this.collideUp=a.collideUp,this.collideDown=a.collideDown,this.collideLeft=a.collideLeft,this.collideRight=a.collideRight,this.collisionCallback=a.collisionCallback,this.collisionCallbackContext=a.collisionCallbackContext}},b.Tile.prototype.constructor=b.Tile,Object.defineProperty(b.Tile.prototype,"collides",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}}),Object.defineProperty(b.Tile.prototype,"canCollide",{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}}),Object.defineProperty(b.Tile.prototype,"left",{get:function(){return this.worldX}}),Object.defineProperty(b.Tile.prototype,"right",{get:function(){return this.worldX+this.width}}),Object.defineProperty(b.Tile.prototype,"top",{get:function(){return this.worldY}}),Object.defineProperty(b.Tile.prototype,"bottom",{get:function(){return this.worldY+this.height}}),b.Tilemap=function(a,c,d,e,f,g){this.game=a,this.key=c;var h=b.TilemapParser.parse(this.game,c,d,e,f,g);null!==h&&(this.width=h.width,this.height=h.height,this.tileWidth=h.tileWidth,this.tileHeight=h.tileHeight,this.orientation=h.orientation,this.version=h.version,this.properties=h.properties,this.widthInPixels=h.widthInPixels,this.heightInPixels=h.heightInPixels,this.layers=h.layers,this.tilesets=h.tilesets,this.tiles=h.tiles,this.objects=h.objects,this.collideIndexes=[],this.collision=h.collision,this.images=h.images,this.currentLayer=0,this.debugMap=[],this._results=[],this._tempA=0,this._tempB=0)},b.Tilemap.CSV=0,b.Tilemap.TILED_JSON=1,b.Tilemap.prototype={create:function(a,b,c,d,e,f){return"undefined"==typeof f&&(f=this.game.world),this.width=b,this.height=c,this.setTileSize(d,e),this.layers.length=0,this.createBlankLayer(a,b,c,d,e,f)},setTileSize:function(a,b){this.tileWidth=a,this.tileHeight=b,this.widthInPixels=this.width*a,this.heightInPixels=this.height*b},addTilesetImage:function(a,c,d,e,f,g,h){if("undefined"==typeof d&&(d=this.tileWidth),"undefined"==typeof e&&(e=this.tileHeight),"undefined"==typeof f&&(f=0),"undefined"==typeof g&&(g=0),"undefined"==typeof h&&(h=0),0===d&&(d=32),0===e&&(e=32),"undefined"==typeof c){if("string"!=typeof a)return null;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),this.tilesets[a])return this.tilesets[a].setImage(this.game.cache.getImage(c)),this.tilesets[a];var i=new b.Tileset(c,h,d,e,f,g,{});i.setImage(this.game.cache.getImage(c)),this.tilesets.push(i);for(var j=this.tilesets.length-1,k=f,l=f,m=0,n=0,o=0,p=h;p<h+i.total&&(this.tiles[p]=[k,l,j],k+=d+g,m++,m!==i.total)&&(n++,n!==i.columns||(k=f,l+=e+g,n=0,o++,o!==i.rows));p++);return i},createFromObjects:function(a,c,d,e,f,g,h,i,j){if("undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!1),"undefined"==typeof h&&(h=this.game.world),"undefined"==typeof i&&(i=b.Sprite),"undefined"==typeof j&&(j=!0),!this.objects[a])return void console.warn("Tilemap.createFromObjects: Invalid objectgroup name given: "+a);for(var k,l=0,m=this.objects[a].length;m>l;l++)if(this.objects[a][l].gid===c){k=new i(this.game,this.objects[a][l].x,this.objects[a][l].y,d,e),k.name=this.objects[a][l].name,k.visible=this.objects[a][l].visible,k.autoCull=g,k.exists=f,j&&(k.y-=k.height),h.add(k);for(var n in this.objects[a][l].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;c<a.length;c++)if(a[c].name===b)return c;return null},getLayerIndex:function(a){return this.getIndex(this.layers,a)},getTilesetIndex:function(a){return this.getIndex(this.tilesets,a)},getImageIndex:function(a){return this.getIndex(this.images,a)},getObjectIndex:function(a){return this.getIndex(this.objects,a)},setTileIndexCallback:function(a,b,c,d){if(d=this.getLayer(d),"number"==typeof a)this.layers[d].callbacks[a]={callback:b,callbackContext:c};else for(var e=0,f=a.length;f>e;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;h<this._results.length;h++)this._results[h].setCollisionCallback(e,f)},setCollision:function(a,b,c){if("undefined"==typeof b&&(b=!0),c=this.getLayer(c),"number"==typeof a)return this.setCollisionByIndex(a,b,c,!0);for(var d=0,e=a.length;e>d;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;f<this.layers[c].height;f++)for(var g=0;g<this.layers[c].width;g++){var h=this.layers[c].data[f][g];h&&h.index===a&&(b?h.setCollision(!0,!0,!0,!0):h.resetCollision(),h.faceTop=b,h.faceBottom=b,h.faceLeft=b,h.faceRight=b)}return d&&this.calculateFaces(c),c},getLayer:function(a){return"undefined"==typeof a?a=this.currentLayer:"string"==typeof a?a=this.getLayerIndex(a):a instanceof b.TilemapLayer&&(a=a.index),a},calculateFaces:function(a){for(var b=null,c=null,d=null,e=null,f=0,g=this.layers[a].height;g>f;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c<this.layers[a].height-1?this.layers[a].data[c+1][b]:null},getTileLeft:function(a,b,c){return b>0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b<this.layers[a].width-1?this.layers[a].data[c][b+1]:null},setLayer:function(a){a=this.getLayer(a),this.layers[a]&&(this.currentLayer=a)},hasTile:function(a,b,c){return null!==this.layers[c].data[b]&&null!==this.layers[c].data[b][a]},putTile:function(a,c,d,e){if(e=this.getLayer(e),c>=0&&c<this.layers[e].width&&d>=0&&d<this.layers[e].height){var f;return a instanceof b.Tile?(f=a.index,this.hasTile(c,d,e)?this.layers[e].data[d][c].copy(a):this.layers[e].data[d][c]=new b.Tile(e,f,c,d,a.width,a.height)):(f=a,this.hasTile(c,d,e)?this.layers[e].data[d][c].index=f:this.layers[e].data[d][c]=new b.Tile(this.layers[e],f,c,d,this.tileWidth,this.tileHeight)),this.collideIndexes.indexOf(f)>-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a<this.layers[c].width&&b>=0&&b<this.layers[c].height?this.layers[c].data[b][a]:void 0},getTileWorldXY:function(a,b,c,d,e){return"undefined"==typeof c&&(c=this.tileWidth),"undefined"==typeof d&&(d=this.tileHeight),e=this.getLayer(e),a=this.game.math.snapToFloor(a,c)/c,b=this.game.math.snapToFloor(b,d)/d,this.getTile(a,b,e)},copy:function(a,b,c,d,e){if(e=this.getLayer(e),!this.layers[e])return void(this._results.length=0);"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.layers[e].width),"undefined"==typeof d&&(d=this.layers[e].height),0>a&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g<c.length;g++)this.layers[d].data[f+c[g].y][e+c[g].x].copy(c[g]);this.layers[d].dirty=!0,this.calculateFaces(d)}},swap:function(a,b,c,d,e,f,g){g=this.getLayer(g),this.copy(c,d,e,f,g),this._results.length<2||(this._tempA=a,this._tempB=b,this._results.forEach(this.swapHandler,this),this.paste(c,d,this._results,g))},swapHandler:function(a,b){a.index===this._tempA&&(this._results[b].index=this._tempB),a.index===this._tempB&&(this._results[b].index=this._tempA)},forEach:function(a,b,c,d,e,f,g){g=this.getLayer(g),this.copy(c,d,e,f,g),this._results.length<2||(this._results.forEach(a,b),this.paste(c,d,this._results,g))},replace:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(c,d,e,f,g),!(this._results.length<2)){for(var h=1;h<this._results.length;h++)this._results[h].index===a&&(this._results[h].index=b);this.paste(c,d,this._results,g)}},random:function(a,b,c,d,e){if(e=this.getLayer(e),this.copy(a,b,c,d,e),!(this._results.length<2)){for(var f=[],g=1;g<this._results.length;g++)if(this._results[g].index){var h=this._results[g].index;-1===f.indexOf(h)&&f.push(h)}for(var i=1;i<this._results.length;i++)this._results[i].index=this.game.rnd.pick(f);this.paste(a,b,this._results,e)}},shuffle:function(a,c,d,e,f){if(f=this.getLayer(f),this.copy(a,c,d,e,f),!(this._results.length<2)){for(var g=[],h=1;h<this._results.length;h++)this._results[h].index&&g.push(this._results[h].index);b.Utils.shuffle(g);for(var i=1;i<this._results.length;i++)this._results[i].index=g[i-1];this.paste(a,c,this._results,f)}},fill:function(a,b,c,d,e,f){if(f=this.getLayer(f),this.copy(b,c,d,e,f),!(this._results.length<2)){for(var g=1;g<this._results.length;g++)this._results[g].index=a;this.paste(b,c,this._results,f)}},removeAllLayers:function(){this.layers.length=0,this.currentLayer=0},dump:function(){for(var a="",b=[""],c=0;c<this.layers[this.currentLayer].height;c++){for(var d=0;d<this.layers[this.currentLayer].width;d++)a+="%c ",b.push(this.layers[this.currentLayer].data[c][d]>1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;i<e.length;i++)for(var j=0;g>j;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;g<this._mc.ty+this._mc.th;g++)for(var h=this._mc.tx;h<this._mc.tx+this._mc.tw;h++)this.layer.data[g]&&this.layer.data[g][h]&&(!e&&!f||this.layer.data[g][h].isInteresting(e,f))&&this._results.push(this.layer.data[g][h]);return this._results},b.TilemapLayer.prototype.updateMax=function(){this._mc.maxX=this.game.math.ceil(this.canvas.width/this.map.tileWidth)+1,this._mc.maxY=this.game.math.ceil(this.canvas.height/this.map.tileHeight)+1,this.layer&&(this._mc.maxX>this.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;k<h.length;k++){g[k]=[];for(var l=h[k].split(","),m=0;m<l.length;m++)g[k][m]=new b.Tile(0,parseInt(l[m],10),m,k,d,e);0===j&&(j=l.length)}return f.name=a,f.width=j,f.height=i,f.tileWidth=d,f.tileHeight=e,f.widthInPixels=j*d,f.heightInPixels=i*e,f.layers[0].width=j,f.layers[0].height=i,f.layers[0].widthInPixels=f.widthInPixels,f.layers[0].heightInPixels=f.heightInPixels,f.layers[0].data=g,f},getEmptyData:function(a,b,c,d){var e={};e.width=0,e.height=0,e.tileWidth=0,e.tileHeight=0,"undefined"!=typeof a&&null!==a&&(e.tileWidth=a),"undefined"!=typeof b&&null!==b&&(e.tileHeight=b),"undefined"!=typeof c&&null!==c&&(e.width=c),"undefined"!=typeof d&&null!==d&&(e.height=d),e.orientation="orthogonal",e.version="1",e.properties={},e.widthInPixels=0,e.heightInPixels=0;var f=[],g={name:"layer",x:0,y:0,width:0,height:0,widthInPixels:0,heightInPixels:0,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],data:[]};return f.push(g),e.layers=f,e.images=[],e.objects={},e.collision={},e.tilesets=[],e.tiles=[],e},parseTiledJSON:function(a){if("orthogonal"!==a.orientation)return console.warn("TilemapParser.parseTiledJSON: Only orthogonal map types are supported in this version of Phaser"),null;var c={};c.width=a.width,c.height=a.height,c.tileWidth=a.tilewidth,c.tileHeight=a.tileheight,c.orientation=a.orientation,c.version=a.version,c.properties=a.properties,c.widthInPixels=c.width*c.tileWidth,c.heightInPixels=c.height*c.tileHeight;for(var d=[],e=0;e<a.layers.length;e++)if("tilelayer"===a.layers[e].type){var f={name:a.layers[e].name,x:a.layers[e].x,y:a.layers[e].y,width:a.layers[e].width,height:a.layers[e].height,widthInPixels:a.layers[e].width*a.tilewidth,heightInPixels:a.layers[e].height*a.tileheight,alpha:a.layers[e].opacity,visible:a.layers[e].visible,properties:{},indexes:[],callbacks:[],bodies:[]};a.layers[e].properties&&(f.properties=a.layers[e].properties); for(var g=0,h=[],i=[],j=0,k=a.layers[e].data.length;k>j;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;e<a.layers.length;e++)if("imagelayer"===a.layers[e].type){var m={name:a.layers[e].name,image:a.layers[e].image,x:a.layers[e].x,y:a.layers[e].y,alpha:a.layers[e].opacity,visible:a.layers[e].visible,properties:{}};a.layers[e].properties&&(m.properties=a.layers[e].properties),l.push(m)}c.images=l;for(var n=[],e=0;e<a.tilesets.length;e++){var o=a.tilesets[e],p=new b.Tileset(o.name,o.firstgid,o.tilewidth,o.tileheight,o.margin,o.spacing,o.properties);o.tileproperties&&(p.tileProperties=o.tileproperties),p.rows=Math.round((o.imageheight-o.margin)/(o.tileheight+o.spacing)),p.columns=Math.round((o.imagewidth-o.margin)/(o.tilewidth+o.spacing)),p.total=p.rows*p.columns,p.rows%1!==0||p.columns%1!==0?console.warn("TileSet image dimensions do not match expected dimensions. Tileset width/height must be evenly divisible by Tilemap tile width/height."):n.push(p)}c.tilesets=n;for(var q={},r={},e=0;e<a.layers.length;e++)if("objectgroup"===a.layers[e].type){q[a.layers[e].name]=[],r[a.layers[e].name]=[];for(var s=0,k=a.layers[e].objects.length;k>s;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u<a.layers[e].objects[s].polyline.length;u++)t.polyline.push([a.layers[e].objects[s].polyline[u].x,a.layers[e].objects[s].polyline[u].y]);r[a.layers[e].name].push(t)}}c.objects=q,c.collision=r,c.tiles=[];for(var e=0;e<c.tilesets.length;e++)for(var o=c.tilesets[e],g=o.tileMargin,v=o.tileMargin,w=0,x=0,y=0,j=o.firstgid;j<o.firstgid+o.total&&(c.tiles[j]=[g,v,e],g+=o.tileWidth+o.tileSpacing,w++,w!==o.total)&&(x++,x!==o.columns||(g=o.tileMargin,v+=o.tileHeight+o.tileSpacing,x=0,y++,y!==o.rows));j++);return c}},b.Tileset=function(a,b,c,d,e,f,g){("undefined"==typeof c||0>=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e<this.rows;e++){for(var f=0;f<this.columns;f++)this.drawCoords[d]=[b,c],b+=this.tileWidth+this.tileSpacing,d++;b=this.tileMargin,c+=this.tileHeight+this.tileSpacing}},setSpacing:function(a,b){this.tileMargin=a,this.tileSpacing=b,this.setImage(this.image)}},b.Tileset.prototype.constructor=b.Tileset,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.Phaser=b):"undefined"!=typeof define&&define.amd?define("Phaser",function(){return a.Phaser=b}()):a.Phaser=b}.call(this),Phaser.Physics.Ninja=function(a){this.game=a,this.time=this.game.time,this.gravity=.2,this.bounds=new Phaser.Rectangle(0,0,a.world.width,a.world.height),this.maxObjects=10,this.maxLevels=4,this.quadTree=new Phaser.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels)},Phaser.Physics.Ninja.prototype.constructor=Phaser.Physics.Ninja,Phaser.Physics.Ninja.prototype={enableAABB:function(a,b){this.enable(a,1,0,0,b)},enableCircle:function(a,b,c){this.enable(a,2,0,b,c)},enableTile:function(a,b,c){this.enable(a,3,b,0,c)},enable:function(a,b,c,d,e){if("undefined"==typeof b&&(b=1),"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=!0),Array.isArray(a))for(var f=a.length;f--;)a[f]instanceof Phaser.Group?this.enable(a[f].children,b,c,d,e):(this.enableBody(a[f],b,c,d),e&&a[f].hasOwnProperty("children")&&a[f].children.length>0&&this.enable(a[f],b,c,d,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c,d,e):(this.enableBody(a,b,c,d),e&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,c,d,!0))},enableBody:function(a,b,c,d){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.Ninja.Body(this,a,b,c,d),a.anchor.set(.5))},setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c){b=a.getLayer(b),this.clearTilemapLayerBodies(a,b);for(var d=0,e=a.layers[b].height;e>d;d++)for(var f=0,g=a.layers[b].width;g>f;f++){var h=a.layers[b].data[d][f];if(h&&c.hasOwnProperty(h.index)){var i=new Phaser.Physics.Ninja.Body(this,null,3,c[h.index],0,h.worldX+h.centerX,h.worldY+h.centerY,h.width,h.height);a.layers[b].bodies.push(i)}}return a.layers[b].bodies},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,b,c,d,e,f){return"undefined"!=typeof b||a.type!==Phaser.GROUP&&a.type!==Phaser.EMITTER?void(a&&b&&a.exists&&b.exists&&(a.type==Phaser.SPRITE||a.type==Phaser.TILESPRITE?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsSprite(a,b,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideSpriteVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,c,d,e):a.type==Phaser.GROUP?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e):a.type==Phaser.TILEMAPLAYER?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,c,d,e):(b.type==Phaser.GROUP||b.type==Phaser.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,c,d,e):a.type==Phaser.EMITTER&&(b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e)))):void this.collideGroupVsSelf(a,c,d,e,f)},collideSpriteVsSprite:function(a,b,c,d,e,f){this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++)},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length)for(var g=0,h=b.children.length;h>g;g++)b.children[g].exists&&b.children[g].body&&this.separate(a.body,b.children[g].body,d,e,f)&&(c&&c.call(e,a,b.children[g]),this._total++)},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},separate:function(a,b){return a.type!==Phaser.Physics.NINJA||b.type!==Phaser.Physics.NINJA?!1:a.aabb&&b.aabb?a.aabb.collideAABBVsAABB(b.aabb):a.aabb&&b.tile?a.aabb.collideAABBVsTile(b.tile):a.tile&&b.aabb?b.aabb.collideAABBVsTile(a.tile):a.circle&&b.tile?a.circle.collideCircleVsTile(b.tile):a.tile&&b.circle?b.circle.collideCircleVsTile(a.tile):void 0}},Phaser.Physics.Ninja.Body=function(a,b,c,d,e,f,g,h,i){b=b||null,"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=16),this.sprite=b,this.game=a.game,this.type=Phaser.Physics.NINJA,this.system=a,this.aabb=null,this.tile=null,this.circle=null,this.shape=null,this.drag=1,this.friction=.05,this.gravityScale=1,this.bounce=.3,this.velocity=new Phaser.Point,this.facing=Phaser.NONE,this.immovable=!1,this.collideWorldBounds=!0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.maxSpeed=8,b&&(f=b.x,g=b.y,h=b.width,i=b.height,0===b.anchor.x&&(f+=.5*b.width),0===b.anchor.y&&(g+=.5*b.height)),1===c?(this.aabb=new Phaser.Physics.Ninja.AABB(this,f,g,h,i),this.shape=this.aabb):2===c?(this.circle=new Phaser.Physics.Ninja.Circle(this,f,g,e),this.shape=this.circle):3===c&&(this.tile=new Phaser.Physics.Ninja.Tile(this,f,g,h,i,d),this.shape=this.tile)},Phaser.Physics.Ninja.Body.prototype={preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.shape.integrate(),this.collideWorldBounds&&this.shape.collideWorldBounds()},postUpdate:function(){this.sprite&&(this.sprite.type===Phaser.TILESPRITE?(this.sprite.x=this.shape.pos.x-this.shape.xw,this.sprite.y=this.shape.pos.y-this.shape.yw):(this.sprite.x=this.shape.pos.x,this.sprite.y=this.shape.pos.y)),this.velocity.x<0?this.facing=Phaser.LEFT:this.velocity.x>0&&(this.facing=Phaser.RIGHT),this.velocity.y<0?this.facing=Phaser.UP:this.velocity.y>0&&(this.facing=Phaser.DOWN)},setZeroVelocity:function(){this.shape.oldpos.x=this.shape.pos.x,this.shape.oldpos.y=this.shape.pos.y},moveTo:function(a,b){var c=a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveFrom:function(a,b){var c=-a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveLeft:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveRight:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveUp:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},moveDown:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},reset:function(){this.velocity.set(0),this.shape.pos.x=this.sprite.x,this.shape.pos.y=this.sprite.y,this.shape.oldpos.copyFrom(this.shape.pos)},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.shape.pos.x-this.shape.oldpos.x},deltaY:function(){return this.shape.pos.y-this.shape.oldpos.y},destroy:function(){this.sprite=null,this.system=null,this.aabb=null,this.tile=null,this.circle=null,this.shape.destroy(),this.shape=null}},Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"x",{get:function(){return this.shape.pos.x},set:function(a){this.shape.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"y",{get:function(){return this.shape.pos.y},set:function(a){this.shape.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"width",{get:function(){return this.shape.width}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"height",{get:function(){return this.shape.height}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"bottom",{get:function(){return this.shape.pos.y+this.shape.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"right",{get:function(){return this.shape.pos.x+this.shape.xw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"speed",{get:function(){return Math.sqrt(this.shape.velocity.x*this.shape.velocity.x+this.shape.velocity.y*this.shape.velocity.y)}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"angle",{get:function(){return Math.atan2(this.shape.velocity.y,this.shape.velocity.x)}}),Phaser.Physics.Ninja.AABB=function(a,b,c,d,e){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.aabbTileProjections={},this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projAABB_Full,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projAABB_45Deg,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projAABB_Concave,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projAABB_Convex,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projAABB_22DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projAABB_22DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projAABB_67DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projAABB_67DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projAABB_Half},Phaser.Physics.Ninja.AABB.prototype.constructor=Phaser.Physics.Ninja.AABB,Phaser.Physics.Ninja.AABB.COL_NONE=0,Phaser.Physics.Ninja.AABB.COL_AXIS=1,Phaser.Physics.Ninja.AABB.COL_OTHER=2,Phaser.Physics.Ninja.AABB.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},reverse:function(){var a=this.pos.x-this.oldpos.x,b=this.pos.y-this.oldpos.y;this.oldpos.x<this.pos.x?this.oldpos.x=this.pos.x+a:this.oldpos.x>this.pos.x&&(this.oldpos.x=this.pos.x-a),this.oldpos.y<this.pos.y?this.oldpos.y=this.pos.y+b:this.oldpos.y>this.pos.y&&(this.oldpos.y=this.pos.y-b)},reportCollisionVsBody:function(a,b,c,d,e){var f=this.pos.x-this.oldpos.x,g=this.pos.y-this.oldpos.y,h=f*c+g*d;return this.body.immovable&&e.body.immovable?(a*=.5,b*=.5,this.pos.add(a,b),this.oldpos.set(this.pos.x,this.pos.y),e.pos.subtract(a,b),void e.oldpos.set(e.pos.x,e.pos.y)):void(this.body.immovable||e.body.immovable?this.body.immovable?e.body.immovable||(e.pos.subtract(a,b),0>h&&e.reverse()):(this.pos.subtract(a,b),0>h&&this.reverse()):(a*=.5,b*=.5,this.pos.add(a,b),e.pos.subtract(a,b),0>h&&(this.reverse(),e.reverse())))},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideAABBVsAABB:function(a){var b=this.pos,c=a,d=c.pos.x,e=c.pos.y,f=c.xw,g=c.yw,h=b.x-d,i=f+this.xw-Math.abs(h);if(i>0){var j=b.y-e,k=g+this.yw-Math.abs(j);if(k>0){k>i?0>h?(i*=-1,k=0):k=0:0>j?(i=0,k*=-1):i=0;var l=Math.sqrt(i*i+k*k);return this.reportCollisionVsBody(i,k,i/l,k/l,c),Phaser.Physics.Ninja.AABB.COL_AXIS}}return!1},collideAABBVsTile:function(a){var b=this.pos.x-a.pos.x,c=a.xw+this.xw-Math.abs(b);if(c>0){var d=this.pos.y-a.pos.y,e=a.yw+this.yw-Math.abs(d);if(e>0)return e>c?0>b?(c*=-1,e=0):e=0:0>d?(c=0,e*=-1):c=0,this.resolveTile(c,e,this,a)}return!1},resolveTile:function(a,b,c,d){return 0<d.id?this.aabbTileProjections[d.type](a,b,c,d):!1},projAABB_Full:function(a,b,c,d){var e=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/e,b/e,d),Phaser.Physics.Ninja.AABB.COL_AXIS},projAABB_Half:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=g*e+h*f;if(0>i){e*=-i,f*=-i;var j=Math.sqrt(e*e+f*f),k=Math.sqrt(a*a+b*b);return j>k?(c.reportCollisionVsWorld(a,b,a/k,b/k,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(e,f,d.signx,d.signy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_45Deg:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.y-f*c.yw,h=d.pos.y-g;if(h*f>0){var i=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw,h=d.pos.x-g;if(h*e>0){var i=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Convex:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=Math.sqrt(g*g+h*h),j=2*d.xw,k=Math.sqrt(j*j+0),l=k-i;if(0>e*g||0>f*h){var m=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS}return l>0?(g/=i,h/=i,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER):Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Concave:function(a,b,c,d){var e=d.signx,f=d.signy,g=d.pos.x+e*d.xw-(c.pos.x-e*c.xw),h=d.pos.y+f*d.yw-(c.pos.y-f*c.yw),i=2*d.xw,j=Math.sqrt(i*i+0),k=Math.sqrt(g*g+h*h),l=k-j;if(l>0){var m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(g/=k,h/=k,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},destroy:function(){this.body=null,this.system=null}},Phaser.Physics.Ninja.Tile=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Phaser.Physics.Ninja.Tile.EMPTY),this.body=a,this.system=a.system,this.id=f,this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.id>1&&this.id<30&&(e=d),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.velocity=new Phaser.Point,this.signx=0,this.signy=0,this.sx=0,this.sy=0,this.body.gravityScale=0,this.body.collideWorldBounds=!1,this.id>0&&this.setType(this.id)},Phaser.Physics.Ninja.Tile.prototype.constructor=Phaser.Physics.Ninja.Tile,Phaser.Physics.Ninja.Tile.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},setType:function(a){return a===Phaser.Physics.Ninja.Tile.EMPTY?this.clear():(this.id=a,this.updateType()),this},clear:function(){this.id=Phaser.Physics.Ninja.Tile.EMPTY,this.updateType()},destroy:function(){this.body=null,this.system=null},updateType:function(){if(0===this.id)return this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.signx=0,this.signy=0,this.sx=0,this.sy=0,!0;if(this.id<Phaser.Physics.Ninja.Tile.TYPE_45DEG)this.type=Phaser.Physics.Ninja.Tile.TYPE_FULL,this.signx=0,this.signy=0,this.sx=0,this.sy=0;else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_CONCAVE)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_45DEG,this.id==Phaser.Physics.Ninja.Tile.SLOPE_45DEGpn)this.signx=1,this.signy=-1,this.sx=this.signx/Math.SQRT2,this.sy=this.signy/Math.SQRT2;else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_45DEGnn)this.signx=-1,this.signy=-1,this.sx=this.signx/Math.SQRT2,this.sy=this.signy/Math.SQRT2;else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_45DEGnp)this.signx=-1,this.signy=1,this.sx=this.signx/Math.SQRT2,this.sy=this.signy/Math.SQRT2;else{if(this.id!=Phaser.Physics.Ninja.Tile.SLOPE_45DEGpp)return!1;this.signx=1,this.signy=1,this.sx=this.signx/Math.SQRT2,this.sy=this.signy/Math.SQRT2}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_CONVEX)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_CONCAVE,this.id==Phaser.Physics.Ninja.Tile.CONCAVEpn)this.signx=1,this.signy=-1,this.sx=0,this.sy=0;else if(this.id==Phaser.Physics.Ninja.Tile.CONCAVEnn)this.signx=-1,this.signy=-1,this.sx=0,this.sy=0;else if(this.id==Phaser.Physics.Ninja.Tile.CONCAVEnp)this.signx=-1,this.signy=1,this.sx=0,this.sy=0;else{if(this.id!=Phaser.Physics.Ninja.Tile.CONCAVEpp)return!1;this.signx=1,this.signy=1,this.sx=0,this.sy=0}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_22DEGs)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_CONVEX,this.id==Phaser.Physics.Ninja.Tile.CONVEXpn)this.signx=1,this.signy=-1,this.sx=0,this.sy=0;else if(this.id==Phaser.Physics.Ninja.Tile.CONVEXnn)this.signx=-1,this.signy=-1,this.sx=0,this.sy=0;else if(this.id==Phaser.Physics.Ninja.Tile.CONVEXnp)this.signx=-1,this.signy=1,this.sx=0,this.sy=0;else{if(this.id!=Phaser.Physics.Ninja.Tile.CONVEXpp)return!1;this.signx=1,this.signy=1,this.sx=0,this.sy=0}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_22DEGb)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_22DEGs,this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGpnS){this.signx=1,this.signy=-1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGnnS){this.signx=-1,this.signy=-1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGnpS){this.signx=-1,this.signy=1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else{if(this.id!=Phaser.Physics.Ninja.Tile.SLOPE_22DEGppS)return!1;this.signx=1,this.signy=1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_67DEGs)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_22DEGb,this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGpnB){this.signx=1,this.signy=-1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGnnB){this.signx=-1,this.signy=-1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_22DEGnpB){this.signx=-1,this.signy=1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else{if(this.id!=Phaser.Physics.Ninja.Tile.SLOPE_22DEGppB)return!1;this.signx=1,this.signy=1;var a=Math.sqrt(5);this.sx=1*this.signx/a,this.sy=2*this.signy/a}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_67DEGb)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_67DEGs,this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGpnS){this.signx=1,this.signy=-1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGnnS){this.signx=-1,this.signy=-1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGnpS){this.signx=-1,this.signy=1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else{if(this.id!=Phaser.Physics.Ninja.Tile.SLOPE_67DEGppS)return!1;this.signx=1,this.signy=1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.id<Phaser.Physics.Ninja.Tile.TYPE_HALF)if(this.type=Phaser.Physics.Ninja.Tile.TYPE_67DEGb,this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGpnB){this.signx=1,this.signy=-1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGnnB){this.signx=-1,this.signy=-1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.id==Phaser.Physics.Ninja.Tile.SLOPE_67DEGnpB){this.signx=-1,this.signy=1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else{if(this.id!=Phaser.Physics.Ninja.Tile.SLOPE_67DEGppB)return!1;this.signx=1,this.signy=1;var a=Math.sqrt(5);this.sx=2*this.signx/a,this.sy=1*this.signy/a}else if(this.type=Phaser.Physics.Ninja.Tile.TYPE_HALF,this.id==Phaser.Physics.Ninja.Tile.HALFd)this.signx=0,this.signy=-1,this.sx=this.signx,this.sy=this.signy;else if(this.id==Phaser.Physics.Ninja.Tile.HALFu)this.signx=0,this.signy=1,this.sx=this.signx,this.sy=this.signy;else if(this.id==Phaser.Physics.Ninja.Tile.HALFl)this.signx=1,this.signy=0,this.sx=this.signx,this.sy=this.signy;else{if(this.id!=Phaser.Physics.Ninja.Tile.HALFr)return!1;this.signx=-1,this.signy=0,this.sx=this.signx,this.sy=this.signy}}},Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype,"x",{get:function(){return this.pos.x-this.xw},set:function(a){this.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype,"y",{get:function(){return this.pos.y-this.yw},set:function(a){this.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype,"bottom",{get:function(){return this.pos.y+this.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype,"right",{get:function(){return this.pos.x+this.xw}}),Phaser.Physics.Ninja.Tile.EMPTY=0,Phaser.Physics.Ninja.Tile.FULL=1,Phaser.Physics.Ninja.Tile.SLOPE_45DEGpn=2,Phaser.Physics.Ninja.Tile.SLOPE_45DEGnn=3,Phaser.Physics.Ninja.Tile.SLOPE_45DEGnp=4,Phaser.Physics.Ninja.Tile.SLOPE_45DEGpp=5,Phaser.Physics.Ninja.Tile.CONCAVEpn=6,Phaser.Physics.Ninja.Tile.CONCAVEnn=7,Phaser.Physics.Ninja.Tile.CONCAVEnp=8,Phaser.Physics.Ninja.Tile.CONCAVEpp=9,Phaser.Physics.Ninja.Tile.CONVEXpn=10,Phaser.Physics.Ninja.Tile.CONVEXnn=11,Phaser.Physics.Ninja.Tile.CONVEXnp=12,Phaser.Physics.Ninja.Tile.CONVEXpp=13,Phaser.Physics.Ninja.Tile.SLOPE_22DEGpnS=14,Phaser.Physics.Ninja.Tile.SLOPE_22DEGnnS=15,Phaser.Physics.Ninja.Tile.SLOPE_22DEGnpS=16,Phaser.Physics.Ninja.Tile.SLOPE_22DEGppS=17,Phaser.Physics.Ninja.Tile.SLOPE_22DEGpnB=18,Phaser.Physics.Ninja.Tile.SLOPE_22DEGnnB=19,Phaser.Physics.Ninja.Tile.SLOPE_22DEGnpB=20,Phaser.Physics.Ninja.Tile.SLOPE_22DEGppB=21,Phaser.Physics.Ninja.Tile.SLOPE_67DEGpnS=22,Phaser.Physics.Ninja.Tile.SLOPE_67DEGnnS=23,Phaser.Physics.Ninja.Tile.SLOPE_67DEGnpS=24,Phaser.Physics.Ninja.Tile.SLOPE_67DEGppS=25,Phaser.Physics.Ninja.Tile.SLOPE_67DEGpnB=26,Phaser.Physics.Ninja.Tile.SLOPE_67DEGnnB=27,Phaser.Physics.Ninja.Tile.SLOPE_67DEGnpB=28,Phaser.Physics.Ninja.Tile.SLOPE_67DEGppB=29,Phaser.Physics.Ninja.Tile.HALFd=30,Phaser.Physics.Ninja.Tile.HALFr=31,Phaser.Physics.Ninja.Tile.HALFu=32,Phaser.Physics.Ninja.Tile.HALFl=33,Phaser.Physics.Ninja.Tile.TYPE_EMPTY=0,Phaser.Physics.Ninja.Tile.TYPE_FULL=1,Phaser.Physics.Ninja.Tile.TYPE_45DEG=2,Phaser.Physics.Ninja.Tile.TYPE_CONCAVE=6,Phaser.Physics.Ninja.Tile.TYPE_CONVEX=10,Phaser.Physics.Ninja.Tile.TYPE_22DEGs=14,Phaser.Physics.Ninja.Tile.TYPE_22DEGb=18,Phaser.Physics.Ninja.Tile.TYPE_67DEGs=22,Phaser.Physics.Ninja.Tile.TYPE_67DEGb=26,Phaser.Physics.Ninja.Tile.TYPE_HALF=30,Phaser.Physics.Ninja.Circle=function(a,b,c,d){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.radius=d,this.xw=d,this.yw=d,this.width=2*d,this.height=2*d,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.circleTileProjections={},this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projCircle_Full,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projCircle_45Deg,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projCircle_Concave,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projCircle_Convex,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projCircle_22DegS,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projCircle_22DegB,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projCircle_67DegS,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projCircle_67DegB,this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projCircle_Half },Phaser.Physics.Ninja.Circle.prototype.constructor=Phaser.Physics.Ninja.Circle,Phaser.Physics.Ninja.Circle.COL_NONE=0,Phaser.Physics.Ninja.Circle.COL_AXIS=1,Phaser.Physics.Ninja.Circle.COL_OTHER=2,Phaser.Physics.Ninja.Circle.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.radius);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.radius-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.radius);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.radius-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideCircleVsTile:function(a){var b=this.pos,c=this.radius,d=a,e=d.pos.x,f=d.pos.y,g=d.xw,h=d.yw,i=b.x-e,j=g+c-Math.abs(i);if(j>0){var k=b.y-f,l=h+c-Math.abs(k);if(l>0)return this.oH=0,this.oV=0,-g>i?this.oH=-1:i>g&&(this.oH=1),-h>k?this.oV=-1:k>h&&(this.oV=1),this.resolveCircleTile(j,l,this.oH,this.oV,this,d)}},resolveCircleTile:function(a,b,c,d,e,f){return 0<f.id?this.circleTileProjections[f.type](a,b,c,d,e,f):!1},projCircle_Full:function(a,b,c,d,e,f){if(0===c){if(0===d){if(b>a){var g=e.pos.x-f.pos.x;return 0>g?(e.reportCollisionVsWorld(-a,0,-1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(a,0,1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}var h=e.pos.y-f.pos.y;return 0>h?(e.reportCollisionVsWorld(0,-b,0,-1,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(0,b,0,1,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS}if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.pos.x+c*f.xw,j=f.pos.y+d*f.yw,g=e.pos.x-i,h=e.pos.y-j,k=Math.sqrt(g*g+h*h),l=e.radius-k;return l>0?(0===k?(g=c/Math.SQRT2,h=d/Math.SQRT2):(g/=k,h/=k),e.reportCollisionVsWorld(g*l,h*l,g,h,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_45Deg:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.pos.x-j*e.radius-f.pos.x,m=e.pos.y-k*e.radius-f.pos.y,n=l*j+m*k;if(0>n){j*=-n,k*=-n,b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1));var o=Math.sqrt(j*j+k*k);return o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x-h*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),p=l*-k+m*j;if(p*h*i>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-i*f.yw),p=l*-k+m*j;if(0>p*h*i){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,q=Math.sqrt(u*u+v*v),r=e.radius-q;if(r>0)return 0===q?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=q,v/=q),e.reportCollisionVsWorld(u*r,v*r,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Concave:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c){if(0===d){var j=f.pos.x+h*f.xw-e.pos.x,k=f.pos.y+i*f.yw-e.pos.y,l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=n+e.radius-m;return o>0?(b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)):Phaser.Physics.Ninja.Circle.COL_NONE}if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x-h*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=0,s=d):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x+c*f.xw,q=f.pos.y-i*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c,s=0):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Convex:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(h*c+i*d>0){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Half:function(a,b,c,d,e,f){var g=f.signx,h=f.signy,i=c*g+d*h;if(i>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var j=e.radius,k=e.pos.x-g*j-f.pos.x,l=e.pos.y-h*j-f.pos.y,m=g,n=h,o=k*m+l*n;if(0>o){m*=-o,n*=-o;var p=Math.sqrt(m*m+n*n),q=Math.sqrt(a*a+b*b);return p>q?(e.reportCollisionVsWorld(a,b,a/q,b/q,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(m,n,f.signx,f.signy),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0!==i)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-f.pos.x;if(0>r*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-(f.pos.y+d*f.yw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0!==i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-f.pos.y;if(0>s*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-(f.pos.x+c*f.xw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var v=f.pos.x+c*f.xw,w=f.pos.y+d*f.yw,r=e.pos.x-v,s=e.pos.y-w,t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegS:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c){if(0!==d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-f.pos.y,o=m*-k+n*j;if(o*h*i>0){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0===d)if(0>h*c){var t=f.pos.x-h*f.xw,u=f.pos.y,v=e.pos.x-t,w=e.pos.y-u;if(0>w*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x+c*f.xw),n=e.pos.y-(f.pos.y-i*f.yw),o=m*-k+n*j;if(0>o*h*i){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegB:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-(f.pos.y+i*f.yw),q=m*-k+n*j;if(q*h*i>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-(f.pos.x+h*f.xw),n=e.pos.y-f.pos.y;if(0>n*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(0>q*h*i){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0){var t=Math.sqrt(5),j=1*h/t,k=2*i/t,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(g*c>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y-h*f.yw),o=m*-k+n*j;if(0>o*g*h){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0>h*d){var t=f.pos.x,u=f.pos.y-h*f.yw,v=e.pos.x-t,w=e.pos.y-u;if(0>v*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-g*f.xw),n=e.pos.y-(f.pos.y+d*f.yw),o=m*-k+n*j;if(o*g*h>0){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y+h*f.yw);if(0>m*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(q*g*h>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=Math.sqrt(5),j=2*g/t,k=1*h/t,m=e.pos.x-(f.pos.x+g*f.xw),n=e.pos.y-(f.pos.y-h*f.yw),q=m*-k+n*j;if(0>q*g*h){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},destroy:function(){this.body=null,this.system=null}},!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define("p2",function(){return this.p2=a()}()):"undefined"!=typeof window?window.p2=a():"undefined"!=typeof global?self.p2=a():"undefined"!=typeof self&&(self.p2=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d={},e=new Float32Array([1,0,0,1]);if(!f)var f=1e-6;d.create=function(){return new Float32Array(e)},d.clone=function(a){var b=new Float32Array(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},d.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},d.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},d.transpose=function(a,b){if(a===b){var c=b[1];a[1]=b[2],a[2]=c}else a[0]=b[0],a[1]=b[2],a[2]=b[1],a[3]=b[3];return a},d.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;return g?(g=1/g,a[0]=f*g,a[1]=-d*g,a[2]=-e*g,a[3]=c*g,a):null},d.adjoint=function(a,b){var c=b[0];return a[0]=b[3],a[1]=-b[1],a[2]=-b[2],a[3]=c,a},d.determinant=function(a){return a[0]*a[3]-a[2]*a[1]},d.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*h+e*j,a[1]=d*i+e*k,a[2]=f*h+g*j,a[3]=f*i+g*k,a},d.mul=d.multiply,d.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=d*-h+e*i,a[2]=f*i+g*h,a[3]=f*-h+g*i,a},d.scale=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1];return a[0]=d*h,a[1]=e*i,a[2]=f*h,a[3]=g*i,a},d.str=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof c&&(c.mat2=d)},{}],2:[function(a,b,c){var d={};if(!e)var e=1e-6;d.create=function(){return new Float32Array(2)},d.clone=function(a){var b=new Float32Array(2);return b[0]=a[0],b[1]=a[1],b},d.fromValues=function(a,b){var c=new Float32Array(2);return c[0]=a,c[1]=b,c},d.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a},d.set=function(a,b,c){return a[0]=b,a[1]=c,a},d.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a},d.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a},d.sub=d.subtract,d.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a},d.mul=d.multiply,d.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a},d.div=d.divide,d.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a},d.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a},d.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a},d.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},d.dist=d.distance,d.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d},d.sqrDist=d.squaredDistance,d.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},d.len=d.length,d.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},d.sqrLen=d.squaredLength,d.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a},d.normalize=function(a,b){var c=b[0],d=b[1],e=c*c+d*d;return e>0&&(e=1/Math.sqrt(e),a[0]=b[0]*e,a[1]=b[1]*e),a},d.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},d.cross=function(a,b,c){var d=b[0]*c[1]-b[1]*c[0];return a[0]=a[1]=0,a[2]=d,a},d.lerp=function(a,b,c,d){var e=b[0],f=b[1];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a},d.transformMat2=function(a,b,c){var d=b[0],e=b[1];return a[0]=d*c[0]+e*c[1],a[1]=d*c[2]+e*c[3],a},d.forEach=function(){var a=new Float32Array(2);return function(b,c,d,e,f,g){var h,i;for(c||(c=2),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],f(a,a,g),b[h]=a[0],b[h+1]=a[1];return b}}(),d.str=function(a){return"vec2("+a[0]+", "+a[1]+")"},"undefined"!=typeof c&&(c.vec2=d)},{}],3:[function(a,b){function c(){}var d=a("./Scalar");b.exports=c,c.lineInt=function(a,b,c){c=c||0;var e,f,g,h,i,j,k,l=[0,0];return e=a[1][1]-a[0][1],f=a[0][0]-a[1][0],g=e*a[0][0]+f*a[0][1],h=b[1][1]-b[0][1],i=b[0][0]-b[1][0],j=h*b[0][0]+i*b[0][1],k=e*i-h*f,d.eq(k,0,c)||(l[0]=(i*g-f*j)/k,l[1]=(e*j-h*g)/k),l},c.segmentsIntersect=function(a,b,c,d){var e=b[0]-a[0],f=b[1]-a[1],g=d[0]-c[0],h=d[1]-c[1];if(g*f-h*e==0)return!1;var i=(e*(c[1]-a[1])+f*(a[0]-c[0]))/(g*f-h*e),j=(g*(a[1]-c[1])+h*(c[0]-a[0]))/(h*e-g*f);return i>=0&&1>=i&&j>=0&&1>=j}},{"./Scalar":6}],4:[function(a,b){function c(){}b.exports=c,c.area=function(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])},c.left=function(a,b,d){return c.area(a,b,d)>0},c.leftOn=function(a,b,d){return c.area(a,b,d)>=0},c.right=function(a,b,d){return c.area(a,b,d)<0},c.rightOn=function(a,b,d){return c.area(a,b,d)<=0};var d=[],e=[];c.collinear=function(a,b,f,g){if(g){var h=d,i=e;h[0]=b[0]-a[0],h[1]=b[1]-a[1],i[0]=f[0]-b[0],i[1]=f[1]-b[1];var j=h[0]*i[0]+h[1]*i[1],k=Math.sqrt(h[0]*h[0]+h[1]*h[1]),l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=Math.acos(j/(k*l));return g>m}return 0==c.area(a,b,f)},c.sqdist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d}},{}],5:[function(a,b){function c(){this.vertices=[]}function d(a,b,c,d,e){e=e||0;var f=b[1]-a[1],h=a[0]-b[0],i=f*a[0]+h*a[1],j=d[1]-c[1],k=c[0]-d[0],l=j*c[0]+k*c[1],m=f*k-j*h;return g.eq(m,0,e)?[0,0]:[(k*i-h*l)/m,(f*l-j*i)/m]}var e=a("./Line"),f=a("./Point"),g=a("./Scalar");b.exports=c,c.prototype.at=function(a){var b=this.vertices,c=b.length;return b[0>a?a%c+c:a%c]},c.prototype.first=function(){return this.vertices[0]},c.prototype.last=function(){return this.vertices[this.vertices.length-1]},c.prototype.clear=function(){this.vertices.length=0},c.prototype.append=function(a,b,c){if("undefined"==typeof b)throw new Error("From is not given!");if("undefined"==typeof c)throw new Error("To is not given!");if(b>c-1)throw new Error("lol1");if(c>a.vertices.length)throw new Error("lol2");if(0>b)throw new Error("lol3");for(var d=b;c>d;d++)this.vertices.push(a.vertices[d])},c.prototype.makeCCW=function(){for(var a=0,b=this.vertices,c=1;c<this.vertices.length;++c)(b[c][1]<b[a][1]||b[c][1]==b[a][1]&&b[c][0]>b[a][0])&&(a=c);f.left(this.at(a-1),this.at(a),this.at(a+1))||this.reverse()},c.prototype.reverse=function(){for(var a=[],b=0,c=this.vertices.length;b!==c;b++)a.push(this.vertices.pop());this.vertices=a},c.prototype.isReflex=function(a){return f.right(this.at(a-1),this.at(a),this.at(a+1))};var h=[],i=[];c.prototype.canSee=function(a,b){var c,d,g=h,j=i;if(f.leftOn(this.at(a+1),this.at(a),this.at(b))&&f.rightOn(this.at(a-1),this.at(a),this.at(b)))return!1;d=f.sqdist(this.at(a),this.at(b));for(var k=0;k!==this.vertices.length;++k)if((k+1)%this.vertices.length!==a&&k!==a&&f.leftOn(this.at(a),this.at(b),this.at(k+1))&&f.rightOn(this.at(a),this.at(b),this.at(k))&&(g[0]=this.at(a),g[1]=this.at(b),j[0]=this.at(k),j[1]=this.at(k+1),c=e.lineInt(g,j),f.sqdist(this.at(a),c)<d))return!1;return!0},c.prototype.copy=function(a,b,d){var e=d||new c;if(e.clear(),b>a)for(var f=a;b>=f;f++)e.vertices.push(this.vertices[f]);else{for(var f=0;b>=f;f++)e.vertices.push(this.vertices[f]);for(var f=a;f<this.vertices.length;f++)e.vertices.push(this.vertices[f])}return e},c.prototype.getCutEdges=function(){for(var a=[],b=[],d=[],e=new c,f=Number.MAX_VALUE,g=0;g<this.vertices.length;++g)if(this.isReflex(g))for(var h=0;h<this.vertices.length;++h)if(this.canSee(g,h)){b=this.copy(g,h,e).getCutEdges(),d=this.copy(h,g,e).getCutEdges();for(var i=0;i<d.length;i++)b.push(d[i]);b.length<f&&(a=b,f=b.length,a.push([this.at(g),this.at(h)]))}return a},c.prototype.decomp=function(){var a=this.getCutEdges();return a.length>0?this.slice(a):[this]},c.prototype.slice=function(a){if(0==a.length)return[this];if(a instanceof Array&&a.length&&a[0]instanceof Array&&2==a[0].length&&a[0][0]instanceof Array){for(var b=[this],c=0;c<a.length;c++)for(var d=a[c],e=0;e<b.length;e++){var f=b[e],g=f.slice(d);if(g){b.splice(e,1),b.push(g[0],g[1]);break}}return b}var d=a,c=this.vertices.indexOf(d[0]),e=this.vertices.indexOf(d[1]);return-1!=c&&-1!=e?[this.copy(c,e),this.copy(e,c)]:!1},c.prototype.isSimple=function(){for(var a=this.vertices,b=0;b<a.length-1;b++)for(var c=0;b-1>c;c++)if(e.segmentsIntersect(a[b],a[b+1],a[c],a[c+1]))return!1;for(var b=1;b<a.length-2;b++)if(e.segmentsIntersect(a[0],a[a.length-1],a[b],a[b+1]))return!1;return!0},c.prototype.quickDecomp=function(a,b,e,g,h,i){h=h||100,i=i||0,g=g||25,a="undefined"!=typeof a?a:[],b=b||[],e=e||[];var j=[0,0],k=[0,0],l=[0,0],m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=new c,u=new c,v=this,w=this.vertices;if(w.length<3)return a;if(i++,i>h)return console.warn("quickDecomp: max level ("+h+") reached."),a;for(var x=0;x<this.vertices.length;++x)if(v.isReflex(x)){b.push(v.vertices[x]),m=n=Number.MAX_VALUE;for(var y=0;y<this.vertices.length;++y)f.left(v.at(x-1),v.at(x),v.at(y))&&f.rightOn(v.at(x-1),v.at(x),v.at(y-1))&&(l=d(v.at(x-1),v.at(x),v.at(y),v.at(y-1)),f.right(v.at(x+1),v.at(x),l)&&(o=f.sqdist(v.vertices[x],l),n>o&&(n=o,k=l,r=y))),f.left(v.at(x+1),v.at(x),v.at(y+1))&&f.rightOn(v.at(x+1),v.at(x),v.at(y))&&(l=d(v.at(x+1),v.at(x),v.at(y),v.at(y+1)),f.left(v.at(x-1),v.at(x),l)&&(o=f.sqdist(v.vertices[x],l),m>o&&(m=o,j=l,q=y)));if(r==(q+1)%this.vertices.length)l[0]=(k[0]+j[0])/2,l[1]=(k[1]+j[1])/2,e.push(l),q>x?(t.append(v,x,q+1),t.vertices.push(l),u.vertices.push(l),0!=r&&u.append(v,r,v.vertices.length),u.append(v,0,x+1)):(0!=x&&t.append(v,x,v.vertices.length),t.append(v,0,q+1),t.vertices.push(l),u.vertices.push(l),u.append(v,r,x+1));else{if(r>q&&(q+=this.vertices.length),p=Number.MAX_VALUE,r>q)return a;for(var y=r;q>=y;++y)f.leftOn(v.at(x-1),v.at(x),v.at(y))&&f.rightOn(v.at(x+1),v.at(x),v.at(y))&&(o=f.sqdist(v.at(x),v.at(y)),p>o&&(p=o,s=y%this.vertices.length));s>x?(t.append(v,x,s+1),0!=s&&u.append(v,s,w.length),u.append(v,0,x+1)):(0!=x&&t.append(v,x,w.length),t.append(v,0,s+1),u.append(v,s,x+1))}return t.vertices.length<u.vertices.length?(t.quickDecomp(a,b,e,g,h,i),u.quickDecomp(a,b,e,g,h,i)):(u.quickDecomp(a,b,e,g,h,i),t.quickDecomp(a,b,e,g,h,i)),a}return a.push(this),a},c.prototype.removeCollinearPoints=function(a){for(var b=0,c=this.vertices.length-1;this.vertices.length>3&&c>=0;--c)f.collinear(this.at(c-1),this.at(c),this.at(c+1),a)&&(this.vertices.splice(c%this.vertices.length,1),c--,b++);return b}},{"./Line":3,"./Point":4,"./Scalar":6}],6:[function(a,b){function c(){}b.exports=c,c.eq=function(a,b,c){return c=c||0,Math.abs(a-b)<c}},{}],7:[function(a,b){b.exports={Polygon:a("./Polygon"),Point:a("./Point")}},{"./Point":4,"./Polygon":5}],8:[function(a,b){b.exports={name:"p2",version:"0.4.0",description:"A JavaScript 2D physics engine.",author:"Stefan Hedman <schteppe@gmail.com> (http://steffe.se)",keywords:["p2.js","p2","physics","engine","2d"],main:"./src/p2.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/p2.js.git"},bugs:{url:"https://github.com/schteppe/p2.js/issues"},licenses:[{type:"MIT"}],devDependencies:{jshint:"latest",nodeunit:"latest",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"~0.1.2","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"*","grunt-browserify":"*",browserify:"*"},dependencies:{underscore:"*","poly-decomp":"git://github.com/schteppe/poly-decomp.js","gl-matrix":"2.0.0",jsonschema:"*"}}},{}],9:[function(a,b){function c(a){this.lowerBound=d.create(),a&&a.lowerBound&&d.copy(this.lowerBound,a.lowerBound),this.upperBound=d.create(),a&&a.upperBound&&d.copy(this.upperBound,a.upperBound)}{var d=a("../math/vec2");a("../utils/Utils")}b.exports=c;var e=d.create();c.prototype.setFromPoints=function(a,b,c){var f=this.lowerBound,g=this.upperBound;d.set(f,Number.MAX_VALUE,Number.MAX_VALUE),d.set(g,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var h=0;h<a.length;h++){var i=a[h];"number"==typeof c&&(d.rotate(e,i,c),i=e);for(var j=0;2>j;j++)i[j]>g[j]&&(g[j]=i[j]),i[j]<f[j]&&(f[j]=i[j])}b&&(d.add(this.lowerBound,this.lowerBound,b),d.add(this.upperBound,this.upperBound,b))},c.prototype.copy=function(a){d.copy(this.lowerBound,a.lowerBound),d.copy(this.upperBound,a.upperBound)},c.prototype.extend=function(a){for(var b=0;2>b;b++)a.lowerBound[b]<this.lowerBound[b]&&(this.lowerBound[b]=a.lowerBound[b]),a.upperBound[b]>this.upperBound[b]&&(this.upperBound[b]=a.upperBound[b])},c.prototype.overlaps=function(a){var b=this.lowerBound,c=this.upperBound,d=a.lowerBound,e=a.upperBound;return(d[0]<=c[0]&&c[0]<=e[0]||b[0]<=e[0]&&e[0]<=c[0])&&(d[1]<=c[1]&&c[1]<=e[1]||b[1]<=e[1]&&e[1]<=c[1])}},{"../math/vec2":33,"../utils/Utils":50}],10:[function(a,b){function c(a){this.type=a,this.result=[],this.world=null}var d=a("../math/vec2"),e=a("../objects/Body");b.exports=c,c.prototype.setWorld=function(a){this.world=a},c.prototype.getCollisionPairs=function(){throw new Error("getCollisionPairs must be implemented in a subclass!")};var f=d.create();c.boundingRadiusCheck=function(a,b){d.sub(f,a.position,b.position);var c=d.squaredLength(f),e=a.boundingRadius+b.boundingRadius;return e*e>=c},c.aabbCheck=function(a,b){return a.aabbNeedsUpdate&&a.updateAABB(),b.aabbNeedsUpdate&&b.updateAABB(),a.aabb.overlaps(b.aabb)},c.canCollide=function(a,b){return a.motionState==e.STATIC&&b.motionState==e.STATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.STATIC||a.motionState==e.STATIC&&b.motionState==e.KINEMATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.KINEMATIC?!1:a.sleepState==e.SLEEPING&&b.sleepState==e.SLEEPING?!1:!0},c.NAIVE=1,c.SAP=2},{"../math/vec2":33,"../objects/Body":34}],11:[function(a,b){function d(a,b,c,d,e,f){h.apply(this),e=e||10,f=f||10,this.binsizeX=(b-a)/e,this.binsizeY=(d-c)/f,this.nx=e,this.ny=f,this.xmin=a,this.ymin=c,this.xmax=b,this.ymax=d}{var e=a("../shapes/Circle"),f=a("../shapes/Plane"),g=a("../shapes/Particle"),h=a("../collision/Broadphase");a("../math/vec2")}b.exports=d,d.prototype=new h,d.prototype.getBinIndex=function(a,b){var c=this.nx,d=this.ny,e=this.xmin,f=this.ymin,g=this.xmax,h=this.ymax,i=Math.floor(c*(a-e)/(g-e)),j=Math.floor(d*(b-f)/(h-f));return i*d+j},d.prototype.getCollisionPairs=function(a){for(var b=[],d=a.bodies,i=i=d.length,j=this.binsizeX,k=this.binsizeY,l=[],m=nx*ny,n=0;m>n;n++)l.push([]);for(var o=nx/(xmax-xmin),p=ny/(ymax-ymin),n=0;n!==i;n++){var q=d[n],r=q.shape;if(void 0!==r)if(r instanceof e)for(var s=q.position[0],t=q.position[1],u=r.radius,v=Math.floor(o*(s-u-xmin)),w=Math.floor(p*(t-u-ymin)),x=Math.floor(o*(s+u-xmin)),y=Math.floor(p*(t+u-ymin)),z=v;x>=z;z++)for(var A=w;y>=A;A++){var B=z,C=A;B*(ny-1)+C>=0&&m>B*(ny-1)+C&&l[B*(ny-1)+C].push(q)}else{if(!(r instanceof f))throw new Error("Shape not supported in GridBroadphase!");if(0==q.angle)for(var t=q.position[1],z=0;z!==m&&t>ymin+k*(z-1);z++)for(var A=0;nx>A;A++){var B=A,C=Math.floor(p*(k*z-ymin));l[B*(ny-1)+C].push(q)}else if(q.angle==.5*Math.PI)for(var s=q.position[0],z=0;z!==m&&s>xmin+j*(z-1);z++)for(var A=0;ny>A;A++){var C=A,B=Math.floor(o*(j*z-xmin));l[B*(ny-1)+C].push(q)}else for(var z=0;z!==m;z++)l[z].push(q)}}for(var n=0;n!==m;n++)for(var D=l[n],z=0,E=D.length;z!==E;z++)for(var q=D[z],r=q.shape,A=0;A!==z;A++){var F=D[A],G=F.shape; r instanceof e?G instanceof e?c=h.circleCircle(q,F):G instanceof g?c=h.circleParticle(q,F):G instanceof f&&(c=h.circlePlane(q,F)):r instanceof g?G instanceof e&&(c=h.circleParticle(F,q)):r instanceof f&&G instanceof e&&(c=h.circlePlane(F,q))}return b}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43}],12:[function(a,b){function c(){d.call(this,d.NAIVE),this.useBoundingBoxes=!1}{var d=(a("../shapes/Circle"),a("../shapes/Plane"),a("../shapes/Shape"),a("../shapes/Particle"),a("../collision/Broadphase"));a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.getCollisionPairs=function(a){var b,c,e,f,g=a.bodies,h=this.result,i=this.useBoundingBoxes?d.aabbCheck:d.boundingRadiusCheck;for(h.length=0,b=0,Ncolliding=g.length;b!==Ncolliding;b++)for(e=g[b],c=0;b>c;c++)f=g[c],d.canCollide(e,f)&&i(e,f)&&h.push(e,f);return h}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Shape":45}],13:[function(a,b){function c(){this.contactEquations=[],this.frictionEquations=[],this.enableFriction=!0,this.slipForce=10,this.frictionCoefficient=.3,this.surfaceVelocity=0,this.reuseObjects=!0,this.reusableContactEquations=[],this.reusableFrictionEquations=[],this.restitution=0,this.stiffness=1e7,this.relaxation=3,this.frictionStiffness=1e7,this.frictionRelaxation=3,this.collidingBodiesLastStep={keys:[]}}function d(a){for(var b=0,c=a.keys.length;c>b;b++)delete a[a.keys[b]];a.keys.length=0}function e(a,b){g.set(a.vertices[0],.5*-b.length,-b.radius),g.set(a.vertices[1],.5*b.length,-b.radius),g.set(a.vertices[2],.5*b.length,b.radius),g.set(a.vertices[3],.5*-b.length,b.radius)}function f(a,b,c,d){for(var e=Q,f=R,j=S,k=T,l=a,m=b.vertices,n=null,o=0;o!==m.length+1;o++){var p=m[o%m.length],q=m[(o+1)%m.length];g.rotate(e,p,d),g.rotate(f,q,d),i(e,e,c),i(f,f,c),h(j,e,l),h(k,f,l);var r=g.crossLength(j,k);if(null===n&&(n=r),0>=r*n)return!1;n=r}return!0}var g=a("../math/vec2"),h=g.sub,i=g.add,j=g.dot,k=a("../utils/Utils"),l=a("../equations/ContactEquation"),m=a("../equations/FrictionEquation"),n=a("../shapes/Circle"),o=a("../shapes/Shape"),p=a("../objects/Body"),q=a("../shapes/Rectangle");b.exports=c;var r=g.fromValues(0,1),s=g.fromValues(0,0),t=g.fromValues(0,0),u=g.fromValues(0,0),v=g.fromValues(0,0),w=g.fromValues(0,0),x=g.fromValues(0,0),y=g.fromValues(0,0),z=g.fromValues(0,0),A=g.fromValues(0,0),B=g.fromValues(0,0),C=g.fromValues(0,0),D=g.fromValues(0,0),E=g.fromValues(0,0),F=g.fromValues(0,0),G=g.fromValues(0,0),H=g.fromValues(0,0),I=g.fromValues(0,0),J=g.fromValues(0,0),K=[];c.prototype.collidedLastStep=function(a,b){var c=a.id,d=b.id;if(c>d){var e=c;c=d,d=e}return!!this.collidingBodiesLastStep[c+" "+d]},c.prototype.reset=function(){d(this.collidingBodiesLastStep);for(var a=0;a!==this.contactEquations.length;a++){var b=this.contactEquations[a],c=b.bi.id,e=b.bj.id;if(c>e){var f=c;c=e,e=f}var g=c+" "+e;this.collidingBodiesLastStep[g]||(this.collidingBodiesLastStep[g]=!0,this.collidingBodiesLastStep.keys.push(g))}if(this.reuseObjects){var h=this.contactEquations,i=this.frictionEquations,j=this.reusableFrictionEquations,l=this.reusableContactEquations;k.appendArray(l,h),k.appendArray(j,i)}this.contactEquations.length=this.frictionEquations.length=0},c.prototype.createContactEquation=function(a,b,c,d){var e=this.reusableContactEquations.length?this.reusableContactEquations.pop():new l(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.restitution=this.restitution,e.firstImpact=!this.collidedLastStep(a,b),e.stiffness=this.stiffness,e.relaxation=this.relaxation,e.enabled=!0,a.allowSleep&&a.motionState==p.DYNAMIC&&b.motionState!=p.STATIC&&b.sleepState!==p.SLEEPY&&a.wakeUp(),b.allowSleep&&b.motionState==p.DYNAMIC&&a.motionState!=p.STATIC&&a.sleepState!==p.SLEEPY&&b.wakeUp(),e},c.prototype.createFrictionEquation=function(a,b,c,d){var e=this.reusableFrictionEquations.length?this.reusableFrictionEquations.pop():new m(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.setSlipForce(this.slipForce),e.frictionCoefficient=this.frictionCoefficient,e.relativeVelocity=this.surfaceVelocity,e.enabled=!0,e.frictionStiffness=this.frictionStiffness,e.frictionRelaxation=this.frictionRelaxation,e},c.prototype.createFrictionFromContact=function(a){var b=this.createFrictionEquation(a.bi,a.bj,a.shapeA,a.shapeB);return g.copy(b.ri,a.ri),g.copy(b.rj,a.rj),g.rotate(b.t,a.ni,-Math.PI/2),b.contactEquation=a,b},c.prototype[o.LINE|o.CONVEX]=c.prototype.convexLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.LINE|o.RECTANGLE]=c.prototype.lineRectangle=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var L=new q(1,1),M=g.create();c.prototype[o.CAPSULE|o.CONVEX]=c.prototype[o.CAPSULE|o.RECTANGLE]=c.prototype.convexCapsule=function(a,b,c,d,f,h,i,j,k){var l=M;g.set(l,h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var m=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);g.set(l,-h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var n=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);if(k&&(m||n))return!0;var o=L;e(o,h);var p=this.convexConvex(a,b,c,d,f,o,i,j,k);return p+m+n},c.prototype[o.CAPSULE|o.LINE]=c.prototype.lineCapsule=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var N=g.create(),O=g.create(),P=new q(1,1);c.prototype[o.CAPSULE|o.CAPSULE]=c.prototype.capsuleCapsule=function(a,b,c,d,f,h,i,j,k){for(var l=N,m=O,n=0,o=0;2>o;o++){g.set(l,(0==o?-1:1)*b.length/2,0),g.rotate(l,l,d),g.add(l,l,c);for(var p=0;2>p;p++){g.set(m,(0==p?-1:1)*h.length/2,0),g.rotate(m,m,j),g.add(m,m,i);var q=this.circleCircle(a,b,l,d,f,h,m,j,k,b.radius,h.radius);if(k&&q)return!0;n+=q}}var r=P;e(r,b);var s=this.convexCapsule(a,r,c,d,f,h,i,j,k);if(k&&s)return!0;n+=s,e(r,h);var t=this.convexCapsule(f,r,i,j,a,b,c,d,k);return k&&t?!0:n+=t},c.prototype[o.LINE|o.LINE]=c.prototype.lineLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.PLANE|o.LINE]=c.prototype.planeLine=function(a,b,c,d,e,f,k,l,m){var n=s,o=t,p=u,q=v,B=w,C=x,D=y,E=z,F=A,G=K;numContacts=0,g.set(n,-f.length/2,0),g.set(o,f.length/2,0),g.rotate(p,n,l),g.rotate(q,o,l),i(p,p,k),i(q,q,k),g.copy(n,p),g.copy(o,q),h(B,o,n),g.normalize(C,B),g.rotate(F,C,-Math.PI/2),g.rotate(E,r,d),G[0]=n,G[1]=o;for(var H=0;H<G.length;H++){var I=G[H];h(D,I,c);var J=j(D,E);if(0>J){if(m)return!0;var L=this.createContactEquation(a,e,b,f);numContacts++,g.copy(L.ni,E),g.normalize(L.ni,L.ni),g.scale(D,E,J),h(L.ri,I,D),h(L.ri,L.ri,a.position),h(L.rj,I,k),i(L.rj,L.rj,k),h(L.rj,L.rj,e.position),this.contactEquations.push(L),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(L))}}return numContacts},c.prototype[o.PARTICLE|o.CAPSULE]=c.prototype.particleCapsule=function(a,b,c,d,e,f,g,h,i){return this.circleLine(a,b,c,d,e,f,g,h,i,f.radius,0)},c.prototype[o.CIRCLE|o.LINE]=c.prototype.circleLine=function(a,b,c,d,e,f,k,l,m,n,o){var p=f,q=l,r=e,G=k,H=c,I=a,J=b,n=n||0,o="undefined"!=typeof o?o:J.radius,L=s,M=t,N=u,O=v,P=w,Q=x,R=y,S=z,T=A,U=B,V=C,W=D,X=E,Y=F,Z=K;g.set(S,-p.length/2,0),g.set(T,p.length/2,0),g.rotate(U,S,q),g.rotate(V,T,q),i(U,U,G),i(V,V,G),g.copy(S,U),g.copy(T,V),h(Q,T,S),g.normalize(R,Q),g.rotate(P,R,-Math.PI/2),h(W,H,S);var $=j(W,P);if(h(O,S,G),h(X,H,G),Math.abs($)<o+n){g.scale(L,P,$),h(N,H,L),g.scale(M,P,j(P,X)),g.normalize(M,M),g.scale(M,M,n),i(N,N,M);var _=j(R,N),ab=j(R,S),bb=j(R,T);if(_>ab&&bb>_){if(m)return!0;var cb=this.createContactEquation(I,r,b,f);return g.scale(cb.ni,L,-1),g.normalize(cb.ni,cb.ni),g.scale(cb.ri,cb.ni,o),i(cb.ri,cb.ri,H),h(cb.ri,cb.ri,I.position),h(cb.rj,N,G),i(cb.rj,cb.rj,G),h(cb.rj,cb.rj,r.position),this.contactEquations.push(cb),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(cb)),1}}Z[0]=S,Z[1]=T;for(var db=0;db<Z.length;db++){var eb=Z[db];if(h(W,eb,H),g.squaredLength(W)<(o+n)*(o+n)){if(m)return!0;var cb=this.createContactEquation(I,r,b,f);return g.copy(cb.ni,W),g.normalize(cb.ni,cb.ni),g.scale(cb.ri,cb.ni,o),i(cb.ri,cb.ri,H),h(cb.ri,cb.ri,I.position),h(cb.rj,eb,G),g.scale(Y,cb.ni,-n),i(cb.rj,cb.rj,Y),i(cb.rj,cb.rj,G),h(cb.rj,cb.rj,r.position),this.contactEquations.push(cb),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(cb)),1}}return 0},c.prototype[o.CIRCLE|o.CAPSULE]=c.prototype.circleCapsule=function(a,b,c,d,e,f,g,h,i){return this.circleLine(a,b,c,d,e,f,g,h,i,f.radius)},c.prototype[o.CIRCLE|o.CONVEX]=c.prototype[o.CIRCLE|o.RECTANGLE]=c.prototype.circleConvex=function(a,b,c,d,e,j,k,l,m,n){var o=j,p=l,q=e,r=k,x=c,y=a,z=b,n="number"==typeof n?n:z.radius,A=s,D=t,I=u,J=v,K=w,L=B,M=C,N=E,O=F,P=G,Q=H,R=!1,S=Number.MAX_VALUE;verts=o.vertices;for(var T=0;T!==verts.length+1;T++){var U=verts[T%verts.length],V=verts[(T+1)%verts.length];if(g.rotate(A,U,p),g.rotate(D,V,p),i(A,A,r),i(D,D,r),h(I,D,A),g.normalize(J,I),g.rotate(K,J,-Math.PI/2),g.scale(O,K,-z.radius),i(O,O,x),f(O,o,r,p)){g.sub(P,A,O);var W=Math.abs(g.dot(P,K));S>W&&(g.copy(Q,O),S=W,g.scale(N,K,W),g.add(N,N,O),R=!0)}}if(R){if(m)return!0;var X=this.createContactEquation(y,q,b,j);return g.sub(X.ni,Q,x),g.normalize(X.ni,X.ni),g.scale(X.ri,X.ni,n),i(X.ri,X.ri,x),h(X.ri,X.ri,y.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}if(n>0)for(var T=0;T<verts.length;T++){var Y=verts[T];if(g.rotate(M,Y,p),i(M,M,r),h(L,M,x),g.squaredLength(L)<n*n){if(m)return!0;var X=this.createContactEquation(y,q,b,j);return g.copy(X.ni,L),g.normalize(X.ni,X.ni),g.scale(X.ri,X.ni,n),i(X.ri,X.ri,x),h(X.ri,X.ri,y.position),h(X.rj,M,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}}return 0};var Q=g.create(),R=g.create(),S=g.create(),T=g.create();c.prototype[o.PARTICLE|o.CONVEX]=c.prototype[o.PARTICLE|o.RECTANGLE]=c.prototype.particleConvex=function(a,b,c,d,e,k,l,m,n){var o=k,p=m,q=e,r=l,z=c,A=a,C=s,D=t,F=u,G=v,H=w,K=x,L=y,M=B,N=E,O=I,P=J,Q=Number.MAX_VALUE,R=!1,S=o.vertices;if(!f(z,o,r,p))return 0;if(n)return!0;for(var T=0;T!==S.length+1;T++){var U=S[T%S.length],V=S[(T+1)%S.length];g.rotate(C,U,p),g.rotate(D,V,p),i(C,C,r),i(D,D,r),h(F,D,C),g.normalize(G,F),g.rotate(H,G,-Math.PI/2),h(M,z,C);{j(M,H)}h(K,C,r),h(L,z,r),g.sub(O,C,z);var W=Math.abs(g.dot(O,H));Q>W&&(Q=W,g.scale(N,H,W),g.add(N,N,z),g.copy(P,H),R=!0)}if(R){var X=this.createContactEquation(A,q,b,k);return g.scale(X.ni,P,-1),g.normalize(X.ni,X.ni),g.set(X.ri,0,0),i(X.ri,X.ri,z),h(X.ri,X.ri,A.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}return 0},c.prototype[o.CIRCLE]=c.prototype.circleCircle=function(a,b,c,d,e,f,j,k,l,m,n){var o=a,p=b,q=c,r=e,t=f,u=j,v=s,m=m||p.radius,n=n||t.radius;h(v,c,j);var w=m+n;if(g.squaredLength(v)>w*w)return 0;if(l)return!0;var x=this.createContactEquation(o,r,b,f);return h(x.ni,u,q),g.normalize(x.ni,x.ni),g.scale(x.ri,x.ni,m),g.scale(x.rj,x.ni,-n),i(x.ri,x.ri,q),h(x.ri,x.ri,o.position),i(x.rj,x.rj,u),h(x.rj,x.rj,r.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.PLANE|o.CONVEX]=c.prototype[o.PLANE|o.RECTANGLE]=c.prototype.planeConvex=function(a,b,c,d,e,f,k,l,m){var n=e,o=k,p=f,q=l,v=a,w=b,x=c,y=d,z=s,A=t,B=u,C=0;g.rotate(A,r,y);for(var D=0;D<p.vertices.length;D++){var E=p.vertices[D];if(g.rotate(z,E,q),i(z,z,o),h(B,z,x),j(B,A)<0){if(m)return!0;C++;var F=this.createContactEquation(v,n,w,p);h(B,z,x),g.copy(F.ni,A);var G=j(B,F.ni);if(g.scale(B,F.ni,G),h(F.rj,z,n.position),h(F.ri,z,B),h(F.ri,F.ri,v.position),this.contactEquations.push(F),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(F)),C>=2)break}}return C},c.prototype.convexPlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.convexPlane is deprecated. Use planeConvex instead!"),this.planeConvex(e,f,g,h,a,b,c,d,i)},c.prototype[o.PARTICLE|o.PLANE]=c.prototype.particlePlane=function(a,b,c,d,e,f,i,k,l){var m=a,n=c,o=e,p=i,q=k,u=s,v=t;q=q||0,h(u,n,p),g.rotate(v,r,q);var w=j(u,v);if(w>0)return 0;if(l)return!0;var x=this.createContactEquation(o,m,f,b);return g.copy(x.ni,v),g.scale(u,x.ni,w),h(x.ri,n,u),h(x.ri,x.ri,o.position),h(x.rj,n,m.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.CIRCLE|o.PARTICLE]=c.prototype.circleParticle=function(a,b,c,d,e,f,j,k,l){var m=a,n=b,o=c,p=e,q=j,r=s;if(h(r,q,o),g.squaredLength(r)>n.radius*n.radius)return 0;if(l)return!0;var t=this.createContactEquation(m,p,b,f);return g.copy(t.ni,r),g.normalize(t.ni,t.ni),g.scale(t.ri,t.ni,n.radius),i(t.ri,t.ri,o),h(t.ri,t.ri,m.position),h(t.rj,q,p.position),this.contactEquations.push(t),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(t)),1};{var U=new n(1),V=g.create(),W=g.create();g.create()}c.prototype[o.PLANE|o.CAPSULE]=c.prototype.planeCapsule=function(a,b,c,d,e,f,h,j,k){var l=V,m=W,n=U;g.set(l,-f.length/2,0),g.rotate(l,l,j),i(l,l,h),g.set(m,f.length/2,0),g.rotate(m,m,j),i(m,m,h),n.radius=f.radius;var o=this.circlePlane(e,n,l,0,a,b,c,d,k),p=this.circlePlane(e,n,m,0,a,b,c,d,k);return k?o||p:o+p},c.prototype.capsulePlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.capsulePlane() is deprecated. Use .planeCapsule() instead!"),this.planeCapsule(e,f,g,h,a,b,c,d,i)},c.prototype[o.CIRCLE|o.PLANE]=c.prototype.circlePlane=function(a,b,c,d,e,f,k,l,m){var n=a,o=b,p=c,q=e,v=k,w=l;w=w||0;var x=s,y=t,z=u;h(x,p,v),g.rotate(y,r,w);var A=j(y,x);if(A>o.radius)return 0;if(m)return!0;var B=this.createContactEquation(q,n,f,b);return g.copy(B.ni,y),g.scale(B.rj,B.ni,-o.radius),i(B.rj,B.rj,p),h(B.rj,B.rj,n.position),g.scale(z,B.ni,A),h(B.ri,x,z),i(B.ri,B.ri,v),h(B.ri,B.ri,q.position),this.contactEquations.push(B),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(B)),1},c.convexPrecision=1e-10,c.prototype[o.CONVEX]=c.prototype[o.CONVEX|o.RECTANGLE]=c.prototype[o.RECTANGLE]=c.prototype.convexConvex=function(a,b,d,e,f,k,l,m,n,o){var p=s,q=t,r=u,x=v,B=w,C=y,D=z,E=A,F=0,o=o||c.convexPrecision,G=c.findSeparatingAxis(b,d,e,k,l,m,p);if(!G)return 0;h(D,l,d),j(p,D)>0&&g.scale(p,p,-1);var H=c.getClosestEdge(b,e,p,!0),I=c.getClosestEdge(k,m,p);if(-1==H||-1==I)return 0;for(var J=0;2>J;J++){var K=H,L=I,M=b,N=k,O=d,P=l,Q=e,R=m,S=a,T=f;if(0==J){var U;U=K,K=L,L=U,U=M,M=N,N=U,U=O,O=P,P=U,U=Q,Q=R,R=U,U=S,S=T,T=U}for(var V=L;L+2>V;V++){var W=N.vertices[(V+N.vertices.length)%N.vertices.length];g.rotate(q,W,R),i(q,q,P);for(var X=0,Y=K-1;K+2>Y;Y++){var Z=M.vertices[(Y+M.vertices.length)%M.vertices.length],$=M.vertices[(Y+1+M.vertices.length)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(E,B,-Math.PI/2),g.normalize(E,E),h(D,q,r);var _=j(E,D);o>=_&&X++}if(3==X){if(n)return!0;var ab=this.createContactEquation(S,T,M,N);F++;var Z=M.vertices[K%M.vertices.length],$=M.vertices[(K+1)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(ab.ni,B,-Math.PI/2),g.normalize(ab.ni,ab.ni),h(D,q,r);var _=j(ab.ni,D);g.scale(C,ab.ni,_),h(ab.ri,q,O),h(ab.ri,ab.ri,C),i(ab.ri,ab.ri,O),h(ab.ri,ab.ri,S.position),h(ab.rj,q,P),i(ab.rj,ab.rj,P),h(ab.rj,ab.rj,T.position),this.contactEquations.push(ab),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(ab))}}}return F};var X=g.fromValues(0,0);c.projectConvexOntoAxis=function(a,b,c,d,e){var f,h,i=null,k=null,l=X;g.rotate(l,d,-c);for(var m=0;m<a.vertices.length;m++)f=a.vertices[m],h=j(f,l),(null===i||h>i)&&(i=h),(null===k||k>h)&&(k=h);if(k>i){var n=k;k=i,i=n}var o=j(b,d);g.set(e,k+o,i+o)};var Y=g.fromValues(0,0),Z=g.fromValues(0,0),$=g.fromValues(0,0),_=g.fromValues(0,0),ab=g.fromValues(0,0),bb=g.fromValues(0,0);c.findSeparatingAxis=function(a,b,d,e,f,i,j){for(var k=null,l=!1,m=!1,n=Y,o=Z,p=$,q=_,r=ab,s=bb,t=0;2!==t;t++){var u=a,v=d;1===t&&(u=e,v=i);for(var w=0;w!==u.vertices.length;w++){g.rotate(o,u.vertices[w],v),g.rotate(p,u.vertices[(w+1)%u.vertices.length],v),h(n,p,o),g.rotate(q,n,-Math.PI/2),g.normalize(q,q),c.projectConvexOntoAxis(a,b,d,q,r),c.projectConvexOntoAxis(e,f,i,q,s);var x=r,y=s,z=!1;r[0]>s[0]&&(y=r,x=s,z=!0);var A=y[0]-x[1];l=0>A,(null===k||A>k)&&(g.copy(j,q),k=A,m=l)}}return m};var cb=g.fromValues(0,0),db=g.fromValues(0,0),eb=g.fromValues(0,0);c.getClosestEdge=function(a,b,c,d){var e=cb,f=db,i=eb;g.rotate(e,c,-b),d&&g.scale(e,e,-1);for(var k=-1,l=a.vertices.length,m=Math.PI/2,n=0;n!==l;n++){h(f,a.vertices[(n+1)%l],a.vertices[n%l]),g.rotate(i,f,-m),g.normalize(i,i);var o=j(i,e);(-1==k||o>maxDot)&&(k=n%l,maxDot=o)}return k};var fb=g.create(),gb=g.create(),hb=g.create(),ib=g.create(),jb=g.create(),kb=g.create(),lb=g.create();c.prototype[o.CIRCLE|o.HEIGHTFIELD]=c.prototype.circleHeightfield=function(a,b,c,d,e,f,j,k,l,m){var n=f.data,m=m||b.radius,o=f.elementWidth,p=gb,q=fb,r=jb,s=lb,t=kb,u=hb,v=ib,w=Math.floor((c[0]-m-j[0])/o),x=Math.ceil((c[0]+m-j[0])/o);0>w&&(w=0),x>=n.length&&(x=n.length-1);for(var y=n[w],z=n[x],A=w;x>A;A++)n[A]<z&&(z=n[A]),n[A]>y&&(y=n[A]);if(c[1]-m>y)return l?!1:0;c[1]+m<z;for(var B=!1,C=!1,A=w;x>A;A++){g.set(u,A*o,n[A]),g.set(v,(A+1)*o,n[A+1]),g.add(u,u,j),g.add(v,v,j),g.sub(t,v,u),g.rotate(t,t,Math.PI/2),g.normalize(t,t),g.scale(q,t,-m),g.add(q,q,c),g.sub(p,q,u);var D=g.dot(p,t);if(q[0]>=u[0]&&q[0]<v[0]&&0>=D&&(C===!1||Math.abs(D)<C)&&(g.scale(p,t,-D),g.add(r,q,p),g.copy(s,t),B=!0,C=Math.abs(D),l))return!0}if(B){var E=this.createContactEquation(e,a,f,b);return g.copy(E.ni,s),g.scale(E.rj,E.ni,-m),i(E.rj,E.rj,c),h(E.rj,E.rj,a.position),g.copy(E.ri,r),g.sub(E.ri,E.ri,e.position),this.contactEquations.push(E),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(E)),1}if(m>0)for(var A=w;x>=A;A++)if(g.set(u,A*o,n[A]),g.add(u,u,j),g.sub(p,c,u),g.squaredLength(p)<m*m){if(l)return!0;var E=this.createContactEquation(e,a,f,b);return g.copy(E.ni,p),g.normalize(E.ni,E.ni),g.scale(E.rj,E.ni,-m),i(E.rj,E.rj,c),h(E.rj,E.rj,a.position),h(E.ri,u,j),i(E.ri,E.ri,j),h(E.ri,E.ri,e.position),this.contactEquations.push(E),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(E)),1}return 0}},{"../equations/ContactEquation":23,"../equations/FrictionEquation":25,"../math/vec2":33,"../objects/Body":34,"../shapes/Circle":38,"../shapes/Rectangle":44,"../shapes/Shape":45,"../utils/Utils":50}],14:[function(a,b){function c(a,b,c,f){var g;g=b?new d(a,0,c,f):new e(a,0,c,f),this.root=g}function d(a,b,c,d){this.bounds=a,this.children=[],this.nodes=[],d&&(this.maxChildren=d),c&&(this.maxDepth=c),b&&(this.depth=b)}function e(a,b,c,e){d.call(this,a,b,c,e),this.stuckChildren=[]}var f=a("../shapes/Plane"),g=a("../collision/Broadphase");b.exports={QuadTree:c,Node:d,BoundsNode:e},c.prototype.insert=function(a){if(a instanceof Array)for(var b=a.length,c=0;b>c;c++)this.root.insert(a[c]);else this.root.insert(a)},c.prototype.clear=function(){this.root.clear()},c.prototype.retrieve=function(a){var b=this.root.retrieve(a).slice(0);return b},c.prototype.getCollisionPairs=function(a){var b=[];this.insert(a.bodies);for(var c=0;c!==a.bodies.length;c++)for(var d=a.bodies[c],e=this.retrieve(d),f=0,h=e.length;f!==h;f++){var i=e[f];if(d!==i){for(var j=!1,k=0,l=b.length;l>k;k+=2){var m=b[k],n=b[k+1];if(m==i&&n==d||n==i&&m==d){j=!0;break}}!j&&g.boundingRadiusCheck(d,i)&&b.push(d,i)}}return this.clear(),b},d.prototype.classConstructor=d,d.prototype.children=null,d.prototype.depth=0,d.prototype.maxChildren=4,d.prototype.maxDepth=4,d.TOP_LEFT=0,d.TOP_RIGHT=1,d.BOTTOM_LEFT=2,d.BOTTOM_RIGHT=3,d.prototype.insert=function(a){if(this.nodes.length){var b=this.findIndex(a);return void this.nodes[b].insert(a)}this.children.push(a);var c=this.children.length;if(!(this.depth>=this.maxDepth)&&c>this.maxChildren){this.subdivide();for(var d=0;c>d;d++)this.insert(this.children[d]);this.children.length=0}},d.prototype.retrieve=function(a){if(this.nodes.length){var b=this.findIndex(a);return this.nodes[b].retrieve(a)}return this.children},d.prototype.findIndex=function(a){var b=this.bounds,c=a.position[0]-a.boundingRadius>b.x+b.width/2?!1:!0,e=a.position[1]-a.boundingRadius>b.y+b.height/2?!1:!0;a instanceof f&&(c=e=!1);var g=d.TOP_LEFT;return c?e||(g=d.BOTTOM_LEFT):g=e?d.TOP_RIGHT:d.BOTTOM_RIGHT,g},d.prototype.subdivide=function(){var a=this.depth+1,b=this.bounds.x,c=this.bounds.y,e=this.bounds.width/2,f=this.bounds.height/2,g=b+e,h=c+f;this.nodes[d.TOP_LEFT]=new this.classConstructor({x:b,y:c,width:e,height:f},a),this.nodes[d.TOP_RIGHT]=new this.classConstructor({x:g,y:c,width:e,height:f},a),this.nodes[d.BOTTOM_LEFT]=new this.classConstructor({x:b,y:h,width:e,height:f},a),this.nodes[d.BOTTOM_RIGHT]=new this.classConstructor({x:g,y:h,width:e,height:f},a)},d.prototype.clear=function(){this.children.length=0;for(var a=this.nodes.length,b=0;a>b;b++)this.nodes[b].clear();this.nodes.length=0},e.prototype=new d,e.prototype.classConstructor=e,e.prototype.stuckChildren=null,e.prototype.out=[],e.prototype.insert=function(a){if(this.nodes.length){var b=this.findIndex(a),c=this.nodes[b];return void(!(a instanceof f)&&a.position[0]-a.boundingRadius>=c.bounds.x&&a.position[0]+a.boundingRadius<=c.bounds.x+c.bounds.width&&a.position[1]-a.boundingRadius>=c.bounds.y&&a.position[1]+a.boundingRadius<=c.bounds.y+c.bounds.height?this.nodes[b].insert(a):this.stuckChildren.push(a))}this.children.push(a);var d=this.children.length;if(this.depth<this.maxDepth&&d>this.maxChildren){this.subdivide();for(var e=0;d>e;e++)this.insert(this.children[e]);this.children.length=0}},e.prototype.getChildren=function(){return this.children.concat(this.stuckChildren)},e.prototype.retrieve=function(a){var b=this.out;if(b.length=0,this.nodes.length){var c=this.findIndex(a);b.push.apply(b,this.nodes[c].retrieve(a))}return b.push.apply(b,this.stuckChildren),b.push.apply(b,this.children),b},e.prototype.clear=function(){this.stuckChildren.length=0,this.children.length=0;var a=this.nodes.length;if(a){for(var b=0;a>b;b++)this.nodes[b].clear();this.nodes.length=0}}},{"../collision/Broadphase":10,"../shapes/Plane":43}],15:[function(a,b){function c(){e.call(this,e.SAP),this.axisListX=[],this.axisListY=[],this.world=null;var a=this.axisListX,b=this.axisListY;this._addBodyHandler=function(c){a.push(c.body),b.push(c.body)},this._removeBodyHandler=function(c){var d=a.indexOf(c.body);-1!==d&&a.splice(d,1),d=b.indexOf(c.body),-1!==d&&b.splice(d,1)}}{var d=(a("../shapes/Circle"),a("../shapes/Plane"),a("../shapes/Shape"),a("../shapes/Particle"),a("../utils/Utils")),e=a("../collision/Broadphase");a("../math/vec2")}b.exports=c,c.prototype=new e,c.prototype.setWorld=function(a){this.axisListX.length=this.axisListY.length=0,d.appendArray(this.axisListX,a.bodies),d.appendArray(this.axisListY,a.bodies),a.off("addBody",this._addBodyHandler).off("removeBody",this._removeBodyHandler),a.on("addBody",this._addBodyHandler).on("removeBody",this._removeBodyHandler),this.world=a},c.sortAxisListX=function(a){for(var b=1,c=a.length;c>b;b++){for(var d=a[b],e=b-1;e>=0&&!(a[e].aabb.lowerBound[0]<=d.aabb.lowerBound[0]);e--)a[e+1]=a[e];a[e+1]=d}return a},c.sortAxisListY=function(a){for(var b=1,c=a.length;c>b;b++){for(var d=a[b],e=b-1;e>=0&&!(a[e].aabb.lowerBound[1]<=d.aabb.lowerBound[1]);e--)a[e+1]=a[e];a[e+1]=d}return a};var f={keys:[]};c.prototype.getCollisionPairs=function(){{var a,b,d=this.axisListX,g=this.axisListY,h=this.result;this.axisIndex}for(h.length=0,a=0;a!==d.length;a++){var i=d[a];i.aabbNeedsUpdate&&i.updateAABB()}for(c.sortAxisListX(d),c.sortAxisListY(g),a=0,N=d.length;a!==N;a++){var j=d[a];for(b=a+1;N>b;b++){var k=d[b];if(!c.checkBounds(j,k,0))break;if(e.canCollide(j,k)){var l=j.id<k.id?j.id+" "+k.id:k.id+" "+j.id;f[l]=!0,f.keys.push(l)}}}for(a=0,N=g.length;a!==N;a++){var j=g[a];for(b=a+1;N>b;b++){var k=g[b];if(!c.checkBounds(j,k,1))break;if(e.canCollide(j,k)){var l=j.id<k.id?j.id+" "+k.id:k.id+" "+j.id;f[l]&&e.boundingRadiusCheck(j,k)&&h.push(j,k)}}}var m=f.keys;for(a=0,N=m.length;a!==N;a++)delete f[m[a]];return m.length=0,h},c.checkBounds=function(a,b,c){return b.aabb.lowerBound[c]<a.aabb.upperBound[c]}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Shape":45,"../utils/Utils":50}],16:[function(a,b){function c(a,b,c){this.type=c,this.equations=[],this.bodyA=a,this.bodyB=b,a&&a.wakeUp(),b&&b.wakeUp()}b.exports=c,c.DISTANCE=1,c.GEAR=2,c.LOCK=3,c.PRISMATIC=4,c.REVOLUTE=5},{}],17:[function(a,b){function c(a,b,c,g){d.call(this,a,b,d.DISTANCE),this.distance=c,"undefined"==typeof g&&(g=Number.MAX_VALUE);var h=new e(a,b,-g,g);this.equations=[h];var i=f.create();h.computeGq=function(){return f.sub(i,b.position,a.position),f.length(i)-c},this.setMaxForce(g)}var d=a("./Constraint"),e=a("../equations/Equation"),f=a("../math/vec2");b.exports=c,c.prototype=new d;var g=f.create();c.prototype.update=function(){var a=this.equations[0],b=this.bodyA,c=this.bodyB,d=(this.distance,a.G);f.sub(g,c.position,b.position),f.normalize(g,g),d[0]=-g[0],d[1]=-g[1],d[3]=g[0],d[4]=g[1]},c.prototype.setMaxForce=function(a){var b=this.equations[0];b.minForce=-a,b.maxForce=a},c.prototype.getMaxForce=function(){var a=this.equations[0];return a.maxForce}},{"../equations/Equation":24,"../math/vec2":33,"./Constraint":16}],18:[function(a,b){function c(a,b,c){d.call(this,a,b,d.GEAR);this.equations=[new e(a,b,c)];this.angle="number"==typeof c.angle?c.angle:0,this.ratio="number"==typeof c.ratio?c.ratio:1}{var d=a("./Constraint"),e=(a("../equations/Equation"),a("../equations/AngleLockEquation"));a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.update=function(){var a=this.equations[0];a.ratio!=this.ratio&&a.setRatio(this.ratio),a.angle=this.angle}},{"../equations/AngleLockEquation":22,"../equations/Equation":24,"../math/vec2":33,"./Constraint":16}],19:[function(a,b){function c(a,b,c){d.call(this,a,b,d.LOCK);var g="undefined"==typeof c.maxForce?Number.MAX_VALUE:c.maxForce,h=c.localOffsetB||e.fromValues(0,0);h=e.fromValues(h[0],h[1]);var i=c.localAngleB||0,j=new f(a,b,-g,g),k=new f(a,b,-g,g),l=new f(a,b,-g,g),m=e.create(),n=e.create();j.computeGq=function(){return e.rotate(m,h,a.angle),e.sub(n,b.position,a.position),e.sub(n,n,m),n[0]},k.computeGq=function(){return e.rotate(m,h,a.angle),e.sub(n,b.position,a.position),e.sub(n,n,m),n[1]};var o=e.create(),p=e.create();l.computeGq=function(){return e.rotate(o,h,b.angle-i),e.scale(o,o,-1),e.sub(n,a.position,b.position),e.add(n,n,o),e.rotate(p,o,-Math.PI/2),e.normalize(p,p),e.dot(n,p)},this.localOffsetB=h,this.localAngleB=i,this.maxForce=g;this.equations=[j,k,l]}var d=a("./Constraint"),e=a("../math/vec2"),f=a("../equations/Equation");b.exports=c,c.prototype=new d;var g=e.create(),h=e.create(),i=e.create(),j=e.fromValues(1,0),k=e.fromValues(0,1);c.prototype.update=function(){var a=this.equations[0],b=this.equations[1],c=this.equations[2],d=this.bodyA,f=this.bodyB;e.rotate(g,this.localOffsetB,d.angle),e.rotate(h,this.localOffsetB,f.angle-this.localAngleB),e.scale(h,h,-1),e.rotate(i,h,Math.PI/2),e.normalize(i,i),a.G[0]=-1,a.G[1]=0,a.G[2]=-e.crossLength(g,j),a.G[3]=1,b.G[0]=0,b.G[1]=-1,b.G[2]=-e.crossLength(g,k),b.G[4]=1,c.G[0]=-i[0],c.G[1]=-i[1],c.G[3]=i[0],c.G[4]=i[1],c.G[5]=e.crossLength(h,i)}},{"../equations/Equation":24,"../math/vec2":33,"./Constraint":16}],20:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,d.PRISMATIC);var i=g.fromValues(0,0),j=g.fromValues(1,0),k=g.fromValues(0,0);c.localAnchorA&&g.copy(i,c.localAnchorA),c.localAxisA&&g.copy(j,c.localAxisA),c.localAnchorB&&g.copy(k,c.localAnchorB),this.localAnchorA=i,this.localAnchorB=k,this.localAxisA=j;var l=this.maxForce="undefined"!=typeof c.maxForce?c.maxForce:Number.MAX_VALUE,m=new f(a,b,-l,l),n=new g.create,o=new g.create,p=new g.create,q=new g.create;if(m.computeGq=function(){return g.dot(p,q)},m.update=function(){var c=this.G,d=a.position,e=b.position;g.rotate(n,i,a.angle),g.rotate(o,k,b.angle),g.add(p,e,o),g.sub(p,p,d),g.sub(p,p,n),g.rotate(q,j,a.angle+Math.PI/2),c[0]=-q[0],c[1]=-q[1],c[2]=-g.crossLength(n,q)+g.crossLength(q,p),c[3]=q[0],c[4]=q[1],c[5]=g.crossLength(o,q)},this.equations.push(m),!c.disableRotationalLock){var r=new h(a,b,-l,l);this.equations.push(r)}this.position=0,this.velocity=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=1,this.upperLimitEquation=new e(a,b),this.lowerLimitEquation=new e(a,b),this.upperLimitEquation.minForce=this.lowerLimitEquation.minForce=0,this.upperLimitEquation.maxForce=this.lowerLimitEquation.maxForce=l,this.motorEquation=new f(a,b),this.motorEnabled=!1,this.motorSpeed=0;{var s=this,t=this.motorEquation;t.computeGW}t.computeGq=function(){return 0},t.computeGW=function(){var a=this.G,b=this.bi,c=this.bj,d=b.velocity,e=c.velocity,f=b.angularVelocity,g=c.angularVelocity;return this.transformedGmult(a,d,f,e,g)+s.motorSpeed}}var d=a("./Constraint"),e=a("../equations/ContactEquation"),f=a("../equations/Equation"),g=a("../math/vec2"),h=a("../equations/RotationalLockEquation");b.exports=c,c.prototype=new d;var i=g.create(),j=g.create(),k=g.create(),l=g.create(),m=g.create(),n=g.create();c.prototype.update=function(){var a=this.equations,b=a[0],c=this.upperLimit,d=this.lowerLimit,e=this.upperLimitEquation,f=this.lowerLimitEquation,h=this.bodyA,o=this.bodyB,p=this.localAxisA,q=this.localAnchorA,r=this.localAnchorB;b.update(),g.rotate(i,p,h.angle),g.rotate(l,q,h.angle),g.add(j,l,h.position),g.rotate(m,r,o.angle),g.add(k,m,o.position);var s=this.position=g.dot(k,i)-g.dot(j,i);if(this.motorEnabled){var t=this.motorEquation.G;t[0]=i[0],t[1]=i[1],t[2]=g.crossLength(i,m),t[3]=-i[0],t[4]=-i[1],t[5]=-g.crossLength(i,l)}if(this.upperLimitEnabled&&s>c)g.scale(e.ni,i,-1),g.sub(e.ri,j,h.position),g.sub(e.rj,k,o.position),g.scale(n,i,c),g.add(e.ri,e.ri,n),-1==a.indexOf(e)&&a.push(e);else{var u=a.indexOf(e);-1!=u&&a.splice(u,1)}if(this.lowerLimitEnabled&&d>s)g.scale(f.ni,i,1),g.sub(f.ri,j,h.position),g.sub(f.rj,k,o.position),g.scale(n,i,d),g.sub(f.rj,f.rj,n),-1==a.indexOf(f)&&a.push(f);else{var u=a.indexOf(f);-1!=u&&a.splice(u,1)}},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}}},{"../equations/ContactEquation":23,"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../math/vec2":33,"./Constraint":16}],21:[function(a,b){function c(a,b,c,n,o){d.call(this,a,c,d.REVOLUTE),o=this.maxForce="undefined"!=typeof o?o:Number.MAX_VALUE,this.pivotA=b,this.pivotB=n;var p=this.equations=[new e(a,c,-o,o),new e(a,c,-o,o)],q=p[0],r=p[1];q.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,k)},r.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,l)},r.minForce=q.minForce=-o,r.maxForce=q.maxForce=o,this.motorEquation=new f(a,c),this.motorEnabled=!1,this.angle=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=0,this.upperLimitEquation=new g(a,c),this.lowerLimitEquation=new g(a,c),this.upperLimitEquation.minForce=0,this.lowerLimitEquation.maxForce=0}var d=a("./Constraint"),e=a("../equations/Equation"),f=a("../equations/RotationalVelocityEquation"),g=a("../equations/RotationalLockEquation"),h=a("../math/vec2");b.exports=c;var i=h.create(),j=h.create(),k=h.fromValues(1,0),l=h.fromValues(0,1),m=h.create();c.prototype=new d,c.prototype.update=function(){var a=this.bodyA,b=this.bodyB,c=this.pivotA,d=this.pivotB,e=this.equations,f=(e[0],e[1],e[0]),g=e[1],m=this.upperLimit,n=this.lowerLimit,o=this.upperLimitEquation,p=this.lowerLimitEquation,q=this.angle=b.angle-a.angle;if(this.upperLimitEnabled&&q>m)o.angle=m,-1==e.indexOf(o)&&e.push(o); else{var r=e.indexOf(o);-1!=r&&e.splice(r,1)}if(this.lowerLimitEnabled&&n>q)p.angle=n,-1==e.indexOf(p)&&e.push(p);else{var r=e.indexOf(p);-1!=r&&e.splice(r,1)}h.rotate(i,c,a.angle),h.rotate(j,d,b.angle),f.G[0]=-1,f.G[1]=0,f.G[2]=-h.crossLength(i,k),f.G[3]=1,f.G[4]=0,f.G[5]=h.crossLength(j,k),g.G[0]=0,g.G[1]=-1,g.G[2]=-h.crossLength(i,l),g.G[3]=0,g.G[4]=1,g.G[5]=h.crossLength(j,l)},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}},c.prototype.motorIsEnabled=function(){return!!this.motorEnabled},c.prototype.setMotorSpeed=function(a){if(this.motorEnabled){var b=this.equations.indexOf(this.motorEquation);this.equations[b].relativeVelocity=a}},c.prototype.getMotorSpeed=function(){return this.motorEnabled?this.motorEquation.relativeVelocity:!1}},{"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../equations/RotationalVelocityEquation":27,"../math/vec2":33,"./Constraint":16}],22:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0,this.ratio="number"==typeof c.ratio?c.ratio:1,this.setRatio(this.ratio)}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeGq=function(){return this.ratio*this.bi.angle-this.bj.angle+this.angle},c.prototype.setRatio=function(a){var b=this.G;b[2]=a,b[5]=-1,this.ratio=a}},{"../math/vec2":33,"./Equation":24}],23:[function(a,b){function c(a,b){d.call(this,a,b,0,Number.MAX_VALUE),this.ri=e.create(),this.penetrationVec=e.create(),this.rj=e.create(),this.ni=e.create(),this.restitution=0,this.firstImpact=!1,this.shapeA=null,this.shapeB=null}{var d=a("./Equation"),e=a("../math/vec2");a("../math/mat2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.bi,f=this.bj,g=this.ri,h=this.rj,i=d.position,j=f.position,k=this.penetrationVec,l=this.ni,m=this.G,n=e.crossLength(g,l),o=e.crossLength(h,l);m[0]=-l[0],m[1]=-l[1],m[2]=-n,m[3]=l[0],m[4]=l[1],m[5]=o,e.add(k,j,h),e.sub(k,k,i),e.sub(k,k,g);var p,q;this.firstImpact&&0!==this.restitution?(q=0,p=1/b*(1+this.restitution)*this.computeGW()):(q=e.dot(l,k),p=this.computeGW());var r=this.computeGiMf(),s=-q*a-p*b-c*r;return s}},{"../math/mat2":31,"../math/vec2":33,"./Equation":24}],24:[function(a,b){function c(a,b,c,d){this.minForce="undefined"==typeof c?-1e6:c,this.maxForce="undefined"==typeof d?1e6:d,this.bi=a,this.bj=b,this.stiffness=1e6,this.relaxation=4,this.G=new g.ARRAY_TYPE(6);for(var e=0;6>e;e++)this.G[e]=0;this.offset=0,this.a=0,this.b=0,this.eps=0,this.h=0,this.updateSpookParams(1/60),this.multiplier=0,this.relativeVelocity=0,this.enabled=!0}function d(a,b,c,d,e){return a[0]*b[0]+a[1]*b[1]+a[2]*c+a[3]*d[0]+a[4]*d[1]+a[5]*e}b.exports=c;var e=a("../math/vec2"),f=a("../math/mat2"),g=a("../utils/Utils");c.prototype.constructor=c,c.prototype.updateSpookParams=function(a){var b=this.stiffness,c=this.relaxation,d=a;this.a=4/(d*(1+4*c)),this.b=4*c/(1+4*c),this.eps=4/(d*d*b*(1+4*c)),this.h=a},c.prototype.computeB=function(a,b,c){var d=this.computeGW(),e=this.computeGq(),f=this.computeGiMf();return-e*a-d*b-f*c};var h=e.create(),i=e.create();c.prototype.computeGq=function(){var a=this.G,b=this.bi,c=this.bj,e=(b.position,c.position,b.angle),f=c.angle;return d(a,h,e,i,f)+this.offset};e.create(),e.create();c.prototype.transformedGmult=function(a,b,c,e,f){return d(a,b,c,e,f)},c.prototype.computeGW=function(){var a=this.G,b=this.bi,c=this.bj,d=b.velocity,e=c.velocity,f=b.angularVelocity,g=c.angularVelocity;return this.transformedGmult(a,d,f,e,g)+this.relativeVelocity},c.prototype.computeGWlambda=function(){var a=this.G,b=this.bi,c=this.bj,e=b.vlambda,f=c.vlambda,g=b.wlambda,h=c.wlambda;return d(a,e,g,f,h)};var j=e.create(),k=e.create();c.prototype.computeGiMf=function(){var a=this.bi,b=this.bj,c=a.force,d=a.angularForce,f=b.force,g=b.angularForce,h=a.invMass,i=b.invMass,l=a.invInertia,m=b.invInertia,n=this.G;return e.scale(j,c,h),e.scale(k,f,i),this.transformedGmult(n,j,d*l,k,g*m)},c.prototype.computeGiMGt=function(){var a=this.bi,b=this.bj,c=a.invMass,d=b.invMass,e=a.invInertia,f=b.invInertia,g=this.G;return g[0]*g[0]*c+g[1]*g[1]*c+g[2]*g[2]*e+g[3]*g[3]*d+g[4]*g[4]*d+g[5]*g[5]*f};{var l=e.create(),m=e.create(),n=e.create();e.create(),e.create(),e.create(),f.create(),f.create()}c.prototype.addToWlambda=function(a){var b=this.bi,c=this.bj,d=l,f=m,g=n,h=this.G;f[0]=h[0],f[1]=h[1],g[0]=h[3],g[1]=h[4],e.scale(d,f,b.invMass*a),e.add(b.vlambda,b.vlambda,d),e.scale(d,g,c.invMass*a),e.add(c.vlambda,c.vlambda,d),b.wlambda+=b.invInertia*h[2]*a,c.wlambda+=c.invInertia*h[5]*a},c.prototype.computeInvC=function(a){return 1/(this.computeGiMGt()+a)}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50}],25:[function(a,b){function c(a,b,c){e.call(this,a,b,-c,c),this.ri=d.create(),this.rj=d.create(),this.t=d.create(),this.contactEquation=null,this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}{var d=(a("../math/mat2"),a("../math/vec2")),e=a("./Equation");a("../utils/Utils")}b.exports=c,c.prototype=new e,c.prototype.constructor=c,c.prototype.setSlipForce=function(a){this.maxForce=a,this.minForce=-a},c.prototype.computeB=function(a,b,c){var e=(this.bi,this.bj,this.ri),f=this.rj,g=this.t,h=this.G;h[0]=-g[0],h[1]=-g[1],h[2]=-d.crossLength(e,g),h[3]=g[0],h[4]=g[1],h[5]=d.crossLength(f,g);var i=this.computeGW(),j=this.computeGiMf(),k=-i*b-c*j;return k}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50,"./Equation":24}],26:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0;var e=this.G;e[2]=1,e[5]=-1}var d=a("./Equation"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.constructor=c;var f=e.create(),g=e.create(),h=e.fromValues(1,0),i=e.fromValues(0,1);c.prototype.computeGq=function(){return e.rotate(f,h,this.bi.angle+this.angle),e.rotate(g,i,this.bj.angle),e.dot(f,g)}},{"../math/vec2":33,"./Equation":24}],27:[function(a,b){function c(a,b){d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.G;d[2]=-1,d[5]=this.ratio;var e=this.computeGiMf(),f=this.computeGW(),g=-f*b-c*e;return g}},{"../math/vec2":33,"./Equation":24}],28:[function(a,b){var c=function(){};b.exports=c,c.prototype={constructor:c,on:function(a,b,c){b.context=c||this,void 0===this._listeners&&(this._listeners={});var d=this._listeners;return void 0===d[a]&&(d[a]=[]),-1===d[a].indexOf(b)&&d[a].push(b),this},has:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},off:function(a,b){if(void 0===this._listeners)return this;var c=this._listeners,d=c[a].indexOf(b);return-1!==d&&c[a].splice(d,1),this},emit:function(a){if(void 0===this._listeners)return this;var b=this._listeners,c=b[a.type];if(void 0!==c){a.target=this;for(var d=0,e=c.length;e>d;d++){var f=c[d];f.call(f.context,a)}}return this}}},{}],29:[function(a,b){function c(a,b,e){if(e=e||{},!(a instanceof d&&b instanceof d))throw new Error("First two arguments must be Material instances.");this.id=c.idCounter++,this.materialA=a,this.materialB=b,this.friction="undefined"!=typeof e.friction?Number(e.friction):.3,this.restitution="undefined"!=typeof e.restitution?Number(e.restitution):0,this.stiffness="undefined"!=typeof e.stiffness?Number(e.stiffness):1e7,this.relaxation="undefined"!=typeof e.relaxation?Number(e.relaxation):3,this.frictionStiffness="undefined"!=typeof e.frictionStiffness?Number(e.frictionStiffness):1e7,this.frictionRelaxation="undefined"!=typeof e.frictionRelaxation?Number(e.frictionRelaxation):3,this.surfaceVelocity="undefined"!=typeof e.surfaceVelocity?Number(e.surfaceVelocity):0}var d=a("./Material");b.exports=c,c.idCounter=0},{"./Material":30}],30:[function(a,b){function c(){this.id=c.idCounter++}b.exports=c,c.idCounter=0},{}],31:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/mat2").mat2;b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/mat2":1}],32:[function(a,b){var c={};c.GetArea=function(a){if(a.length<6)return 0;for(var b=a.length-2,c=0,d=0;b>d;d+=2)c+=(a[d+2]-a[d])*(a[d+1]+a[d+3]);return c+=(a[0]-a[b])*(a[b+1]+a[1]),.5*-c},c.Triangulate=function(a){var b=a.length>>1;if(3>b)return[];for(var d=[],e=[],f=0;b>f;f++)e.push(f);for(var f=0,g=b;g>3;){var h=e[(f+0)%g],i=e[(f+1)%g],j=e[(f+2)%g],k=a[2*h],l=a[2*h+1],m=a[2*i],n=a[2*i+1],o=a[2*j],p=a[2*j+1],q=!1;if(c._convex(k,l,m,n,o,p)){q=!0;for(var r=0;g>r;r++){var s=e[r];if(s!=h&&s!=i&&s!=j&&c._PointInTriangle(a[2*s],a[2*s+1],k,l,m,n,o,p)){q=!1;break}}}if(q)d.push(h,i,j),e.splice((f+1)%g,1),g--,f=0;else if(f++>3*g)break}return d.push(e[0],e[1],e[2]),d},c._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},c._convex=function(a,b,c,d,e,f){return(b-d)*(e-c)+(c-a)*(f-d)>=0},b.exports=c},{}],33:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/vec2").vec2;c.getX=function(a){return a[0]},c.getY=function(a){return a[1]},c.crossLength=function(a,b){return a[0]*b[1]-a[1]*b[0]},c.crossVZ=function(a,b,d){return c.rotate(a,b,-Math.PI/2),c.scale(a,a,d),a},c.crossZV=function(a,b,d){return c.rotate(a,d,Math.PI/2),c.scale(a,a,b),a},c.rotate=function(a,b,c){var d=Math.cos(c),e=Math.sin(c),f=b[0],g=b[1];a[0]=d*f-e*g,a[1]=e*f+d*g},c.toLocalFrame=function(a,b,d,e){c.copy(a,b),c.sub(a,a,d),c.rotate(a,a,-e)},c.toGlobalFrame=function(a,b,d,e){c.copy(a,b),c.rotate(a,a,e),c.add(a,a,d)},c.centroid=function(a,b,d,e){return c.add(a,b,d),c.add(a,a,e),c.scale(a,a,1/3),a},b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/vec2":2}],34:[function(a,b){function c(a){a=a||{},h.call(this),this.id=++c._idCounter,this.world=null,this.shapes=[],this.shapeOffsets=[],this.shapeAngles=[],this.mass=a.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.fixedRotation=!!a.fixedRotation||!1,this.position=d.fromValues(0,0),a.position&&d.copy(this.position,a.position),this.interpolatedPosition=d.fromValues(0,0),this.velocity=d.fromValues(0,0),a.velocity&&d.copy(this.velocity,a.velocity),this.vlambda=d.fromValues(0,0),this.wlambda=0,this.angle=a.angle||0,this.angularVelocity=a.angularVelocity||0,this.force=d.create(),a.force&&d.copy(this.force,a.force),this.angularForce=a.angularForce||0,this.damping="number"==typeof a.damping?a.damping:.1,this.angularDamping="number"==typeof a.angularDamping?a.angularDamping:.1,this.motionState=0==this.mass?c.STATIC:c.DYNAMIC,this.boundingRadius=0,this.aabb=new g,this.aabbNeedsUpdate=!0,this.allowSleep=!1,this.sleepState=c.AWAKE,this.sleepSpeedLimit=.1,this.sleepTimeLimit=1,this.gravityScale=1,this.timeLastSleepy=0,this.concavePath=null,this.lastDampingScale=1,this.lastAngularDampingScale=1,this.lastDampingTimeStep=-1,this.updateMassProperties()}var d=a("../math/vec2"),e=a("poly-decomp"),f=a("../shapes/Convex"),g=a("../collision/AABB"),h=a("../events/EventEmitter");b.exports=c,c.prototype=new h,c._idCounter=0,c.prototype.setDensity=function(a){var b=this.getArea();this.mass=b*a,this.updateMassProperties()},c.prototype.getArea=function(){for(var a=0,b=0;b<this.shapes.length;b++)a+=this.shapes[b].area;return a};var i=new g,j=d.create();c.prototype.updateAABB=function(){for(var a=this.shapes,b=this.shapeOffsets,c=this.shapeAngles,e=a.length,f=0;f!==e;f++){var g=a[f],h=j,k=c[f]+this.angle;d.rotate(h,b[f],this.angle),d.add(h,h,this.position),g.computeAABB(i,h,k),0===f?this.aabb.copy(i):this.aabb.extend(i)}this.aabbNeedsUpdate=!1},c.prototype.updateBoundingRadius=function(){for(var a=this.shapes,b=this.shapeOffsets,c=a.length,e=0,f=0;f!==c;f++){var g=a[f],h=d.length(b[f]),i=g.boundingRadius;h+i>e&&(e=h+i)}this.boundingRadius=e},c.prototype.addShape=function(a,b,c){c=c||0,b=b?d.fromValues(b[0],b[1]):d.fromValues(0,0),this.shapes.push(a),this.shapeOffsets.push(b),this.shapeAngles.push(c),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},c.prototype.removeShape=function(a){var b=this.shapes.indexOf(a);return-1!=b?(this.shapes.splice(b,1),this.shapeOffsets.splice(b,1),this.shapeAngles.splice(b,1),this.aabbNeedsUpdate=!0,!0):!1},c.prototype.updateMassProperties=function(){if(this.motionState==c.STATIC||this.motionState==c.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var a=this.shapes,b=a.length,e=this.mass/b,f=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var g=0;b>g;g++){var h=a[g],i=d.squaredLength(this.shapeOffsets[g]),j=h.computeMomentOfInertia(e);f+=j+e*i}this.inertia=f,this.invInertia=f>0?1/f:0}this.invMass=1/this.mass}};var k=d.create();c.prototype.applyForce=function(a,b){var c=k;d.sub(c,b,this.position),d.add(this.force,this.force,a);var e=d.crossLength(c,a);this.angularForce+=e},c.prototype.toLocalFrame=function(a,b){d.toLocalFrame(a,b,this.position,this.angle)},c.prototype.toWorldFrame=function(a,b){d.toGlobalFrame(a,b,this.position,this.angle)},c.prototype.fromPolygon=function(a,b){b=b||{};for(var c=this.shapes.length;c>=0;--c)this.removeShape(this.shapes[c]);var g=new e.Polygon;if(g.vertices=a,g.makeCCW(),"number"==typeof b.removeCollinearPoints&&g.removeCollinearPoints(b.removeCollinearPoints),"undefined"==typeof b.skipSimpleCheck&&!g.isSimple())return!1;this.concavePath=g.vertices.slice(0);for(var c=0;c<this.concavePath.length;c++){var h=[0,0];d.copy(h,this.concavePath[c]),this.concavePath[c]=h}var i;i=b.optimalDecomp?g.decomp():g.quickDecomp();for(var j=d.create(),c=0;c!==i.length;c++){for(var k=new f(i[c].vertices),l=0;l!==k.vertices.length;l++){var h=k.vertices[l];d.sub(h,h,k.centerOfMass)}d.scale(j,k.centerOfMass,1),k.updateTriangles(),k.updateCenterOfMass(),k.updateBoundingRadius(),this.addShape(k,j)}return this.adjustCenterOfMass(),this.aabbNeedsUpdate=!0,!0};var l=(d.fromValues(0,0),d.fromValues(0,0)),m=d.fromValues(0,0),n=d.fromValues(0,0);c.prototype.adjustCenterOfMass=function(){var a=l,b=m,c=n,e=0;d.set(b,0,0);for(var f=0;f!==this.shapes.length;f++){var g=this.shapes[f],h=this.shapeOffsets[f];d.scale(a,h,g.area),d.add(b,b,a),e+=g.area}d.scale(c,b,1/e);for(var f=0;f!==this.shapes.length;f++){var g=this.shapes[f],h=this.shapeOffsets[f];h||(h=this.shapeOffsets[f]=d.create()),d.sub(h,h,c)}d.add(this.position,this.position,c);for(var f=0;this.concavePath&&f<this.concavePath.length;f++)d.sub(this.concavePath[f],this.concavePath[f],c);this.updateMassProperties(),this.updateBoundingRadius()},c.prototype.setZeroForce=function(){d.set(this.force,0,0),this.angularForce=0},c.prototype.resetConstraintVelocity=function(){var a=this,b=a.vlambda;d.set(b,0,0),a.wlambda=0},c.prototype.addConstraintVelocity=function(){var a=this,b=a.velocity;d.add(b,b,a.vlambda),a.angularVelocity+=a.wlambda},c.prototype.applyDamping=function(a){if(this.motionState==c.DYNAMIC){a!=this.lastDampingTimeStep&&(this.lastDampingScale=Math.pow(1-this.damping,a),this.lastAngularDampingScale=Math.pow(1-this.angularDamping,a),this.lastDampingTimeStep=a);var b=this.velocity;d.scale(b,b,this.lastDampingScale),this.angularVelocity*=this.lastAngularDampingScale}},c.prototype.wakeUp=function(){var a=this.sleepState;this.sleepState=c.AWAKE,a!==c.AWAKE&&this.emit(c.wakeUpEvent)},c.prototype.sleep=function(){this.sleepState=c.SLEEPING,this.emit(c.sleepEvent)},c.prototype.sleepTick=function(a){if(this.allowSleep){var b=this.sleepState,e=d.squaredLength(this.velocity)+Math.pow(this.angularVelocity,2),f=Math.pow(this.sleepSpeedLimit,2);b===c.AWAKE&&f>e?(this.sleepState=c.SLEEPY,this.timeLastSleepy=a,this.emit(c.sleepyEvent)):b===c.SLEEPY&&e>f?this.wakeUp():b===c.SLEEPY&&a-this.timeLastSleepy>this.sleepTimeLimit&&this.sleep()}},c.sleepyEvent={type:"sleepy"},c.sleepEvent={type:"sleep"},c.wakeUpEvent={type:"wakeup"},c.DYNAMIC=1,c.STATIC=2,c.KINEMATIC=4,c.AWAKE=0,c.SLEEPY=1,c.SLEEPING=2},{"../collision/AABB":9,"../events/EventEmitter":28,"../math/vec2":33,"../shapes/Convex":39,"poly-decomp":7}],35:[function(a,b){function c(a,b,c){c=c||{},this.restLength="number"==typeof c.restLength?c.restLength:1,this.stiffness=c.stiffness||100,this.damping=c.damping||1,this.bodyA=a,this.bodyB=b,this.localAnchorA=d.fromValues(0,0),this.localAnchorB=d.fromValues(0,0),c.localAnchorA&&d.copy(this.localAnchorA,c.localAnchorA),c.localAnchorB&&d.copy(this.localAnchorB,c.localAnchorB),c.worldAnchorA&&this.setWorldAnchorA(c.worldAnchorA),c.worldAnchorB&&this.setWorldAnchorB(c.worldAnchorB)}var d=a("../math/vec2");b.exports=c,c.prototype.setWorldAnchorA=function(a){this.bodyA.toLocalFrame(this.localAnchorA,a)},c.prototype.setWorldAnchorB=function(a){this.bodyB.toLocalFrame(this.localAnchorB,a)},c.prototype.getWorldAnchorA=function(a){this.bodyA.toWorldFrame(a,this.localAnchorA)},c.prototype.getWorldAnchorB=function(a){this.bodyB.toWorldFrame(a,this.localAnchorB)};var e=d.create(),f=d.create(),g=d.create(),h=d.create(),i=d.create(),j=d.create(),k=d.create(),l=d.create(),m=d.create();c.prototype.applyForce=function(){var a=this.stiffness,b=this.damping,c=this.restLength,n=this.bodyA,o=this.bodyB,p=e,q=f,r=g,s=h,t=m,u=i,v=j,w=k,x=l;this.getWorldAnchorA(u),this.getWorldAnchorB(v),d.sub(w,u,n.position),d.sub(x,v,o.position),d.sub(p,v,u);var y=d.len(p);d.normalize(q,p),d.sub(r,o.velocity,n.velocity),d.crossZV(t,o.angularVelocity,x),d.add(r,r,t),d.crossZV(t,n.angularVelocity,w),d.sub(r,r,t),d.scale(s,q,-a*(y-c)-b*d.dot(r,q)),d.sub(n.force,n.force,s),d.add(o.force,o.force,s);var z=d.crossLength(w,s),A=d.crossLength(x,s);n.angularForce-=z,o.angularForce+=A}},{"../math/vec2":33}],36:[function(a,b){b.exports={AABB:a("./collision/AABB"),AngleLockEquation:a("./equations/AngleLockEquation"),Body:a("./objects/Body"),Broadphase:a("./collision/Broadphase"),Capsule:a("./shapes/Capsule"),Circle:a("./shapes/Circle"),Constraint:a("./constraints/Constraint"),ContactEquation:a("./equations/ContactEquation"),ContactMaterial:a("./material/ContactMaterial"),Convex:a("./shapes/Convex"),DistanceConstraint:a("./constraints/DistanceConstraint"),Equation:a("./equations/Equation"),EventEmitter:a("./events/EventEmitter"),FrictionEquation:a("./equations/FrictionEquation"),GearConstraint:a("./constraints/GearConstraint"),GridBroadphase:a("./collision/GridBroadphase"),GSSolver:a("./solver/GSSolver"),Heightfield:a("./shapes/Heightfield"),Island:a("./solver/IslandSolver"),IslandSolver:a("./solver/IslandSolver"),Line:a("./shapes/Line"),LockConstraint:a("./constraints/LockConstraint"),Material:a("./material/Material"),Narrowphase:a("./collision/Narrowphase"),NaiveBroadphase:a("./collision/NaiveBroadphase"),Particle:a("./shapes/Particle"),Plane:a("./shapes/Plane"),RevoluteConstraint:a("./constraints/RevoluteConstraint"),PrismaticConstraint:a("./constraints/PrismaticConstraint"),Rectangle:a("./shapes/Rectangle"),RotationalVelocityEquation:a("./equations/RotationalVelocityEquation"),SAPBroadphase:a("./collision/SAPBroadphase"),Shape:a("./shapes/Shape"),Solver:a("./solver/Solver"),Spring:a("./objects/Spring"),Utils:a("./utils/Utils"),World:a("./world/World"),QuadTree:a("./collision/QuadTree").QuadTree,vec2:a("./math/vec2"),version:a("../package.json").version}},{"../package.json":8,"./collision/AABB":9,"./collision/Broadphase":10,"./collision/GridBroadphase":11,"./collision/NaiveBroadphase":12,"./collision/Narrowphase":13,"./collision/QuadTree":14,"./collision/SAPBroadphase":15,"./constraints/Constraint":16,"./constraints/DistanceConstraint":17,"./constraints/GearConstraint":18,"./constraints/LockConstraint":19,"./constraints/PrismaticConstraint":20,"./constraints/RevoluteConstraint":21,"./equations/AngleLockEquation":22,"./equations/ContactEquation":23,"./equations/Equation":24,"./equations/FrictionEquation":25,"./equations/RotationalVelocityEquation":27,"./events/EventEmitter":28,"./material/ContactMaterial":29,"./material/Material":30,"./math/vec2":33,"./objects/Body":34,"./objects/Spring":35,"./shapes/Capsule":37,"./shapes/Circle":38,"./shapes/Convex":39,"./shapes/Heightfield":40,"./shapes/Line":41,"./shapes/Particle":42,"./shapes/Plane":43,"./shapes/Rectangle":44,"./shapes/Shape":45,"./solver/GSSolver":46,"./solver/IslandSolver":48,"./solver/Solver":49,"./utils/Utils":50,"./world/World":51}],37:[function(a,b){function c(a,b){this.length=a||1,this.radius=b||1,d.call(this,d.CAPSULE)}var d=a("./Shape"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(a){var b=this.radius,c=this.length+b,d=2*b;return a*(d*d+c*c)/12},c.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius+this.length/2},c.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius+2*this.radius*this.length};var f=e.create();c.prototype.computeAABB=function(a,b,c){var d=this.radius;e.set(f,this.length,0),e.rotate(f,f,c),e.set(a.upperBound,Math.max(f[0]+d,-f[0]+d),Math.max(f[1]+d,-f[1]+d)),e.set(a.lowerBound,Math.min(f[0]-d,-f[0]-d),Math.min(f[1]-d,-f[1]-d)),e.add(a.lowerBound,a.lowerBound,b),e.add(a.upperBound,a.upperBound,b)}},{"../math/vec2":33,"./Shape":45}],38:[function(a,b){function c(a){this.radius=a||1,d.call(this,d.CIRCLE)}var d=a("./Shape"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(a){var b=this.radius;return a*b*b/2},c.prototype.updateBoundingRadius=function(){this.boundingRadius=this.radius},c.prototype.updateArea=function(){this.area=Math.PI*this.radius*this.radius},c.prototype.computeAABB=function(a,b){var c=this.radius;e.set(a.upperBound,c,c),e.set(a.lowerBound,-c,-c),b&&(e.add(a.lowerBound,a.lowerBound,b),e.add(a.upperBound,a.upperBound,b))}},{"../math/vec2":33,"./Shape":45}],39:[function(a,b){function c(a){this.vertices=[];for(var b=0;b<a.length;b++){var c=e.create();e.copy(c,a[b]),this.vertices.push(c)}if(this.centerOfMass=e.fromValues(0,0),this.triangles=[],this.vertices.length&&(this.updateTriangles(),this.updateCenterOfMass()),this.boundingRadius=0,d.call(this,d.CONVEX),this.updateBoundingRadius(),this.updateArea(),this.area<0)throw new Error("Convex vertices must be given in conter-clockwise winding.")}{var d=a("./Shape"),e=a("../math/vec2"),f=a("../math/polyk");a("poly-decomp")}b.exports=c,c.prototype=new d,c.prototype.updateTriangles=function(){this.triangles.length=0;for(var a=[],b=0;b<this.vertices.length;b++){var c=this.vertices[b];a.push(c[0],c[1])}for(var d=f.Triangulate(a),b=0;b<d.length;b+=3){var e=d[b],g=d[b+1],h=d[b+2];this.triangles.push([e,g,h])}};{var g=e.create(),h=e.create(),i=e.create(),j=e.create(),k=e.create();e.create(),e.create(),e.create(),e.create()}c.prototype.updateCenterOfMass=function(){var a=this.triangles,b=this.vertices,d=this.centerOfMass,f=g,l=i,m=j,n=k,o=h;e.set(d,0,0);for(var p=0,q=0;q!==a.length;q++){var r=a[q],l=b[r[0]],m=b[r[1]],n=b[r[2]];e.centroid(f,l,m,n);var s=c.triangleArea(l,m,n);p+=s,e.scale(o,f,s),e.add(d,d,o)}e.scale(d,d,1/p)},c.prototype.computeMomentOfInertia=function(a){for(var b=0,c=0,d=this.vertices.length,f=d-1,g=0;d>g;f=g,g++){var h=this.vertices[f],i=this.vertices[g],j=Math.abs(e.crossLength(h,i)),k=e.dot(i,i)+e.dot(i,h)+e.dot(h,h);b+=j*k,c+=j}return a/6*(b/c)},c.prototype.updateBoundingRadius=function(){for(var a=this.vertices,b=0,c=0;c!==a.length;c++){var d=e.squaredLength(a[c]);d>b&&(b=d)}this.boundingRadius=Math.sqrt(b)},c.triangleArea=function(a,b,c){return.5*((b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1]))},c.prototype.updateArea=function(){this.updateTriangles(),this.area=0;for(var a=this.triangles,b=this.vertices,d=0;d!==a.length;d++){var e=a[d],f=b[e[0]],g=b[e[1]],h=b[e[2]],i=c.triangleArea(f,g,h);this.area+=i}},c.prototype.computeAABB=function(a,b,c){a.setFromPoints(this.vertices,b,c)}},{"../math/polyk":32,"../math/vec2":33,"./Shape":45,"poly-decomp":7}],40:[function(a,b){function c(a,b,c){this.data=a,this.maxValue=b,this.elementWidth=c,d.call(this,d.HEIGHTFIELD)}{var d=a("./Shape");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return Number.MAX_VALUE},c.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},c.prototype.updateArea=function(){for(var a=this.data,b=0,c=0;c<a.length-1;c++)b+=(a[c]+a[c+1])/2*this.elementWidth;this.area=b},c.prototype.computeAABB=function(a,b){a.upperBound[0]=this.elementWidth*this.data.length+b[0],a.upperBound[1]=this.maxValue+b[1],a.lowerBound[0]=b[0],a.lowerBound[1]=b[1]}},{"../math/vec2":33,"./Shape":45}],41:[function(a,b){function c(a){this.length=a,d.call(this,d.LINE)}var d=a("./Shape"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(a){return a*Math.pow(this.length,2)/12},c.prototype.updateBoundingRadius=function(){this.boundingRadius=this.length/2};var f=[e.create(),e.create()];c.prototype.computeAABB=function(a,b,c){var d=this.length;e.set(f[0],-d/2,0),e.set(f[1],d/2,0),a.setFromPoints(f,b,c)}},{"../math/vec2":33,"./Shape":45}],42:[function(a,b){function c(){d.call(this,d.PARTICLE)}var d=a("./Shape"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return 0},c.prototype.updateBoundingRadius=function(){this.boundingRadius=0},c.prototype.computeAABB=function(a,b){this.length;e.copy(a.lowerBound,b),e.copy(a.upperBound,b)}},{"../math/vec2":33,"./Shape":45}],43:[function(a,b){function c(){d.call(this,d.PLANE)}{var d=a("./Shape"),e=a("../math/vec2");a("../utils/Utils")}b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return 0},c.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},c.prototype.computeAABB=function(a,b,c){var d=0,f=e.set;"number"==typeof c&&(d=c%(2*Math.PI)),0==d?(f(a.lowerBound,-Number.MAX_VALUE,-Number.MAX_VALUE),f(a.upperBound,Number.MAX_VALUE,0)):d==Math.PI/2?(f(a.lowerBound,0,-Number.MAX_VALUE),f(a.upperBound,Number.MAX_VALUE,Number.MAX_VALUE)):d==Math.PI?(f(a.lowerBound,-Number.MAX_VALUE,0),f(a.upperBound,Number.MAX_VALUE,Number.MAX_VALUE)):d==3*Math.PI/2?(f(a.lowerBound,-Number.MAX_VALUE,-Number.MAX_VALUE),f(a.upperBound,0,Number.MAX_VALUE)):(f(a.lowerBound,-Number.MAX_VALUE,-Number.MAX_VALUE),f(a.upperBound,Number.MAX_VALUE,Number.MAX_VALUE)),e.add(a.lowerBound,a.lowerBound,b),e.add(a.upperBound,a.upperBound,b)},c.prototype.updateArea=function(){this.area=Number.MAX_VALUE}},{"../math/vec2":33,"../utils/Utils":50,"./Shape":45}],44:[function(a,b){function c(a,b){var c=[d.fromValues(-a/2,-b/2),d.fromValues(a/2,-b/2),d.fromValues(a/2,b/2),d.fromValues(-a/2,b/2)];this.width=a,this.height=b,f.call(this,c),this.type=e.RECTANGLE}var d=a("../math/vec2"),e=a("./Shape"),f=a("./Convex");b.exports=c,c.prototype=new f([]),c.prototype.computeMomentOfInertia=function(a){var b=this.width,c=this.height;return a*(c*c+b*b)/12},c.prototype.updateBoundingRadius=function(){var a=this.width,b=this.height;this.boundingRadius=Math.sqrt(a*a+b*b)/2};d.create(),d.create(),d.create(),d.create();c.prototype.computeAABB=function(a,b,c){a.setFromPoints(this.vertices,b,c)},c.prototype.updateArea=function(){this.area=this.width*this.height}},{"../math/vec2":33,"./Convex":39,"./Shape":45}],45:[function(a,b){function c(a){this.type=a,this.id=c.idCounter++,this.boundingRadius=0,this.collisionGroup=1,this.collisionMask=1,a&&this.updateBoundingRadius(),this.material=null,this.area=0,this.sensor=!1,this.updateArea()}b.exports=c,c.idCounter=0,c.CIRCLE=1,c.PARTICLE=2,c.PLANE=4,c.CONVEX=8,c.LINE=16,c.RECTANGLE=32,c.CAPSULE=64,c.HEIGHTFIELD=128,c.prototype.computeMomentOfInertia=function(){throw new Error("Shape.computeMomentOfInertia is not implemented in this Shape...")},c.prototype.updateBoundingRadius=function(){throw new Error("Shape.updateBoundingRadius is not implemented in this Shape...")},c.prototype.updateArea=function(){},c.prototype.computeAABB=function(){}},{}],46:[function(a,b){function c(a){f.call(this,a,f.GS),a=a||{},this.iterations=a.iterations||10,this.tolerance=a.tolerance||0,this.debug=a.debug||!1,this.arrayStep=30,this.lambda=new g.ARRAY_TYPE(this.arrayStep),this.Bs=new g.ARRAY_TYPE(this.arrayStep),this.invCs=new g.ARRAY_TYPE(this.arrayStep),this.useGlobalEquationParameters=!0,this.stiffness=1e6,this.relaxation=4,this.useZeroRHS=!1,this.useNormalForceForFriction=!1,this.skipFrictionIterations=0}function d(a){for(var b=0;b!==a.length;b++)a[b]=0}var e=a("../math/vec2"),f=a("./Solver"),g=a("../utils/Utils"),h=a("../equations/FrictionEquation");b.exports=c,c.prototype=new f,c.prototype.solve=function(a,b){this.sortEquations();var f=0,i=this.iterations,j=this.skipFrictionIterations,k=this.tolerance*this.tolerance,l=this.equations,m=l.length,n=b.bodies,o=b.bodies.length,p=this.relaxation,q=this.stiffness,r=4/(a*a*q*(1+4*p)),s=4/(a*(1+4*p)),t=4*p/(1+4*p),u=this.useGlobalEquationParameters,v=(e.add,e.set,this.useZeroRHS),w=this.lambda;w.length<m&&(w=this.lambda=new g.ARRAY_TYPE(m+this.arrayStep),this.Bs=new g.ARRAY_TYPE(m+this.arrayStep),this.invCs=new g.ARRAY_TYPE(m+this.arrayStep)),d(w);var x=this.invCs,y=this.Bs,w=this.lambda;if(u)for(var z,A=0;z=l[A];A++)y[A]=z.computeB(s,t,a),x[A]=z.computeInvC(r);else for(var z,A=0;z=l[A];A++)z.updateSpookParams(a),y[A]=z.computeB(z.a,z.b,a),x[A]=z.computeInvC(z.eps);var z,B,A,C;if(0!==m){for(A=0;A!==o;A++)n[A].resetConstraintVelocity();for(f=0;f!==i;f++){for(B=0,C=0;C!==m;C++)if(z=l[C],!(z instanceof h&&j>f)){var D=u?r:z.eps,E=c.iterateEquation(C,z,D,y,x,w,v,a,f,j,this.useNormalForceForFriction);B+=Math.abs(E)}if(k>=B*B)break}for(A=0;A!==o;A++)n[A].addConstraintVelocity()}},c.iterateEquation=function(a,b,c,d,e,f,g,i,j,k,l){var m=d[a],n=e[a],o=f[a],p=b.computeGWlambda();l&&b instanceof h&&j==k&&(b.maxForce=b.contactEquation.multiplier*b.frictionCoefficient*i,b.minForce=-b.contactEquation.multiplier*b.frictionCoefficient*i);var q=b.maxForce,r=b.minForce;g&&(m=0);var s=n*(m-p-c*o),t=o+s;return r*i>t?s=r*i-o:t>q*i&&(s=q*i-o),f[a]+=s,b.multiplier=f[a]/i,b.addToWlambda(s),s}},{"../equations/FrictionEquation":25,"../math/vec2":33,"../utils/Utils":50,"./Solver":49}],47:[function(a,b){function c(){this.equations=[],this.bodies=[]}b.exports=c,c.prototype.reset=function(){this.equations.length=this.bodies.length=0},c.prototype.getBodies=function(){for(var a=[],b=[],c=this.equations,d=0;d!==c.length;d++){var e=c[d];-1===b.indexOf(e.bi.id)&&(a.push(e.bi),b.push(e.bi.id)),-1===b.indexOf(e.bj.id)&&(a.push(e.bj),b.push(e.bj.id))}return a},c.prototype.solve=function(a,b){var c=[];b.removeAllEquations();for(var d=this.equations.length,e=0;e!==d;e++)b.addEquation(this.equations[e]);for(var f=this.getBodies(),g=f.length,e=0;e!==g;e++)c.push(f[e]);b.solve(a,{bodies:c})}},{}],48:[function(a,b){function c(a,b){g.call(this,b,g.ISLAND);this.subsolver=a,this.numIslands=0,this._nodePool=[],this._islandPool=[],this.beforeSolveIslandEvent={type:"beforeSolveIsland",island:null}}function d(a){for(var b=a.length,c=0;c!==b;c++){var d=a[c];if(!d.visited&&d.body.motionState!=j)return d}return!1}function e(a,b,c){b.push(a.body);for(var d=a.eqs.length,e=0;e!==d;e++){var f=a.eqs[e];-1===c.indexOf(f)&&c.push(f)}}function f(a,b,c,e){for(k.length=0,k.push(a),a.visited=!0,b(a,c,e);k.length;)for(var f,g=k.pop();f=d(g.children);)f.visited=!0,b(f,c,e),k.push(f)}var g=a("./Solver"),h=(a("../math/vec2"),a("../solver/Island")),i=a("../objects/Body"),j=i.STATIC;b.exports=c,c.prototype=new g;var k=[],l=[],m=[],n=[],o=[];c.prototype.solve=function(a,b){var c=l,g=b.bodies,i=this.equations,j=i.length,k=g.length,p=(this.subsolver,this._workers,this._workerData,this._workerIslandGroups,this._islandPool);l.length=0;for(var q=0;q!==k;q++)c.push(this._nodePool.length?this._nodePool.pop():{body:g[q],children:[],eqs:[],visited:!1});for(var q=0;q!==k;q++){var r=c[q];r.body=g[q],r.children.length=0,r.eqs.length=0,r.visited=!1}for(var s=0;s!==j;s++){var t=i[s],q=g.indexOf(t.bi),u=g.indexOf(t.bj),v=c[q],w=c[u]; v.children.push(w),v.eqs.push(t),w.children.push(v),w.eqs.push(t)}var x,y=0,z=m,A=n;z.length=0,A.length=0;var B=o;for(B.length=0;x=d(c);){var C=p.length?p.pop():new h;z.length=0,A.length=0,f(x,e,A,z);for(var D=z.length,q=0;q!==D;q++){var t=z[q];C.equations.push(t)}y++,B.push(C)}this.numIslands=y;for(var E=this.beforeSolveIslandEvent,q=0;q<B.length;q++){var C=B[q];E.island=C,this.emit(E),C.solve(a,this.subsolver),C.reset(),p.push(C)}}},{"../math/vec2":33,"../objects/Body":34,"../solver/Island":47,"./Solver":49}],49:[function(a,b){function c(a,b){a=a||{},d.call(this),this.type=b,this.equations=[],this.equationSortFunction=a.equationSortFunction||!1}var d=(a("../utils/Utils"),a("../events/EventEmitter"));b.exports=c,c.prototype=new d,c.prototype.solve=function(){throw new Error("Solver.solve should be implemented by subclasses!")},c.prototype.sortEquations=function(){this.equationSortFunction&&this.equations.sort(this.equationSortFunction)},c.prototype.addEquation=function(a){a.enabled&&this.equations.push(a)},c.prototype.addEquations=function(a){for(var b=0,c=a.length;b!==c;b++){var d=a[b];d.enabled&&this.equations.push(d)}},c.prototype.removeEquation=function(a){var b=this.equations.indexOf(a);-1!=b&&this.equations.splice(b,1)},c.prototype.removeAllEquations=function(){this.equations.length=0},c.GS=1,c.ISLAND=2},{"../events/EventEmitter":28,"../utils/Utils":50}],50:[function(a,b){function c(){}b.exports=c,c.appendArray=function(a,b){if(b.length<15e4)a.push.apply(a,b);else for(var c=0,d=b.length;c!==d;++c)a.push(b[c])},c.splice=function(a,b,c){c=c||1;for(var d=b,e=a.length-c;e>d;d++)a[d]=a[d+c];a.length=e},c.ARRAY_TYPE=Float32Array||Array},{}],51:[function(a,b){function c(a){n.apply(this),a=a||{},this.springs=[],this.bodies=[],this.solver=a.solver||new d,this.narrowphase=new x(this),this.gravity=a.gravity||f.fromValues(0,-9.78),this.doProfiling=a.doProfiling||!1,this.lastStepTime=0,this.broadphase=a.broadphase||new e,this.broadphase.setWorld(this),this.constraints=[],this.defaultFriction=.3,this.defaultRestitution=0,this.defaultMaterial=new q,this.defaultContactMaterial=new r(this.defaultMaterial,this.defaultMaterial),this.lastTimeStep=1/60,this.applySpringForces=!0,this.applyDamping=!0,this.applyGravity=!0,this.solveConstraints=!0,this.contactMaterials=[],this.time=0,this.fixedStepTime=0,this.emitImpactEvent=!0,this._constraintIdCounter=0,this._bodyIdCounter=0,this.postStepEvent={type:"postStep"},this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.addSpringEvent={type:"addSpring",spring:null},this.impactEvent={type:"impact",bodyA:null,bodyB:null,shapeA:null,shapeB:null,contactEquation:null},this.postBroadphaseEvent={type:"postBroadphase",pairs:null},this.enableBodySleeping=!1,this.beginContactEvent={type:"beginContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null,contactEquations:[]},this.endContactEvent={type:"endContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null},this.preSolveEvent={type:"preSolve",contactEquations:null,frictionEquations:null},this.overlappingShapesLastState={keys:[]},this.overlappingShapesCurrentState={keys:[]},this.overlappingShapeLookup={keys:[]}}var d=a("../solver/GSSolver"),e=a("../collision/NaiveBroadphase"),f=a("../math/vec2"),g=a("../shapes/Circle"),h=a("../shapes/Rectangle"),i=a("../shapes/Convex"),j=a("../shapes/Line"),k=a("../shapes/Plane"),l=a("../shapes/Capsule"),m=a("../shapes/Particle"),n=a("../events/EventEmitter"),o=a("../objects/Body"),p=a("../objects/Spring"),q=a("../material/Material"),r=a("../material/ContactMaterial"),s=a("../constraints/DistanceConstraint"),t=a("../constraints/LockConstraint"),u=a("../constraints/RevoluteConstraint"),v=a("../constraints/PrismaticConstraint"),w=a("../../package.json"),x=(a("../collision/Broadphase"),a("../collision/Narrowphase")),y=a("../utils/Utils");b.exports=c;var z=w.version.split(".").slice(0,2).join(".");if("undefined"==typeof performance&&(performance={}),!performance.now){var A=Date.now();performance.timing&&performance.timing.navigationStart&&(A=performance.timing.navigationStart),performance.now=function(){return Date.now()-A}}c.prototype=new Object(n.prototype),c.prototype.addConstraint=function(a){this.constraints.push(a)},c.prototype.addContactMaterial=function(a){this.contactMaterials.push(a)},c.prototype.removeContactMaterial=function(a){var b=this.contactMaterials.indexOf(a);-1!==b&&y.splice(this.contactMaterials,b,1)},c.prototype.getContactMaterial=function(a,b){for(var c=this.contactMaterials,d=0,e=c.length;d!==e;d++){var f=c[d];if(f.materialA===a&&f.materialB===b||f.materialA===b&&f.materialB===a)return f}return!1},c.prototype.removeConstraint=function(a){var b=this.constraints.indexOf(a);-1!==b&&y.splice(this.constraints,b,1)};{var B=(f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create()),C=f.fromValues(0,0),D=f.fromValues(0,0);f.fromValues(0,0)}c.prototype.step=function(a,b,c){if(c=c||10,b=b||0,0==b)this.internalStep(a),this.time+=a;else{var d=Math.floor((this.time+b)/a)-Math.floor(this.time/a);d=Math.min(d,c);for(var e=0;d>e;e++)this.internalStep(a);this.time+=b,this.fixedStepTime+=d*a;for(var f=this.time-this.fixedStepTime-a,g=0;g!==this.bodies.length;g++){var h=this.bodies[g];h.interpolatedPosition[0]=h.position[0]+h.velocity[0]*f,h.interpolatedPosition[1]=h.position[1]+h.velocity[1]*f}}},c.prototype.internalStep=function(a){{var b,d,e=this,g=this.doProfiling,h=this.springs.length,i=this.springs,j=this.bodies,k=this.gravity,l=this.solver,m=this.bodies.length,n=this.broadphase,p=this.narrowphase,q=this.constraints,r=B,s=(f.scale,f.add);f.rotate}this.lastTimeStep=a,g&&(b=performance.now());var t=f.length(this.gravity);if(this.applyGravity)for(var u=0;u!==m;u++){var v=j[u],w=v.force;v.motionState==o.DYNAMIC&&(f.scale(r,k,v.mass*v.gravityScale),s(w,w,r))}if(this.applySpringForces)for(var u=0;u!==h;u++){var x=i[u];x.applyForce()}if(this.applyDamping)for(var u=0;u!==m;u++){var v=j[u];v.motionState==o.DYNAMIC&&v.applyDamping(a)}var y=n.getCollisionPairs(this);this.postBroadphaseEvent.pairs=y,this.emit(this.postBroadphaseEvent),p.reset(this);for(var u=0,z=y.length;u!==z;u+=2)for(var A=y[u],C=y[u+1],D=0,E=A.shapes.length;D!==E;D++)for(var F=A.shapes[D],G=A.shapeOffsets[D],H=A.shapeAngles[D],I=0,J=C.shapes.length;I!==J;I++){var K=C.shapes[I],L=C.shapeOffsets[I],M=C.shapeAngles[I],N=this.defaultContactMaterial;if(F.material&&K.material){var O=this.getContactMaterial(F.material,K.material);O&&(N=O)}this.runNarrowphase(p,A,F,G,H,C,K,L,M,N,t)}for(var P=this.overlappingShapesLastState,u=0;u!==P.keys.length;u++){var Q=P.keys[u];if(P[Q]===!0&&!this.overlappingShapesCurrentState[Q]){var R=this.endContactEvent;R.shapeA=P[Q+"_shapeA"],R.shapeB=P[Q+"_shapeB"],R.bodyA=P[Q+"_bodyA"],R.bodyB=P[Q+"_bodyB"],this.emit(R)}}for(var u=0;u!==P.keys.length;u++)delete P[P.keys[u]];P.keys.length=0;for(var S=this.overlappingShapesCurrentState,u=0;u!==S.keys.length;u++)P[S.keys[u]]=S[S.keys[u]],P.keys.push(S.keys[u]);for(var u=0;u!==S.keys.length;u++)delete S[S.keys[u]];S.keys.length=0;var T=this.preSolveEvent;T.contactEquations=p.contactEquations,T.frictionEquations=p.frictionEquations,this.emit(T),l.addEquations(p.contactEquations),l.addEquations(p.frictionEquations);var U=q.length;for(u=0;u!==U;u++){var V=q[u];V.update(),l.addEquations(V.equations)}this.solveConstraints&&l.solve(a,this),l.removeAllEquations();for(var u=0;u!==m;u++){var W=j[u];W.sleepState!==o.SLEEPING&&W.motionState!=o.STATIC&&c.integrateBody(W,a)}for(var u=0;u!==m;u++)j[u].setZeroForce();if(g&&(d=performance.now(),e.lastStepTime=d-b),this.emitImpactEvent)for(var X=this.impactEvent,u=0;u!==p.contactEquations.length;u++){var Y=p.contactEquations[u];Y.firstImpact&&(X.bodyA=Y.bi,X.bodyB=Y.bj,X.shapeA=Y.shapeA,X.shapeB=Y.shapeB,X.contactEquation=Y,this.emit(X))}if(this.enableBodySleeping)for(u=0;u!==m;u++)j[u].sleepTick(this.time);this.emit(this.postStepEvent)};var E=f.create(),F=f.create();c.integrateBody=function(a,b){var c=a.invMass,d=a.force,e=a.position,g=a.velocity;a.fixedRotation||(a.angularVelocity+=a.angularForce*a.invInertia*b,a.angle+=a.angularVelocity*b),f.scale(E,d,b*c),f.add(g,E,g),f.scale(F,g,b),f.add(e,e,F),a.aabbNeedsUpdate=!0},c.prototype.runNarrowphase=function(a,b,c,d,e,g,h,i,j,k,l){if(0!==(c.collisionGroup&h.collisionMask)&&0!==(h.collisionGroup&c.collisionMask)){f.rotate(C,d,b.angle),f.rotate(D,i,g.angle),f.add(C,C,b.position),f.add(D,D,g.position);var m=e+b.angle,n=j+g.angle;a.enableFriction=k.friction>0,a.frictionCoefficient=k.friction;var p;p=b.motionState==o.STATIC||b.motionState==o.KINEMATIC?g.mass:g.motionState==o.STATIC||g.motionState==o.KINEMATIC?b.mass:b.mass*g.mass/(b.mass+g.mass),a.slipForce=k.friction*l*p,a.restitution=k.restitution,a.surfaceVelocity=k.surfaceVelocity,a.frictionStiffness=k.frictionStiffness,a.frictionRelaxation=k.frictionRelaxation,a.stiffness=k.stiffness,a.relaxation=k.relaxation;var q=a[c.type|h.type],r=0;if(q){var s=c.sensor||h.sensor;if(r=c.type<h.type?q.call(a,b,c,C,m,g,h,D,n,s):q.call(a,g,h,D,n,b,c,C,m,s)){var t=c.id<h.id?c.id+" "+h.id:h.id+" "+c.id;if(!this.overlappingShapesLastState[t]){var u=this.beginContactEvent;if(u.shapeA=c,u.shapeB=h,u.bodyA=b,u.bodyB=g,"number"==typeof r){u.contactEquations.length=0;for(var v=a.contactEquations.length-r;v<a.contactEquations.length;v++)u.contactEquations.push(a.contactEquations[v])}this.emit(u)}var w=this.overlappingShapesCurrentState;w[t]||(w[t]=!0,w.keys.push(t),w[t+"_shapeA"]=c,w.keys.push(t+"_shapeA"),w[t+"_shapeB"]=h,w.keys.push(t+"_shapeB"),w[t+"_bodyA"]=b,w.keys.push(t+"_bodyA"),w[t+"_bodyB"]=g,w.keys.push(t+"_bodyB"))}}}},c.prototype.addSpring=function(a){this.springs.push(a),this.addSpringEvent.spring=a,this.emit(this.addSpringEvent)},c.prototype.removeSpring=function(a){var b=this.springs.indexOf(a);-1===b&&y.splice(this.springs,b,1)},c.prototype.addBody=function(a){if(a.world)throw new Error("This body is already added to a World.");this.bodies.push(a),a.world=this,this.addBodyEvent.body=a,this.emit(this.addBodyEvent)},c.prototype.removeBody=function(a){if(a.world!==this)throw new Error("The body was never added to this World, cannot remove it.");a.world=null;var b=this.bodies.indexOf(a);-1!==b&&(y.splice(this.bodies,b,1),this.removeBodyEvent.body=a,a.resetConstraintVelocity(),this.emit(this.removeBodyEvent))},c.prototype.getBodyById=function(a){for(var b=this.bodies,c=0;c<b.length;c++){var d=b[c];if(d.id===a)return d}return!1},c.prototype.toJSON=function(){function a(a){return a?[a[0],a[1]]:a}for(var b={p2:z,bodies:[],springs:[],solver:{},gravity:a(this.gravity),broadphase:{},constraints:[],contactMaterials:[]},c=0;c!==this.springs.length;c++){var d=this.springs[c];b.springs.push({bodyA:this.bodies.indexOf(d.bodyA),bodyB:this.bodies.indexOf(d.bodyB),stiffness:d.stiffness,damping:d.damping,restLength:d.restLength,localAnchorA:a(d.localAnchorA),localAnchorB:a(d.localAnchorB)})}for(var c=0;c<this.constraints.length;c++){var e=this.constraints[c],f={bodyA:this.bodies.indexOf(e.bodyA),bodyB:this.bodies.indexOf(e.bodyB)};if(e instanceof s)f.type="DistanceConstraint",f.distance=e.distance,f.maxForce=e.getMaxForce();else if(e instanceof u)f.type="RevoluteConstraint",f.pivotA=a(e.pivotA),f.pivotB=a(e.pivotB),f.maxForce=e.maxForce,f.motorSpeed=e.getMotorSpeed(),f.lowerLimit=e.lowerLimit,f.lowerLimitEnabled=e.lowerLimitEnabled,f.upperLimit=e.upperLimit,f.upperLimitEnabled=e.upperLimitEnabled;else if(e instanceof v)f.type="PrismaticConstraint",f.localAxisA=a(e.localAxisA),f.localAnchorA=a(e.localAnchorA),f.localAnchorB=a(e.localAnchorB),f.maxForce=e.maxForce;else{if(!(e instanceof t)){console.error("Constraint not supported yet!");continue}f.type="LockConstraint",f.localOffsetB=a(e.localOffsetB),f.localAngleB=e.localAngleB,f.maxForce=e.maxForce}b.constraints.push(f)}for(var c=0;c!==this.bodies.length;c++){for(var n=this.bodies[c],o=n.shapes,p=[],q=0;q<o.length;q++){var r,d=o[q];if(d instanceof g)r={type:"Circle",radius:d.radius};else if(d instanceof k)r={type:"Plane"};else if(d instanceof m)r={type:"Particle"};else if(d instanceof j)r={type:"Line",length:d.length};else if(d instanceof h)r={type:"Rectangle",width:d.width,height:d.height};else if(d instanceof i){for(var w=[],x=0;x<d.vertices.length;x++)w.push(a(d.vertices[x]));r={type:"Convex",verts:w}}else{if(!(d instanceof l))throw new Error("Shape type not supported yet!");r={type:"Capsule",length:d.length,radius:d.radius}}r.offset=a(n.shapeOffsets[q]),r.angle=n.shapeAngles[q],r.collisionGroup=d.collisionGroup,r.collisionMask=d.collisionMask,r.material=d.material&&{id:d.material.id},p.push(r)}b.bodies.push({id:n.id,mass:n.mass,angle:n.angle,position:a(n.position),velocity:a(n.velocity),angularVelocity:n.angularVelocity,force:a(n.force),shapes:p,concavePath:n.concavePath})}for(var c=0;c<this.contactMaterials.length;c++){var y=this.contactMaterials[c];b.contactMaterials.push({id:y.id,materialA:y.materialA.id,materialB:y.materialB.id,friction:y.friction,restitution:y.restitution,stiffness:y.stiffness,relaxation:y.relaxation,frictionStiffness:y.frictionStiffness,frictionRelaxation:y.frictionRelaxation})}return b},c.upgradeJSON=function(a){if(!a||!a.p2)return!1;switch(a=JSON.parse(JSON.stringify(a)),a.p2){case z:return a;case"0.3":for(var b=0;b<a.constraints.length;b++){var d=a.constraints[b];"PrismaticConstraint"==d.type&&(delete d.localAxisA,delete d.localAxisB,d.localAxisA=[1,0],d.localAnchorA=[0,0],d.localAnchorB=[0,0])}a.p2="0.4"}return c.upgradeJSON(a)},c.prototype.fromJSON=function(a){if(this.clear(),a=c.upgradeJSON(a),!a)return!1;if(!a.p2)return!1;f.copy(this.gravity,a.gravity);for(var b=this.bodies,d={},e=0;e!==a.bodies.length;e++){var n=a.bodies[e],w=n.shapes,x=new o({mass:n.mass,position:n.position,angle:n.angle,velocity:n.velocity,angularVelocity:n.angularVelocity,force:n.force});x.id=n.id;for(var y=0;y<w.length;y++){var z,A=w[y];switch(A.type){case"Circle":z=new g(A.radius);break;case"Plane":z=new k;break;case"Particle":z=new m;break;case"Line":z=new j(A.length);break;case"Rectangle":z=new h(A.width,A.height);break;case"Convex":z=new i(A.verts);break;case"Capsule":z=new l(A.length,A.radius);break;default:throw new Error("Shape type not supported: "+A.type)}z.collisionMask=A.collisionMask,z.collisionGroup=A.collisionGroup,z.material=A.material,z.material&&(z.material=new q,z.material.id=A.material.id,d[z.material.id+""]=z.material),x.addShape(z,A.offset,A.angle)}n.concavePath&&(x.concavePath=n.concavePath),this.addBody(x)}for(var e=0;e<a.springs.length;e++){var A=a.springs[e],B=new p(b[A.bodyA],b[A.bodyB],{stiffness:A.stiffness,damping:A.damping,restLength:A.restLength,localAnchorA:A.localAnchorA,localAnchorB:A.localAnchorB});this.addSpring(B)}for(var e=0;e<a.contactMaterials.length;e++){var C=a.contactMaterials[e],D=new r(d[C.materialA+""],d[C.materialB+""],{friction:C.friction,restitution:C.restitution,stiffness:C.stiffness,relaxation:C.relaxation,frictionStiffness:C.frictionStiffness,frictionRelaxation:C.frictionRelaxation});D.id=C.id,this.addContactMaterial(D)}for(var e=0;e<a.constraints.length;e++){var E,F=a.constraints[e];switch(F.type){case"DistanceConstraint":E=new s(b[F.bodyA],b[F.bodyB],F.distance,F.maxForce);break;case"RevoluteConstraint":E=new u(b[F.bodyA],F.pivotA,b[F.bodyB],F.pivotB,F.maxForce),F.motorSpeed&&(E.enableMotor(),E.setMotorSpeed(F.motorSpeed)),E.lowerLimit=F.lowerLimit||0,E.upperLimit=F.upperLimit||0,E.lowerLimitEnabled=F.lowerLimitEnabled||!1,E.upperLimitEnabled=F.upperLimitEnabled||!1;break;case"PrismaticConstraint":E=new v(b[F.bodyA],b[F.bodyB],{maxForce:F.maxForce,localAxisA:F.localAxisA,localAnchorA:F.localAnchorA,localAnchorB:F.localAnchorB});break;case"LockConstraint":E=new t(b[F.bodyA],b[F.bodyB],{maxForce:F.maxForce,localOffsetB:F.localOffsetB,localAngleB:F.localAngleB});break;default:throw new Error("Constraint type not recognized: "+F.type)}this.addConstraint(E)}return!0},c.prototype.clear=function(){this.time=0,this.solver&&this.solver.equations.length&&this.solver.removeAllEquations();for(var a=this.constraints,b=a.length-1;b>=0;b--)this.removeConstraint(a[b]);for(var c=this.bodies,b=c.length-1;b>=0;b--)this.removeBody(c[b]);for(var d=this.springs,b=d.length-1;b>=0;b--)this.removeSpring(d[b]);for(var e=this.contactMaterials,b=e.length-1;b>=0;b--)this.removeContactMaterial(e[b])},c.prototype.clone=function(){var a=new c;return a.fromJSON(this.toJSON()),a};var G=f.create(),H=f.fromValues(0,0),I=f.fromValues(0,0);c.prototype.hitTest=function(a,b,c){c=c||0;var d=new o({position:a}),e=new m,h=a,j=0,n=G,p=H,q=I;d.addShape(e);for(var r=this.narrowphase,s=[],t=0,u=b.length;t!==u;t++)for(var v=b[t],w=0,x=v.shapes.length;w!==x;w++){var y=v.shapes[w],z=v.shapeOffsets[w]||p,A=v.shapeAngles[w]||0;f.rotate(n,z,v.angle),f.add(n,n,v.position);var B=A+v.angle;(y instanceof g&&r.circleParticle(v,y,n,B,d,e,h,j,!0)||y instanceof i&&r.particleConvex(d,e,h,j,v,y,n,B,!0)||y instanceof k&&r.particlePlane(d,e,h,j,v,y,n,B,!0)||y instanceof l&&r.particleCapsule(d,e,h,j,v,y,n,B,!0)||y instanceof m&&f.squaredLength(f.sub(q,n,a))<c*c)&&s.push(v)}return s}},{"../../package.json":8,"../collision/Broadphase":10,"../collision/NaiveBroadphase":12,"../collision/Narrowphase":13,"../constraints/DistanceConstraint":17,"../constraints/LockConstraint":19,"../constraints/PrismaticConstraint":20,"../constraints/RevoluteConstraint":21,"../events/EventEmitter":28,"../material/ContactMaterial":29,"../material/Material":30,"../math/vec2":33,"../objects/Body":34,"../objects/Spring":35,"../shapes/Capsule":37,"../shapes/Circle":38,"../shapes/Convex":39,"../shapes/Line":41,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Rectangle":44,"../solver/GSSolver":46,"../utils/Utils":50}]},{},[36])(36)}),p2.Body.prototype.parent=null,p2.Spring.prototype.parent=null,Phaser.Physics.P2=function(a,b){this.game=a,"undefined"!=typeof b&&b.hasOwnProperty("gravity")&&b.hasOwnProperty("broadphase")||(b={gravity:[0,0],broadphase:new p2.SAPBroadphase}),this.world=new p2.World(b),this.frameRate=1/60,this.useElapsedTime=!1,this.materials=[],this.gravity=new Phaser.Physics.P2.InversePointProxy(this,this.world.gravity),this.bounds=null,this._wallShapes=[null,null,null,null],this.onBodyAdded=new Phaser.Signal,this.onBodyRemoved=new Phaser.Signal,this.onSpringAdded=new Phaser.Signal,this.onSpringRemoved=new Phaser.Signal,this.onConstraintAdded=new Phaser.Signal,this.onConstraintRemoved=new Phaser.Signal,this.onContactMaterialAdded=new Phaser.Signal,this.onContactMaterialRemoved=new Phaser.Signal,this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,b.hasOwnProperty("mpx")&&b.hasOwnProperty("pxm")&&b.hasOwnProperty("mpxi")&&b.hasOwnProperty("pxmi")&&(this.mpx=b.mpx,this.mpxi=b.mpxi,this.pxm=b.pxm,this.pxmi=b.pxmi),this.world.on("beginContact",this.beginContactHandler,this),this.world.on("endContact",this.endContactHandler,this),this._toRemove=[],this.collisionGroups=[],this._collisionGroupID=2,this.nothingCollisionGroup=new Phaser.Physics.P2.CollisionGroup(1),this.boundsCollisionGroup=new Phaser.Physics.P2.CollisionGroup(2),this.everythingCollisionGroup=new Phaser.Physics.P2.CollisionGroup(2147483648),this.boundsCollidesWith=[],this.setBoundsToWorld(!0,!0,!0,!0,!1)},Phaser.Physics.P2.LIME_CORONA_JSON=0,Phaser.Physics.P2.prototype={removeBodyNextStep:function(a){this._toRemove.push(a)},preUpdate:function(){for(var a=this._toRemove.length;a--;)this.removeBody(this._toRemove[a]);this._toRemove.length=0},enable:function(a,b,c){"undefined"==typeof b&&(b=!1),"undefined"==typeof c&&(c=!0);var d=1;if(Array.isArray(a))for(d=a.length;d--;)a[d]instanceof Phaser.Group?this.enable(a[d].children,b,c):(this.enableBody(a[d],b),c&&a[d].hasOwnProperty("children")&&a[d].children.length>0&&this.enable(a[d],b,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c):(this.enableBody(a,b),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,!0))},enableBody:function(a,b){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.P2.Body(this.game,a,a.x,a.y,1),a.body.debug=b,a.anchor.set(.5))},setImpactEvents:function(a){a?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(a,b){this.postBroadphaseCallback=a,this.callbackContext=b,null!==a?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(a){if(this.postBroadphaseCallback)for(var b=a.pairs.length;b-=2;)1===a.pairs[b].id||1===a.pairs[b+1].id||this.postBroadphaseCallback.call(this.callbackContext,a.pairs[b].parent,a.pairs[b+1].parent)||a.pairs.splice(b,2)},impactHandler:function(a){if(a.bodyA.parent&&a.bodyB.parent){var b=a.bodyA.parent,c=a.bodyB.parent;b._bodyCallbacks[a.bodyB.id]&&b._bodyCallbacks[a.bodyB.id].call(b._bodyCallbackContext[a.bodyB.id],b,c,a.shapeA,a.shapeB),c._bodyCallbacks[a.bodyA.id]&&c._bodyCallbacks[a.bodyA.id].call(c._bodyCallbackContext[a.bodyA.id],c,b,a.shapeB,a.shapeA),b._groupCallbacks[a.shapeB.collisionGroup]&&b._groupCallbacks[a.shapeB.collisionGroup].call(b._groupCallbackContext[a.shapeB.collisionGroup],b,c,a.shapeA,a.shapeB),c._groupCallbacks[a.shapeA.collisionGroup]&&c._groupCallbacks[a.shapeA.collisionGroup].call(c._groupCallbackContext[a.shapeA.collisionGroup],c,b,a.shapeB,a.shapeA)}},beginContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onBeginContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB,a.contactEquations),a.bodyA.parent&&a.bodyA.parent.onBeginContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB,a.contactEquations),a.bodyB.parent&&a.bodyB.parent.onBeginContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA,a.contactEquations))},endContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onEndContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB),a.bodyA.parent&&a.bodyA.parent.onEndContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB),a.bodyB.parent&&a.bodyB.parent.onEndContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA))},setBoundsToWorld:function(a,b,c,d,e){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,a,b,c,d,e)},setWorldMaterial:function(a,b,c,d,e){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),b&&this._wallShapes[0]&&(this._wallShapes[0].material=a),c&&this._wallShapes[1]&&(this._wallShapes[1].material=a),d&&this._wallShapes[2]&&(this._wallShapes[2].material=a),e&&this._wallShapes[3]&&(this._wallShapes[3].material=a)},updateBoundsCollisionGroup:function(a){"undefined"==typeof a&&(a=!0);for(var b=0;4>b;b++)this._wallShapes[b]&&(this._wallShapes[b].collisionGroup=a?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask)},setBounds:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=c/2,k=d/2,l=j+a,m=k+b;if(null!==this.bounds){this.bounds.world&&this.world.removeBody(this.bounds);for(var n=this.bounds.shapes.length;n--;){var o=this.bounds.shapes[n];this.bounds.removeShape(o)}this.bounds.position[0]=this.pxmi(l),this.bounds.position[1]=this.pxmi(m)}else this.bounds=new p2.Body({mass:0,position:[this.pxmi(l),this.pxmi(m)]});e&&(this._wallShapes[0]=new p2.Plane,i&&(this._wallShapes[0].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[0],[this.pxmi(-j),0],1.5707963267948966)),f&&(this._wallShapes[1]=new p2.Plane,i&&(this._wallShapes[1].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[1],[this.pxmi(j),0],-1.5707963267948966)),g&&(this._wallShapes[2]=new p2.Plane,i&&(this._wallShapes[2].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[2],[0,this.pxmi(-k)],-3.141592653589793)),h&&(this._wallShapes[3]=new p2.Plane,i&&(this._wallShapes[3].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[3],[0,this.pxmi(k)])),this.world.addBody(this.bounds)},update:function(){this.world.step(this.useElapsedTime?this.game.time.physicsElapsed:this.frameRate)},clear:function(){this.world.clear(),this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this._collisionGroupID=2,this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){return a.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){return a.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){return this.world.addSpring(a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){return this.world.removeSpring(a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.GearConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e){return a=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(new Phaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):void console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){return this.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){return this.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){return this.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){return this.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){return this.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(var c=b.length;c--;)b.setMaterial(a)},createMaterial:function(a,b){a=a||"";var c=new Phaser.Physics.P2.Material(a);return this.materials.push(c),"undefined"!=typeof b&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeof a&&(a=this.createMaterial()),"undefined"==typeof b&&(b=this.createMaterial());var d=new Phaser.Physics.P2.ContactMaterial(a,b,c);return this.addContactMaterial(d)},getBodies:function(){for(var a=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);return a},getBody:function(a){return a instanceof p2.Body?a:a instanceof Phaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(var a=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);return a},getConstraints:function(){for(var a=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);return a},hitTest:function(a,b,c,d){"undefined"==typeof b&&(b=this.world.bodies),"undefined"==typeof c&&(c=5),"undefined"==typeof d&&(d=!1);for(var e=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceof Phaser.Physics.P2.Body&&(!d||b[g].data.motionState!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceof p2.Body&&b[g].parent&&(!d||b[g].motionState!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceof Phaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.motionState!==p2.Body.STATIC)&&f.push(b[g].body.data);return this.world.hitTest(e,f,c)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(a){var b=Math.pow(2,this._collisionGroupID);this._wallShapes[0]&&(this._wallShapes[0].collisionMask=this._wallShapes[0].collisionMask|b),this._wallShapes[1]&&(this._wallShapes[1].collisionMask=this._wallShapes[1].collisionMask|b),this._wallShapes[2]&&(this._wallShapes[2].collisionMask=this._wallShapes[2].collisionMask|b),this._wallShapes[3]&&(this._wallShapes[3].collisionMask=this._wallShapes[3].collisionMask|b),this._collisionGroupID++;var c=new Phaser.Physics.P2.CollisionGroup(b);return this.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(a instanceof Phaser.Group)for(var c=0;c<a.total;c++)a.children[c].body&&a.children[c].body.type===Phaser.Physics.P2JS&&a.children[c].body.setCollisionGroup(b);else a.body.setCollisionGroup(b)},createSpring:function(a,b,c,d,e,f,g,h,i){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addSpring(new Phaser.Physics.P2.Spring(this,a,b,c,d,e,f,g,h,i)):void console.warn("Cannot create Spring, invalid body objects given")},createBody:function(a,b,c,d,e,f){"undefined"==typeof d&&(d=!1);var g=new Phaser.Physics.P2.Body(this.game,null,a,b,c);if(f){var h=g.addPolygon(e,f);if(!h)return!1}return d&&this.world.addBody(g.data),g},createParticle:function(a,b,c,d,e,f){"undefined"==typeof d&&(d=!1);var g=new Phaser.Physics.P2.Body(this.game,null,a,b,c);if(f){var h=g.addPolygon(e,f);if(!h)return!1}return d&&this.world.addBody(g.data),g},convertCollisionObjects:function(a,b,c){"undefined"==typeof c&&(c=!0);for(var d=[],e=0,f=a.collision[b].length;f>e;e++){var g=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}return d},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c,d){b=a.getLayer(b),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),this.clearTilemapLayerBodies(a,b);for(var e=0,f=0,g=0,h=0,i=a.layers[b].height;i>h;h++){e=0;for(var j=0,k=a.layers[b].width;k>j;j++){var l=a.layers[b].data[h][j];if(l)if(d){var m=a.getTileRight(b,j,h);if(0===e&&(f=l.x*l.width,g=l.y*l.height,e=l.width),m&&m.collides)e+=l.width;else{var n=this.createBody(f,g,0,!1);n.addRectangle(e,l.height,e/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n),e=0}}else{var n=this.createBody(l.x*l.width,l.y*l.height,0,!1);n.addRectangle(l.width,l.height,l.width/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n)}}}return a.layers[b].bodies},mpx:function(a){return a*=20},pxm:function(a){return.05*a},mpxi:function(a){return a*=-20},pxmi:function(a){return a*-.05}},Object.defineProperty(Phaser.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultFriction},set:function(a){this.world.defaultFriction=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"restituion",{get:function(){return this.world.defaultRestitution},set:function(a){this.world.defaultRestitution=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(a){this.world.applySpringForces=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(a){this.world.applyDamping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(a){this.world.applyGravity=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(a){this.world.solveConstraints=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"time",{get:function(){return this.world.time }}),Object.defineProperty(Phaser.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(a){this.world.emitImpactEvent=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"enableBodySleeping",{get:function(){return this.world.enableBodySleeping},set:function(a){this.world.enableBodySleeping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),Phaser.Physics.P2.PointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.PointProxy.prototype.constructor=Phaser.Physics.P2.PointProxy,Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(a)}}),Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(a)}}),Phaser.Physics.P2.InversePointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.InversePointProxy.prototype.constructor=Phaser.Physics.P2.InversePointProxy,Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(-a)}}),Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(-a)}}),Phaser.Physics.P2.Body=function(a,b,c,d,e){b=b||null,c=c||0,d=d||0,"undefined"==typeof e&&(e=1),this.game=a,this.world=a.physics.p2,this.sprite=b,this.type=Phaser.Physics.P2JS,this.offset=new Phaser.Point,this.data=new p2.Body({position:[this.world.pxmi(c),this.world.pxmi(d)],mass:e}),this.data.parent=this,this.velocity=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new Phaser.Point,this.onImpact=new Phaser.Signal,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,this.collidesWith=[],this.removeNextStep=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody=null,b&&(this.setRectangleFromSprite(b),b.exists&&this.game.physics.p2.addBody(this))},Phaser.Physics.P2.Body.prototype={createBodyCallback:function(a,b,c){var d=-1;a.id?d=a.id:a.body&&(d=a.body.id),d>-1&&(null===b?(delete this._bodyCallbacks[d],delete this._bodyCallbackContext[d]):(this._bodyCallbacks[d]=b,this._bodyCallbackContext[d]=c))},createGroupCallback:function(a,b,c){null===b?(delete this._groupCallbacks[a.mask],delete this._groupCallbacksContext[a.mask]):(this._groupCallbacks[a.mask]=b,this._groupCallbackContext[a.mask]=c)},getCollisionMask:function(){var a=0;this._collideWorldBounds&&(a=this.game.physics.p2.boundsCollisionGroup.mask);for(var b=0;b<this.collidesWith.length;b++)a|=this.collidesWith[b].mask;return a},updateCollisionMask:function(a){var b=this.getCollisionMask();if("undefined"==typeof a)for(var c=this.data.shapes.length-1;c>=0;c--)this.data.shapes[c].collisionMask=b;else a.collisionMask=b},setCollisionGroup:function(a,b){var c=this.getCollisionMask();if("undefined"==typeof b)for(var d=this.data.shapes.length-1;d>=0;d--)this.data.shapes[d].collisionGroup=a.mask,this.data.shapes[d].collisionMask=c;else b.collisionGroup=a.mask,b.collisionMask=c},clearCollision:function(a,b,c){if("undefined"==typeof c)for(var d=this.data.shapes.length-1;d>=0;d--)a&&(this.data.shapes[d].collisionGroup=null),b&&(this.data.shapes[d].collisionMask=null);else a&&(c.collisionGroup=null),b&&(c.collisionMask=null);a&&(this.collidesWith.length=0)},collides:function(a,b,c,d){if(Array.isArray(a))for(var e=0;e<a.length;e++)-1===this.collidesWith.indexOf(a[e])&&(this.collidesWith.push(a[e]),b&&this.createGroupCallback(a[e],b,c));else-1===this.collidesWith.indexOf(a)&&(this.collidesWith.push(a),b&&this.createGroupCallback(a,b,c));var f=this.getCollisionMask();if("undefined"==typeof d)for(var e=this.data.shapes.length-1;e>=0;e--)this.data.shapes[e].collisionMask=f;else d.collisionMask=f},adjustCenterOfMass:function(){this.data.adjustCenterOfMass()},applyDamping:function(a){this.data.applyDamping(a)},applyForce:function(a,b,c){this.data.applyForce(a,[this.world.pxm(b),this.world.pxm(c)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(a,b){return this.data.toLocalFrame(a,b)},toWorldFrame:function(a,b){return this.data.toWorldFrame(a,b)},rotateLeft:function(a){this.data.angularVelocity=this.world.pxm(-a)},rotateRight:function(a){this.data.angularVelocity=this.world.pxm(a)},moveForward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=b*Math.cos(c),this.data.velocity[1]=b*Math.sin(c)},moveBackward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=-(b*Math.cos(c)),this.data.velocity[1]=-(b*Math.sin(c))},thrust:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]+=b*Math.cos(c),this.data.force[1]+=b*Math.sin(c)},reverse:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]-=b*Math.cos(c),this.data.force[1]-=b*Math.sin(c)},moveLeft:function(a){this.data.velocity[0]=this.world.pxmi(-a)},moveRight:function(a){this.data.velocity[0]=this.world.pxmi(a)},moveUp:function(a){this.data.velocity[1]=this.world.pxmi(-a)},moveDown:function(a){this.data.velocity[1]=this.world.pxmi(a)},preUpdate:function(){this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0]),this.sprite.y=this.world.mpxi(this.data.position[1]),this.fixedRotation||(this.sprite.rotation=this.data.angle)},reset:function(a,b,c,d){"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),c&&this.setZeroDamping(),d&&(this.mass=1),this.x=a,this.y=b},addToWorld:function(){this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(),this.debugBody=null,this.sprite=null},clearShapes:function(){for(var a=this.data.shapes.length;a--;)this.data.removeShape(this.data.shapes[a]);this.shapeChanged()},addShape:function(a,b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.data.addShape(a,[this.world.pxmi(b),this.world.pxmi(c)],d),this.shapeChanged(),a},addCircle:function(a,b,c,d){var e=new p2.Circle(this.world.pxm(a));return this.addShape(e,b,c,d)},addRectangle:function(a,b,c,d,e){var f=new p2.Rectangle(this.world.pxm(a),this.world.pxm(b));return this.addShape(f,c,d,e)},addPlane:function(a,b,c){var d=new p2.Plane;return this.addShape(d,a,b,c)},addParticle:function(a,b,c){var d=new p2.Particle;return this.addShape(d,a,b,c)},addLine:function(a,b,c,d){var e=new p2.Line(this.world.pxm(a));return this.addShape(e,b,c,d)},addCapsule:function(a,b,c,d,e){var f=new p2.Capsule(this.world.pxm(a),b);return this.addShape(f,c,d,e)},addPolygon:function(a,b){a=a||{},b=Array.prototype.slice.call(arguments,1);var c=[];if(1===b.length&&Array.isArray(b[0]))c=b[0].slice(0);else if(Array.isArray(b[0]))c=b[0].slice(0);else if("number"==typeof b[0])for(var d=0,e=b.length;e>d;d+=2)c.push([b[d],b[d+1]]);var f=c.length-1;c[f][0]===c[0][0]&&c[f][1]===c[0][1]&&c.pop();for(var g=0;g<c.length;g++)c[g][0]=this.world.pxmi(c[g][0]),c[g][1]=this.world.pxmi(c[g][1]);var h=this.data.fromPolygon(c,a);return this.shapeChanged(),h},removeShape:function(a){return this.data.removeShape(a)},setCircle:function(a,b,c,d){this.clearShapes(),this.addCircle(a,b,c,d)},setRectangle:function(a,b,c,d,e){return"undefined"==typeof a&&(a=16),"undefined"==typeof b&&(b=16),this.clearShapes(),this.addRectangle(a,b,c,d,e)},setRectangleFromSprite:function(a){return"undefined"==typeof a&&(a=this.sprite),this.clearShapes(),this.addRectangle(a.width,a.height,0,0,a.rotation)},setMaterial:function(a,b){if("undefined"==typeof b)for(var c=this.data.shapes.length-1;c>=0;c--)this.data.shapes[c].material=a;else b.material=a},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(a,b){for(var c=this.game.cache.getPhysicsData(a,b),d=[],e=0;e<c.length;e++){var f=c[e],g=this.addFixture(f);d[f.filter.group]=d[f.filter.group]||[],d[f.filter.group].push(g)}return this.data.aabbNeedsUpdate=!0,this.shapeChanged(),d},addFixture:function(a){var b=[];if(a.circle){var c=new p2.Circle(this.world.pxm(a.circle.radius));c.collisionGroup=a.filter.categoryBits,c.collisionMask=a.filter.maskBits,c.sensor=a.isSensor;var d=p2.vec2.create();d[0]=this.world.pxmi(a.circle.position[0]-this.sprite.width/2),d[1]=this.world.pxmi(a.circle.position[1]-this.sprite.height/2),this.data.addShape(c,d),b.push(c)}else for(var e=a.polygons,f=p2.vec2.create(),g=0;g<e.length;g++){for(var h=e[g],i=[],j=0;j<h.length;j+=2)i.push([this.world.pxmi(h[j]),this.world.pxmi(h[j+1])]);for(var c=new p2.Convex(i),k=0;k!==c.vertices.length;k++){var l=c.vertices[k];p2.vec2.sub(l,l,c.centerOfMass)}p2.vec2.scale(f,c.centerOfMass,1),f[0]-=this.world.pxmi(this.sprite.width/2),f[1]-=this.world.pxmi(this.sprite.height/2),c.updateTriangles(),c.updateCenterOfMass(),c.updateBoundingRadius(),c.collisionGroup=a.filter.categoryBits,c.collisionMask=a.filter.maskBits,c.sensor=a.isSensor,this.data.addShape(c,f),b.push(c)}return b},loadPolygon:function(a,b,c){var d=this.game.cache.getPhysicsData(a,b);if(1===d.length){for(var e=[],f=d[d.length-1],g=0,h=f.shape.length;h>g;g+=2)e.push([f.shape[g],f.shape[g+1]]);return this.addPolygon(c,e)}for(var i=p2.vec2.create(),g=0;g<d.length;g++){for(var j=[],k=0;k<d[g].shape.length;k+=2)j.push([this.world.pxmi(d[g].shape[k]),this.world.pxmi(d[g].shape[k+1])]);for(var l=new p2.Convex(j),m=0;m!==l.vertices.length;m++){var n=l.vertices[m];p2.vec2.sub(n,n,l.centerOfMass)}p2.vec2.scale(i,l.centerOfMass,1),i[0]-=this.world.pxmi(this.sprite.width/2),i[1]-=this.world.pxmi(this.sprite.height/2),l.updateTriangles(),l.updateCenterOfMass(),l.updateBoundingRadius(),this.data.addShape(l,i)}return this.data.aabbNeedsUpdate=!0,this.shapeChanged(),!0},loadData:function(a,b,c){var d=this.game.cache.getPhysicsData(a,b);d&&d.shape&&(this.mass=d.density,this.loadPolygon(a,b,c))}},Phaser.Physics.P2.Body.prototype.constructor=Phaser.Physics.P2.Body,Phaser.Physics.P2.Body.DYNAMIC=1,Phaser.Physics.P2.Body.STATIC=2,Phaser.Physics.P2.Body.KINEMATIC=4,Object.defineProperty(Phaser.Physics.P2.Body.prototype,"static",{get:function(){return this.data.motionState===Phaser.Physics.P2.Body.STATIC},set:function(a){a&&this.data.motionState!==Phaser.Physics.P2.Body.STATIC?(this.data.motionState=Phaser.Physics.P2.Body.STATIC,this.mass=0):a||this.data.motionState!==Phaser.Physics.P2.Body.STATIC||(this.data.motionState=Phaser.Physics.P2.Body.DYNAMIC,0===this.mass&&(this.mass=1))}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"dynamic",{get:function(){return this.data.motionState===Phaser.Physics.P2.Body.DYNAMIC},set:function(a){a&&this.data.motionState!==Phaser.Physics.P2.Body.DYNAMIC?(this.data.motionState=Phaser.Physics.P2.Body.DYNAMIC,0===this.mass&&(this.mass=1)):a||this.data.motionState!==Phaser.Physics.P2.Body.DYNAMIC||(this.data.motionState=Phaser.Physics.P2.Body.STATIC,this.mass=0)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"kinematic",{get:function(){return this.data.motionState===Phaser.Physics.P2.Body.KINEMATIC},set:function(a){a&&this.data.motionState!==Phaser.Physics.P2.Body.KINEMATIC?(this.data.motionState=Phaser.Physics.P2.Body.KINEMATIC,this.mass=4):a||this.data.motionState!==Phaser.Physics.P2.Body.KINEMATIC||(this.data.motionState=Phaser.Physics.P2.Body.STATIC,this.mass=0)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"allowSleep",{get:function(){return this.data.allowSleep},set:function(a){a!==this.data.allowSleep&&(this.data.allowSleep=a)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"angle",{get:function(){return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.data.angle))},set:function(a){this.data.angle=Phaser.Math.degToRad(Phaser.Math.wrapAngle(a))}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"angularDamping",{get:function(){return this.data.angularDamping},set:function(a){this.data.angularDamping=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"angularForce",{get:function(){return this.data.angularForce},set:function(a){this.data.angularForce=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"angularVelocity",{get:function(){return this.data.angularVelocity},set:function(a){this.data.angularVelocity=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"damping",{get:function(){return this.data.damping},set:function(a){this.data.damping=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"fixedRotation",{get:function(){return this.data.fixedRotation},set:function(a){a!==this.data.fixedRotation&&(this.data.fixedRotation=a)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"inertia",{get:function(){return this.data.inertia},set:function(a){this.data.inertia=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"mass",{get:function(){return this.data.mass},set:function(a){a!==this.data.mass&&(this.data.mass=a,this.data.updateMassProperties())}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"motionState",{get:function(){return this.data.motionState},set:function(a){a!==this.data.motionState&&(this.data.motionState=a)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"rotation",{get:function(){return this.data.angle},set:function(a){this.data.angle=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"sleepSpeedLimit",{get:function(){return this.data.sleepSpeedLimit},set:function(a){this.data.sleepSpeedLimit=a}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"x",{get:function(){return this.world.mpxi(this.data.position[0])},set:function(a){this.data.position[0]=this.world.pxmi(a)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"y",{get:function(){return this.world.mpxi(this.data.position[1])},set:function(a){this.data.position[1]=this.world.pxmi(a)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"id",{get:function(){return this.data.id}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"debug",{get:function(){return!this.debugBody},set:function(a){a&&!this.debugBody?this.debugBody=new Phaser.Physics.P2.BodyDebug(this.game,this.data):!a&&this.debugBody&&(this.debugBody.destroy(),this.debugBody=null)}}),Object.defineProperty(Phaser.Physics.P2.Body.prototype,"collideWorldBounds",{get:function(){return this._collideWorldBounds},set:function(a){a&&!this._collideWorldBounds?(this._collideWorldBounds=!0,this.updateCollisionMask()):!a&&this._collideWorldBounds&&(this._collideWorldBounds=!1,this.updateCollisionMask())}}),Phaser.Physics.P2.BodyDebug=function(a,b,c){Phaser.Group.call(this,a);var d={pixelsPerLengthUnit:20,debugPolygons:!1,lineWidth:1,alpha:.5};this.settings=Phaser.Utils.extend(d,c),this.ppu=this.settings.pixelsPerLengthUnit,this.ppu=-1*this.ppu,this.body=b,this.canvas=new Phaser.Graphics(a),this.canvas.alpha=this.settings.alpha,this.add(this.canvas),this.draw()},Phaser.Physics.P2.BodyDebug.prototype=Object.create(Phaser.Group.prototype),Phaser.Physics.P2.BodyDebug.prototype.constructor=Phaser.Physics.P2.BodyDebug,Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype,{update:function(){this.updateSpriteTransform()},updateSpriteTransform:function(){return this.position.x=this.body.position[0]*this.ppu,this.position.y=this.body.position[1]*this.ppu,this.rotation=this.body.angle},draw:function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;if(h=this.body,j=this.canvas,j.clear(),c=parseInt(this.randomPastelHex(),16),f=16711680,g=this.lineWidth,h instanceof p2.Body&&h.shapes.length){var p=h.shapes.length;for(d=0;d!==p;){if(b=h.shapes[d],i=h.shapeOffsets[d],a=h.shapeAngles[d],i=i||0,a=a||0,b instanceof p2.Circle)this.drawCircle(j,i[0]*this.ppu,i[1]*this.ppu,a,b.radius*this.ppu,c,g);else if(b instanceof p2.Convex){for(l=[],m=p2.vec2.create(),e=n=0,o=b.vertices.length;o>=0?o>n:n>o;e=o>=0?++n:--n)k=b.vertices[e],p2.vec2.rotate(m,k,a),l.push([(m[0]+i[0])*this.ppu,-(m[1]+i[1])*this.ppu]);this.drawConvex(j,l,b.triangles,f,c,g,this.settings.debugPolygons,[i[0]*this.ppu,-i[1]*this.ppu])}else b instanceof p2.Plane?this.drawPlane(j,i[0]*this.ppu,-i[1]*this.ppu,c,f,5*g,10*g,10*g,100*this.ppu,a):b instanceof p2.Line?this.drawLine(j,b.length*this.ppu,f,g):b instanceof p2.Rectangle&&this.drawRectangle(j,i[0]*this.ppu,-i[1]*this.ppu,a,b.width*this.ppu,b.height*this.ppu,f,c,g);d++}}},drawRectangle:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof i&&(i=1),"undefined"==typeof g&&(g=0),a.lineStyle(i,g,1),a.beginFill(h),a.drawRect(b-e/2,c-f/2,e,f)},drawCircle:function(a,b,c,d,e,f,g){"undefined"==typeof g&&(g=1),"undefined"==typeof f&&(f=16777215),a.lineStyle(g,0,1),a.beginFill(f,1),a.drawCircle(b,c,-e),a.endFill(),a.moveTo(b,c),a.lineTo(b+e*Math.cos(-d),c+e*Math.sin(-d))},drawLine:function(a,b,c,d){"undefined"==typeof d&&(d=1),"undefined"==typeof c&&(c=0),a.lineStyle(5*d,c,1),a.moveTo(-b/2,0),a.lineTo(b/2,0)},drawConvex:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s;if("undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=0),g){for(i=[16711680,65280,255],j=0;j!==b.length+1;)l=b[j%b.length],m=b[(j+1)%b.length],o=l[0],r=l[1],p=m[0],s=m[1],a.lineStyle(f,i[j%i.length],1),a.moveTo(o,-r),a.lineTo(p,-s),a.drawCircle(o,-r,2*f),j++;return a.lineStyle(f,0,1),a.drawCircle(h[0],h[1],2*f)}for(a.lineStyle(f,d,1),a.beginFill(e),j=0;j!==b.length;)k=b[j],n=k[0],q=k[1],0===j?a.moveTo(n,-q):a.lineTo(n,-q),j++;return a.endFill(),b.length>2?(a.moveTo(b[b.length-1][0],-b[b.length-1][1]),a.lineTo(b[0][0],-b[0][1])):void 0},drawPath:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;for("undefined"==typeof e&&(e=1),"undefined"==typeof c&&(c=0),a.lineStyle(e,c,1),"number"==typeof d&&a.beginFill(d),h=null,i=null,g=0;g<b.length;)p=b[g],q=p[0],r=p[1],(q!==h||r!==i)&&(0===g?a.moveTo(q,r):(j=h,k=i,l=q,m=r,n=b[(g+1)%b.length][0],o=b[(g+1)%b.length][1],f=(l-j)*(o-k)-(n-j)*(m-k),0!==f&&a.lineTo(q,r)),h=q,i=r),g++;"number"==typeof d&&a.endFill(),b.length>2&&"number"==typeof d&&(a.moveTo(b[b.length-1][0],b[b.length-1][1]),a.lineTo(b[0][0],b[0][1]))},drawPlane:function(a,b,c,d,e,f,g,h,i,j){var k,l,m;"undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=16777215),a.lineStyle(f,e,11),a.beginFill(d),k=i,a.moveTo(b,-c),l=b+Math.cos(j)*this.game.width,m=c+Math.sin(j)*this.game.height,a.lineTo(l,-m),a.moveTo(b,-c),l=b+Math.cos(j)*-this.game.width,m=c+Math.sin(j)*-this.game.height,a.lineTo(l,-m)},randomPastelHex:function(){var a,b,c,d;return c=[255,255,255],d=Math.floor(256*Math.random()),b=Math.floor(256*Math.random()),a=Math.floor(256*Math.random()),d=Math.floor((d+3*c[0])/4),b=Math.floor((b+3*c[1])/4),a=Math.floor((a+3*c[2])/4),this.rgbToHex(d,b,a)},rgbToHex:function(a,b,c){return this.componentToHex(a)+this.componentToHex(b)+this.componentToHex(c)},componentToHex:function(a){var b;return b=a.toString(16),2===b.len?b:b+"0"}}),Phaser.Physics.P2.Spring=function(a,b,c,d,e,f,g,h,i,j){this.game=a.game,this.world=a,"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=100),"undefined"==typeof f&&(f=1),d=a.pxm(d);var k={restLength:d,stiffness:e,damping:f};"undefined"!=typeof g&&null!==g&&(k.worldAnchorA=[a.pxm(g[0]),a.pxm(g[1])]),"undefined"!=typeof h&&null!==h&&(k.worldAnchorB=[a.pxm(h[0]),a.pxm(h[1])]),"undefined"!=typeof i&&null!==i&&(k.localAnchorA=[a.pxm(i[0]),a.pxm(i[1])]),"undefined"!=typeof j&&null!==j&&(k.localAnchorB=[a.pxm(j[0]),a.pxm(j[1])]),p2.Spring.call(this,b,c,k)},Phaser.Physics.P2.Spring.prototype=Object.create(p2.Spring.prototype),Phaser.Physics.P2.Spring.prototype.constructor=Phaser.Physics.P2.Spring,Phaser.Physics.P2.Material=function(a){this.name=a,p2.Material.call(this)},Phaser.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),Phaser.Physics.P2.Material.prototype.constructor=Phaser.Physics.P2.Material,Phaser.Physics.P2.ContactMaterial=function(a,b,c){p2.ContactMaterial.call(this,a,b,c)},Phaser.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),Phaser.Physics.P2.ContactMaterial.prototype.constructor=Phaser.Physics.P2.ContactMaterial,Phaser.Physics.P2.CollisionGroup=function(a){this.mask=a},Phaser.Physics.P2.DistanceConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=100),this.game=a.game,this.world=a,d=a.pxm(d),p2.DistanceConstraint.call(this,b,c,d,e)},Phaser.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),Phaser.Physics.P2.DistanceConstraint.prototype.constructor=Phaser.Physics.P2.DistanceConstraint,Phaser.Physics.P2.GearConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1),this.game=a.game,this.world=a;var f={angle:d,ratio:e};p2.GearConstraint.call(this,b,c,f)},Phaser.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),Phaser.Physics.P2.GearConstraint.prototype.constructor=Phaser.Physics.P2.GearConstraint,Phaser.Physics.P2.LockConstraint=function(a,b,c,d,e,f){"undefined"==typeof d&&(d=[0,0]),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,d=[a.pxm(d[0]),a.pxm(d[1])];var g={localOffsetB:d,localAngleB:e,maxForce:f};p2.LockConstraint.call(this,b,c,g)},Phaser.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),Phaser.Physics.P2.LockConstraint.prototype.constructor=Phaser.Physics.P2.LockConstraint,Phaser.Physics.P2.PrismaticConstraint=function(a,b,c,d,e,f,g,h){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=[0,0]),"undefined"==typeof f&&(f=[0,0]),"undefined"==typeof g&&(g=[0,0]),"undefined"==typeof h&&(h=Number.MAX_VALUE),this.game=a.game,this.world=a,e=[a.pxmi(e[0]),a.pxmi(e[1])],f=[a.pxmi(f[0]),a.pxmi(f[1])];var i={localAnchorA:e,localAnchorB:f,localAxisA:g,maxForce:h,disableRotationalLock:!d};p2.PrismaticConstraint.call(this,b,c,i)},Phaser.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),Phaser.Physics.P2.PrismaticConstraint.prototype.constructor=Phaser.Physics.P2.PrismaticConstraint,Phaser.Physics.P2.RevoluteConstraint=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,c=[a.pxmi(c[0]),a.pxmi(c[1])],e=[a.pxmi(e[0]),a.pxmi(e[1])],p2.RevoluteConstraint.call(this,b,c,d,e,f)},Phaser.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),Phaser.Physics.P2.RevoluteConstraint.prototype.constructor=Phaser.Physics.P2.RevoluteConstraint; //# sourceMappingURL=phaser.map
dada0423/cdnjs
ajax/libs/phaser/2.0.2/phaser.min.js
JavaScript
mit
602,197
/** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', rsComboSymbolsRange = '\\u20d0-\\u20f0', rsVarRange = '\\ufe0e\\ufe0f'; /** Used to compose unicode capture groups. */ var rsAstral = '[' + rsAstralRange + ']', rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { result++; } return result; } module.exports = unicodeSize;
vivekparekh8/LearningReact
node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-classes/node_modules/babel-template/node_modules/lodash/_unicodeSize.js
JavaScript
mit
1,553
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Acl\Domain; use Symfony\Component\Security\Acl\Model\AclInterface; use Symfony\Component\Security\Acl\Model\AuditableEntryInterface; use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface; /** * Auditable ACE implementation. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class Entry implements AuditableEntryInterface { private $acl; private $mask; private $id; private $securityIdentity; private $strategy; private $auditFailure; private $auditSuccess; private $granting; /** * Constructor. * * @param int $id * @param AclInterface $acl * @param SecurityIdentityInterface $sid * @param string $strategy * @param int $mask * @param bool $granting * @param bool $auditFailure * @param bool $auditSuccess */ public function __construct($id, AclInterface $acl, SecurityIdentityInterface $sid, $strategy, $mask, $granting, $auditFailure, $auditSuccess) { $this->id = $id; $this->acl = $acl; $this->securityIdentity = $sid; $this->strategy = $strategy; $this->mask = $mask; $this->granting = $granting; $this->auditFailure = $auditFailure; $this->auditSuccess = $auditSuccess; } /** * {@inheritdoc} */ public function getAcl() { return $this->acl; } /** * {@inheritdoc} */ public function getMask() { return $this->mask; } /** * {@inheritdoc} */ public function getId() { return $this->id; } /** * {@inheritdoc} */ public function getSecurityIdentity() { return $this->securityIdentity; } /** * {@inheritdoc} */ public function getStrategy() { return $this->strategy; } /** * {@inheritdoc} */ public function isAuditFailure() { return $this->auditFailure; } /** * {@inheritdoc} */ public function isAuditSuccess() { return $this->auditSuccess; } /** * {@inheritdoc} */ public function isGranting() { return $this->granting; } /** * Turns on/off auditing on permissions denials. * * Do never call this method directly. Use the respective methods on the * AclInterface instead. * * @param bool $boolean */ public function setAuditFailure($boolean) { $this->auditFailure = $boolean; } /** * Turns on/off auditing on permission grants. * * Do never call this method directly. Use the respective methods on the * AclInterface instead. * * @param bool $boolean */ public function setAuditSuccess($boolean) { $this->auditSuccess = $boolean; } /** * Sets the permission mask. * * Do never call this method directly. Use the respective methods on the * AclInterface instead. * * @param int $mask */ public function setMask($mask) { $this->mask = $mask; } /** * Sets the mask comparison strategy. * * Do never call this method directly. Use the respective methods on the * AclInterface instead. * * @param string $strategy */ public function setStrategy($strategy) { $this->strategy = $strategy; } /** * Implementation of \Serializable. * * @return string */ public function serialize() { return serialize(array( $this->mask, $this->id, $this->securityIdentity, $this->strategy, $this->auditFailure, $this->auditSuccess, $this->granting, )); } /** * Implementation of \Serializable. * * @param string $serialized */ public function unserialize($serialized) { list($this->mask, $this->id, $this->securityIdentity, $this->strategy, $this->auditFailure, $this->auditSuccess, $this->granting ) = unserialize($serialized); } }
yayojual/Cupon
vendor/symfony/symfony/src/Symfony/Component/Security/Acl/Domain/Entry.php
PHP
mit
4,607
/* * /MathJax/localization/zh-hans/FontWarnings.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Localization.addTranslation("zh-hans","FontWarnings",{version:"2.3",isLoaded:true,strings:{webFont:"MathJax\u4F7F\u7528\u57FA\u4E8EWeb\u7684\u5B57\u4F53\u6765\u663E\u793A\u6B64\u9875\u4E0A\u663E\u793A\u6570\u5B66\u76F8\u5173\u5185\u5BB9\u3002\u8FD9\u5C06\u82B1\u8D39\u8F83\u957F\u65F6\u95F4\u4E0B\u8F7D\uFF0C\u6240\u4EE5\u6211\u4EEC\u5F3A\u70C8\u5EFA\u8BAE\u60A8\u76F4\u63A5\u5728\u60A8\u7684\u64CD\u4F5C\u7CFB\u7EDF\u7684\u5B57\u4F53\u6587\u4EF6\u5939\u4E2D\u5B89\u88C5\u6570\u5B66\u7B26\u53F7\u5B57\u4F53\u4EE5\u4FBF\u7ACB\u523B\u663E\u793A\u3002",imageFonts:"MathJax\u4F7F\u7528\u56FE\u50CF\u5B57\u4F53\u800C\u4E0D\u662F\u672C\u5730\u6216\u57FA\u4E8EWeb\u7684\u5B57\u4F53\u3002\u8FD9\u5C06\u6BD4\u5E73\u5E38\u663E\u793A\u66F4\u6162\uFF0C\u4E14\u76F8\u5173\u6570\u5B66\u7B26\u53F7\u53EF\u80FD\u65E0\u6CD5\u5168\u606F\u7684\u88AB\u6253\u5370\u673A\u6253\u5370\u3002",noFonts:"MathJax\u65E0\u6CD5\u5B9A\u4F4D\u60A8\u4F7F\u7528\u4E2D\u7684\u5B57\u4F53\u4EE5\u663E\u793A\u6570\u5B66\u7B26\u53F7\uFF0C\u56FE\u50CF\u5B57\u4F53\u4EA6\u65E0\u6CD5\u4F7F\u7528\uFF0C\u6240\u4EE5\u6211\u4EEC\u4E0D\u5F97\u4E0D\u8C03\u7528Unicode\u5B57\u7B26\u4EE5\u663E\u793A\u4E4B\u3002\u67D0\u4E9B\u5B57\u7B26\u5C06\u65E0\u6CD5\u6B63\u786E\u663E\u793A\uFF0C\u4E43\u81F3\u5F7B\u5E95\u65E0\u6CD5\u663E\u793A\u3002",webFonts:"\u73B0\u65F6\u5927\u591A\u6570\u6D4F\u89C8\u5668\u5141\u8BB8\u901A\u8FC7\u4E92\u8054\u7F51\u4E0B\u8F7D\u5B57\u4F53\u3002\u66F4\u65B0\u60A8\u7684\u6D4F\u89C8\u5668\u81F3\u6700\u65B0\u7248\u672C\uFF08\u6216\u8005\u5E72\u8106\u66F4\u6362\u6D4F\u89C8\u5668\uFF09\u4EE5\u4FBF\u5728\u6B64\u9875\u9762\u63D0\u9AD8\u6570\u5B66\u7B26\u53F7\u7684\u663E\u793A\u8D28\u91CF\u3002",fonts:"MathJax\u53EF\u4F7F\u7528[STIX fonts](%1)\u6216\u8005[MathJax TeX fonts](%2)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u8FD9\u4E9B\u5B57\u4F53\u4EE5\u6539\u5584\u60A8\u7684MathJax\u4F53\u9A8C\u3002",STIXPage:"\u6B64\u9875\u9762\u88AB\u8BBE\u8BA1\u4E3A\u4F7F\u7528[STIX fonts](%1)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u5B83\u4EE5\u589E\u52A0\u60A8\u7684MathJax\u4F53\u9A8C\u3002",TeXPage:"\u6B64\u9875\u9762\u88AB\u8BBE\u8BA1\u4E3A\u4F7F\u7528[MathJax TeX fonts](%1)\u3002\u4E0B\u8F7D\u5E76\u5B89\u88C5\u5B83\u4EE5\u589E\u52A0\u60A8\u7684MathJax\u4F53\u9A8C\u3002"}});MathJax.Ajax.loadComplete("[MathJax]/localization/zh-hans/FontWarnings.js");
yinghunglai/cdnjs
ajax/libs/mathjax/2.3.0/localization/zh-hans/FontWarnings.js
JavaScript
mit
2,998
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscTechnical.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{8960:[487,-14,606,25,581],8962:[774,0,926,55,871],8965:[577,0,620,48,572],8966:[728,0,620,48,572],8972:[166,215,463,52,412],8973:[166,215,463,52,412],8974:[876,-495,463,52,412],8975:[876,-495,463,52,412],8976:[393,-115,600,48,552],8977:[439,-65,523,75,449],8978:[331,0,762,50,712],8979:[331,0,762,50,712],8981:[582,189,847,26,796],8982:[748,246,1100,53,1047],8983:[749,245,1100,53,1047],8984:[662,156,926,55,871],8985:[393,-115,600,48,552],8986:[671,69,685,64,622],8988:[662,-281,463,51,411],8989:[662,-281,463,51,411],8990:[164,217,463,51,411],8991:[164,217,463,52,412],9001:[713,213,400,77,335],9002:[713,213,400,65,323],9004:[692,186,926,83,843],9005:[592,88,986,55,931],9006:[450,140,624,-18,574],9010:[562,56,889,80,809],9014:[751,156,926,85,841],9021:[683,179,910,84,826],9023:[703,176,683,60,623],9024:[703,176,683,60,623],9043:[751,176,794,55,739],9072:[751,176,794,55,739],9084:[584,220,871,50,820],9107:[386,-120,913,85,841],9108:[633,127,926,24,902],9140:[766,-574,926,55,871],9141:[109,83,926,55,871],9142:[495,-11,926,55,871],9166:[731,225,926,50,856],9180:[100,100,1000,0,1000],9181:[764,-564,1000,0,1000],9182:[214,114,1000,0,1000],9183:[892,-564,1000,0,1000],9184:[100,114,1000,0,1000],9185:[778,-564,1000,0,1000],9186:[558,53,1144,54,1090],9187:[680,178,910,82,828],9188:[286,-220,1094,47,1047],9189:[527,20,1018,23,995],9190:[434,-72,926,55,871],9191:[606,97,798,194,733]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/MiscTechnical.js");
Timbioz/cdnjs
ajax/libs/mathjax/2.2.0/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscTechnical.js
JavaScript
mit
1,972
/* * /MathJax/localization/ko/ko.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Localization.addTranslation("ko",null,{menuTitle:"\uD55C\uAD6D\uC5B4",version:"2.3",isLoaded:true,domains:{_:{version:"2.3",isLoaded:true,strings:{CookieConfig:"MathJax\uAC00 \uC2E4\uD589\uD560 \uCF54\uB4DC\uB97C \uD3EC\uD568\uD558\uB294 \uC0AC\uC6A9\uC790-\uC124\uC815 \uCFE0\uD0A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4. \uC2E4\uD589\uD558\uACA0\uC2B5\uB2C8\uAE4C?\n\n(\uCFE0\uD0A4\uB97C \uC2A4\uC2A4\uB85C \uC124\uC815\uD558\uC9C0 \uC54A\uC73C\uBA74 \uCDE8\uC18C\uB97C \uB20C\uB7EC\uC57C \uD569\uB2C8\uB2E4.)",MathProcessingError:"\uC218\uC2DD \uCC98\uB9AC \uC624\uB958",MathError:"\uC218\uC2DD \uC624\uB958",LoadFile:"%1(\uC744)\uB97C \uBD88\uB7EC\uC624\uB294 \uC911",Loading:"\uBD88\uB7EC\uC624\uB294 \uC911",LoadFailed:"\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: %1",ProcessMath:"\uC218\uC2DD \uCC98\uB9AC \uC911: %1%%",Processing:"\uCC98\uB9AC \uC911",TypesetMath:"\uC218\uC2DD \uC870\uD310 \uC911: %1%%",Typesetting:"\uC870\uD310 \uC911",MathJaxNotSupported:"\uC0AC\uC6A9\uD558\uB294 \uBE0C\uB77C\uC6B0\uC800\uB294 MathJax\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4"}},FontWarnings:{},"HTML-CSS":{},HelpDialog:{},MathML:{},MathMenu:{},TeX:{}},plural:function(a){return 1},number:function(a){return a}});MathJax.Ajax.loadComplete("[MathJax]/localization/ko/ko.js");
zhangbg/cdnjs
ajax/libs/mathjax/2.3.0/localization/ko/ko.js
JavaScript
mit
1,984
/* * /MathJax/localization/da/HTML-CSS.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Localization.addTranslation("da","HTML-CSS",{version:"2.3",isLoaded:true,strings:{LoadWebFont:"Indl\u00E6ser webskrifftype %1",CantLoadWebFont:"Kan ikke indl\u00E6se webskrifttype %1",FirefoxCantLoadWebFont:"Firefox kan ikke indl\u00E6se webskrifttyper fra en fjernstyret v\u00E6rt",CantFindFontUsing:"Kunne ikke finde en gyldig skrifttype ved hj\u00E6lp af %1",WebFontsNotAvailable:"Webskrifttyper er ikke tilg\u00E6ngelig. Brug billede skrifttyper i stedet"}});MathJax.Ajax.loadComplete("[MathJax]/localization/da/HTML-CSS.js");
gaearon/cdnjs
ajax/libs/mathjax/2.3/localization/da/HTML-CSS.js
JavaScript
mit
1,209
.yasqe{@-moz-keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0 0}100%{background:#7e7}}}.yasqe .CodeMirror{font-family:monospace;height:300px}.yasqe .CodeMirror-lines{padding:4px 0}.yasqe .CodeMirror pre{padding:0 4px}.yasqe .CodeMirror-scrollbar-filler,.yasqe .CodeMirror-gutter-filler{background-color:#fff}.yasqe .CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.yasqe .CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.yasqe .CodeMirror-guttermarker{color:#000}.yasqe .CodeMirror-guttermarker-subtle{color:#999}.yasqe .CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.yasqe .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.yasqe .CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.yasqe .CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.yasqe .cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.yasqe .cm-tab{display:inline-block;text-decoration:inherit}.yasqe .CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.yasqe .cm-s-default .cm-keyword{color:#708}.yasqe .cm-s-default .cm-atom{color:#219}.yasqe .cm-s-default .cm-number{color:#164}.yasqe .cm-s-default .cm-def{color:#00f}.yasqe .cm-s-default .cm-variable-2{color:#05a}.yasqe .cm-s-default .cm-variable-3{color:#085}.yasqe .cm-s-default .cm-comment{color:#a50}.yasqe .cm-s-default .cm-string{color:#a11}.yasqe .cm-s-default .cm-string-2{color:#f50}.yasqe .cm-s-default .cm-meta{color:#555}.yasqe .cm-s-default .cm-qualifier{color:#555}.yasqe .cm-s-default .cm-builtin{color:#30a}.yasqe .cm-s-default .cm-bracket{color:#997}.yasqe .cm-s-default .cm-tag{color:#170}.yasqe .cm-s-default .cm-attribute{color:#00c}.yasqe .cm-s-default .cm-header{color:#00f}.yasqe .cm-s-default .cm-quote{color:#090}.yasqe .cm-s-default .cm-hr{color:#999}.yasqe .cm-s-default .cm-link{color:#00c}.yasqe .cm-negative{color:#d44}.yasqe .cm-positive{color:#292}.yasqe .cm-header,.yasqe .cm-strong{font-weight:700}.yasqe .cm-em{font-style:italic}.yasqe .cm-link{text-decoration:underline}.yasqe .cm-strikethrough{text-decoration:line-through}.yasqe .cm-s-default .cm-error{color:red}.yasqe .cm-invalidchar{color:red}.yasqe div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}.yasqe div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.yasqe .CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.yasqe .CodeMirror-activeline-background{background:#e8f2ff}.yasqe .CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.yasqe .CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.yasqe .CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.yasqe .CodeMirror-vscrollbar,.yasqe .CodeMirror-hscrollbar,.yasqe .CodeMirror-scrollbar-filler,.yasqe .CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.yasqe .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.yasqe .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.yasqe .CodeMirror-scrollbar-filler{right:0;bottom:0}.yasqe .CodeMirror-gutter-filler{left:0;bottom:0}.yasqe .CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.yasqe .CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;display:inline-block;margin-bottom:-30px;;}.yasqe .CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.yasqe .CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.yasqe .CodeMirror-lines{cursor:text;min-height:1px}.yasqe .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.yasqe .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.yasqe .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.yasqe .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.yasqe .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.yasqe .CodeMirror-measure pre{position:static}.yasqe .CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}.yasqe div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.yasqe .CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.yasqe .CodeMirror-selected{background:#d9d9d9}.yasqe .CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.yasqe .CodeMirror-crosshair{cursor:crosshair}.yasqe .cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.yasqe .cm-force-border{padding-right:.1px}@media print{.yasqe .CodeMirror div.CodeMirror-cursors{visibility:hidden}}.yasqe .cm-tab-wrap-hack:after{content:''}.yasqe span.CodeMirror-selectedtext{background:0 0}.yasqe .CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.yasqe .CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.yasqe .CodeMirror-foldgutter{width:.7em}.yasqe .CodeMirror-foldgutter-open,.yasqe .CodeMirror-foldgutter-folded{cursor:pointer}.yasqe .CodeMirror-foldgutter-open:after{content:"\25BE"}.yasqe .CodeMirror-foldgutter-folded:after{content:"\25B8"}.yasqe .svgImg{display:inline-block}.yasqe .CodeMirror{line-height:1.5em;border:1px solid #d1d1d1}.yasqe pre{font-size:13px}.yasqe span.cm-error{border-bottom:2px dotted red}.yasqe .gutterErrorBar{width:4px}.yasqe .yasqe_buttons{position:absolute;top:5px;right:5px;z-index:5}.yasqe .yasqe_buttons div{vertical-align:top;margin-left:5px}.yasqe .yasqe_queryButton{display:inline-block;cursor:pointer;width:40px;height:40px}.yasqe .yasqe_queryButton .svgImg{display:block}.yasqe .yasqe_share{cursor:pointer;height:20px;width:20px;margin-top:3px}.yasqe .yasqe_sharePopup{position:absolute;padding:6px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);width:400px;height:auto}.yasqe .yasqe_sharePopup textarea{width:100%}.yasqe .completionNotification{color:#999;background-color:#f7f7f7;position:absolute;padding:0 5px;right:0;bottom:0;font-size:90%}.yasqe .CodeMirror-fullscreen .fullscreenToggleBtns .yasqe_smallscreenBtn{display:inline-block}.yasqe .CodeMirror-fullscreen .fullscreenToggleBtns .yasqe_fullscreenBtn{display:none}.yasqe .fullscreenToggleBtns{display:inline-block;margin-top:3px}.yasqe .fullscreenToggleBtns div{cursor:pointer;width:20px;height:20px}.yasqe .fullscreenToggleBtns .yasqe_smallscreenBtn{display:none}.yasqe .parseErrorIcon{width:15px;height:15px}.yasqe .yasqe_tooltip{display:inline;position:absolute;background:#333;background:rgba(0,0,0,.8);border-radius:5px;bottom:26px;color:#fff;left:20%;padding:5px 15px;position:absolute;width:220px;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;white-space:normal}.yasqe .notificationLoader{width:18px;height:18px;vertical-align:middle}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-hint{max-width:30em}
andyinabox/cdnjs
ajax/libs/yasqe/2.3.5/yasqe.min.css
CSS
mit
8,288
/*! * VERSION: beta 0.2.0 * DATE: 2013-05-07 * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com **/ (window._gsQueue||(window._gsQueue=[])).push(function(){"use strict";window._gsDefine.plugin({propName:"directionalRotation",API:2,init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,l=e.useRadians===!0?2*Math.PI:360,h=1e-6;for(i in e)"useRadians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexOf("short")&&(a%=l,a!==a%(l/2)&&(a=0>a?a+l:a-l)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*l)%l-(0|a/l)*l:-1!==s.indexOf("ccw")&&a>0&&(a=(a-9999999999*l)%l-(0|a/l)*l)),(a>h||-h>a)&&(this._addTween(t,i,r,r+a,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0}),window._gsDefine&&window._gsQueue.pop()();
zauguin/cdnjs
ajax/libs/gsap/1.11.0/plugins/DirectionalRotationPlugin.min.js
JavaScript
mit
1,476
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var pathModule = require('path'); var isWindows = process.platform === 'win32'; var fs = require('fs'); // JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; if (DEBUG) { var backtrace = new Error; callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs else if (!process.noDeprecation) { var msg = 'fs: missing callback ' + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } // Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; } // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } // walk down the path, swapping out linked pathparts for their real // values function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err) { if (err) return cb(err); fs.readlink(base, function(err, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err, target); }); }); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } };
natewscott/holy_grail
node_modules/grunt-contrib-watch/node_modules/gaze/node_modules/globule/node_modules/glob/node_modules/fs.realpath/old.js
JavaScript
mit
8,542
/*! Waypoints - 4.0.0 Copyright © 2011-2015 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/waypoints/blog/master/licenses.txt */ !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,c=!l&&!h;(p||c)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var u in t)t[u].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,c,u,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,c=h&&p,u=!h&&!p,!g&&c?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&u?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.element=t,this.$element=e(t)}var e=window.Zepto,i=window.Waypoint;e.each(["off","on","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),t.prototype.offset=function(){return this.element!==this.element.window?this.$element.offset():void 0},e.each(["width","height"],function(i,o){function n(t,i){return function(t){var n=this.$element,r=n[o](),s={width:["left","right"],height:["top","bottom"]};return e.each(s[o],function(e,o){r+=parseInt(n.css("padding-"+o),10),i&&(r+=parseInt(n.css("border-"+o+"-width"),10)),t&&(r+=parseInt(n.css("margin-"+o),10))}),r}}var r=e.camelCase("inner-"+o),s=e.camelCase("outer-"+o);t.prototype[r]=n(!1),t.prototype[s]=n(!0)}),e.each(["extend","inArray"],function(i,o){t[o]=e[o]}),t.isEmptyObject=function(t){for(var e in t)return!1;return!0},i.adapters.push({name:"zepto",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
iwdmb/cdnjs
ajax/libs/waypoints/4.0.0/zepto.waypoints.min.js
JavaScript
mit
9,350
/* Tagalog LANGUAGE ================================================== */typeof VMM!="undefined"&&(VMM.Language={lang:"tl",api:{wikipedia:"tl"},date:{month:["Enemo","Pebrero","Marso","Abril","Mayo","Hunyo","Hulyo","Agosto","Setyembre","Oktubre","Nobyembre","Disyembre"],month_abbr:["Ene.","Peb.","Mar.","Abr.","Mayo","Hun.","Hul.","Ago.","Set.","Okt.","Nob.","Dis."],day:["Linggo","Lunes","Martes","Miyerkules","Huwebes","Biyernes","Sabado"],day_abbr:["Li.","L.","M.","Mi.","H.","B.","S."]},dateformats:{year:"yyyy",month_short:"mmm",month:"mmmm yyyy",full_short:"mmm d",full:"mmmm d',' yyyy",time_no_seconds_short:"h:MM TT",time_no_seconds_small_date:"h:MM TT'<br/><small>'mmmm d',' yyyy'</small>'",full_long:"mmm d',' yyyy 'at' h:MM TT",full_long_small_date:"h:MM TT'<br/><small>mmm d',' yyyy'</small>'"},messages:{loading_timeline:"Loading Timeline... ",return_to_title:"Return to Title",expand_timeline:"Expand Timeline",contract_timeline:"Contract Timeline",wikipedia:"Mula sa Wikipedia, ang malayang ensiklopedya",loading_content:"Loading Content",loading:"Loading"}});
hhbyyh/cdnjs
ajax/libs/timelinejs/2.24/js/locale/tl.js
JavaScript
mit
1,076
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. (function (window, undefined) { var freeExports = typeof exports == 'object' && exports && (typeof global == 'object' && global && global == global.global && (window = global), exports); /** * @name Rx * @type Object */ var Rx = { Internals: {} }; // Defaults function noop() { } function identity(x) { return x; } function defaultNow() { return new Date().getTime(); } function defaultComparer(x, y) { return x === y; } function defaultSubComparer(x, y) { return x - y; } function defaultKeySerializer(x) { return x.toString(); } function defaultError(err) { throw err; } // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; /** @private */ var inherits = this.inherits = Rx.Internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; /** @private */ var addProperties = Rx.Internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.Internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; // Collection polyfills function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Collections var IndexedItem = function (id, value) { this.id = id; this.value = value; }; IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); if (c === 0) { c = this.id - other.id; } return c; }; // Priority Queue for Scheduling var PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { if (index === undefined) { index = 0; } if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * * @memberOf CompositeDisposable# * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. * * @memberOf CompositeDisposable# */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable. * * @memberOf CompositeDisposable# */ CompositeDisposablePrototype.clear = function () { var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } }; /** * Determines whether the CompositeDisposable contains a specific disposable. * * @memberOf CompositeDisposable# * @param {Mixed} item Disposable to search for. * @returns {Boolean} true if the disposable was found; otherwise, false. */ CompositeDisposablePrototype.contains = function (item) { return this.disposables.indexOf(item) !== -1; }; /** * Converts the existing CompositeDisposable to an array of disposables * * @memberOf CompositeDisposable# * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action; }; /** * Performs the task of cleaning up resources. * * @memberOf Disposable# */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * * @static * @memberOf Disposable * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. * * @static * @memberOf Disposable */ var disposableEmpty = Disposable.empty = { dispose: noop }; /** * Represents a disposable resource which only allows a single assignment of its underlying disposable resource. * If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error. * * @constructor */ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { this.isDisposed = false; this.current = null; }; var SingleAssignmentDisposablePrototype = SingleAssignmentDisposable.prototype; /** * Gets or sets the underlying disposable. After disposal, the result of getting this method is undefined. * * @memberOf SingleAssignmentDisposable# * @param {Disposable} [value] The new underlying disposable. * @returns {Disposable} The underlying disposable. */ SingleAssignmentDisposablePrototype.disposable = function (value) { return !value ? this.getDisposable() : this.setDisposable(value); }; /** * Gets the underlying disposable. After disposal, the result of getting this method is undefined. * * @memberOf SingleAssignmentDisposable# * @returns {Disposable} The underlying disposable. */ SingleAssignmentDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * * @memberOf SingleAssignmentDisposable# * @param {Disposable} value The new underlying disposable. */ SingleAssignmentDisposablePrototype.setDisposable = function (value) { if (this.current) { throw new Error('Disposable has already been assigned'); } var shouldDispose = this.isDisposed; if (!shouldDispose) { this.current = value; } if (shouldDispose && value) { value.dispose(); } }; /** * Disposes the underlying disposable. * * @memberOf SingleAssignmentDisposable# */ SingleAssignmentDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } if (old) { old.dispose(); } }; /** * Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. * * @constructor */ var SerialDisposable = Rx.SerialDisposable = function () { this.isDisposed = false; this.current = null; }; /** * Gets the underlying disposable. * @return The underlying disposable</returns> */ SerialDisposable.prototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * * @memberOf SerialDisposable# * @param {Disposable} value The new underlying disposable. */ SerialDisposable.prototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } if (old) { old.dispose(); } if (shouldDispose && value) { value.dispose(); } }; /** * Gets or sets the underlying disposable. * If the SerialDisposable has already been disposed, assignment to this property causes immediate disposal of the given disposable object. Assigning this property disposes the previous disposable object. * * @memberOf SerialDisposable# * @param {Disposable} [value] The new underlying disposable. * @returns {Disposable} The underlying disposable. */ SerialDisposable.prototype.disposable = function (value) { if (!value) { return this.getDisposable(); } else { this.setDisposable(value); } }; /** * Disposes the underlying disposable as well as all future replacements. * * @memberOf SerialDisposable# */ SerialDisposable.prototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } if (old) { old.dispose(); } }; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { /** * @constructor * @private */ function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } /** @private */ InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed * * @memberOf RefCountDisposable# */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * * @memberOf RefCountDisposable# * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.H */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); /** * @constructor * @private */ function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler, this.disposable = disposable, this.isDisposed = false; } /** * @private * @memberOf ScheduledDisposable# */ ScheduledDisposable.prototype.dispose = function () { var parent = this; this.scheduler.schedule(function () { if (!parent.isDisposed) { parent.isDisposed = true; parent.disposable.dispose(); } }); }; /** * @private * @constructor */ function ScheduledItem(scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } /** * @private * @memberOf ScheduledItem# */ ScheduledItem.prototype.invoke = function () { this.disposable.disposable(this.invokeCore()); }; /** * @private * @memberOf ScheduledItem# */ ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; /** * @private * @memberOf ScheduledItem# */ ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; /** * @private * @memberOf ScheduledItem# */ ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { /** * @constructor * @private */ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. * * @memberOf Scheduler# * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. */ schedulerProto.catchException = function (handler) { return new CatchScheduler(this, handler); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * * @memberOf Scheduler# * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, function () { action(); }); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * * @memberOf Scheduler# * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodicWithState = function (state, period, action) { var s = state, id = window.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { window.clearInterval(id); }); }; /** * Schedules an action to be executed. * * @memberOf Scheduler# * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * * @memberOf Scheduler# * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * * @memberOf Scheduler# * @param {Function} action Action to execute. * @param {Number}dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * * @memberOf Scheduler# * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * * @memberOf Scheduler# * @param {Function} action Action to execute. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * * @memberOf Scheduler# * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** * Schedules an action to be executed recursively. * * @memberOf Scheduler# * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * * @memberOf Scheduler# * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, function (s, p) { return invokeRecImmediate(s, p); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * * @memberOf Scheduler * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * * @memberOf Scheduler * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * * @memberOf Scheduler * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * * @memberOf Scheduler * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * * @static * @memberOf Scheduler * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { if (timeSpan < 0) { timeSpan = 0; } return timeSpan; }; return Scheduler; }()); var schedulerNoBlockError = 'Scheduler is not allowed to block the thread'; /** * Gets a scheduler that schedules work immediately on the current thread. * * @memberOf Scheduler */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { if (dueTime > 0) throw new Error(schedulerNoBlockError); return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; /** * @private * @constructor */ function Trampoline() { queue = new PriorityQueue(4); } /** * @private * @memberOf Trampoline */ Trampoline.prototype.dispose = function () { queue = null; }; /** * @private * @memberOf Trampoline */ Trampoline.prototype.run = function () { var item; while (queue.length > 0) { item = queue.dequeue(); if (!item.isCancelled()) { while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } }; function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt), t; if (!queue) { t = new Trampoline(); try { queue.enqueue(si); t.run(); } catch (e) { throw e; } finally { t.dispose(); } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return queue === null; }; currentScheduler.ensureTrampoline = function (action) { if (queue === null) { return this.schedule(action); } else { return action(); } }; return currentScheduler; }()); /** * @private */ var SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } /** * @constructor * @private */ function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); /** Provides a set of extension methods for virtual time scheduling. */ Rx.VirtualTimeScheduler = (function (_super) { function localNow() { return this.toDateTimeOffset(this.clock); } function scheduleNow(state, action) { return this.scheduleAbsoluteWithState(state, this.clock, action); } function scheduleRelative(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action); } function invokeAction(scheduler, action) { action(); return disposableEmpty; } inherits(VirtualTimeScheduler, _super); /** * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer. * * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function VirtualTimeScheduler(initialClock, comparer) { this.clock = initialClock; this.comparer = comparer; this.isEnabled = false; this.queue = new PriorityQueue(1024); _super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling. * * @memberOf VirtualTimeScheduler# * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) { var s = new SchedulePeriodicRecursive(this, state, period, action); return s.start(); }; /** * Schedules an action to be executed after dueTime. * * @memberOf VirtualTimeScheduler# * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) { var runAt = this.add(this.clock, dueTime); return this.scheduleAbsoluteWithState(state, runAt, action); }; /** * Schedules an action to be executed at dueTime. * * @memberOf VirtualTimeScheduler# * @param {Number} dueTime Relative time after which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) { return this.scheduleRelativeWithState(action, dueTime, invokeAction); }; /** * Starts the virtual time scheduler. * * @memberOf VirtualTimeScheduler# */ VirtualTimeSchedulerPrototype.start = function () { var next; if (!this.isEnabled) { this.isEnabled = true; do { next = this.getNext(); if (next !== null) { if (this.comparer(next.dueTime, this.clock) > 0) { this.clock = next.dueTime; } next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled); } }; /** * Stops the virtual time scheduler. * * @memberOf VirtualTimeScheduler# */ VirtualTimeSchedulerPrototype.stop = function () { this.isEnabled = false; }; /** * Advances the scheduler's clock to the specified time, running all work till that point. * * @param {Number} time Absolute time to advance the scheduler's clock to. */ VirtualTimeSchedulerPrototype.advanceTo = function (time) { var next; var dueToClock = this.comparer(this.clock, time); if (this.comparer(this.clock, time) > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } if (!this.isEnabled) { this.isEnabled = true; do { next = this.getNext(); if (next !== null && this.comparer(next.dueTime, time) <= 0) { if (this.comparer(next.dueTime, this.clock) > 0) { this.clock = next.dueTime; } next.invoke(); } else { this.isEnabled = false; } } while (this.isEnabled) this.clock = time; } }; /** * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan. * * @memberOf VirtualTimeScheduler# * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.advanceBy = function (time) { var dt = this.add(this.clock, time); var dueToClock = this.comparer(this.clock, dt); if (dueToClock > 0) { throw new Error(argumentOutOfRange); } if (dueToClock === 0) { return; } return this.advanceTo(dt); }; /** * Advances the scheduler's clock by the specified relative time. * * @memberOf VirtualTimeScheduler# * @param {Number} time Relative time to advance the scheduler's clock by. */ VirtualTimeSchedulerPrototype.sleep = function (time) { var dt = this.add(this.clock, time); if (this.comparer(this.clock, dt) >= 0) { throw new Error(argumentOutOfRange); } this.clock = dt; }; /** * Gets the next scheduled item to be executed. * * @memberOf VirtualTimeScheduler# * @returns {ScheduledItem} The next scheduled item. */ VirtualTimeSchedulerPrototype.getNext = function () { var next; while (this.queue.length > 0) { next = this.queue.peek(); if (next.isCancelled()) { this.queue.dequeue(); } else { return next; } } return null; }; /** * Schedules an action to be executed at dueTime. * * @memberOf VirtualTimeScheduler# * @param {Scheduler} scheduler Scheduler to execute the action on. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) { return this.scheduleAbsoluteWithState(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * * @memberOf VirtualTimeScheduler# * @param {Mixed} state State passed to the action to be executed. * @param {Number} dueTime Absolute time at which to execute the action. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) { var self = this, run = function (scheduler, state1) { self.queue.remove(si); return action(scheduler, state1); }, si = new ScheduledItem(self, state, run, dueTime, self.comparer); self.queue.enqueue(si); return si.disposable; } return VirtualTimeScheduler; }(Scheduler)); /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */ Rx.HistoricalScheduler = (function (_super) { inherits(HistoricalScheduler, _super); /** * Creates a new historical scheduler with the specified initial clock value. * * @constructor * @param {Number} initialClock Initial value for the clock. * @param {Function} comparer Comparer to determine causality of events based on absolute time. */ function HistoricalScheduler(initialClock, comparer) { var clock = initialClock == null ? 0 : initialClock; var cmp = comparer || defaultSubComparer; _super.call(this, clock, cmp); } var HistoricalSchedulerProto = HistoricalScheduler.prototype; /** * Adds a relative time value to an absolute time value. * * @memberOf HistoricalScheduler * @param {Number} absolute Absolute virtual time value. * @param {Number} relative Relative virtual time value to add. * @return {Number} Resulting absolute virtual time sum value. */ HistoricalSchedulerProto.add = function (absolute, relative) { return absolute + relative; }; /** * @private * @memberOf HistoricalScheduler */ HistoricalSchedulerProto.toDateTimeOffset = function (absolute) { return new Date(absolute).getTime(); }; /** * Converts the TimeSpan value to a relative virtual time value. * * @memberOf HistoricalScheduler * @param {Number} timeSpan TimeSpan value to convert. * @return {Number} Corresponding relative virtual time value. */ HistoricalSchedulerProto.toRelative = function (timeSpan) { return timeSpan; }; return HistoricalScheduler; }(Rx.VirtualTimeScheduler)); /** * Gets a scheduler that schedules work via a timed callback based upon platform. * * @memberOf Scheduler */ var timeoutScheduler = Scheduler.timeout = (function () { function postMessageSupported () { // Ensure not in a worker if (!window.postMessage || window.importScripts) { return false; } var isAsync = false, oldHandler = window.onmessage; // Test for async window.onmessage = function () { isAsync = true; }; window.postMessage('','*'); window.onmessage = oldHandler; return isAsync; } var scheduleMethod, clearMethod = noop; if (typeof window.process !== 'undefined' && typeof window.process === '[object process]') { scheduleMethod = window.process.nextTick; } else if (typeof window.setImmediate === 'function') { scheduleMethod = window.setImmediate; clearMethod = window.clearImmediate; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (window.addEventListener) { window.addEventListener('message', onGlobalPostMessage, false); } else { window.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; window.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!window.MessageChannel) { scheduleMethod = function (action) { var channel = new window.MessageChannel(); channel.port1.onmessage = function (event) { action(); }; channel.port2.postMessage(); }; } else if ('document' in window && 'onreadystatechange' in window.document.createElement('script')) { var scriptElement = window.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; window.document.documentElement.appendChild(scriptElement); } else { scheduleMethod = function (action) { return window.setTimeout(action, 0); }; clearMethod = window.clearTimeout; } function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = window.setTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { window.clearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** @private */ var CatchScheduler = (function (_super) { function localNow() { return this._scheduler.now(); } function scheduleNow(state, action) { return this._scheduler.scheduleWithState(state, this._wrap(action)); } function scheduleRelative(state, dueTime, action) { return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action)); } function scheduleAbsolute(state, dueTime, action) { return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action)); } inherits(CatchScheduler, _super); /** @private */ function CatchScheduler(scheduler, handler) { this._scheduler = scheduler; this._handler = handler; this._recursiveOriginal = null; this._recursiveWrapper = null; _super.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute); } /** @private */ CatchScheduler.prototype._clone = function (scheduler) { return new CatchScheduler(scheduler, this._handler); }; /** @private */ CatchScheduler.prototype._wrap = function (action) { var parent = this; return function (self, state) { try { return action(parent._getRecursiveWrapper(self), state); } catch (e) { if (!parent._handler(e)) { throw e; } return disposableEmpty; } }; }; /** @private */ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { if (!this._recursiveOriginal !== scheduler) { this._recursiveOriginal = scheduler; var wrapper = this._clone(scheduler); wrapper._recursiveOriginal = scheduler; wrapper._recursiveWrapper = wrapper; this._recursiveWrapper = wrapper; } return this._recursiveWrapper; }; /** @private */ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) { var self = this, failed = false, d = new SingleAssignmentDisposable(); d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) { if (failed) { return null; } try { return action(state1); } catch (e) { failed = true; if (!self._handler(e)) { throw e; } d.dispose(); return null; } })); return d; }; return CatchScheduler; }(Scheduler)); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } var NotificationPrototype = Notification.prototype; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) { if (arguments.length === 1 && typeof observerOrOnNext === 'object') { return this._acceptObservable(observerOrOnNext); } return this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notification * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ NotificationPrototype.toObservable = function (scheduler) { var notification = this; scheduler = scheduler || immediateScheduler; return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); if (notification.kind === 'N') { observer.onCompleted(); } }); }); }; NotificationPrototype.equals = function (other) { var otherString = other == null ? '' : other.toString(); return this.toString() === otherString; }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * * @static * @memberOf Notification * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept.bind(notification); notification._acceptObservable = _acceptObservable.bind(notification); notification.toString = toString.bind(notification); return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * * @static s * @memberOf Notification * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept.bind(notification); notification._acceptObservable = _acceptObservable.bind(notification); notification.toString = toString.bind(notification); return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * * @static * @memberOf Notification * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept.bind(notification); notification._acceptObservable = _acceptObservable.bind(notification); notification.toString = toString.bind(notification); return notification; }; }()); /** * @constructor * @private */ var Enumerator = Rx.Internals.Enumerator = function (moveNext, getCurrent, dispose) { this.moveNext = moveNext; this.getCurrent = getCurrent; this.dispose = dispose; }; /** * @static * @memberOf Enumerator * @private */ var enumeratorCreate = Enumerator.create = function (moveNext, getCurrent, dispose) { var done = false; dispose || (dispose = noop); return new Enumerator(function () { if (done) { return false; } var result = moveNext(); if (!result) { done = true; dispose(); } return result; }, function () { return getCurrent(); }, function () { if (!done) { dispose(); done = true; } }); }; /** @private */ var Enumerable = Rx.Internals.Enumerable = (function () { /** * @constructor * @private */ function Enumerable(getEnumerator) { this.getEnumerator = getEnumerator; } /** * @private * @memberOf Enumerable# */ Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } else { e.dispose(); } } catch (exception) { ex = exception; e.dispose(); } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { observer.onCompleted(); return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; e.dispose(); })); }); }; /** * @private * @memberOf Enumerable# */ Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, lastException; var subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext; hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } } catch (exception) { ex = exception; } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; return Enumerable; }()); /** * @static * @private * @memberOf Enumerable */ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount === undefined) { repeatCount = -1; } return new Enumerable(function () { var current, left = repeatCount; return enumeratorCreate(function () { if (left === 0) { return false; } if (left > 0) { left--; } current = value; return true; }, function () { return current; }); }); }; /** * @static * @private * @memberOf Enumerable */ var enumerableFor = Enumerable.forEach = function (source, selector) { selector || (selector = identity); return new Enumerable(function () { var current, index = -1; return enumeratorCreate( function () { if (++index < source.length) { current = selector(source[index], index); return true; } return false; }, function () { return current; } ); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * * @param observer Observer object. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * * @static * @memberOf Observer * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler) { return new AnonymousObserver(function (x) { return handler(notificationCreateOnNext(x)); }, function (exception) { return handler(notificationCreateOnError(exception)); }, function () { return handler(notificationCreateOnCompleted()); }); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.Internals.AbstractObserver = (function (_super) { inherits(AbstractObserver, _super); /** * Creates a new observer in a non-stopped state. * * @constructor */ function AbstractObserver() { this.isStopped = false; _super.call(this); } /** * Notifies the observer of a new element in the sequence. * * @memberOf AbstractObserver * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * * @memberOf AbstractObserver * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function () { if (!this.isStopped) { this.isStopped = true; this.error(true); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (_super) { inherits(AnonymousObserver, _super); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * * @constructor * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { _super.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * * @memberOf AnonymousObserver * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * * @memberOf AnonymousObserver * @param {Any{ error The error that has occurred. */ AnonymousObserver.prototype.error = function (exception) { this._onError(exception); }; /** * Calls the onCompleted action. * * @memberOf AnonymousObserver */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var CheckedObserver = (function (_super) { inherits(CheckedObserver, _super); function CheckedObserver(observer) { _super.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); try { this._observer.onNext(value); } catch (e) { throw e; } finally { this._state = 0; } }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); try { this._observer.onError(err); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); try { this._observer.onCompleted(); } catch (e) { throw e; } finally { this._state = 2; } }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); /** @private */ var ScheduledObserver = Rx.Internals.ScheduledObserver = (function (_super) { inherits(ScheduledObserver, _super); function ScheduledObserver(scheduler, observer) { _super.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } /** @private */ ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; /** @private */ ScheduledObserver.prototype.error = function (exception) { var self = this; this.queue.push(function () { self.observer.onError(exception); }); }; /** @private */ ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; /** @private */ ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; /** @private */ ScheduledObserver.prototype.dispose = function () { _super.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** @private */ var ObserveOnObserver = (function (_super) { inherits(ObserveOnObserver, _super); /** @private */ function ObserveOnObserver() { _super.apply(this, arguments); } /** @private */ ObserveOnObserver.prototype.next = function (value) { _super.prototype.next.call(this, value); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.error = function (e) { _super.prototype.error.call(this, e); this.ensureActive(); }; /** @private */ ObserveOnObserver.prototype.completed = function () { _super.prototype.completed.call(this); this.ensureActive(); }; return ObserveOnObserver; })(ScheduledObserver); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { /** * @constructor * @private */ function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); }; /** * Subscribes an observer to the observable sequence. * * @example * 1 - source.subscribe(); * 2 - source.subscribe(observer); * 3 - source.subscribe(function (x) { console.log(x); }); * 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }); * 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); }); * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { var subscriber; if (typeof observerOrOnNext === 'object') { subscriber = observerOrOnNext; } else { subscriber = observerCreate(observerOrOnNext, onError, onCompleted); } return this._subscribe(subscriber); }; /** * Creates a list from an observable sequence. * * @memberOf Observable * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { function accumulator(list, i) { var newList = list.slice(0); newList.push(i); return newList; } return this.scan([], accumulator).startWith([]).finalValue(); } return Observable; })(); /** * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence. * * @example * 1 - res = Rx.Observable.start(function () { console.log('hello'); }); * 2 - res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout); * 2 - res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console); * * @param {Function} func Function to run asynchronously. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. * * Remarks * * The function is called immediately, not during the subscription of the resulting sequence. * * Multiple subscriptions to the resulting sequence can observe the function's result. */ Observable.start = function (func, scheduler, context) { return observableToAsync(func, scheduler)(); }; /** * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. * * @example * 1 - res = Rx.Observable.toAsync(function (x, y) { return x + y; })(4, 3); * 2 - res = Rx.Observable.toAsync(function (x, y) { return x + y; }, Rx.Scheduler.timeout)(4, 3); * 2 - res = Rx.Observable.toAsync(function (x) { this.log(x); }, Rx.Scheduler.timeout, console)('hello'); * * @param function Function to convert to an asynchronous function. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @returns {Function} Asynchronous function. */ var observableToAsync = Observable.toAsync = function (func, scheduler, context) { scheduler || (scheduler = timeoutScheduler); return function () { var args = slice.call(arguments, 0), subject = new AsyncSubject(); scheduler.schedule(function () { var result; try { result = func.apply(context, args); } catch (e) { subject.onError(e); return; } subject.onNext(result); subject.onCompleted(); }); return subject.asObservable(); }; }; /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(new ObserveOnObserver(scheduler, observer)); }); }; /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { var source = this; return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(scheduler.schedule(function () { d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer))); })); return d; }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * 1 - res = Rx.Observable.create(function (observer) { return function () { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = function (subscribe) { return new AnonymousObservable(function (o) { return disposableCreate(subscribe(o)); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * 1 - res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * @static * @memberOf Observable * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * 1 - res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @static * @memberOf Observable * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * 1 - res = Rx.Observable.empty(); * 2 - res = Rx.Observable.empty(Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * 1 - res = Rx.Observable.fromArray([1,2,3]); * 2 - res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0; return scheduler.scheduleRecursive(function (self) { if (count < array.length) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * 1 - res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * 2 - res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * * @static * @memberOf Observable * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * 1 - res = Rx.Observable.range(0, 10); * 2 - res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * 1 - res = Rx.Observable.repeat(42); * 2 - res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { scheduler || (scheduler = currentThreadScheduler); if (repeatCount == undefined) { repeatCount = -1; } return observableReturn(value, scheduler).repeat(repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * * @example * 1 - res = Rx.Observable.returnValue(42); * 2 - res = Rx.Observable.returnValue(42, Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable.returnValue = function (value, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single OnError message. * * @example * 1 - res = Rx.Observable.throwException(new Error('Error')); * 2 - res = Rx.Observable.throwException(new Error('Error'), Rx.Scheduler.timeout); * @static * @memberOf Observable * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable.throwException = function (exception, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * * @example * 1 - res = Rx.Observable.using(function () { return new AsyncSubject(); }, function (s) { return s; }); * @static * @memberOf Observable * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new AnonymousObservable(function (observer) { var disposable = disposableEmpty, resource, source; try { resource = resourceFactory(); if (resource) { disposable = resource; } source = observableFactory(resource); } catch (exception) { return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable); } return new CompositeDisposable(source.subscribe(observer), disposable); }); }; /** * Propagates the observable sequence that reacts first. * * @memberOf Observable# * @param {Observable} rightSource Second observable sequence. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } leftSubscription.setDisposable(leftSource.subscribe(function (left) { choiceL(); if (choice === leftChoice) { observer.onNext(left); } }, function (err) { choiceL(); if (choice === leftChoice) { observer.onError(err); } }, function () { choiceL(); if (choice === leftChoice) { observer.onCompleted(); } })); rightSubscription.setDisposable(rightSource.subscribe(function (right) { choiceR(); if (choice === rightChoice) { observer.onNext(right); } }, function (err) { choiceR(); if (choice === rightChoice) { observer.onError(err); } }, function () { choiceR(); if (choice === rightChoice) { observer.onCompleted(); } })); return new CompositeDisposable(leftSubscription, rightSubscription); }); }; /** * Propagates the observable sequence that reacts first. * * @example * E.g. winner = Rx.Observable.amb(xs, ys, zs); * @static * @memberOf Observable * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items = argsOrArray(arguments, 0); function func(previous, current) { return previous.amb(current); } for (var i = 0, len = items.length; i < len; i++) { acc = func(acc, items[i]); } return acc; }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @memberOf Observable# * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto.catchException = function (handlerOrSecond) { if (typeof handlerOrSecond === 'function') { return observableCatchHandler(this, handlerOrSecond); } return observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.catchException(xs, ys, zs); * 2 - res = Rx.Observable.catchException([xs, ys, zs]); * @static * @memberOf Observable * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = function () { var items = argsOrArray(arguments, 0); return enumerableFor(items).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @memberOf Observable# * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @static * @memberOf Observable * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(function (x) { return x; }))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(function (x) { return x; })) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(args[i].subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @memberOf Observable# * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * * @example * 1 - res = Rx.Observable.concat(xs, ys, zs); * 2 - res = Rx.Observable.concat([xs, ys, zs]); * @static * @memberOf Observable * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var sources = argsOrArray(arguments, 0); return enumerableFor(sources).concat(); }; /** * Concatenates an observable sequence of observable sequences. * * @memberOf Observable# * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @memberOf Observable# * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [], subscribe = function (xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { var s; group.remove(subscription); if (q.length > 0) { s = q.shift(); subscribe(s); } else { activeCount--; if (isStopped && activeCount === 0) { observer.onCompleted(); } } })); }; group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; if (activeCount === 0) { observer.onCompleted(); } })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * * @static * @memberOf Observable * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * * @memberOf Observable# * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll =function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe(function (x) { observer.onNext(x); }, observer.onError.bind(observer), function () { group.remove(innerSubscription); if (isStopped && group.length === 1) { observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; if (group.length === 1) { observer.onCompleted(); } })); return group; }); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @memberOf Observable * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs); * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]); * @static * @memberOf Observable * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var pos = 0, subscription = new SerialDisposable(), cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, d; if (pos < sources.length) { current = sources[pos++]; d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe(observer.onNext.bind(observer), function () { self(); }, function () { self(); })); } else { observer.onCompleted(); } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * * @memberOf Observable# * @param {Observable} other The observable sequence that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { if (isOpen) { observer.onNext(left); } }, observer.onError.bind(observer), function () { if (isOpen) { observer.onCompleted(); } })); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * * @memberOf Observable# * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe(function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); d.setDisposable(innerSource.subscribe(function (x) { if (latest === id) { observer.onNext(x); } }, function (e) { if (latest === id) { observer.onError(e); } }, function () { if (latest === id) { hasLatest = false; if (isStopped) { observer.onCompleted(); } } })); }, observer.onError.bind(observer), function () { isStopped = true; if (!hasLatest) { observer.onCompleted(); } }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * * @memberOf Observable# * @param {Observable} other Observable sequence that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @memberOf Observable# * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); var next = function (i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(function (x) { return x; })) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * * @static * @memberOf Observable * @param {Array} sources Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function (sources, resultSelector) { var first = sources[0], rest = sources.slice(1); rest.push(resultSelector); return first.zip.apply(first, rest); }; /** * Hides the identity of an observable sequence. * * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(observer); }); }; /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * * @example * 1 - xs.bufferWithCount(10); * 2 - xs.bufferWithCount(10, 1); * * @memberOf Observable# * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { if (skip === undefined) { skip = count; } return this.windowWithCount(count, skip).selectMany(function (x) { return x.toArray(); }).where(function (x) { return x.length > 0; }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * * @memberOf Observable# * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * 1 - var obs = observable.distinctUntilChanged(); * 2 - var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * 3 - var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @memberOf Observable# * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * * @example * 1 - observable.doAction(observer); * 2 - observable.doAction(onNext); * 3 - observable.doAction(onNext, onError); * 4 - observable.doAction(onNext, onError, onCompleted); * * @memberOf Observable# * @param {Mixed} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (exception) { if (!onError) { observer.onError(exception); } else { try { onError(exception); } catch (e) { observer.onError(e); } observer.onError(exception); } }, function () { if (!onCompleted) { observer.onCompleted(); } else { try { onCompleted(); } catch (e) { observer.onError(e); } observer.onCompleted(); } }); }); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * 1 - obs = observable.finallyAction(function () { console.log('sequence ended'; }); * * @memberOf Observable# * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription = source.subscribe(observer); return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * * @memberOf Observable# * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * * @memberOf Observable# * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (exception) { observer.onNext(notificationCreateOnError(exception)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * 1 - repeated = source.repeat(); * 2 - repeated = source.repeat(42); * * @memberOf Observable# * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * * @example * 1 - retried = retry.repeat(); * 2 - retried = retry.repeat(42); * * @memberOf Observable# * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * * 1 - scanned = source.scan(function (acc, x) { return acc + x; }); * 2 - scanned = source.scan(0, function (acc, x) { return acc + x; }); * * @memberOf Observable# * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var seed, hasSeed = false, accumulator; if (arguments.length === 2) { seed = arguments[0]; accumulator = arguments[1]; hasSeed = true; } else { accumulator = arguments[0]; } var source = this; return observableDefer(function () { var hasAccumulation = false, accumulation; return source.select(function (x) { if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } return accumulation; }); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * * @memberOf Observable# * @description * This operator accumulates a queue with a length enough to store the first <paramref name="count"/> elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { observer.onNext(q.shift()); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * * 1 - source.startWith(1, 2, 3); * 2 - source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * * @memberOf Observable# * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (arguments.length > 0 && arguments[0] != null && arguments[0].now !== undefined) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableFor([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence, using an optional scheduler to drain the queue. * * @example * 1 - obs = source.takeLast(5); * 2 - obs = source.takeLast(5, Rx.Scheduler.timeout); * * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * * @memberOf Observable# * @param {Number} count Number of elements to take from the end of the source sequence. * @param {Scheduler} [scheduler] Scheduler used to drain the queue upon completion of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count, scheduler) { return this.takeLastBuffer(count).selectMany(function (xs) { return observableFromArray(xs, scheduler); }); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * * @memberOf Observable# * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { q.shift(); } }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * * 1 - xs.windowWithCount(10); * 2 - xs.windowWithCount(10, 1); * * @memberOf Observable# * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; if (count <= 0) { throw new Error(argumentOutOfRange); } if (skip == null) { skip = count; } if (skip <= 0) { throw new Error(argumentOutOfRange); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = [], createWindow = function () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); }; createWindow(); m.setDisposable(source.subscribe(function (x) { var s; for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; if (c >= 0 && c % skip === 0) { s = q.shift(); s.onCompleted(); } n++; if (n % skip === 0) { createWindow(); } }, function (exception) { while (q.length > 0) { q.shift().onError(exception); } observer.onError(exception); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * 1 - obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; if (defaultValue === undefined) { defaultValue = null; } return new AnonymousObservable(function (observer) { var found = false; return source.subscribe(function (x) { found = true; observer.onNext(x); }, observer.onError.bind(observer), function () { if (!found) { observer.onNext(defaultValue); } observer.onCompleted(); }); }); }; /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * 1 - obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (x) { return x.toString(); }); * * @memberOf Observable# * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, keySerializer) { var source = this; keySelector || (keySelector = identity); keySerializer || (keySerializer = defaultKeySerializer); return new AnonymousObservable(function (observer) { var hashSet = {}; return source.subscribe(function (x) { var key, serializedKey, otherKey, hasMatch = false; try { key = keySelector(x); serializedKey = keySerializer(key); } catch (exception) { observer.onError(exception); return; } for (otherKey in hashSet) { if (serializedKey === otherKey) { hasMatch = true; break; } } if (!hasMatch) { hashSet[serializedKey] = null; observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. * * @example * 1 - observable.groupBy(function (x) { return x.id; }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); * * @memberOf Observable# * @param {Function} keySelector A function to extract the key for each element. * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. */ observableProto.groupBy = function (keySelector, elementSelector, keySerializer) { return this.groupByUntil(keySelector, elementSelector, function () { return observableNever(); }, keySerializer); }; /** * Groups the elements of an observable sequence according to a specified key selector function. * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. * * @example * 1 - observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); * * @memberOf Observable# * @param {Function} keySelector A function to extract the key for each element. * @param {Function} durationSelector A function to signal the expiration of a group. * @param {Function} [keySerializer] Used to serialize the given object into a string for object comparison. * @returns {Observable} * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. * */ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, keySerializer) { var source = this; elementSelector || (elementSelector = identity); keySerializer || (keySerializer = defaultKeySerializer); return new AnonymousObservable(function (observer) { var map = {}, groupDisposable = new CompositeDisposable(), refCountDisposable = new RefCountDisposable(groupDisposable); groupDisposable.add(source.subscribe(function (x) { var duration, durationGroup, element, expire, fireNewMapEntry, group, key, serializedKey, md, writer, w; try { key = keySelector(x); serializedKey = keySerializer(key); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } fireNewMapEntry = false; try { writer = map[serializedKey]; if (!writer) { writer = new Subject(); map[serializedKey] = writer; fireNewMapEntry = true; } } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } if (fireNewMapEntry) { group = new GroupedObservable(key, writer, refCountDisposable); durationGroup = new GroupedObservable(key, writer); try { duration = durationSelector(durationGroup); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } observer.onNext(group); md = new SingleAssignmentDisposable(); groupDisposable.add(md); expire = function () { if (serializedKey in map) { delete map[serializedKey]; writer.onCompleted(); } groupDisposable.remove(md); }; md.setDisposable(duration.take(1).subscribe(noop, function (exn) { for (w in map) { map[w].onError(exn); } observer.onError(exn); }, function () { expire(); })); } try { element = elementSelector(x); } catch (e) { for (w in map) { map[w].onError(e); } observer.onError(e); return; } writer.onNext(element); }, function (ex) { for (var w in map) { map[w].onError(ex); } observer.onError(ex); }, function () { for (var w in map) { map[w].onCompleted(); } observer.onCompleted(); })); return refCountDisposable; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * * @example * source.select(function (value, index) { return value * value + index; }); * * @memberOf Observable# * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; observableProto.map = observableProto.select; function selectMany(selector) { return this.select(selector).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * 1 - source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * 1 - source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * 1 - source.selectMany(Rx.Observable.fromArray([1,2,3])); * * @memberOf Observable# * @param selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector) { if (resultSelector) { return this.selectMany(function (x) { return selector(x).select(function (y) { return resultSelector(x, y); }); }); } if (typeof selector === 'function') { return selectMany.call(this, selector); } return selectMany.call(this, function () { return selector; }); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * * @memberOf Observable# * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * 1 - source.skipWhile(function (value) { return value < 10; }); * 1 - source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * * @memberOf Observable# * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate(x, i++); } catch (e) { observer.onError(e); return; } } if (running) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * 1 - source.take(5); * 2 - source.take(0, Rx.Scheduler.timeout); * * @memberOf Observable# * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new Error(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining > 0) { remaining--; observer.onNext(x); if (remaining === 0) { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * * @example * 1 - source.takeWhile(function (value) { return value < 10; }); * 1 - source.takeWhile(function (value, index) { return value < 10 || index < 10; }); * * @memberOf Observable# * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate(x, i++); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * 1 - source.where(function (value) { return value < 10; }); * 1 - source.where(function (value, index) { return value < 10 || index < 10; }); * * @memberOf Observable# * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } if (shouldRun) { observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; observableProto.filter = observableProto.where; /** @private */ var AnonymousObservable = Rx.Internals.AnonymousObservable = (function (_super) { inherits(AnonymousObservable, _super); /** * @private * @constructor */ function AnonymousObservable(subscribe) { function s(observer) { var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(function () { try { autoDetachObserver.disposable(subscribe(autoDetachObserver)); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }); } else { try { autoDetachObserver.disposable(subscribe(autoDetachObserver)); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } } return autoDetachObserver; } _super.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); /** * @private * @constructor */ function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype /** * @private * @memberOf AutoDetachObserver# */ AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; /** * @private * @memberOf AutoDetachObserver# */ AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; /** * @private * @memberOf AutoDetachObserver# */ AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; /** * @private * @memberOf AutoDetachObserver# */ AutoDetachObserverPrototype.disposable = function (value) { return this.m.disposable(value); }; /** * @private * @memberOf AutoDetachObserver# */ AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var GroupedObservable = (function (_super) { inherits(GroupedObservable, _super); function subscribe(observer) { return this.underlyingObservable.subscribe(observer); } /** * @constructor * @private */ function GroupedObservable(key, underlyingObservable, mergedDisposable) { _super.call(this, subscribe); this.key = key; this.underlyingObservable = !mergedDisposable ? underlyingObservable : new AnonymousObservable(function (observer) { return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer)); }); } return GroupedObservable; }(Observable)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * * @memberOf ReplaySubject# * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. * * @memberOf ReplaySubject# */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * * @memberOf ReplaySubject# * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * * @memberOf ReplaySubject# * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. * * @memberOf ReplaySubject# */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * * @static * @memberOf Subject * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception; var hv = this.hasValue; var v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, _super); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * * @constructor */ function AsyncSubject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.value = null, this.hasValue = false, this.observers = [], this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * * @memberOf AsyncSubject# * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). * * @memberOf AsyncSubject# */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; var v = this.value; var hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * * @memberOf AsyncSubject# * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * * @memberOf AsyncSubject# * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; this.hasValue = true; } }, /** * Unsubscribe all observers and release resources. * * @memberOf AsyncSubject# */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); /** @private */ var AnonymousSubject = (function (_super) { inherits(AnonymousSubject, _super); function subscribe(observer) { return this.observable.subscribe(observer); } /** * @private * @constructor */ function AnonymousSubject(observer, observable) { _super.call(this, subscribe); this.observer = observer; this.observable = observable; } addProperties(AnonymousSubject.prototype, Observer, { /** * @private * @memberOf AnonymousSubject# */ onCompleted: function () { this.observer.onCompleted(); }, /** * @private * @memberOf AnonymousSubject# */ onError: function (exception) { this.observer.onError(exception); }, /** * @private * @memberOf AnonymousSubject# */ onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); // Check for AMD if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { window.Rx = Rx; return define(function () { return Rx; }); } else if (freeExports) { if (typeof module == 'object' && module && module.exports == freeExports) { module.exports = Rx; } else { freeExports = Rx; } } else { window.Rx = Rx; } }(this));
abenjamin765/cdnjs
ajax/libs/rxjs/2.1.1/rx.modern.js
JavaScript
mit
179,912
// Backbone React Component // ======================== // // Backbone.React.Component v0.6.2 // // (c) 2014 "Magalhas" José Magalhães <magalhas@gmail.com> // Backbone.React.Component can be freely distributed under the MIT license. // // // `Backbone.React.Component` is a React.Component wrapper that serves // as a bridge between the React and Backbone worlds. Besides some extra members // that may be set by extending/instancing a component, it works pretty much the // same way that [React](http://facebook.github.io/react/) components do. // // When mounted (if using mixin mode) or created (wrapper mode) it starts listening // to models and collections changes to automatically set your component props and // achieve UI binding through reactive updates. // // // Basic usage // // var MyComponent = Backbone.React.Component.extend({ // render: function () { // return <div>{this.props.foo}</div>; // } // }); // var model = new Backbone.Model({foo: 'bar'}); // var myComponent = <MyComponent el={document.body} model={model} />; // myComponent.mount(); // // Mixin usage // // var MyComponent = React.createClass({ // mixins: [Backbone.React.Component.mixin], // render: function () { // return <div>{this.props.foo}</div>; // } // }); // var model = new Backbone.Model({foo: 'bar'}); // React.renderComponent(<MyComponent el={document.body} model={model} />, document.body); 'use strict'; (function (root, factory) { // Universal module definition if (typeof define === 'function' && define.amd) define(['react', 'backbone', 'underscore'], factory); else if (typeof module !== 'undefined' && module.exports) { var React = require('react'); var Backbone = require('backbone'); var _ = require('underscore'); module.exports = factory(React, Backbone, _); } else factory(root.React, root.Backbone, root._); }(this, function (React, Backbone, _) { // Here lies the public API available on each component that runs through the wrapper // instead of the mixin approach. if (!Backbone.React) Backbone.React = {}; Backbone.React.Component = { // Wraps `React.Component` into `Backbone.React.Component` and extends to a new // class. extend: function (Clazz) { function Factory (props, children) { return (new Wrapper(Component, props, children)).virtualComponent; } // Allow deep extending Factory.extend = function () { return Backbone.React.Component.extend(_.extend({}, Clazz, arguments[0])); }; // Apply mixin if (Clazz.mixins) { if (Clazz.mixins[0] !== mixin) Clazz.mixins.splice(0, 0, mixin); } else Clazz.mixins = [mixin]; // Create the react component later used by `Factory` var Component = React.createClass(_.extend(Factory.prototype, Clazz)); return Factory; }, // Renders/mounts the component. It delegates to `React.renderComponent`. mount: function (el, onRender) { if (!(el || this.el)) throw new Error('No element to mount on'); else if (!el) el = this.el; this.wrapper.component = React.renderComponent(this, el, onRender); return this; }, // Stops all listeners and unmounts this component from the DOM. remove: function () { if (this.wrapper.component && this.wrapper.component.isMounted()) this.unmount(); this.wrapper.stopListening(); this.stopListening(); }, // Intended to be used on the server side (Node.js), renders your component to a string // ready to be used on the client side by delegating to `React.renderComponentToString`. toHTML: function () { // Since we're only able to call `renderComponentToString` once, lets clone this component // and use it insteaad. var clone = this.clone(_.extend({}, this.props, { collection: this.wrapper.collection, model: this.wrapper.model })); // Return the html representation of the component. return React.renderComponentToString(clone); }, // Unmount the component from the DOM. unmount: function () { var parentNode = this.el.parentNode; if (!React.unmountComponentAtNode(parentNode)) { // Throw an error if there's any unmounting the component. throw new Error('There was an error unmounting the component'); } delete this.wrapper.component; this.setElement(parentNode); } }; // Mixin used in all component instances. Exported through `Backbone.React.Component.mixin`. var mixin = Backbone.React.Component.mixin = { // Sets this.el and this.$el when the component mounts. componentDidMount: function () { this.setElement(this.getDOMNode()); }, // Sets this.el and this.$el when the component updates. componentDidUpdate: function () { this.setElement(this.getDOMNode()); }, // Checks if the component is running in mixin or wrapper mode when it mounts. // If it's a mixin set a flag for later use and instance a Wrapper to take care // of models and collections binding. componentWillMount: function () { if (!this.wrapper) { this.isBackboneMixin = true; this.wrapper = new Wrapper(this, this.props); } }, // If running in mixin mode disposes of the wrapper that was created when the // component mounted. componentWillUnmount: function () { if (this.wrapper && this.isBackboneMixin) { this.wrapper.stopListening(); delete this.wrapper; } }, // Shortcut to this.$el.find. Inspired by Backbone.View. $: function () { if (this.$el) return this.$el.find.apply(this.$el, arguments); }, // Crawls to the owner of the component searching for a collection. getCollection: function () { var owner = this; var lookup = owner.wrapper; while (!lookup.collection) { owner = owner._owner; if (!owner) throw new Error('Collection not found'); lookup = owner.wrapper; } return lookup.collection; }, // Crawls to the owner of the component searching for a model. getModel: function () { var owner = this; var lookup = owner.wrapper; while (!lookup.model) { owner = owner._owner; if (!owner) throw new Error('Model not found'); lookup = owner.wrapper; } return lookup.model; }, // Crawls `this._owner` recursively until it finds the owner of this // component. In case of being a parent component (no owners) it returns itself. getOwner: function () { var owner = this; while (owner._owner) owner = owner._owner; return owner; }, // Sets a DOM element to render/mount this component on this.el and this.$el. setElement: function (el) { if (el && Backbone.$ && el instanceof Backbone.$) { if (el.length > 1) throw new Error('You can only assign one element to a component'); this.el = el[0]; this.$el = el; } else if (el) { this.el = el; if (Backbone.$) this.$el = Backbone.$(el); } return this; } }; // Binds models and collections to a React.Component. It mixes Backbone.Events. function Wrapper (Component, props) { props = props || {}; var el, model = props.model, collection = props.collection; // Check if props.el is a DOM element or a jQuery object if (_.isElement(props.el) || Backbone.$ && props.el instanceof Backbone.$) { el = props.el; delete props.el; } // Check if props.model is a Backbone.Model or an hashmap of them if (typeof model !== 'undefined' && (model.attributes || typeof model === 'object' && _.values(model)[0].attributes)) { delete props.model; // The model(s) bound to this component this.model = model; // Set model(s) attributes on props for the first render this.setPropsBackbone(model, void 0, props); } // Check if props.collection is a Backbone.Collection or an hashmap of them if (typeof collection !== 'undefined' && (collection.models || typeof collection === 'object' && _.values(collection)[0].models)) { delete props.collection; // The collection(s) bound to this component this.collection = collection; // Set collection(s) models on props for the first render this.setPropsBackbone(collection, void 0, props); } var component; if (Component.prototype) { // Instance the component mixing Backbone.Events, our public API and some special // properties. component = this.virtualComponent = _.defaults(Component.apply(this, _.rest(arguments)).__realComponentInstance, Backbone.Events, _.omit(Backbone.React.Component, 'mixin'), { // Clones the component wrapper and returns the component. clone: function (props, children) { return (new Wrapper(Component, props, children)).virtualComponent; }, // Assign a component unique id, this is handy sometimes as a DOM attribute cid: _.uniqueId(), // One to one relationship between the wrapper and the component wrapper: this }); // Set element if (el) mixin.setElement.call(component, el); } else { component = Component; this.component = component; } // Start listeners if this is a root node if (!component._owner) { this.startModelListeners(); this.startCollectionListeners(); } } // Mixing `Backbone.Events` into `Wrapper.prototype` _.extend(Wrapper.prototype, Backbone.Events, { // Sets this.props when a model/collection request results in error. It delegates // to `this.setProps`. It listens to `Backbone.Model#error` and `Backbone.Collection#error`. onError: function (modelOrCollection, res, options) { // Set props only if there's no silent option if (!options.silent) this.setProps({ isRequesting: false, hasError: true, error: res }); }, // Sets this.props when a model/collection request starts. It delegates to // `this.setProps`. It listens to `Backbone.Model#request` and `Backbone.Collection#request`. onRequest: function (modelOrCollection, xhr, options) { // Set props only if there's no silent option if (!options.silent) this.setProps({ isRequesting: true, hasError: false }); }, // Sets this.props when a model/collection syncs. It delegates to `this.setProps`. // It listens to `Backbone.Model#sync` and `Backbone.Collection#sync` onSync: function (modelOrCollection, res, options) { // Set props only if there's no silent option if (!options.silent) this.setProps({isRequesting: false}); }, // Used internally to set this.collection or this.model on this.props. Delegates to // `this.setProps`. It listens to `Backbone.Collection#add`, `Backbone.Collection#remove`, // `Backbone.Collection#change` and `Backbone.Model#change`. setPropsBackbone: function (modelOrCollection, key, target) { if (!(modelOrCollection.models || modelOrCollection.attributes)) { for (key in modelOrCollection) this.setPropsBackbone(modelOrCollection[key], key, target); return; } this.setProps.apply(this, arguments); }, // Sets a model, collection or object into props by delegating to `React.Component#setProps`. setProps: function (modelOrCollection, key, target) { // If the component isn't rendered/mounted set target because you can't set props // on an unmounted (virtual) component. if (!target && !(this.component && this.component.isMounted())) target = this.virtualComponent.props; var props = {}; var newProps = modelOrCollection.toJSON ? modelOrCollection.toJSON() : modelOrCollection; if (key) props[key] = newProps; else if (modelOrCollection instanceof Backbone.Collection) props.collection = newProps; else props = newProps; if (target) _.extend(target, props); else { this.nextProps = _.extend(this.nextProps || {}, props); _.defer(_.bind(function () { if (this.nextProps) { this.component.setProps(this.nextProps); delete this.nextProps; } }, this)); } }, // Binds the component to any collection changes. startCollectionListeners: function (collection, key) { if (!collection) collection = this.collection; if (collection) { if (collection.models) this .listenTo(collection, 'add remove change sort reset', _.partial(this.setPropsBackbone, collection, key, void 0)) .listenTo(collection, 'error', this.onError) .listenTo(collection, 'request', this.onRequest) .listenTo(collection, 'sync', this.onSync); else if (typeof collection === 'object') for (key in collection) if (collection.hasOwnProperty(key)) this.startCollectionListeners(collection[key], key); } }, // Binds the component to any model changes. startModelListeners: function (model, key) { if (!model) model = this.model; if (model) { if (model.attributes) this .listenTo(model, 'change', _.partial(this.setPropsBackbone, model, key, void 0)) .listenTo(model, 'error', this.onError) .listenTo(model, 'request', this.onRequest) .listenTo(model, 'sync', this.onSync); else if (typeof model === 'object') for (key in model) this.startModelListeners(model[key], key); } } }); // Expose `Backbone.React.Component`. return Backbone.React.Component; })); // <a href="https://github.com/magalhas/backbone-react-component"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://github-camo.global.ssl.fastly.net/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
chrisharrington/cdnjs
ajax/libs/backbone-react-component/0.6.2/backbone-react-component.js
JavaScript
mit
14,455
/* * /MathJax/jax/output/HTML-CSS/fonts/Gyre-Pagella/Operators/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.GyrePagellaMathJax_Operators={directory:"Operators/Regular",family:"GyrePagellaMathJax_Operators",testString:"\u00A0\u2206\u220A\u220C\u220E\u220F\u2210\u2211\u221F\u222C\u222D\u222E\u222F\u2230\u2231",32:[0,0,250,0,0],160:[0,0,250,0,0],8710:[700,3,629,6,617],8714:[450,-50,578,80,498],8716:[650,150,778,80,698],8718:[585,0,745,80,665],8719:[750,250,1113,80,1033],8720:[750,250,1113,80,1033],8721:[750,250,983,80,903],8735:[630,0,790,80,710],8748:[796,296,952,80,872],8749:[796,296,1270,80,1190],8750:[796,296,684,80,604],8751:[796,296,1002,80,922],8752:[796,296,1320,80,1240],8753:[796,296,726,80,686],8754:[796,296,747,80,707],8755:[796,296,689,80,649],8758:[468,-32,280,80,200],8759:[468,-32,596,80,516],8760:[520,-220,760,80,680],8761:[441,-59,880,80,800],8762:[520,20,760,80,680],8763:[497,-3,758,80,678],8766:[390,-110,751,80,671],8767:[467,-33,760,80,680],8772:[550,50,760,80,680],8775:[550,50,760,80,680],8777:[550,50,758,80,678],8779:[517,17,758,80,678],8780:[518,-40,760,80,680],8788:[441,-59,880,80,800],8789:[441,-59,880,80,800],8792:[540,0,760,80,680],8793:[554,54,760,80,680],8794:[554,54,760,80,680],8795:[853,-110,760,80,680],8797:[867,-110,925,80,845],8798:[745,-110,760,80,680],8799:[870,-110,760,80,680],8802:[650,150,760,80,680],8803:[610,110,760,80,680],8813:[650,150,760,80,680],8820:[706,206,766,80,686],8821:[706,206,766,80,686],8824:[761,261,771,80,691],8825:[761,261,771,80,691],8836:[650,150,778,80,698],8837:[650,150,778,80,698],8844:[550,68,760,80,680],8845:[550,68,760,80,680],8860:[568,68,796,80,716],8870:[650,150,590,80,510],8871:[650,150,590,80,510],8875:[650,150,770,80,690],8886:[410,-90,1080,80,1000],8887:[410,-90,1080,80,1000],8889:[550,50,760,80,680],8893:[584,84,760,80,680],8894:[630,103,893,80,813],8895:[651,0,812,80,732],8896:[744,230,860,80,780],8897:[730,244,860,80,780],8898:[748,230,860,80,780],8899:[730,248,860,80,780],8903:[556,56,772,80,692],8917:[650,150,760,80,680],8924:[623,113,766,80,686],8925:[623,113,766,80,686],8930:[690,190,760,80,680],8931:[690,190,760,80,680],8932:[640,220,760,80,680],8933:[640,220,760,80,680],8944:[536,36,733,80,653],10752:[708,208,1076,80,996],10753:[708,208,1076,80,996],10754:[708,208,1076,80,996],10755:[730,248,860,80,780],10756:[730,248,860,80,780],10757:[747,213,860,80,780],10758:[713,247,860,80,780],10761:[635,135,929,80,849],10764:[796,296,1588,80,1508],10769:[796,296,726,80,686],10799:[490,-10,641,80,561]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"GyrePagellaMathJax_Operators"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Operators/Regular/Main.js"]);
ljharb/cdnjs
ajax/libs/mathjax/2.5.1/jax/output/HTML-CSS/fonts/Gyre-Pagella/Operators/Regular/Main.js
JavaScript
mit
3,353
/* * /MathJax/jax/output/SVG/fonts/STIX-Web/Main/BoldItalic/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax.SVG.FONTDATA.FONTS["STIXMathJax_Main-bold-italic"]={directory:"Main/BoldItalic",family:"STIXMathJax_Main",weight:"bold",style:"italic",id:"STIXWEBMAINBI",32:[0,0,250,0,0,""],33:[684,13,389,67,370,"196 204l-29 9c30 157 47 273 52 353c3 60 15 118 79 118c50 0 72 -29 72 -73c0 -27 -6 -41 -30 -89c-57 -113 -102 -209 -144 -318zM213 58c0 -40 -33 -71 -74 -71c-42 0 -72 30 -72 71c0 42 32 75 73 75c38 0 73 -35 73 -75"],34:[685,-398,555,136,536,"396 398l15 214c3 38 41 73 80 73c25 0 45 -22 45 -49c0 -14 -2 -21 -13 -47l-85 -191h-42zM136 398l15 214c3 38 41 73 80 73c25 0 45 -22 45 -49c0 -12 -1 -20 -13 -47l-85 -191h-42"],35:[700,0,500,-32,532,"532 490l-20 -73h-96l-54 -134h86l-20 -73h-96l-85 -210h-78l85 210h-113l-85 -210h-78l85 210h-95l20 73h105l54 134h-95l20 73h104l87 210h77l-86 -210h113l87 210h77l-86 -210h87zM338 417h-113l-54 -134h113"],36:[733,100,500,-20,497,"497 598l-42 -134l-21 5c1 11 1 25 1 31c0 69 -19 105 -84 125l-59 -215c112 -97 140 -141 140 -212c0 -117 -92 -198 -254 -198l-28 -100h-52l29 107c-63 15 -98 32 -147 80l42 141l22 -6c3 -108 19 -143 93 -180l74 261c-106 81 -132 122 -132 190 c0 110 84 177 196 177c8 0 16 0 38 -2l18 65h50l-20 -72c33 -6 87 -24 136 -63zM248 436l55 199c-5 2 -9 2 -15 2c-67 0 -110 -37 -110 -95c0 -40 17 -66 70 -106zM253 274l-67 -242c76 0 137 40 137 129c0 47 -13 74 -70 113"],37:[706,29,757,80,707,"707 214c0 -70 -28 -143 -73 -190c-25 -27 -61 -42 -99 -42c-76 0 -128 56 -128 138c0 113 91 213 195 213c66 0 105 -45 105 -119zM682 220c0 46 -25 80 -59 80c-21 0 -41 -15 -62 -46c-32 -48 -56 -125 -56 -178c0 -43 17 -66 50 -66c30 0 55 16 79 51 c28 43 48 108 48 159zM645 706l-438 -735h-48l388 655c-40 -30 -73 -42 -113 -42c-21 0 -35 3 -60 13c2 -19 3 -29 3 -42c0 -71 -28 -147 -70 -189c-28 -28 -65 -44 -101 -44c-74 0 -126 57 -126 139c0 114 92 213 197 213c26 0 45 -8 71 -29c29 -23 47 -30 83 -30 c66 0 115 27 166 91h48zM351 560c0 34 -6 44 -32 54c-7 3 -10 4 -21 11s-15 9 -20 9c-42 0 -102 -127 -102 -216c0 -42 18 -66 50 -66c64 0 125 101 125 208"],38:[682,19,849,76,771,"745 101l26 -21c-61 -74 -102 -98 -168 -98c-55 0 -98 18 -142 62c-62 -47 -128 -63 -198 -63c-115 0 -187 58 -187 161c0 177 157 224 240 242c-9 46 -11 67 -11 92c0 127 79 206 189 206c84 0 134 -47 134 -114c0 -72 -59 -126 -182 -172c10 -76 45 -161 86 -227 c59 70 74 101 74 129c0 22 -13 31 -56 38v25h212v-25c-59 -4 -68 -24 -205 -203c37 -51 71 -72 110 -72c27 0 49 11 78 40zM548 582c0 42 -19 67 -52 67c-45 0 -70 -44 -70 -113c0 -25 2 -46 11 -102c86 46 111 88 111 148zM433 80c-60 85 -86 155 -109 263 c-84 -41 -115 -83 -115 -153c0 -79 52 -138 125 -138c31 0 63 6 99 28"],39:[685,-398,278,128,268,"128 398l16 215c3 47 40 72 79 72c25 0 45 -22 45 -49c0 -14 -4 -23 -15 -48l-83 -190h-42"],40:[685,179,333,28,344,"326 685l18 -20c-81 -74 -118 -119 -155 -200c-45 -99 -67 -218 -67 -346c0 -119 16 -186 71 -283l-23 -15c-101 138 -142 238 -142 386c0 122 41 231 117 321c41 48 97 95 181 157"],41:[685,179,333,-44,271,"105 670l23 15c55 -75 78 -111 102 -172c28 -70 41 -144 41 -214c0 -97 -25 -179 -68 -251c-51 -86 -129 -158 -230 -227l-17 20c92 82 122 126 161 222c39 95 60 218 60 331c0 114 -21 187 -72 276"],42:[685,-252,500,101,492,"312 468l11 -6c33 -18 42 -23 88 -23c36 0 81 -11 81 -51c0 -29 -25 -54 -52 -54c-25 0 -39 11 -60 47c-22 36 -31 49 -65 67l-11 6v-12c0 -32 7 -54 26 -87c13 -22 17 -37 17 -52c0 -31 -20 -51 -51 -51c-30 0 -50 20 -50 52c0 14 4 29 17 51c19 33 26 55 26 87v12 l-11 -6c-34 -18 -43 -31 -65 -67c-21 -36 -35 -47 -60 -47c-27 0 -52 25 -52 54c0 40 45 51 81 51c46 0 55 5 88 23l11 6l-11 6c-33 18 -44 22 -88 23c-38 0 -81 12 -81 52c0 28 24 54 49 54c24 0 41 -12 63 -47c24 -38 35 -51 65 -68l11 -6v12c0 33 -7 56 -26 88 c-13 22 -17 36 -17 51c0 32 20 52 50 52c31 0 51 -20 51 -52c0 -15 -4 -29 -17 -51c-19 -32 -26 -55 -26 -88v-12l11 6c30 17 41 30 65 68c22 35 39 47 63 47c26 0 49 -26 49 -54c0 -40 -43 -52 -81 -52c-44 -1 -55 -5 -88 -23"],43:[506,0,570,33,537,"537 209h-208v-209h-88v209h-208v88h208v209h88v-209h208v-88"],44:[134,182,250,-60,144,"-47 -182l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],45:[282,-166,333,2,271,"271 282l-23 -116h-246l24 116h245"],46:[135,13,250,-9,139,"139 61c0 -42 -33 -74 -75 -74c-41 0 -73 32 -73 73c0 43 32 75 75 75c40 0 73 -33 73 -74"],47:[685,18,278,-64,342,"342 685l-319 -703h-87l319 703h87"],48:[683,14,500,17,477,"477 442c0 -153 -73 -317 -166 -401c-41 -37 -81 -55 -134 -55c-104 0 -160 87 -160 220c0 154 64 306 152 407c46 53 103 70 158 70c96 0 150 -95 150 -241zM374 582c0 45 -18 72 -49 72c-28 0 -49 -25 -76 -83c-60 -133 -129 -409 -129 -490c0 -40 20 -66 50 -66 c42 0 71 40 106 144c31 95 98 318 98 423"],49:[683,0,500,5,419,"419 683l-154 -560c-7 -26 -14 -48 -14 -63c0 -28 22 -35 99 -37v-23h-345v23c76 4 103 19 121 82l124 445c2 9 6 24 6 30c0 22 -17 33 -48 33c-19 0 -36 -1 -62 -5l2 23c115 15 180 30 271 52"],50:[683,0,500,-27,446,"86 507l-22 12c40 98 116 164 218 164c104 0 164 -73 164 -168c0 -79 -43 -151 -144 -237l-196 -167h138c86 0 117 14 151 80h24l-80 -191h-366v24l89 92c184 191 250 273 250 360c0 69 -25 117 -92 117c-52 0 -93 -25 -134 -86"],51:[683,13,500,-14,450,"117 537l-21 13c60 97 126 133 207 133c80 0 147 -58 147 -136c0 -60 -30 -115 -119 -149v-2c57 -43 77 -80 77 -146c0 -141 -123 -263 -290 -263c-82 0 -132 31 -132 80c0 34 22 58 59 58c49 0 63 -57 90 -84c8 -8 24 -14 40 -14c61 0 110 79 110 162 c0 48 -12 85 -36 112c-33 37 -68 43 -122 46l4 22c129 27 190 76 190 153c0 55 -25 90 -87 90c-47 0 -76 -18 -117 -75"],52:[683,0,500,-15,503,"503 683l-119 -435h70l-27 -98h-69l-42 -150h-128l41 150h-244l28 105l427 428h63zM335 528l-282 -280h203"],53:[669,13,500,-11,486,"486 669l-36 -109h-253l-34 -77c106 -20 127 -26 176 -67c47 -40 73 -98 73 -165c0 -141 -121 -264 -286 -264c-85 0 -137 31 -137 79c0 34 24 58 59 58c30 0 52 -16 71 -54c18 -36 37 -43 59 -43c63 0 129 76 129 162c0 65 -37 123 -101 155c-37 19 -68 25 -133 28 l131 297h282"],54:[679,15,500,23,509,"503 679l6 -24c-129 -45 -214 -128 -278 -246c21 9 42 13 62 13c93 0 150 -58 150 -171c0 -156 -109 -266 -246 -266c-112 0 -174 77 -174 204c0 138 65 267 176 360c92 77 158 102 304 130zM319 315c0 46 -17 67 -68 67c-28 0 -39 -6 -55 -44c-36 -84 -61 -185 -61 -243 c0 -53 18 -78 55 -78c26 0 42 9 61 39c38 60 68 189 68 259"],55:[669,0,500,52,525,"525 669l-381 -669h-92l332 556h-127c-113 0 -136 -12 -173 -77h-26l87 190h380"],56:[683,13,500,3,476,"183 341v4c-56 59 -74 96 -74 154c0 114 87 184 191 184c56 0 99 -17 130 -44c28 -25 46 -54 46 -99c0 -71 -39 -120 -143 -160v-4c66 -74 86 -119 86 -183c0 -128 -99 -206 -228 -206c-115 0 -188 67 -188 166c0 87 60 143 180 188zM383 544c0 64 -34 106 -77 106 c-52 0 -86 -37 -86 -98c0 -50 19 -92 90 -149c58 60 73 90 73 141zM306 140c0 52 -10 89 -97 181c-76 -48 -109 -98 -109 -180c0 -77 38 -124 96 -124c62 0 110 53 110 123"],57:[683,10,500,-12,475,"-6 -10l-6 25c122 37 216 120 277 244c-25 -11 -38 -14 -61 -14c-90 0 -151 67 -151 167c0 152 108 271 246 271c50 0 89 -15 118 -44c37 -38 58 -97 58 -163c0 -146 -81 -292 -212 -384c-77 -55 -138 -78 -269 -102zM363 582c0 46 -16 69 -49 69c-32 0 -59 -22 -79 -63 c-31 -63 -58 -172 -58 -236c0 -41 23 -64 66 -64c42 0 50 9 77 89c32 95 43 147 43 205"],58:[459,13,333,23,264,"264 385c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74zM171 61c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],59:[459,183,333,-25,264,"264 385c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74zM-12 -183l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -41 38 -41 65c0 48 33 73 74 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],60:[518,12,570,31,539,"539 -12l-508 223v84l508 223v-96l-385 -169l385 -169v-96"],61:[399,-107,570,33,537,"537 311h-504v88h504v-88zM537 107h-504v88h504v-88"],62:[518,12,570,31,539,"539 211l-508 -223v96l385 169l-385 169v96l508 -223v-84"],63:[684,13,500,79,470,"196 208l-29 8c4 55 22 115 112 209c49 51 64 101 64 149c0 49 -26 79 -69 79c-32 0 -62 -18 -62 -38c0 -26 29 -26 29 -67c0 -33 -27 -62 -61 -62c-35 0 -61 34 -61 72c0 67 79 126 181 126c95 0 170 -52 170 -144c0 -63 -33 -117 -126 -171 c-103 -60 -120 -91 -148 -161zM227 61c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],64:[685,18,939,118,825,"703 77l13 -35c-95 -49 -158 -60 -231 -60c-212 0 -367 161 -367 343c0 207 165 360 373 360c189 0 334 -117 334 -298c0 -132 -68 -244 -187 -245c-49 0 -91 34 -93 75c-35 -46 -79 -74 -122 -74c-58 0 -96 47 -96 114c0 117 76 258 201 258c36 0 49 -10 72 -52l11 38 h71l-61 -243c-2 -10 -6 -23 -6 -34c0 -29 17 -44 41 -44c81 0 123 139 123 206c0 146 -130 260 -287 260c-165 0 -283 -134 -283 -327c0 -164 115 -291 287 -291c70 0 138 8 207 49zM583 402c0 40 -13 64 -42 65c-84 1 -138 -111 -138 -192c0 -52 23 -85 59 -85 c29 0 60 25 82 68c21 41 39 100 39 144"],65:[683,0,667,-68,593,"593 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-12 119h-215l-57 -96c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l370 582h25l94 -560c14 -82 23 -94 86 -98v-25zM346 248l-37 243l-148 -243h185"],66:[669,0,667,-25,624,"118 669h265c161 0 241 -50 241 -146c0 -109 -86 -138 -189 -168v-1c96 -27 137 -73 137 -148c0 -134 -112 -206 -295 -206h-302v25c48 6 68 24 84 83l119 438c7 25 11 47 11 57c0 39 -32 41 -71 41v25zM334 577l-57 -209c69 5 116 5 153 40c30 28 47 72 47 128 c0 67 -29 101 -87 101c-32 0 -41 -4 -56 -60zM269 338l-64 -236c-5 -19 -7 -29 -7 -37c0 -23 18 -33 57 -33c53 0 90 21 121 59c29 35 43 88 43 138c0 37 -12 67 -35 85c-21 16 -50 22 -115 24"],67:[685,18,667,32,677,"677 685l-51 -235l-32 6c2 13 3 23 3 36c0 93 -46 158 -131 158c-53 0 -107 -30 -145 -73c-77 -87 -135 -220 -135 -368c0 -109 61 -174 155 -174c87 0 138 43 204 119l31 -22c-32 -44 -49 -63 -78 -85c-57 -43 -128 -65 -199 -65c-163 0 -267 101 -267 252 c0 148 62 276 159 358c69 58 156 93 249 93c41 0 86 -7 131 -21c15 -5 30 -8 38 -8c15 0 24 7 38 29h30"],68:[669,0,722,-46,685,"94 669h290c189 0 301 -101 301 -264c0 -109 -44 -218 -119 -288c-79 -73 -191 -117 -324 -117h-288v25c48 6 66 22 83 84l115 422c13 46 15 61 15 71c0 24 -9 33 -39 37l-34 5v25zM318 600l-126 -465c-11 -39 -15 -55 -15 -67c0 -24 20 -34 58 -34c87 0 156 34 210 105 c62 81 93 193 93 318c0 122 -54 181 -165 181c-33 0 -47 -10 -55 -38"],69:[669,0,667,-27,653,"653 669l-43 -190l-27 5c-3 71 -4 96 -45 123c-30 19 -76 30 -137 30c-41 0 -55 -6 -67 -51l-59 -216c132 0 158 13 205 107l28 -4l-74 -274l-28 4c3 19 4 30 4 44c0 69 -31 91 -144 91l-63 -234c-5 -20 -8 -31 -8 -38c0 -24 18 -34 61 -34c88 0 157 19 214 61 c37 27 57 50 91 106l25 -5l-60 -194h-553v25c52 8 65 19 82 80l119 432c9 33 12 55 12 70c0 20 -10 29 -41 33l-33 4v25h541"],70:[669,0,667,-13,660,"660 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -73 53 -157 53c-41 0 -52 -10 -63 -48l-61 -219c131 1 156 13 198 107l28 -4l-74 -274l-28 5c3 19 4 30 4 44c0 68 -30 88 -137 90l-55 -206c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25 c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h533"],71:[685,18,722,21,705,"705 330v-26c-50 -4 -60 -14 -82 -96l-44 -167l-28 -13c-57 -27 -156 -46 -234 -46c-176 0 -296 104 -296 274c0 130 63 254 163 337c74 61 162 92 264 92c46 0 81 -6 124 -21c19 -7 27 -9 36 -9c20 0 31 8 42 30h31l-51 -221l-29 4c-2 61 -8 91 -24 119 c-23 40 -63 62 -115 62c-69 0 -129 -42 -173 -98c-67 -87 -112 -211 -112 -335c0 -130 58 -196 164 -196c39 0 81 11 94 30l31 104c22 75 27 89 27 114c0 9 -6 20 -12 24c-11 6 -20 8 -63 12v26h287"],72:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l62 225h-239l-54 -197c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h316v-25c-65 -2 -84 -15 -102 -80l-52 -191h239l47 173c5 19 10 49 10 61c0 20 -10 29 -41 33l-31 4v25h297"],73:[669,0,389,-32,406,"406 669v-25c-49 -5 -67 -17 -84 -80l-112 -412c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82l117 429c8 29 14 59 14 71c0 20 -15 30 -42 33l-32 4v25h298"],74:[669,99,500,-46,524,"524 669v-25c-49 -6 -65 -11 -85 -85l-122 -457c-36 -135 -115 -201 -215 -201c-88 0 -148 36 -148 101c0 40 28 72 64 72c35 0 63 -25 63 -65c0 -31 -23 -36 -23 -54c0 -12 8 -18 27 -18c37 0 51 30 88 170l114 432c10 39 13 53 13 64c0 18 -11 31 -41 36l-33 5v25h298"],75:[669,0,667,-21,702,"702 669v-25c-43 -6 -51 -9 -94 -48l-216 -199l157 -333c11 -24 25 -35 63 -39v-25h-280l1 25l26 4c27 4 38 9 38 23c0 12 -5 27 -15 49l-111 236l-67 -249c-1 -5 -2 -11 -2 -17c0 -33 13 -42 65 -46v-25h-288v25c45 5 65 15 79 68l123 453c8 28 11 46 11 58 c0 22 -10 32 -41 36l-33 4v25h311v-25c-59 -5 -80 -20 -94 -72l-62 -227l197 175c59 52 77 78 77 97c0 15 -10 23 -35 25l-21 2v25h211"],76:[669,0,611,-22,590,"590 195l-60 -195h-552v25c55 7 67 24 82 78l121 443c5 19 11 49 11 61c0 20 -10 28 -41 32c-11 2 -24 4 -34 5v25h318v-25c-66 -4 -85 -17 -99 -70l-129 -473c-4 -16 -6 -31 -6 -39c0 -21 27 -30 72 -30c70 0 127 14 178 45c52 31 76 59 115 123"],77:[669,12,889,-29,917,"917 669v-25c-51 -6 -67 -19 -84 -81l-119 -438c-5 -17 -10 -45 -10 -57c0 -32 12 -43 71 -43v-25h-311v25c69 4 85 21 101 79l123 457l-375 -573h-28l-67 559l-101 -369c-14 -50 -20 -75 -20 -92c0 -45 16 -55 80 -61v-25h-206v25c54 12 67 33 103 157l107 369 c7 26 11 44 11 58c0 28 -7 35 -71 35v25h219l54 -480l311 480h212"],78:[669,15,722,-27,748,"748 669v-25c-56 -11 -66 -24 -102 -153l-143 -506h-28l-257 547l-99 -354c-12 -42 -19 -75 -19 -94c0 -39 20 -54 79 -59v-25h-206v25c55 11 60 17 101 155l120 407c-19 44 -27 52 -82 57v25h193l216 -467l81 289c11 41 19 75 19 94c0 38 -21 59 -81 59v25h208"],79:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388 c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],80:[669,0,611,-28,613,"112 669h282c147 0 219 -54 219 -155c0 -53 -21 -98 -59 -131c-48 -42 -122 -66 -214 -66c-27 0 -46 1 -81 5l-54 -199c-5 -17 -11 -48 -11 -58c0 -27 16 -37 72 -40v-25h-294v25c52 8 66 17 84 82l117 426c11 39 13 59 13 74c0 20 -10 29 -41 33l-33 4v25zM330 584 l-61 -229c17 -3 29 -3 42 -3c62 0 96 18 123 62c22 35 33 93 33 136c0 53 -31 87 -84 87c-35 0 -41 -9 -53 -53"],81:[685,208,722,27,691,"203 -17l2 4c-5 2 -8 3 -16 6c-101 36 -162 108 -162 218c0 150 74 293 180 381c71 59 155 93 242 93c140 0 242 -98 242 -233c0 -124 -56 -256 -155 -351c-87 -84 -143 -112 -284 -118l-44 -47v-3c43 -2 113 -9 186 -35c37 -13 58 -16 85 -16c61 0 97 18 155 78l21 -19 c-79 -115 -150 -149 -259 -149c-41 0 -74 6 -136 26c-52 16 -75 21 -104 21c-32 0 -58 -6 -114 -28l-14 24zM547 532c0 71 -41 119 -101 119c-63 0 -114 -38 -162 -119c-60 -101 -113 -286 -113 -396c0 -73 39 -119 102 -119c68 0 125 57 169 137c57 105 105 272 105 378"],82:[669,0,667,-28,623,"110 669h286c147 0 227 -47 227 -143c0 -69 -36 -114 -96 -151c-24 -15 -50 -23 -96 -32l85 -254c16 -49 31 -59 87 -64v-25h-202l-107 331h-30l-52 -182c-14 -48 -18 -68 -18 -82c0 -30 14 -38 72 -42v-25h-294v25c49 6 66 25 82 84l120 437c5 19 10 49 10 61 c0 20 -9 31 -42 34l-32 3v25zM330 583l-57 -220c62 1 101 8 127 25c44 27 72 88 72 154c0 61 -29 95 -82 95c-31 0 -48 -8 -60 -54"],83:[685,18,556,2,526,"526 681l-40 -202l-27 4c-5 42 -9 76 -22 101c-23 46 -64 66 -116 66c-53 0 -98 -40 -98 -105c0 -60 36 -86 107 -137c106 -77 138 -127 138 -217c0 -84 -41 -150 -110 -184c-33 -16 -74 -25 -120 -25c-40 0 -73 7 -122 24c-23 8 -36 11 -46 11c-19 0 -26 -6 -38 -35h-30 l36 225l29 -2c8 -66 16 -103 48 -139c27 -31 62 -50 106 -50c38 0 67 11 89 34c23 23 37 47 37 92c0 59 -34 96 -115 154s-130 114 -130 198c0 114 90 191 204 191c88 0 108 -30 146 -30c21 0 35 8 44 26h30"],84:[669,0,611,49,650,"650 669l-36 -192l-27 2c0 114 -38 155 -138 155l-135 -489c-7 -24 -17 -53 -17 -74c0 -29 23 -46 83 -46v-25h-331v25h15c46 0 77 20 91 72l148 537c-102 -2 -167 -37 -218 -143l-25 7l39 171h551"],85:[669,18,722,67,744,"744 669v-25c-55 -11 -65 -13 -102 -147l-65 -234c-30 -107 -62 -187 -121 -234c-39 -31 -92 -47 -166 -47c-131 0 -223 56 -223 163c0 40 14 101 37 189l51 193c10 37 15 66 15 78c0 22 -9 33 -41 36l-32 3v25h311v-25c-62 -3 -78 -17 -94 -76l-81 -294 c-26 -94 -28 -107 -28 -135c0 -72 46 -101 122 -101c55 0 94 17 123 47c43 44 67 114 90 197l57 209c12 44 19 79 19 96c0 36 -22 57 -79 57v25h207"],86:[669,18,667,66,715,"715 669v-25c-30 -6 -50 -25 -62 -44l-390 -618h-32l-76 513c-20 136 -27 149 -89 149v25h296v-25c-68 -6 -75 -11 -75 -45c0 -5 1 -17 2 -23l50 -394l187 297c43 69 63 107 63 129c0 19 -13 32 -41 34l-24 2v25h191"],87:[669,18,889,64,940,"940 669v-24c-42 -6 -55 -15 -88 -82l-282 -581h-29l-59 489l-233 -489h-29l-78 572c-10 71 -14 80 -78 91v24h278v-25c-47 -6 -61 -19 -61 -50c0 -6 0 -14 1 -19l40 -349l149 314c0 79 -10 97 -70 105v24h267v-25c-53 -5 -62 -16 -62 -54c0 -12 3 -34 7 -73l33 -291 l155 327c12 26 15 34 15 46c0 36 -7 41 -63 45v25h187"],88:[669,0,667,-24,694,"694 669v-25c-36 -5 -56 -16 -99 -61l-199 -205l75 -237c27 -86 43 -108 115 -116v-25h-307v25c57 5 67 12 67 38c0 22 -11 63 -37 141l-20 60l-130 -144c-23 -25 -32 -42 -32 -55c0 -23 18 -36 63 -40v-25h-214v25c56 10 82 47 231 210l68 74l-83 269 c-17 55 -33 60 -93 66v25h305v-25l-29 -3c-33 -3 -45 -10 -45 -33c0 -15 12 -59 35 -132l17 -55l94 99c52 55 70 80 70 98c0 15 -10 22 -33 24l-21 2v25h202"],89:[669,0,611,71,659,"659 669v-25c-38 -5 -60 -27 -92 -72l-189 -264l-52 -191c-5 -20 -10 -37 -10 -51c0 -28 17 -41 79 -41v-25h-323v25c66 6 87 15 104 78l57 208l-87 270c-16 48 -23 52 -75 63v25h285v-25c-55 -2 -69 -9 -69 -39c0 -18 8 -44 29 -110l46 -143l128 183c21 30 28 49 28 67 c0 31 -13 40 -66 42v25h207"],90:[669,0,611,-12,589,"589 640l-434 -605h75c92 0 147 12 199 50c36 27 69 69 97 114l27 -5l-60 -194h-505v29l434 605h-83c-105 0 -168 -36 -247 -147l-28 4l58 178h467v-29"],91:[674,159,333,-37,362,"362 674l-7 -35h-69c-36 0 -39 -6 -53 -66l-155 -667c-1 -3 -1 -7 -1 -9c0 -15 13 -21 34 -21h78l-7 -35h-219l199 833h200"],92:[685,18,278,-1,279,"279 -18h-84l-196 703h85"],93:[674,157,333,-56,343,"343 674l-200 -831h-199l7 35h68c36 0 37 5 51 63l157 667c1 5 1 10 1 10c0 13 -14 21 -34 21h-78l7 35h220"],94:[669,-304,570,67,503,"503 304h-89l-129 272l-129 -272h-89l178 365h80"],95:[-75,125,500,0,500,"500 -125h-500v50h500v-50"],96:[697,-516,333,85,297,"297 516h-46l-132 88c-22 15 -34 32 -34 48c0 24 21 45 45 45c19 0 38 -9 56 -33"],97:[462,14,500,-21,456,"435 127l21 -15c-58 -94 -109 -126 -156 -126c-37 0 -63 21 -63 64c0 14 2 28 14 69c-56 -95 -103 -132 -164 -132c-65 0 -108 51 -108 127c0 80 36 164 87 231c53 70 121 117 186 117c43 0 65 -21 74 -72h1l17 59l111 7l-75 -251c-24 -79 -30 -108 -30 -133 c0 -9 4 -15 12 -15c16 0 32 15 73 70zM303 373c0 27 -15 47 -37 47c-42 0 -80 -58 -108 -115c-35 -71 -56 -152 -56 -190c0 -40 17 -57 43 -57c27 0 59 26 86 75c39 69 72 180 72 240"],98:[699,13,500,-14,444,"284 699l-91 -326c48 66 93 89 144 89c64 0 107 -58 107 -131c0 -179 -152 -344 -320 -344c-66 0 -138 24 -138 61c0 6 10 45 20 81l94 327c27 94 39 143 39 156c0 20 -16 30 -46 30h-19v27c89 10 140 17 210 30zM319 325c0 46 -12 69 -41 69c-33 0 -66 -29 -92 -84 c-22 -48 -45 -124 -62 -182c-10 -34 -15 -73 -15 -81c0 -16 13 -27 31 -27c40 0 74 28 108 78c41 60 71 169 71 227"],99:[462,13,444,-5,392,"318 142l28 -18c-38 -52 -70 -96 -115 -119c-23 -12 -50 -18 -83 -18c-91 0 -153 53 -153 151c0 92 43 177 105 239c51 52 113 85 180 85c60 0 112 -37 112 -90c0 -42 -25 -71 -62 -71c-34 0 -58 23 -58 53s21 36 21 58c0 10 -12 17 -24 17c-38 0 -65 -37 -93 -88 c-33 -61 -53 -134 -53 -201c0 -58 29 -89 73 -89c43 0 74 24 122 91"],100:[699,13,500,-21,517,"517 699l-117 -421c-35 -126 -51 -194 -51 -203c0 -6 5 -15 11 -15c15 0 40 26 68 71l22 -16c-55 -88 -101 -126 -150 -126c-38 0 -60 23 -60 61c0 16 2 29 11 68c-52 -94 -105 -131 -166 -131s-106 42 -106 125c0 99 58 212 131 282c43 42 93 68 138 68 c29 0 53 -8 75 -33l18 64c25 88 29 113 29 122c0 18 -15 28 -41 28h-21v27c100 8 149 15 209 29zM308 371c0 28 -15 49 -37 49c-43 1 -85 -54 -114 -112c-33 -66 -54 -144 -54 -186c0 -36 16 -63 41 -63c29 0 59 25 86 74c36 64 78 194 78 238"],101:[462,13,444,5,398,"317 143l29 -17c-56 -100 -118 -139 -195 -139c-87 0 -146 48 -146 147c0 165 143 328 288 328c65 0 105 -36 105 -87c0 -43 -29 -88 -69 -122c-43 -36 -91 -54 -188 -71c-4 -20 -6 -33 -6 -49c0 -54 22 -82 64 -82c43 0 72 23 118 92zM306 390c0 23 -7 39 -31 39 c-48 0 -91 -76 -127 -215c90 20 158 93 158 176"],102:[698,205,333,-169,446,"47 449h74c20 71 43 135 79 181c34 42 79 68 147 68c60 0 99 -31 99 -80c0 -31 -20 -54 -51 -54c-28 0 -49 22 -49 50c0 23 16 28 16 42c0 8 -8 13 -18 13c-34 0 -68 -56 -92 -154l-16 -66h91l-9 -42h-89c-56 -265 -68 -313 -95 -394c-31 -92 -54 -137 -90 -172 c-32 -31 -70 -46 -114 -46c-56 0 -99 31 -99 79c0 31 24 55 51 55c26 0 50 -20 50 -49c0 -25 -16 -28 -16 -42c0 -8 8 -12 18 -12c40 0 59 41 90 189c6 29 38 172 88 392h-74"],103:[462,203,500,-52,477,"477 373h-66c6 -12 6 -26 6 -42c0 -53 -25 -99 -71 -132s-88 -46 -145 -46c-17 0 -39 4 -51 8c-13 0 -28 -14 -28 -36c0 -16 22 -33 54 -41l50 -12c110 -26 149 -62 149 -123c0 -81 -88 -152 -237 -152c-115 0 -190 33 -190 101c0 89 80 107 133 109 c-44 15 -62 34 -62 66c0 37 21 67 96 97c-54 23 -80 58 -80 110c0 104 95 182 218 182c46 0 83 -7 114 -33h110v-56zM300 372c0 35 -12 59 -45 59c-22 0 -42 -14 -57 -32c-33 -41 -47 -110 -47 -156c0 -38 15 -59 42 -59c31 0 57 23 78 69c17 37 29 85 29 119zM266 -100 c0 24 -14 44 -42 58c-22 10 -97 35 -109 36c-9 -1 -38 -17 -51 -30c-20 -19 -29 -36 -29 -55c0 -46 46 -78 113 -78c72 0 118 34 118 69"],104:[699,9,556,-13,498,"476 142l22 -15c-66 -103 -106 -136 -167 -136c-39 0 -66 24 -66 64c0 41 11 77 61 225l20 59c5 15 7 24 7 30c0 16 -8 21 -20 21c-27 0 -63 -31 -106 -94c-49 -72 -68 -121 -119 -296h-121l152 562c6 22 10 38 10 47c0 23 -13 33 -42 33h-22v27c81 7 132 15 209 30 l-108 -416c99 141 145 179 213 179c49 0 76 -28 76 -75c0 -19 -9 -56 -29 -118l-59 -182c-3 -8 -3 -9 -3 -12c0 -7 9 -16 17 -16c13 0 32 21 75 83"],105:[684,9,278,2,262,"262 616c0 -37 -30 -66 -68 -66s-66 30 -66 69c0 34 31 65 65 65c38 0 69 -31 69 -68zM216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334 c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],106:[685,207,278,-189,279,"279 617c0 -37 -31 -67 -69 -67c-37 0 -66 30 -66 69c0 35 31 66 66 66c38 0 69 -31 69 -68zM239 462l-116 -444c-42 -160 -107 -225 -207 -225c-63 0 -105 33 -105 77c0 29 22 53 49 53c29 0 49 -19 49 -49c0 -21 -15 -21 -15 -35c0 -10 12 -15 24 -15 c28 0 49 36 74 136l89 350c8 30 12 54 12 67c0 21 -12 30 -41 30h-22v27c112 10 149 15 209 28"],107:[699,8,500,-23,483,"483 449v-25c-46 -6 -67 -14 -135 -76l-64 -58c39 -195 57 -227 79 -227c19 0 37 16 64 64l22 -11c-45 -95 -88 -124 -138 -124c-62 0 -90 48 -123 223l-39 -27l-50 -188h-122l157 566c7 24 7 32 7 42c0 28 -10 34 -30 34h-34v27c77 4 132 13 209 30l-124 -461 c126 99 165 137 165 163c0 16 -11 21 -50 23v25h206"],108:[699,9,278,2,290,"290 699l-145 -523c-15 -54 -22 -86 -22 -100c0 -8 5 -15 15 -15c18 0 39 21 79 80l22 -14c-69 -105 -105 -136 -169 -136c-41 0 -68 27 -68 63c0 23 14 84 34 155l74 259c21 73 34 121 34 145c0 20 -15 30 -42 30c-5 0 -11 0 -22 -1v27c75 7 124 14 210 30"],109:[462,9,778,-14,723,"701 135l22 -13c-52 -97 -99 -131 -161 -131c-43 0 -67 20 -67 66c0 29 15 87 37 151l44 130c4 13 7 24 7 30c0 11 -11 21 -23 21c-30 0 -70 -41 -112 -116c-36 -63 -43 -81 -101 -273h-120l65 207c32 102 45 143 45 160c0 16 -8 22 -18 22c-15 0 -43 -21 -65 -47 c-57 -68 -94 -153 -147 -342h-121l66 232c28 97 36 135 36 150c0 16 -12 25 -38 25h-18v27c113 9 137 12 200 27l-63 -199h1c48 74 77 115 104 142c32 32 74 58 114 58c42 0 67 -25 67 -67c0 -28 -6 -53 -26 -105c81 132 126 172 198 172c48 0 77 -30 77 -71 c0 -26 -8 -66 -23 -109l-45 -128c-18 -51 -21 -59 -21 -77c0 -12 7 -18 16 -18c13 0 35 21 58 58c4 7 8 13 12 18"],110:[462,9,556,-6,494,"472 135l22 -13c-55 -97 -100 -131 -160 -131c-43 0 -68 19 -68 60c0 26 10 77 26 125l55 165c3 10 7 25 7 28c0 17 -12 21 -25 21c-18 0 -49 -27 -69 -54c-62 -81 -99 -162 -145 -336h-121l57 204c33 120 45 167 45 179c0 19 -13 23 -55 24v27c56 2 135 13 199 27 l-62 -198h1c67 99 85 123 122 158c27 26 63 41 100 41c51 0 73 -28 73 -77c0 -24 -12 -69 -28 -116l-35 -104c-19 -56 -24 -79 -24 -89s6 -17 14 -17c17 0 31 14 71 76"],111:[462,13,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-49 -49 -108 -75 -175 -75c-94 0 -164 50 -164 148c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64 c26 0 50 15 71 49c49 80 86 220 86 307"],112:[462,205,500,-120,446,"177 347h1c56 87 101 115 158 115c72 0 110 -47 110 -121c0 -185 -135 -354 -277 -354c-21 0 -46 6 -68 22l-12 -41c-19 -66 -24 -100 -24 -114c0 -24 15 -31 65 -32v-27h-250v27c48 0 59 10 78 86l96 380c13 52 22 84 22 94c0 19 -9 23 -54 25v27c52 6 90 12 192 28z M321 336c0 40 -15 55 -39 55c-31 0 -61 -32 -87 -71c-18 -27 -22 -40 -44 -113c-27 -91 -38 -132 -38 -149c0 -20 17 -36 39 -36s43 12 62 30c67 66 107 223 107 284"],113:[462,205,500,1,471,"471 449l-129 -461c-20 -73 -36 -127 -36 -138c0 -20 17 -28 49 -28h17v-27h-268v27c61 0 75 13 92 69l61 207c-44 -82 -94 -111 -154 -111c-65 0 -102 48 -102 130c0 55 19 117 54 178c59 103 142 167 218 167c23 0 47 -9 57 -22c9 -11 12 -22 17 -50l15 59h109z M325 371c0 28 -12 48 -35 48c-39 0 -86 -65 -111 -115c-32 -66 -53 -140 -53 -188c0 -38 13 -57 39 -57c31 0 59 24 88 74c35 62 72 180 72 238"],114:[462,0,389,-21,389,"160 253h1c79 159 117 209 171 209c34 0 57 -26 57 -66c0 -42 -25 -73 -58 -73c-39 0 -41 38 -61 38c-14 0 -38 -27 -65 -76c-26 -47 -41 -81 -74 -186l-31 -99h-121c71 240 102 357 102 382c0 19 -12 25 -56 25v27c121 10 140 13 200 28"],115:[462,13,389,-19,333,"333 461l-23 -154l-27 2c-16 83 -42 120 -88 120c-32 0 -53 -21 -53 -53c0 -23 18 -54 57 -99c60 -70 80 -114 80 -162c0 -75 -66 -128 -148 -128c-21 0 -42 3 -64 12c-13 5 -23 8 -30 8c-13 0 -23 -6 -29 -20h-27l22 166l27 -3c11 -88 42 -133 93 -133c40 0 60 22 60 54 c0 30 -16 59 -56 104c-68 77 -80 107 -80 161c0 80 53 126 134 126c20 0 41 -4 58 -12s27 -10 37 -10c15 0 19 4 28 21h29"],116:[594,9,278,-11,281,"281 407h-83l-34 -119c-35 -122 -53 -185 -53 -209c0 -13 8 -18 16 -18c16 0 42 27 76 80l23 -15c-66 -103 -110 -135 -170 -135c-42 0 -67 21 -67 65c0 18 10 63 25 115l67 236h-52v35c82 28 130 67 184 152h35l-39 -145h72v-42"],117:[462,9,556,15,493,"471 133l22 -13c-52 -89 -99 -129 -159 -129c-44 0 -68 19 -68 60c0 29 8 55 26 110h-1c-94 -138 -133 -170 -198 -170c-50 0 -78 26 -78 79c0 25 8 56 22 106l37 128c8 29 17 59 17 75c0 15 -12 25 -58 28v27c51 1 149 15 210 28l-93 -302c-14 -45 -16 -57 -16 -72 c0 -17 10 -25 24 -25c18 0 40 16 70 55c58 76 88 131 142 331h118l-78 -266c-13 -46 -25 -91 -25 -103c0 -10 3 -21 14 -21c17 0 37 20 72 74"],118:[462,13,444,15,401,"15 408v27c82 11 107 15 156 27c21 -67 31 -146 31 -334c99 113 126 154 126 189c0 11 -5 19 -20 36c-18 20 -25 36 -25 53c0 31 27 56 57 56c38 0 61 -32 61 -67c0 -42 -20 -96 -60 -154c-55 -80 -103 -133 -230 -254h-26c5 91 5 173 5 177c0 108 -9 193 -25 225 c-7 13 -19 19 -50 19"],119:[462,13,667,15,614,"387 462l31 -333c88 103 120 157 120 187c0 10 -6 22 -20 38c-17 19 -22 33 -22 48c0 40 27 60 57 60c33 0 61 -29 61 -62c0 -84 -89 -223 -272 -413h-27l-23 285c-34 -63 -70 -135 -114 -201l-56 -84h-27v46c0 13 1 32 1 62c0 121 -18 284 -38 302c-8 7 -18 10 -43 10 v27c80 13 115 19 156 28c23 -86 33 -154 33 -274l156 274h27"],120:[462,13,500,-45,469,"41 438l165 24c19 -28 31 -53 47 -138c78 114 111 138 158 138c31 0 58 -29 58 -61c0 -29 -26 -53 -56 -53c-24 0 -34 20 -57 20s-60 -37 -92 -94l32 -157c8 -39 18 -53 37 -53c18 0 28 9 67 59l21 -14c-61 -88 -103 -122 -151 -122c-50 0 -75 40 -97 155l-24 -39 c-59 -96 -81 -116 -131 -116c-38 0 -63 24 -63 59c0 32 23 57 54 57c30 0 41 -22 62 -22c18 0 26 6 47 40l44 71l-29 152c-9 49 -25 69 -57 69c-9 0 -16 0 -35 -2v27"],121:[462,205,444,-94,392,"239 110h2c70 134 87 176 87 207c0 13 -7 19 -25 34c-22 18 -31 29 -31 54s21 57 58 57c33 0 62 -30 62 -64c0 -101 -119 -338 -249 -497c-55 -67 -120 -106 -175 -106c-35 0 -62 26 -62 60c0 29 24 56 50 56c47 0 58 -36 94 -36c17 0 46 22 67 52c17 24 25 48 25 71 c0 31 -16 126 -50 288c-13 59 -24 97 -40 113c-11 11 -15 12 -40 12v27c65 6 102 12 150 24c18 -47 48 -149 66 -274"],122:[449,78,389,-43,368,"368 439l-281 -335c39 -17 61 -35 86 -69c21 -29 39 -84 68 -84c13 0 22 8 22 17c0 16 -20 17 -20 45s23 53 50 53c28 0 53 -25 53 -53c0 -62 -49 -91 -110 -91c-41 0 -80 15 -129 50c-35 25 -54 33 -74 33c-11 0 -17 -3 -32 -14c-6 -5 -12 -10 -19 -14l-25 22l292 354 h-136c-37 0 -58 -14 -73 -61l-27 3l44 154h311v-10"],123:[686,187,348,4,436,"436 686l-3 -12c-82 -15 -118 -48 -138 -124l-45 -171c-22 -85 -54 -111 -152 -130c75 -20 93 -34 93 -76c0 -23 -10 -70 -29 -130c-19 -63 -30 -113 -30 -140c0 -46 22 -67 81 -78l-3 -12c-139 3 -182 25 -182 91c0 30 16 103 35 159c16 49 26 92 26 116 c0 35 -23 54 -85 70c89 19 119 41 138 116l46 179c28 109 89 142 248 142"],124:[685,18,220,66,154,"154 -18h-88v703h88v-703"],125:[686,187,348,-129,303,"94 674l3 12c94 -2 133 -10 158 -32c16 -14 24 -33 24 -56c0 -31 -16 -105 -35 -162c-16 -49 -26 -92 -26 -116c0 -35 23 -54 85 -70c-89 -20 -119 -44 -138 -116l-46 -179c-28 -111 -89 -142 -248 -142l3 12c82 15 118 48 138 124l45 171c22 85 54 111 152 130 c-75 20 -93 34 -93 76c0 23 8 64 28 130c20 69 31 115 31 141c0 44 -23 66 -81 77"],126:[331,-175,570,54,516,"461 308l55 -48c-46 -64 -77 -85 -123 -85c-33 0 -60 7 -105 33c-46 26 -77 35 -112 35c-29 0 -45 -10 -69 -42l-53 46c33 58 71 84 121 84c36 0 60 -7 136 -41c49 -22 64 -27 82 -27c24 0 43 13 68 45"],160:[0,0,250,0,0,""],163:[683,12,500,-32,510,"45 370h105c25 124 49 182 98 237c42 49 96 76 153 76c63 0 109 -39 109 -91c0 -38 -26 -68 -61 -68c-30 0 -53 22 -53 51c0 10 2 22 4 34c2 7 3 14 3 19c0 12 -10 21 -24 21c-29 0 -50 -27 -60 -77l-39 -202h114l-10 -60h-115c-13 -58 -37 -127 -64 -169l-11 -17 c59 -23 92 -32 125 -32c48 0 68 14 90 63h25c-12 -58 -24 -86 -45 -114c-26 -33 -65 -53 -106 -53c-42 0 -76 16 -127 61c-27 -43 -55 -60 -98 -60c-53 0 -90 35 -90 86c0 52 39 87 96 87c21 0 35 -3 61 -14c7 66 9 79 19 162h-109zM113 90c-24 22 -42 30 -64 30 c-31 0 -51 -20 -51 -50s23 -51 56 -51c30 0 48 22 59 71"],165:[669,0,500,33,628,"628 669v-25c-40 -8 -61 -25 -93 -69l-166 -233h135l-13 -50h-150l-21 -78h152l-14 -50h-152l-3 -11c-12 -44 -16 -66 -16 -85c0 -33 14 -40 81 -43v-25h-322v25c77 5 93 17 109 72l19 67h-141l14 50h141l22 78h-142l14 50h125l-79 239c-17 52 -27 56 -82 63v25h280v-25 c-57 -2 -75 -9 -75 -32c0 -9 2 -20 6 -32l80 -236l135 194c21 30 26 42 26 60c0 35 -14 44 -70 46v25h200"],167:[685,143,500,36,459,"221 419l2 3c-36 40 -55 85 -55 129c0 79 63 134 155 134c79 0 136 -41 136 -98c0 -35 -25 -62 -58 -62c-30 0 -55 25 -55 55c0 40 36 37 36 55c0 15 -28 28 -59 28c-50 0 -85 -30 -85 -73c0 -32 19 -63 69 -122l69 -81c39 -45 59 -97 59 -144c0 -81 -53 -122 -117 -122 c-10 0 -18 1 -30 4l-2 -4c43 -54 59 -88 59 -130c0 -75 -72 -134 -164 -134c-82 0 -145 46 -145 105c0 35 24 61 58 61c33 0 56 -22 56 -51c0 -32 -35 -35 -35 -63c0 -15 33 -29 67 -29c51 0 86 31 86 76c0 33 -13 51 -84 137l-66 80c-35 43 -50 83 -50 126 c0 84 46 126 104 126c13 0 36 -3 49 -6zM364 206c0 67 -111 194 -169 194c-32 0 -56 -25 -56 -58c0 -21 11 -51 29 -76c25 -35 57 -72 79 -91c23 -20 37 -27 58 -27c32 0 59 27 59 58"],168:[655,-525,333,55,397,"397 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66zM185 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66"],175:[623,-553,333,51,393,"393 623l-16 -70h-326l17 70h325"],176:[688,-402,400,83,369,"369 545c0 -79 -64 -143 -143 -143s-143 64 -143 143s64 143 143 143s143 -64 143 -143zM314 545c0 49 -39 88 -88 88s-88 -39 -88 -88s39 -88 88 -88s88 39 88 88"],180:[697,-516,333,139,379,"139 516l122 131c36 38 52 50 70 50c26 0 48 -21 48 -47c0 -19 -9 -30 -39 -47l-152 -87h-49"],181:[449,207,576,-60,516,"516 449l-104 -336c-3 -10 -5 -20 -5 -27c0 -8 5 -14 12 -14c15 0 33 17 63 62l22 -16c-73 -105 -110 -131 -166 -131c-37 0 -63 26 -63 63c0 18 2 30 11 68c-53 -90 -85 -118 -132 -118c-24 0 -52 9 -62 24c-14 -43 -23 -89 -23 -133c0 -62 -29 -98 -79 -98 c-37 0 -50 27 -50 66c0 51 41 103 74 215l111 375h135l-93 -312c-4 -14 -7 -31 -7 -42c0 -16 7 -25 19 -25c42 0 117 106 151 215l51 164h135"],183:[405,-257,250,51,199,"199 331c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],240:[699,13,500,-3,454,"454 664l-107 -56c68 -74 94 -137 94 -228c0 -209 -119 -393 -286 -393c-94 0 -158 63 -158 147c0 175 137 328 275 328c31 0 54 -12 71 -42l2 4c-4 54 -23 100 -62 150l-119 -62l-33 31l122 64c-40 38 -77 58 -117 65l45 27c49 -7 89 -25 132 -60l107 57zM322 375 c0 36 -18 58 -46 58c-88 0 -160 -239 -160 -347c0 -47 16 -70 49 -70c51 0 84 63 109 129c27 73 48 173 48 230"],295:[699,9,556,-13,498,"65 514l12 44h61c7 25 11 42 11 51c0 23 -13 33 -42 33h-22v27c81 7 132 15 209 30l-37 -141h159l-12 -44h-158l-60 -231c99 141 145 179 213 179c49 0 76 -28 76 -75c0 -19 -9 -56 -29 -118l-59 -182c-3 -8 -3 -9 -3 -12c0 -7 9 -16 17 -16c13 0 32 21 75 83l22 -15 c-66 -103 -106 -136 -167 -136c-39 0 -66 24 -66 64c0 41 11 77 61 225l20 59c5 15 7 24 7 30c0 16 -8 21 -20 21c-27 0 -63 -31 -106 -94c-49 -72 -68 -121 -119 -296h-121l139 514h-61"],305:[462,9,278,2,238,"216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],567:[462,207,278,-189,239,"239 462l-116 -444c-42 -160 -107 -225 -207 -225c-63 0 -105 33 -105 77c0 29 22 53 49 53c29 0 49 -19 49 -49c0 -21 -15 -21 -15 -35c0 -10 12 -15 24 -15c28 0 49 36 74 136l89 350c8 30 12 54 12 67c0 21 -12 30 -41 30h-22v27c112 10 149 15 209 28"],710:[690,-516,333,40,367,"367 516h-51l-88 95l-131 -95h-57l160 174h81"],711:[690,-516,333,79,411,"411 690l-162 -174h-82l-88 174h51l90 -97l134 97h57"],728:[678,-516,333,71,387,"348 678h39c-21 -103 -81 -162 -178 -162c-93 0 -138 54 -138 149v13h43c5 -57 35 -90 99 -90c66 0 104 24 135 90"],729:[655,-525,333,163,293,"293 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66"],730:[754,-541,333,127,340,"340 648c0 -59 -48 -107 -107 -107c-64 0 -106 45 -106 108c0 59 49 105 107 105c63 0 106 -47 106 -106zM292 646c0 33 -27 60 -60 60c-31 0 -57 -27 -57 -59s26 -58 57 -58c33 0 60 26 60 57"],732:[655,-536,333,48,407,"366 655h41c-22 -84 -57 -119 -117 -119c-19 0 -30 2 -57 13l-59 23c-13 5 -27 8 -38 8c-22 0 -35 -11 -48 -43h-40c13 72 59 118 116 118c25 0 56 -8 97 -26c27 -11 42 -16 54 -16c23 0 36 10 51 42"],913:[683,0,667,-68,593,"593 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-12 119h-215l-57 -96c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l370 582h25l94 -560c14 -82 23 -94 86 -98v-25zM346 248l-37 243l-148 -243h185"],914:[669,0,667,-25,624,"118 669h265c161 0 241 -50 241 -146c0 -109 -86 -138 -189 -168v-1c96 -27 137 -73 137 -148c0 -134 -112 -206 -295 -206h-302v25c48 6 68 24 84 83l119 438c7 25 11 47 11 57c0 39 -32 41 -71 41v25zM334 577l-57 -209c69 5 116 5 153 40c30 28 47 72 47 128 c0 67 -29 101 -87 101c-32 0 -41 -4 -56 -60zM269 338l-64 -236c-5 -19 -7 -29 -7 -37c0 -23 18 -33 57 -33c53 0 90 21 121 59c29 35 43 88 43 138c0 37 -12 67 -35 85c-21 16 -50 22 -115 24"],915:[669,0,585,-13,670,"670 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -83 53 -167 53c-41 0 -53 -10 -63 -48l-125 -457c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h543"],916:[683,0,667,-65,549,"549 0h-614l453 683h25zM384 124l-75 367l-240 -367h315"],917:[669,0,667,-27,653,"653 669l-43 -190l-27 5c-3 71 -4 96 -45 123c-30 19 -76 30 -137 30c-41 0 -55 -6 -67 -51l-59 -216c132 0 158 13 205 107l28 -4l-74 -274l-28 4c3 19 4 30 4 44c0 69 -31 91 -144 91l-63 -234c-5 -20 -8 -31 -8 -38c0 -24 18 -34 61 -34c88 0 157 19 214 61 c37 27 57 50 91 106l25 -5l-60 -194h-553v25c52 8 65 19 82 80l119 432c9 33 12 55 12 70c0 20 -10 29 -41 33l-33 4v25h541"],918:[669,0,611,-12,589,"589 640l-434 -605h75c92 0 147 12 199 50c36 27 69 69 97 114l27 -5l-60 -194h-505v29l434 605h-83c-105 0 -168 -36 -247 -147l-28 4l58 178h467v-29"],919:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l62 225h-239l-54 -197c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h316v-25c-65 -2 -84 -15 -102 -80l-52 -191h239l47 173c5 19 10 49 10 61c0 20 -10 29 -41 33l-31 4v25h297"],920:[685,18,718,27,691,"466 457l28 -4c-35 -76 -50 -173 -59 -254l-27 3c0 49 -3 65 -42 65h-41c-48 0 -59 -15 -86 -65l-26 10c36 74 51 163 56 241l29 4c1 -54 6 -70 57 -70h34c41 0 51 13 77 70zM691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239 c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -16 -162 -100c-60 -101 -113 -289 -113 -408c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],921:[669,0,389,-32,406,"406 669v-25c-49 -5 -67 -17 -84 -80l-112 -412c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82l117 429c8 29 14 59 14 71c0 20 -15 30 -42 33l-32 4v25h298"],922:[669,0,667,-21,702,"702 669v-25c-43 -6 -51 -9 -94 -48l-216 -199l157 -333c11 -24 25 -35 63 -39v-25h-280l1 25l26 4c27 4 38 9 38 23c0 12 -5 27 -15 49l-111 236l-67 -249c-1 -5 -2 -11 -2 -17c0 -33 13 -42 65 -46v-25h-288v25c45 5 65 15 79 68l123 453c8 28 11 46 11 58 c0 22 -10 32 -41 36l-33 4v25h311v-25c-59 -5 -80 -20 -94 -72l-62 -227l197 175c59 52 77 78 77 97c0 15 -10 23 -35 25l-21 2v25h211"],923:[683,0,655,-68,581,"581 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-50 399h-2l-220 -376c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l364 582h25l88 -560c13 -82 23 -94 86 -98v-25"],924:[669,12,889,-29,917,"917 669v-25c-51 -6 -67 -19 -84 -81l-119 -438c-5 -17 -10 -45 -10 -57c0 -32 12 -43 71 -43v-25h-311v25c69 4 85 21 101 79l123 457l-375 -573h-28l-67 559l-101 -369c-14 -50 -20 -75 -20 -92c0 -45 16 -55 80 -61v-25h-206v25c54 12 67 33 103 157l107 369 c7 26 11 44 11 58c0 28 -7 35 -71 35v25h219l54 -480l311 480h212"],925:[669,15,722,-27,748,"748 669v-25c-56 -11 -66 -24 -102 -153l-143 -506h-28l-257 547l-99 -354c-12 -42 -19 -75 -19 -94c0 -39 20 -54 79 -59v-25h-206v25c55 11 60 17 101 155l120 407c-19 44 -27 52 -82 57v25h193l216 -467l81 289c11 41 19 75 19 94c0 38 -21 59 -81 59v25h208"],926:[669,0,746,25,740,"740 669l-28 -183l-25 5c0 53 -21 58 -92 58h-301c-42 0 -58 -7 -96 -63l-26 7l58 176h510zM618 462l-64 -231l-25 3c0 43 -12 59 -57 59h-161c-57 0 -68 -15 -88 -62l-25 3l64 236l25 -2c0 -41 5 -61 56 -61h159c39 0 71 4 91 61zM653 199l-64 -199h-564l41 205l25 6 c0 -62 33 -81 89 -81h320c69 0 89 10 128 75"],927:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388 c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],928:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l144 525h-239l-136 -497c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h683"],929:[669,0,611,-28,613,"112 669h282c147 0 219 -54 219 -155c0 -53 -21 -98 -59 -131c-48 -42 -122 -66 -214 -66c-27 0 -46 1 -81 5l-54 -199c-5 -17 -11 -48 -11 -58c0 -27 16 -37 72 -40v-25h-294v25c52 8 66 17 84 82l117 426c11 39 13 59 13 74c0 20 -10 29 -41 33l-33 4v25zM330 584 l-61 -229c17 -3 29 -3 42 -3c62 0 96 18 123 62c22 35 33 93 33 136c0 53 -31 87 -84 87c-35 0 -41 -9 -53 -53"],931:[669,0,633,-11,619,"619 669l-37 -181l-25 4c0 93 -37 142 -127 142h-152l146 -262l-260 -238h225c84 0 106 14 144 79l26 -5l-61 -208h-509v28l313 287l-186 325v29h503"],932:[669,0,611,49,650,"650 669l-36 -192l-27 2c0 114 -38 155 -138 155l-135 -489c-7 -24 -17 -53 -17 -74c0 -29 23 -46 83 -46v-25h-331v25h15c46 0 77 20 91 72l148 537c-102 -2 -167 -37 -218 -143l-25 7l39 171h551"],933:[685,0,611,21,697,"697 628l-17 -19c-24 20 -51 26 -75 26c-42 0 -81 -26 -119 -79c-30 -42 -68 -109 -106 -248l-53 -192c-5 -17 -10 -36 -10 -49c0 -31 17 -42 79 -42v-25h-323v25c66 6 87 16 104 78l56 209c0 84 -17 304 -126 304c-21 0 -38 -6 -68 -29l-18 18c40 61 95 80 150 80 c144 0 185 -144 185 -274h4c44 134 137 266 243 266c38 0 70 -11 94 -49"],934:[669,0,771,26,763,"538 581l-4 -18c124 -1 229 -50 229 -176c0 -205 -234 -292 -355 -292c-3 -12 -4 -20 -4 -29c0 -28 17 -41 79 -41v-25h-311v25c64 6 71 12 87 70h-8c-134 0 -225 69 -225 194c0 179 195 274 347 274h15c4 19 7 36 7 44c0 20 -18 30 -45 33l-35 4v25h311v-25 c-56 0 -79 -23 -88 -63zM521 529l-108 -400c114 0 206 132 206 259c0 66 -30 123 -98 141zM272 129l109 400c-119 0 -211 -142 -211 -274c0 -70 23 -126 102 -126"],935:[669,0,667,-24,694,"694 669v-25c-36 -5 -56 -16 -99 -61l-199 -205l75 -237c27 -86 43 -108 115 -116v-25h-307v25c57 5 67 12 67 38c0 22 -11 63 -37 141l-20 60l-130 -144c-23 -25 -32 -42 -32 -55c0 -23 18 -36 63 -40v-25h-214v25c56 10 82 47 231 210l68 74l-83 269 c-17 55 -33 60 -93 66v25h305v-25l-29 -3c-33 -3 -45 -10 -45 -33c0 -15 12 -59 35 -132l17 -55l94 99c52 55 70 80 70 98c0 15 -10 22 -33 24l-21 2v25h202"],936:[685,0,661,17,780,"780 685v-25c-70 0 -80 -74 -87 -125c-25 -177 -202 -226 -313 -226l-52 -192c-5 -20 -10 -37 -10 -51c0 -28 17 -41 79 -41v-25h-323v25c60 6 87 15 104 78l56 206c-100 0 -212 27 -212 157c0 61 29 96 29 156c0 22 -6 37 -34 38v25h36c79 0 127 -50 127 -128 c0 -33 -14 -78 -14 -110c0 -57 24 -104 77 -104l53 193c8 29 14 59 14 71c0 20 -15 30 -42 33l-34 4v25h305v-25c-43 0 -70 -13 -81 -54l-68 -247c65 0 123 66 142 146c36 155 119 196 215 196h33"],937:[685,0,808,25,774,"279 124v32c-119 48 -150 118 -150 211c0 94 64 201 174 264c63 36 141 54 231 54c160 0 240 -83 240 -216c0 -148 -103 -271 -282 -315l-9 -30h111c69 0 89 10 128 75l25 -6l-64 -193h-295l60 192c110 24 182 161 182 289c0 89 -20 170 -107 170 c-128 0 -250 -162 -250 -313c0 -71 13 -113 67 -146l-29 -192h-286l41 199l25 6c0 -62 33 -81 89 -81h99"],945:[462,13,576,-3,574,"574 449l-158 -255c0 -72 14 -135 38 -135c21 0 43 26 58 77l24 -7c-12 -69 -56 -140 -121 -140c-57 0 -85 41 -92 79c-55 -61 -100 -81 -168 -81c-39 0 -73 8 -100 25c-36 23 -58 73 -58 133c0 158 113 317 274 317c76 0 119 -43 135 -94l44 81h124zM312 285 c0 71 -5 148 -51 148c-52 0 -145 -166 -145 -345c0 -51 23 -71 45 -71c55 0 142 118 143 192c4 22 8 48 8 76"],946:[698,205,500,-79,480,"-50 -122l135 505c31 117 138 315 280 315c58 0 115 -25 115 -104c0 -75 -53 -157 -115 -184v-2c31 -6 84 -45 84 -122c0 -129 -101 -299 -274 -299c-33 0 -57 10 -75 22l-36 -138c-6 -24 -17 -61 -25 -76h-118c8 15 23 59 29 83zM216 454l-101 -388c0 -28 15 -44 40 -44 c100 0 169 190 169 296c0 41 -9 69 -32 69c-17 0 -17 -6 -28 -6c-20 0 -27 11 -27 21c0 17 16 31 38 31c12 0 25 -4 39 -4c43 0 62 125 62 175c0 54 -14 65 -31 65c-48 0 -103 -113 -129 -215"],947:[462,204,438,3,461,"461 449l-263 -411c0 -77 -18 -242 -112 -242c-44 0 -52 41 -52 63c0 60 63 141 118 229c10 73 12 86 12 141c0 68 -17 136 -66 136c-18 0 -52 -4 -68 -68h-27c16 88 64 165 125 165c71 0 78 -65 78 -135c0 -33 -2 -102 -5 -135l136 257h124"],948:[698,13,496,-3,456,"236 429v2c-61 27 -106 55 -106 121c0 91 122 146 192 146c48 0 134 -17 134 -79c0 -24 -7 -44 -48 -44c-64 0 -43 79 -111 79c-26 0 -72 -8 -72 -60c0 -48 40 -80 99 -114s117 -82 117 -167c0 -67 -26 -156 -79 -224c-46 -59 -112 -102 -201 -102 c-110 0 -164 70 -164 149c0 48 6 102 31 143c46 76 113 133 208 150zM322 342c0 51 -29 59 -52 59c-92 -10 -154 -165 -154 -279c0 -67 9 -106 47 -106s69 35 102 106c25 54 57 162 57 220"],949:[462,13,454,-5,408,"83 234v1c-32 18 -44 43 -44 71c0 85 120 156 251 156c60 0 118 -34 118 -90c0 -40 -25 -71 -62 -71c-34 0 -58 23 -58 53c0 29 21 36 21 58c0 10 -18 17 -30 17c-44 0 -104 -54 -104 -120c0 -33 10 -52 43 -52c11 0 22 9 48 9c17 0 35 -5 35 -23c0 -23 -18 -34 -53 -34 c-10 0 -18 6 -33 6c-56 0 -92 -50 -92 -95c0 -36 24 -69 73 -69c44 0 95 16 143 83l28 -18c-37 -54 -104 -129 -207 -129c-123 0 -165 60 -165 120c0 64 38 105 88 127"],950:[698,205,415,-5,473,"283 698l6 -26c-61 -20 -81 -65 -81 -86c0 -39 27 -46 39 -49c57 37 109 77 163 77c35 0 63 -17 63 -49c0 -60 -59 -93 -201 -93c-91 -64 -168 -159 -168 -293c0 -57 36 -86 106 -86c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59 c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 65 -140 151c1 131 66 228 202 352c-63 11 -87 47 -87 87c0 60 68 116 173 121"],951:[462,205,488,-7,474,"178 263h1c67 99 85 123 122 158c27 26 63 41 100 41c51 0 73 -28 73 -77c0 -24 -12 -69 -26 -121l-68 -258c-13 -50 -30 -140 -30 -173c0 -13 0 -26 5 -38h-112c-13 21 -13 32 -13 50c0 39 42 209 108 448c6 23 11 58 11 76c0 17 -7 21 -20 21c-18 0 -49 -27 -69 -54 c-62 -81 -99 -162 -145 -336h-121l87 309c6 23 12 40 12 55c0 17 -6 21 -17 21c-20 0 -43 -26 -63 -49l-20 18c42 62 101 101 167 101c48 0 58 -25 58 -47c0 -15 -10 -55 -18 -78"],952:[698,13,501,-3,488,"488 508c0 -186 -75 -328 -146 -417c-57 -73 -122 -104 -191 -104c-90 0 -154 60 -154 203c0 157 71 308 141 395c59 73 132 113 202 113c97 0 148 -73 148 -190zM158 368h178c20 74 33 158 33 222c0 46 -10 79 -36 79c-22 0 -49 -28 -71 -59c-37 -52 -76 -147 -104 -242 zM325 326h-179c-19 -74 -30 -154 -30 -221c0 -51 14 -89 40 -89c27 0 57 36 83 86c29 57 61 141 86 224"],953:[462,9,278,2,238,"216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],954:[462,12,500,-23,504,"163 244h1c144 177 208 218 269 218c52 0 71 -38 71 -72c0 -29 -18 -62 -59 -62c-53 0 -55 47 -79 47c-10 0 -45 -10 -126 -102l118 -196c24 -40 35 -50 94 -50v-27c-29 -9 -72 -12 -95 -12c-91 0 -118 66 -138 98l-68 111l-52 -197h-122l92 334c6 23 9 36 9 44 c0 19 -16 29 -46 29h-14v27c78 6 150 16 204 28"],955:[698,18,484,-34,459,"432 150h27c-8 -110 -40 -168 -122 -168c-52 0 -69 54 -69 120c0 63 4 138 12 188l-190 -290h-124l314 444l-4 51c-6 80 -32 105 -65 105c-18 0 -47 -16 -62 -68h-27c20 88 41 166 112 166c62 0 76 -73 80 -158l17 -363c4 -84 20 -97 44 -97c14 0 48 1 57 70"],956:[449,205,523,-82,483,"460 133l23 -13c-49 -89 -95 -133 -155 -133c-44 0 -70 21 -70 64c0 8 2 33 12 80h-1c-76 -135 -107 -141 -177 -141l-33 -122c-6 -22 -18 -56 -24 -73h-117c8 15 19 46 27 75l155 579h121l-77 -289c-5 -20 -10 -40 -10 -60c0 -21 11 -37 27 -37c38 0 92 84 131 168 l58 218h119l-71 -266c-12 -46 -22 -91 -22 -103c0 -11 4 -23 15 -23c17 0 36 22 69 76"],957:[462,13,469,-23,441,"414 462l27 -5c-41 -287 -265 -430 -437 -470h-27l93 346c4 14 8 36 8 44c0 22 -21 30 -60 30v27c45 1 139 14 203 28l-92 -340h2c125 25 237 131 283 340"],958:[698,205,415,-5,426,"275 698l5 -27c-58 -21 -83 -47 -83 -76c0 -13 2 -23 15 -32c42 33 104 62 150 62c45 0 64 -16 64 -36c0 -56 -71 -95 -177 -95c-39 0 -64 -33 -64 -65c0 -16 6 -31 20 -42c37 21 91 36 141 36c42 0 63 -19 63 -42c0 -50 -61 -79 -138 -79c-20 0 -54 3 -72 6 c-61 -25 -95 -69 -95 -129c0 -57 36 -86 106 -86c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 55 -140 141c0 88 43 161 132 216v2 c-20 10 -40 41 -40 68c0 39 21 70 55 93v2c-17 4 -45 25 -45 64c0 72 77 112 178 125"],959:[462,13,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-49 -49 -108 -75 -175 -75c-94 0 -164 50 -164 148c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64 c26 0 50 15 71 49c49 80 86 220 86 307"],960:[449,15,558,-6,570,"570 449l-21 -100h-108c-17 -47 -53 -164 -53 -227c0 -25 10 -61 34 -61c16 0 42 13 65 71l23 -12c-22 -66 -69 -129 -157 -129c-56 0 -89 41 -89 83c0 73 51 189 89 275h-89c-17 -72 -63 -210 -110 -294c-24 -42 -55 -70 -99 -70s-61 17 -61 51c0 23 9 44 42 56 c31 11 49 29 68 62c37 65 70 138 86 195h-35c-36 0 -83 -24 -104 -55h-27c54 95 110 155 223 155h323"],961:[462,205,495,-81,447,"-52 -122l74 279c20 76 65 171 129 234c43 42 103 71 159 71c59 0 137 -15 137 -125c0 -92 -50 -213 -116 -277c-42 -41 -93 -73 -158 -73c-30 0 -59 10 -75 22l-34 -138c-6 -23 -19 -60 -27 -76h-118c9 16 22 56 29 83zM151 219l-37 -153c0 -28 13 -44 39 -44 c35 0 68 33 95 76c45 71 74 177 74 253c0 62 -16 82 -37 82s-47 -20 -68 -52c-26 -39 -50 -97 -66 -162"],962:[462,205,415,-5,447,"447 393c0 -40 -27 -69 -69 -69c-64 0 -77 49 -128 49c-104 0 -146 -77 -146 -184c0 -67 36 -96 106 -96c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47 c-23 0 -65 -11 -95 -11c-88 0 -140 65 -140 151c0 79 38 153 92 208c73 74 175 116 257 116c54 0 103 -22 103 -69"],963:[449,13,499,-3,536,"536 449l-21 -100h-187c29 -67 113 -61 113 -146c0 -120 -131 -216 -280 -216c-101 0 -164 56 -164 148c0 139 121 314 320 314h219zM322 222c0 66 -24 111 -46 127c-82 0 -160 -135 -160 -268c0 -24 5 -65 49 -65c78 0 157 98 157 206"],964:[449,9,415,4,455,"455 449l-23 -100h-126c-51 -129 -62 -217 -62 -235c0 -28 9 -53 32 -53c16 0 42 14 67 73l24 -11c-17 -68 -81 -132 -151 -132c-68 0 -96 40 -96 88c0 42 5 82 91 270h-46c-43 0 -107 -28 -134 -88h-27c20 75 85 188 251 188h200"],965:[462,13,536,-7,477,"300 435v27c35 0 64 -4 88 -13c60 -22 89 -71 89 -138c0 -171 -130 -324 -275 -324c-112 0 -160 46 -160 128c0 25 5 54 13 86l24 91c6 22 14 49 15 66c0 16 -3 27 -17 27c-20 0 -45 -26 -64 -49l-20 18c34 52 98 101 168 101c40 0 57 -19 57 -48c0 -13 -6 -45 -12 -67 l-38 -144c-7 -27 -16 -91 -16 -111c0 -50 24 -69 52 -69c96 0 154 268 154 356c0 57 -24 63 -58 63"],966:[462,205,678,-3,619,"195 16l37 139c21 79 59 166 117 226c37 38 83 69 139 69c75 0 131 -38 131 -139c0 -89 -39 -190 -113 -259c-48 -45 -111 -65 -205 -65l-51 -192h-114l51 192c-120 0 -190 48 -190 148c0 151 96 327 306 327h40v-27c-62 0 -120 -9 -166 -82c-43 -69 -61 -163 -61 -231 c0 -87 40 -106 79 -106zM369 253l-60 -237c29 0 77 18 102 47c59 70 89 158 89 255c0 63 -8 103 -32 103c-49 0 -85 -114 -99 -168"],967:[462,205,404,-136,515,"515 449l-300 -372l10 -88c8 -72 32 -96 52 -96c24 0 53 10 64 70h27c-8 -111 -52 -168 -117 -168c-57 0 -70 81 -73 162l-3 90l-187 -236h-124l307 373l-6 78c-7 85 -29 102 -62 102c-21 0 -52 -17 -61 -68h-27c8 62 35 166 120 166c54 0 66 -53 72 -157l5 -85l179 229 h124"],968:[462,205,652,-5,715,"715 462v-27c-70 -6 -111 -84 -130 -155c-38 -141 -108 -293 -293 -293l-51 -192h-114l51 192c-97 0 -161 58 -161 147c0 92 42 157 42 217c0 40 -17 77 -64 84v27h57c102 0 120 -55 120 -116c0 -60 -36 -199 -36 -265c0 -43 18 -65 51 -65l116 433h114l-116 -433 c25 0 46 9 67 38c99 135 78 408 302 408h45"],969:[462,13,735,-3,676,"473 435v27c114 0 162 -34 186 -81c11 -21 17 -45 17 -72c0 -119 -84 -274 -212 -313c-19 -6 -41 -9 -62 -9c-49 0 -96 16 -112 62c-30 -42 -87 -62 -141 -62c-31 0 -62 6 -86 20c-41 23 -66 68 -66 120c0 117 43 202 103 260c50 47 112 75 220 75v-27 c-44 0 -76 -6 -101 -34c-65 -71 -103 -201 -103 -318c0 -35 13 -67 47 -67c49 0 86 49 108 109c0 12 -1 29 -1 49c0 81 37 197 106 197c24 0 37 -27 37 -65c0 -19 -4 -42 -10 -65c-11 -40 -47 -103 -54 -115c-2 -13 -3 -26 -3 -38c0 -42 15 -72 53 -72 c106 0 158 271 158 334c0 20 -2 37 -8 52c-9 23 -32 33 -76 33"],976:[696,12,500,42,479,"479 617c0 -123 -201 -131 -288 -130c-39 -57 -65 -121 -87 -186c52 49 103 87 177 87c95 0 151 -93 151 -180c0 -121 -102 -220 -222 -220c-131 0 -168 132 -168 240c0 132 61 342 175 422c31 22 96 46 134 46c53 0 128 -11 128 -79zM413 640c0 13 -1 32 -19 32 c-70 0 -151 -100 -184 -155c55 1 122 12 164 51c19 18 39 45 39 72zM363 268c0 35 -22 73 -61 73c-63 0 -182 -173 -182 -232c0 -34 19 -77 58 -77c58 0 185 180 185 236"],977:[698,13,582,8,589,"589 235l-5 -31c-39 2 -64 6 -97 12c-48 -121 -110 -229 -234 -229c-112 0 -160 46 -160 128c0 39 16 76 16 107c0 16 -3 27 -17 27c-20 0 -45 -26 -64 -49l-20 18c34 52 96 101 166 101c40 0 59 -19 59 -48c0 -13 -6 -49 -11 -67c-19 -73 -19 -99 -19 -119 c0 -49 23 -69 50 -69c51 0 96 109 128 228c-148 54 -204 152 -204 252c0 137 100 202 194 202c46 0 62 -8 94 -26c61 -34 80 -111 80 -190c0 -76 -20 -158 -44 -228c29 -8 51 -15 88 -19zM429 541c0 67 -15 119 -60 119c-48 0 -80 -64 -80 -149c0 -30 0 -145 105 -212 c13 55 35 159 35 242"],978:[685,0,611,21,696,"356 411h4c36 109 104 272 237 272c73 0 99 -47 99 -93c0 -37 -27 -73 -67 -73c-45 0 -66 26 -66 55c0 26 11 42 24 54c0 5 -4 9 -15 9c-38 0 -79 -46 -107 -93c-30 -52 -61 -143 -86 -235l-52 -191c-5 -17 -10 -36 -10 -49c0 -31 17 -42 79 -42v-25h-323v25 c66 6 87 16 104 78l56 209c0 84 -17 304 -126 304c-21 0 -38 -6 -68 -29l-18 18c40 61 95 80 150 80c144 0 185 -144 185 -274"],981:[699,205,678,-3,619,"494 699l-65 -237c121 0 190 -42 190 -151c0 -90 -46 -194 -117 -259c-49 -45 -106 -65 -200 -65l-51 -192h-115l51 192c-119 0 -190 47 -190 148c0 149 99 327 317 327l62 237h118zM421 433l-113 -417c30 0 75 18 99 47c59 70 93 160 93 275c0 71 -30 95 -79 95zM195 16 l112 417c-56 0 -89 -18 -128 -80c-38 -60 -63 -147 -63 -230c0 -90 39 -107 79 -107"],982:[449,13,828,-2,844,"844 449l-21 -100h-60c5 -15 7 -41 7 -58c0 -143 -119 -304 -270 -304c-55 0 -88 24 -105 62c-36 -40 -82 -62 -132 -62c-36 0 -66 4 -90 18c-45 27 -62 76 -62 130c0 82 38 175 75 213h-22c-59 0 -108 -18 -139 -81h-27c23 81 84 182 248 182h598zM651 349h-364 c-32 -62 -57 -166 -57 -245c0 -51 17 -88 43 -88c43 0 80 46 102 106c-1 5 -3 30 -3 36c0 65 21 144 92 144c30 0 45 -24 45 -50c0 -53 -39 -111 -57 -138c-1 -10 -2 -17 -2 -26c0 -42 15 -72 53 -72c93 0 148 272 148 333"],984:[685,200,722,27,691,"166 -93l23 84c-99 24 -162 104 -162 230c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241c0 -128 -73 -271 -180 -366c-52 -46 -111 -76 -176 -89l-10 -37c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82zM547 528 c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],985:[462,205,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-36 -36 -78 -60 -124 -69l-54 -198h-115l56 201c-62 17 -102 64 -102 139c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322 c0 -44 19 -64 49 -64c26 0 50 15 71 49c49 80 86 220 86 307"],986:[685,205,669,32,665,"98 -120l26 24c27 -44 71 -63 114 -63c75 0 151 56 151 131c0 50 -54 78 -157 94c-108 17 -200 67 -200 189c0 254 229 430 472 430c82 0 161 -27 161 -86c0 -49 -26 -75 -64 -75c-90 0 -63 105 -178 105c-113 0 -271 -134 -271 -283c0 -184 239 -141 341 -226 c32 -27 45 -62 45 -98c0 -62 -38 -128 -87 -164c-55 -41 -126 -63 -198 -63c-58 0 -121 23 -155 85"],987:[492,205,475,-5,509,"486 492h23c-23 -182 -120 -228 -247 -233c-64 -3 -128 5 -167 -25c-26 -20 -38 -45 -38 -69c0 -45 25 -77 70 -77c27 0 81 18 114 18c75 0 116 -56 116 -122c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96 c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 45 -140 131c0 139 150 239 288 253c146 15 181 62 203 121"],988:[669,0,667,-13,670,"670 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -83 53 -167 53c-41 0 -53 -10 -63 -48l-60 -219h220l-13 -44h-219l-53 -194c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h543"],989:[450,190,525,32,507,"507 450l-20 -84h-203l-53 -231h153l-12 -50h-153l-63 -275h-124l148 640h327"],990:[793,18,757,-7,758,"758 570l-322 -425c-17 -23 -28 -40 -28 -62c0 -19 15 -29 33 -29c24 0 53 12 77 30l10 -20c-70 -56 -122 -82 -176 -82c-70 0 -95 36 -95 75c0 52 35 88 105 151l178 160v6l-538 -184l-9 15l321 425c13 17 28 42 28 64c0 19 -13 29 -31 29c-24 0 -55 -14 -79 -32l-10 20 c70 56 122 82 176 82c70 0 96 -35 96 -74c0 -43 -20 -75 -106 -152l-178 -159v-6l538 184"],991:[698,0,485,16,466,"466 399l-301 -399h-140l279 299h-288l301 399h140l-289 -299h298"],992:[685,205,734,27,710,"52 503l-25 28c127 115 229 154 381 154c217 0 302 -146 302 -317c0 -276 -227 -546 -503 -573v40c190 52 351 282 351 499c0 29 -4 56 -11 81c-114 -44 -211 -246 -236 -415h-161c30 186 197 395 388 456c-28 91 -111 163 -215 163c-10 0 -20 0 -29 -2l-64 -274h-46 l60 262c-70 -11 -132 -47 -192 -102"],993:[639,205,530,47,467,"47 605l24 34c241 -22 396 -242 396 -441c0 -152 -46 -296 -136 -403l-36 4c13 29 23 58 30 86c14 53 20 104 20 153c0 45 -5 89 -13 131l-181 -91l-12 38l185 92c-12 42 -24 81 -38 122l-184 -92l-12 38l180 90c-44 101 -109 190 -223 239"],1008:[462,15,569,-50,592,"592 449l-154 -146c-21 -43 -46 -129 -46 -170c0 -26 14 -36 36 -36c40 0 57 -26 57 -51s-16 -61 -69 -61c-59 0 -81 51 -81 105c0 46 17 113 39 153l-260 -243h-164l157 147c21 43 46 126 46 167c0 26 -14 36 -36 36c-40 0 -57 26 -57 51s16 61 69 61 c59 0 81 -51 81 -105c0 -46 -17 -110 -38 -150l256 242h164"],1009:[462,206,517,-12,458,"303 -206h-25c1 4 2 7 2 10c0 42 -90 -13 -205 69c-62 45 -87 116 -87 192c0 121 62 256 126 320c51 50 116 77 184 77c97 0 160 -59 160 -151c0 -94 -44 -188 -105 -249c-49 -49 -107 -75 -175 -75c-66 0 -107 34 -127 90h-2c0 -109 57 -151 133 -151c27 0 58 3 81 3 c45 0 77 -16 77 -54c0 -36 -8 -47 -37 -81zM339 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64c26 0 50 15 71 49c49 80 86 220 86 307"],1012:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM209 359h314c15 61 24 121 24 169c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120 c-28 -47 -55 -108 -75 -172zM511 315h-315c-16 -60 -25 -121 -25 -172c0 -75 39 -127 102 -127c64 0 108 41 157 114c32 47 60 115 81 185"],1013:[462,13,466,-3,429,"429 462l-26 -152h-27c0 52 -6 115 -80 115c-73 0 -132 -94 -152 -168h177l-10 -42h-177c-7 -21 -9 -43 -9 -66c0 -68 28 -98 73 -98c44 0 85 16 133 83l29 -18c-38 -53 -103 -129 -199 -129c-119 0 -164 68 -164 157c0 153 135 313 283 318c64 2 73 -31 93 -31 c10 0 28 17 33 31h23"],1014:[460,15,486,-5,427,"93 313l-29 18c38 53 103 129 199 129c119 0 164 -68 164 -157c0 -153 -135 -313 -283 -318c-64 -2 -73 31 -93 31c-10 0 -28 -17 -33 -31h-23l26 152h27c0 -52 6 -115 80 -115c73 0 132 94 152 168h-177l10 42h177c7 21 9 43 9 66c0 68 -28 98 -73 98 c-44 0 -85 -16 -133 -83"],8211:[269,-178,500,-40,477,"477 269l-17 -91h-500l17 91h500"],8212:[269,-178,1000,-40,977,"977 269l-17 -91h-1000l17 91h1000"],8216:[685,-369,333,128,332,"319 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73c-53 0 -83 40 -83 94c0 89 72 172 191 222"],8217:[685,-369,333,98,302,"111 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],8220:[685,-369,500,53,513,"500 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73c-53 0 -83 40 -83 94c0 89 72 172 191 222zM244 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73 c-53 0 -83 40 -83 94c0 89 72 172 191 222"],8221:[685,-369,500,53,513,"322 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222zM66 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94 c0 -89 -72 -172 -191 -222"],8224:[685,145,500,91,494,"352 560l-15 -19c-14 -18 -21 -37 -29 -74c31 1 44 4 82 23c25 12 35 16 50 16c33 0 54 -20 54 -52c0 -31 -24 -52 -58 -52c-12 0 -23 4 -46 17c-31 18 -51 24 -76 24h-11c-4 -23 -6 -38 -6 -56c0 -37 7 -70 26 -118c-39 -49 -75 -141 -109 -281 c-15 -63 -19 -76 -35 -133h-23l28 173c7 43 13 123 13 172c0 24 -1 44 -6 78c44 39 78 104 87 165c-35 -1 -40 -2 -75 -20c-28 -15 -41 -19 -61 -19c-31 0 -51 20 -51 51s20 51 52 51c16 0 29 -4 56 -17c40 -19 51 -22 83 -22c6 21 9 37 9 54c0 11 -2 22 -9 45 c-7 26 -10 42 -10 58c0 38 21 61 56 61c32 0 56 -23 56 -54c0 -22 -9 -42 -32 -71"],8225:[685,139,500,10,493,"268 471h13c5 21 6 33 6 55c0 20 -2 33 -8 58c-5 21 -6 31 -6 42c0 38 19 59 54 59c31 0 54 -22 54 -51c0 -17 -7 -33 -28 -62c-30 -42 -35 -53 -50 -102c40 4 50 6 93 23c23 9 36 13 47 13c28 0 50 -20 50 -47c0 -29 -23 -52 -53 -52c-12 0 -26 4 -51 16 c-42 19 -51 22 -89 25c-6 -23 -7 -35 -7 -68c0 -55 4 -72 24 -107c-50 -46 -67 -80 -91 -176c32 0 50 5 88 24c23 11 29 15 42 15h5c34 -1 52 -20 52 -49c0 -30 -21 -49 -53 -49c-13 0 -25 5 -49 16c-33 16 -53 21 -77 21h-12c-5 -20 -6 -32 -6 -55c0 -21 1 -32 8 -58 c6 -21 6 -31 6 -42c0 -38 -20 -59 -54 -59c-31 0 -54 21 -54 51c0 18 7 33 28 62c29 42 35 53 50 102c-40 -4 -52 -5 -93 -23c-23 -10 -36 -13 -47 -13c-28 0 -50 20 -50 47c0 29 23 52 52 52c13 0 27 -5 52 -16c42 -20 51 -22 89 -25c6 24 7 36 7 70c0 52 -4 70 -24 105 c50 46 67 80 91 176c-33 -1 -50 -5 -88 -24c-23 -11 -29 -15 -42 -15h-5c-33 1 -52 19 -52 49c0 29 21 49 52 49c14 0 26 -5 50 -16c33 -16 53 -21 76 -21"],8254:[838,-766,500,0,500,"500 766h-500v72h500v-72"],8260:[688,12,183,-168,345,"345 688l-439 -700h-74l441 700h72"],8467:[699,14,500,43,632,"43 429l26 38c40 -27 107 -51 128 -53c127 186 236 285 325 285c58 0 110 -25 110 -85c0 -77 -51 -147 -128 -194c-58 -36 -132 -59 -208 -65c-50 -84 -129 -215 -129 -286c0 -27 13 -33 25 -33c32 0 100 35 194 162l36 -27c-94 -132 -167 -185 -250 -185 c-68 0 -112 40 -112 121c0 70 49 172 103 255c-35 8 -96 43 -120 67zM333 421l1 -1c99 22 208 92 208 201c0 16 -5 28 -25 28c-57 0 -145 -155 -184 -228"],8706:[686,10,559,44,559,"234 627l2 23c30 25 79 36 119 36c130 0 204 -80 204 -256c0 -171 -103 -440 -328 -440c-120 0 -187 66 -187 176c0 159 139 293 298 293c50 0 115 -24 133 -70h4v8c1 9 2 18 2 27c0 114 -20 221 -154 221c-26 0 -58 -8 -93 -18zM423 293c0 91 -43 126 -89 126 c-88 0 -174 -152 -174 -265c0 -97 28 -124 88 -124c92 0 175 135 175 263"],9416:[690,19,695,0,695,"490 524l-22 -121h-15c-3 24 -6 43 -15 58c-13 22 -36 31 -65 31s-47 -17 -47 -47c0 -29 17 -44 57 -70c62 -42 93 -72 93 -127c0 -75 -72 -114 -137 -114c-24 0 -48 4 -75 13c-13 5 -21 6 -26 6c-10 0 -14 -3 -21 -19h-20l18 133h17c7 -59 42 -101 97 -101 c34 0 61 17 61 58c0 30 -20 49 -67 80c-48 31 -79 63 -79 112c0 68 56 108 119 108c31 0 47 -5 60 -10c8 -3 15 -6 23 -6c12 0 19 7 24 16h20zM695 335c0 -200 -151 -354 -346 -354c-199 0 -349 154 -349 357c0 200 153 352 354 352c190 0 341 -156 341 -355zM643 338 c0 168 -128 300 -299 300c-162 0 -292 -136 -292 -303c0 -168 130 -302 296 -302c168 0 295 135 295 305"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Main/BoldItalic/Main.js");
ddeveloperr/cdnjs
ajax/libs/mathjax/2.5.1/jax/output/SVG/fonts/STIX-Web/Main/BoldItalic/Main.js
JavaScript
mit
61,663
/* * /MathJax/jax/output/HTML-CSS/fonts/Asana-Math/Operators/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.AsanaMathJax_Operators={directory:"Operators/Regular",family:"AsanaMathJax_Operators",testString:"\u2206\u220A\u220C\u220E\u220F\u2210\u2211\u221B\u221C\u221F\u222C\u222D\u222E\u222F\u2230",32:[0,0,249,0,0],8710:[697,4,688,27,662],8714:[482,3,511,66,446],8716:[648,107,563,55,509],8718:[406,0,508,52,457],8719:[626,311,994,54,941],8720:[626,311,994,54,941],8721:[620,310,850,62,788],8731:[1048,59,739,63,772],8732:[1045,59,739,63,771],8735:[368,0,498,65,434],8748:[885,442,1132,54,1058],8749:[885,442,1496,54,1422],8750:[885,442,768,54,694],8751:[885,442,1132,54,1058],8752:[885,442,1496,54,1422],8753:[885,442,787,54,713],8754:[885,442,787,54,713],8755:[885,442,787,54,713],8758:[518,-23,249,66,184],8759:[518,-23,570,76,495],8760:[538,-286,668,65,604],8761:[518,-23,890,65,806],8762:[518,-23,668,65,604],8763:[518,-23,668,58,610],8766:[422,-123,729,32,706],8767:[587,3,784,34,750],8772:[596,55,668,65,604],8775:[596,55,668,65,604],8777:[596,55,668,58,611],8779:[614,-14,668,53,614],8780:[587,-134,668,58,610],8788:[518,-23,890,85,826],8789:[518,-23,890,65,806],8792:[587,-134,668,62,604],8793:[646,-134,687,65,623],8794:[646,-134,687,65,623],8795:[652,-134,687,65,623],8797:[658,-134,687,65,623],8798:[632,-134,687,65,623],8799:[751,-134,687,65,623],8802:[596,55,668,65,604],8803:[566,27,668,65,604],8813:[596,55,668,54,616],8820:[712,171,668,65,604],8821:[712,171,668,65,604],8824:[712,171,668,65,604],8825:[712,171,668,65,604],8836:[648,107,668,55,615],8837:[648,107,668,55,615],8844:[603,0,687,65,623],8845:[603,0,687,65,623],8860:[587,46,668,18,652],8870:[541,0,490,65,425],8871:[620,-1,709,85,624],8875:[541,0,748,64,684],8880:[652,118,748,75,673],8881:[652,118,748,75,674],8886:[446,-94,1363,65,1299],8887:[446,-94,1363,65,1299],8889:[505,-5,687,96,598],8893:[620,78,687,65,623],8894:[410,0,535,63,473],8895:[368,0,498,65,434],8896:[626,313,897,86,813],8897:[626,313,897,86,813],8898:[626,313,897,86,812],8899:[626,313,897,86,812],8903:[547,5,668,59,611],8917:[714,177,641,65,604],8924:[615,74,668,65,604],8925:[615,74,668,65,604],8930:[712,171,668,55,615],8931:[712,171,668,55,615],8932:[602,114,668,55,615],8933:[602,114,668,55,615],8944:[570,14,774,95,680],8946:[580,-22,876,53,824],8947:[533,-8,563,55,509],8948:[482,3,511,66,478],8949:[618,79,563,55,509],8950:[597,55,563,55,509],8951:[583,42,511,66,446],8952:[597,55,563,55,509],8953:[533,-8,563,55,509],8954:[580,-22,876,53,824],8955:[533,-8,563,55,509],8956:[482,3,511,66,478],8957:[597,55,563,55,509],8958:[583,42,511,66,446],8959:[697,0,617,46,572],10752:[830,316,1320,86,1235],10753:[833,316,1320,86,1235],10754:[833,316,1320,86,1235],10755:[741,198,897,86,812],10756:[741,198,897,86,812],10757:[734,192,897,86,812],10758:[734,192,897,86,812],10759:[626,313,1035,86,950],10760:[626,313,1035,86,950],10761:[734,192,1098,86,1013],10762:[882,434,1158,60,1069],10763:[885,442,850,27,764],10764:[885,442,1860,54,1786],10765:[885,442,768,54,694],10766:[885,442,768,54,694],10767:[885,442,768,54,694],10768:[885,442,768,54,694],10769:[885,442,810,54,736],10770:[885,442,768,54,694],10771:[885,442,768,54,694],10772:[885,442,768,54,694],10773:[885,442,768,54,694],10774:[885,442,768,54,694],10775:[885,442,1005,52,936],10776:[885,442,768,54,694],10777:[885,442,768,54,694],10778:[885,442,768,54,694],10779:[994,442,775,54,701],10780:[994,442,775,54,701],10781:[515,-23,758,65,694],10782:[535,-6,668,65,604],10783:[703,355,552,16,521],10784:[556,10,826,48,770],10785:[714,171,524,233,478],10786:[672,129,668,65,604],10787:[609,68,668,65,604],10788:[631,88,668,65,604],10789:[538,180,668,65,604],10790:[538,178,668,65,604],10791:[538,95,668,65,604],10792:[538,0,668,65,604],10793:[570,-233,605,51,555],10794:[289,-74,605,51,555],10795:[492,-30,605,51,555],10796:[492,-30,605,51,555],10797:[587,52,602,26,571],10798:[587,52,602,26,571],10799:[489,-53,554,59,496],10800:[688,5,668,59,611],10801:[545,142,668,59,611],10802:[547,5,760,58,702],10803:[554,11,671,53,619],10804:[587,52,603,54,550],10805:[587,52,603,54,550],10806:[634,192,668,18,652],10807:[587,46,668,18,652],10808:[587,46,668,18,652],10809:[559,18,666,44,623],10810:[559,18,666,44,623],10811:[559,18,666,44,623],10812:[360,-88,672,65,608],10813:[360,-88,672,65,608],10814:[703,166,396,54,344],10816:[573,30,687,65,623],10817:[573,30,687,65,623],10818:[634,91,687,65,623],10819:[634,91,687,65,623],10820:[578,25,687,65,623],10821:[578,25,687,65,623],10822:[622,80,407,64,344],10823:[622,80,407,64,344],10824:[622,80,407,64,344],10825:[622,80,407,64,344],10826:[422,-120,659,64,596],10827:[422,-120,659,64,596],10828:[601,58,779,64,716],10829:[601,58,779,64,716],10830:[559,17,687,65,623],10831:[559,17,687,65,623],10832:[601,58,779,64,716],10833:[570,29,537,57,481],10834:[570,29,537,57,481],10835:[563,22,687,65,623],10836:[563,22,687,65,623],10837:[563,22,836,65,772],10838:[563,22,836,65,772],10839:[598,42,670,66,605],10840:[598,41,669,66,604],10841:[621,79,687,65,623],10842:[563,22,687,65,623],10843:[563,22,687,65,623],10844:[563,22,687,65,623],10845:[563,22,687,65,623],10847:[720,27,687,65,623],10848:[640,267,687,65,623],10849:[497,-45,687,65,623],10850:[636,262,687,65,623],10851:[645,262,687,65,623],10852:[535,-6,668,65,604],10853:[535,-6,668,65,604],10854:[445,19,668,65,604],10855:[571,29,668,65,604],10856:[540,0,668,65,604],10857:[540,0,668,65,604],10858:[429,-113,668,58,611],10859:[500,-41,668,58,611],10860:[514,-14,668,56,614],10861:[581,39,668,65,604],10862:[530,-12,668,65,604],10863:[649,-51,668,58,611],10864:[596,55,668,65,604],10865:[667,126,668,66,604],10866:[667,126,668,66,604],10867:[507,-35,668,65,604],10868:[518,-23,1092,85,1028],10869:[406,-134,1347,85,1263],10870:[406,-134,1986,85,1902],10871:[599,58,668,65,604],10872:[567,25,668,65,604],10873:[535,-5,668,65,604],10874:[535,-5,668,65,604],10875:[623,82,668,65,604],10876:[623,82,668,65,604],10879:[615,74,668,65,604],10880:[615,74,668,65,604],10881:[615,74,668,65,604],10882:[615,74,668,65,604],10883:[700,159,668,65,604],10884:[700,159,668,65,604],10893:[672,186,668,65,604],10894:[672,186,668,65,604],10895:[821,279,668,65,604],10896:[821,279,668,65,604],10897:[755,159,668,65,604],10898:[755,159,668,65,604],10899:[944,279,668,65,604],10900:[944,279,668,65,604],10903:[615,74,668,65,604],10904:[615,74,668,65,604],10905:[672,131,668,65,604],10906:[672,131,668,65,604],10907:[701,147,668,66,605],10908:[701,147,668,66,605],10909:[605,122,668,65,604],10910:[605,122,668,65,604],10911:[801,193,668,65,604],10912:[801,193,668,65,604],10913:[535,-5,668,65,604],10914:[535,-5,668,65,604],10915:[606,61,965,55,912],10916:[535,-5,768,56,713],10917:[535,-5,1251,55,1198],10918:[535,-7,725,64,661],10919:[535,-7,725,64,662],10920:[613,74,725,64,661],10921:[613,74,725,64,662],10922:[553,5,713,65,649],10923:[553,5,713,65,649],10924:[635,61,713,65,649],10925:[635,61,713,65,649],10926:[550,8,668,65,604],10929:[623,134,668,65,604],10930:[623,134,668,65,604],10931:[680,139,668,65,604],10932:[680,139,668,65,604],10939:[553,14,1057,65,993],10940:[553,14,1057,65,993],10941:[533,-8,668,55,615],10942:[533,-8,668,55,615],10943:[588,46,465,65,401],10944:[588,46,465,65,401],10945:[623,81,465,65,401],10946:[623,81,465,65,401],10947:[645,103,607,65,543],10948:[645,103,607,65,543],10951:[656,115,668,55,615],10952:[656,115,668,55,615],10953:[739,227,668,55,615],10954:[739,227,668,55,615],10957:[543,-2,1145,64,1082],10958:[543,-2,1145,64,1082],10959:[533,-8,668,55,615],10960:[533,-8,668,55,615],10961:[603,61,668,55,615],10962:[603,61,668,55,615],10963:[611,69,407,53,355],10964:[611,69,407,53,355],10965:[611,69,407,53,355],10966:[611,69,407,53,355],10967:[410,-130,764,53,711],10968:[410,-130,764,53,711],10969:[498,-44,613,45,569],10970:[656,115,687,65,623],10971:[771,150,687,65,623],10972:[648,107,687,65,623],10973:[571,31,687,65,623],10974:[541,0,400,65,337],10975:[408,-136,670,65,607],10976:[408,-136,670,65,607],10977:[579,0,748,65,684],10978:[580,39,748,85,664],10979:[580,39,859,85,795],10980:[580,39,728,85,664],10981:[580,39,859,85,795],10982:[580,39,730,87,666],10983:[473,-70,670,65,607],10984:[473,-70,670,65,607],10985:[579,37,670,65,607],10986:[559,20,748,65,684],10987:[559,20,748,65,684],10988:[407,-135,672,65,608],10989:[407,-135,672,65,608],10990:[714,171,437,0,438],10991:[715,173,521,85,437],10992:[714,174,521,85,437],10993:[714,174,560,65,496],10994:[714,171,644,70,575],10995:[714,171,668,58,611],10996:[714,171,560,61,500],10997:[714,171,691,65,627],10998:[709,164,286,85,202],10999:[535,-7,668,65,604],11000:[535,-7,668,65,604],11001:[695,153,668,66,605],11002:[695,153,668,66,605],11003:[714,169,885,65,821],11004:[763,222,620,71,550],11005:[714,169,673,65,609],11006:[541,0,383,64,320],11007:[654,112,383,64,320]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"AsanaMathJax_Operators"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Operators/Regular/Main.js"]);
dmsanchez86/cdnjs
ajax/libs/mathjax/2.5.3/jax/output/HTML-CSS/fonts/Asana-Math/Operators/Regular/Main.js
JavaScript
mit
9,585
/* * /MathJax/jax/output/SVG/fonts/STIX-Web/Alphabets/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax.SVG.FONTDATA.FONTS.STIXMathJax_Alphabets={directory:"Alphabets/Regular",family:"STIXMathJax_Alphabets",id:"STIXWEBALPHABETS",32:[0,0,250,0,0,""],160:[0,0,250,0,0,""],900:[662,-507,277,113,240,"113 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],901:[662,-507,333,18,316,"316 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49c27 0 50 -23 50 -49zM113 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM117 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49 c27 0 50 -23 50 -49"],902:[683,0,722,15,707,"113 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM707 0h-255v19l45 4c14 1 24 15 24 29c0 15 -7 42 -19 70l-41 94h-262l-46 -114c-5 -13 -9 -30 -9 -42c0 -31 22 -41 70 -41v-19h-199v19c58 6 67 27 126 167l206 488h20 l246 -563c28 -65 42 -86 94 -92v-19zM447 257l-116 275l-115 -275h231"],903:[459,-348,278,81,192,"192 403c0 -30 -25 -55 -55 -55s-56 25 -56 55c0 32 24 56 56 56c30 0 55 -26 55 -56"],904:[683,0,750,8,737,"737 169l-46 -169h-539v19c77 5 87 18 87 95v436c0 74 -12 89 -87 93v19h529l5 -143h-25c-15 90 -38 105 -285 105c-28 0 -35 -4 -35 -36v-220h151c86 0 101 17 113 96h23v-234h-23c-12 84 -27 97 -113 97h-151v-243c0 -42 27 -47 101 -47c179 0 222 26 267 132h28z M8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],905:[683,0,850,8,836,"836 0h-279v19c78 5 88 21 88 105v191h-303v-202c0 -73 13 -90 87 -94l1 -19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h280v-19c-73 -6 -89 -17 -89 -95v-189h303v189c0 79 -13 89 -89 95v19h280v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19z M8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],906:[683,0,470,8,449,"8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM449 0h-297v19c84 3 97 15 97 93v439c0 79 -12 87 -97 92v19h297v-19c-84 -4 -98 -16 -98 -92v-439c0 -75 16 -90 98 -93v-19"],908:[683,14,722,8,688,"688 331c0 -206 -135 -345 -327 -345c-194 0 -327 140 -327 348c0 203 132 342 327 342c196 0 327 -147 327 -345zM574 337c0 114 -34 208 -91 256c-36 30 -76 47 -123 47c-54 0 -104 -22 -143 -67c-43 -49 -69 -146 -69 -241c0 -119 29 -209 90 -265 c34 -31 78 -45 124 -45c50 0 94 15 129 48c55 53 83 147 83 267zM8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],910:[683,0,840,8,818,"818 658v-19c-10 3 -21 5 -32 5c-139 0 -254 -160 -254 -340v-193c0 -78 19 -88 103 -92v-19h-306v19c90 6 101 15 101 104v172c-30 242 -102 328 -205 329c-18 0 -54 -11 -73 -18l-8 16c34 30 88 52 134 52c127 0 205 -82 230 -239h2c29 144 142 236 244 236 c22 0 41 -1 64 -13zM8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],911:[683,0,744,8,715,"715 0h-286l7 161c85 21 141 131 141 238c0 142 -74 241 -205 241c-136 0 -205 -121 -205 -241c0 -98 52 -213 140 -238l9 -161h-287v171h25c1 -61 18 -76 62 -76h151l-2 37c-139 39 -212 120 -212 265c0 136 117 279 319 279c198 0 319 -130 319 -279 c0 -146 -80 -227 -215 -265l-2 -37h154c41 0 60 24 62 74h25v-169zM8 528l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34"],912:[662,10,340,18,316,"316 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49c27 0 50 -23 50 -49zM113 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM117 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49 c27 0 50 -23 50 -49zM286 107l15 -8c-23 -48 -61 -109 -113 -109c-46 0 -59 45 -59 88v266c0 37 -11 49 -33 49c-9 0 -23 0 -42 -4v18c52 16 103 34 155 53l4 -4v-377c0 -10 5 -23 20 -23c22 0 30 10 53 51"],938:[873,0,333,18,316,"316 823c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM117 823c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM315 0h-297v19c84 3 97 15 97 93v439c0 79 -12 87 -97 92v19h297v-19 c-84 -4 -98 -16 -98 -92v-439c0 -75 16 -90 98 -93v-19"],939:[873,0,722,29,703,"515 823c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM316 823c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM703 658v-19c-10 3 -21 5 -32 5c-139 0 -254 -160 -254 -340v-193c0 -78 19 -88 103 -92v-19 h-306v19c90 6 101 15 101 104v172c-30 242 -102 328 -205 329c-18 0 -54 -11 -73 -18l-8 16c34 30 88 52 134 52c127 0 205 -82 230 -239h2c29 144 142 236 244 236c22 0 41 -1 64 -13"],940:[662,10,543,29,529,"217 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM514 129h15c0 -76 -29 -139 -79 -139c-41 0 -66 45 -80 110c-35 -63 -76 -110 -154 -110c-108 0 -187 97 -187 233c0 127 74 237 196 237c87 0 136 -74 154 -146l45 136h97 l-109 -263c10 -46 39 -135 69 -135c14 0 26 20 33 77zM331 208c-11 74 -37 224 -111 224c-50 0 -101 -45 -101 -159c0 -74 17 -255 106 -255c69 0 96 137 106 190"],941:[662,10,439,25,407,"153 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM393 145l14 -9c-45 -105 -117 -146 -192 -146c-173 0 -190 93 -190 132c0 54 45 104 100 113c-48 14 -77 52 -77 94c0 68 68 131 194 131c67 0 156 -25 156 -103 c0 -28 -25 -42 -47 -42c-24 0 -44 17 -44 42c0 19 4 24 4 34c0 27 -31 40 -87 40c-57 0 -93 -45 -93 -97c0 -46 28 -85 84 -85c30 0 36 9 61 9c26 0 38 -10 38 -21c0 -13 -16 -26 -48 -26c-17 0 -23 6 -44 6c-44 0 -107 -25 -107 -88c0 -58 53 -89 105 -89 c74 0 124 37 173 105"],942:[662,217,512,10,452,"168 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM452 -217h-85c-8 15 -15 31 -15 86v439c0 66 -23 97 -73 97c-33 0 -59 -13 -103 -57v-348h-84v313c0 66 -12 75 -20 75c-21 0 -39 -30 -48 -49l-14 6c25 53 60 110 103 110 c46 0 54 -19 60 -76h1c52 59 98 81 144 81c76 0 118 -60 118 -141v-451c0 -39 5 -67 16 -85"],943:[662,10,275,20,267,"80 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM252 107l15 -8c-23 -48 -61 -109 -113 -109c-46 0 -59 45 -59 88v266c0 37 -11 49 -33 49c-9 0 -23 0 -42 -4v18c52 16 103 34 155 53l4 -4v-377c0 -10 5 -23 20 -23 c22 0 30 10 53 51"],944:[662,10,524,16,494,"404 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49c27 0 50 -23 50 -49zM201 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM205 557c0 -27 -23 -50 -50 -50c-26 0 -49 23 -49 50c0 26 23 49 49 49 c27 0 50 -23 50 -49zM255 460h27c111 0 212 -78 212 -235c0 -130 -93 -235 -216 -235c-146 0 -180 95 -180 208v120c0 38 -3 70 -20 70c-20 0 -39 -30 -48 -49l-14 6c25 53 61 110 103 110s63 -23 63 -70v-211c0 -57 20 -156 102 -156c87 0 120 91 120 191 c0 57 -15 127 -50 173c-28 36 -60 55 -99 58v20"],970:[622,10,340,18,316,"316 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM117 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM276 107l15 -8c-23 -48 -61 -109 -113 -109c-46 0 -59 45 -59 88v266c0 37 -11 49 -33 49 c-9 0 -23 0 -42 -4v18c52 16 103 34 155 53l4 -4v-377c0 -10 5 -23 20 -23c22 0 30 10 53 51"],971:[622,10,524,16,494,"404 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM205 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM255 460h27c111 0 212 -78 212 -235c0 -130 -93 -235 -216 -235c-146 0 -180 95 -180 208 v120c0 38 -3 70 -20 70c-20 0 -39 -30 -48 -49l-14 6c25 53 61 110 103 110s63 -23 63 -70v-211c0 -57 20 -156 102 -156c87 0 120 91 120 191c0 57 -15 127 -50 173c-28 36 -60 55 -99 58v20"],972:[662,10,505,35,473,"191 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM473 228c0 -116 -100 -238 -221 -238c-119 0 -217 92 -217 212c0 127 86 258 224 258c136 0 214 -102 214 -232zM384 191c0 85 -38 237 -145 237c-87 0 -115 -115 -115 -184 c0 -83 42 -222 145 -222c80 0 115 103 115 169"],973:[662,10,524,16,494,"192 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM255 460h27c111 0 212 -78 212 -235c0 -130 -93 -235 -216 -235c-146 0 -180 95 -180 208v120c0 38 -3 70 -20 70c-20 0 -39 -30 -48 -49l-14 6c25 53 61 110 103 110 s63 -23 63 -70v-211c0 -57 20 -156 102 -156c87 0 120 91 120 191c0 57 -15 127 -50 173c-28 36 -60 55 -99 58v20"],974:[662,10,625,29,595,"247 507l59 132c7 15 17 23 38 23c13 0 30 -9 30 -29c0 -12 -11 -26 -27 -45l-66 -81h-34zM361 445v15c133 0 234 -74 234 -249c0 -74 -16 -128 -48 -165s-69 -56 -111 -56c-58 0 -100 32 -124 96c-28 -64 -70 -96 -126 -96c-40 0 -76 19 -109 56c-33 38 -48 92 -48 163 c0 175 103 251 234 251v-15c-83 0 -144 -81 -144 -227c0 -92 11 -200 81 -200c45 0 73 46 85 128c-12 39 -18 62 -18 105c0 73 22 98 45 98s45 -28 45 -96c0 -40 -6 -65 -18 -107c9 -81 47 -128 82 -128c76 0 84 98 84 190c0 154 -51 237 -144 237"],1025:[872,0,629,22,607,"485 822c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM286 822c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM607 169l-46 -169h-539v19c77 5 87 18 87 95v436c0 74 -12 89 -87 93v19h530l4 -143h-24 c-15 90 -39 105 -155 105h-131c-28 0 -35 -4 -35 -36v-221h151c86 0 101 17 113 96h23v-233h-23c-12 84 -27 97 -113 97h-151v-242c0 -42 27 -47 101 -47h36c143 0 186 25 231 131h28"],1026:[662,189,756,18,700,"327 596v-263c16 21 48 55 89 77c31 17 82 26 116 26c136 0 168 -136 168 -254c0 -100 -14 -217 -58 -292c-28 -48 -69 -79 -127 -79c-53 0 -104 30 -104 81c0 29 18 65 58 65c27 0 51 -20 51 -50c0 -11 -5 -27 -5 -35c0 -15 8 -24 18 -24c52 0 52 228 52 324 c0 115 0 200 -101 200c-43 0 -105 -22 -157 -78v-175c0 -81 15 -96 85 -100v-19h-283v19c78 2 96 13 96 100v469c0 26 -11 36 -34 36h-15c-93 0 -107 -14 -127 -95c-3 -11 -5 -21 -7 -35h-24l7 168h512l5 -168h-24c-1 8 -6 26 -10 40c-23 79 -66 90 -137 90h-9 c-25 0 -35 -7 -35 -28"],1027:[928,0,571,19,544,"251 757l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32c0 -16 -9 -29 -30 -42l-154 -97h-40zM544 483h-24c-1 8 -6 36 -10 50c-23 79 -80 91 -126 91h-141c-28 0 -35 -4 -35 -36v-476c0 -75 13 -89 91 -93v-19h-280v19c75 5 87 17 87 95v436c0 74 -12 89 -87 93v19h520"],1028:[676,14,651,38,621,"602 129l19 -18c-55 -81 -138 -125 -251 -125c-93 0 -180 32 -236 89c-58 60 -96 145 -96 244c0 100 32 183 86 249c60 73 144 108 233 108c37 0 76 -4 114 -15c20 -6 53 -18 69 -18c18 0 35 12 40 33h20l4 -228h-24c-11 55 -20 85 -44 112c-42 47 -95 76 -157 76 c-133 0 -216 -111 -224 -269h291v-44h-292c0 -65 11 -122 35 -168c38 -75 106 -125 200 -125c86 0 140 30 213 99"],1029:[676,14,556,62,510,"488 463h-25c-12 44 -23 70 -41 94c-35 45 -85 83 -145 83c-62 0 -101 -45 -101 -100c0 -68 74 -110 179 -171c106 -62 155 -120 155 -196c0 -112 -88 -187 -204 -187c-42 0 -81 7 -118 23c-19 8 -36 11 -47 11c-15 0 -28 -12 -28 -33h-22l-29 212h22 c46 -121 111 -177 206 -177c70 0 118 46 118 112c0 35 -10 58 -29 79c-35 38 -103 82 -167 116c-90 48 -122 110 -122 172c0 109 75 175 174 175c41 0 67 -6 105 -22c18 -8 34 -12 44 -12c17 0 28 12 32 34h21"],1030:[662,0,333,18,315,"315 0h-297v19c84 3 97 15 97 93v439c0 79 -12 87 -97 92v19h297v-19c-84 -4 -98 -16 -98 -92v-439c0 -75 16 -90 98 -93v-19"],1031:[872,0,333,25,323,"323 822c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM124 822c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM322 0h-297v19c84 3 97 15 97 93v439c0 79 -12 87 -97 92v19h297v-19 c-84 -4 -98 -16 -98 -92v-439c0 -75 16 -90 98 -93v-19"],1032:[662,14,373,-6,354,"354 662v-19c-81 -6 -92 -17 -92 -94v-364c0 -137 -61 -199 -167 -199c-60 0 -101 25 -101 72c0 26 22 52 49 52c23 0 38 -14 49 -42c10 -25 11 -44 31 -44c31 0 37 20 37 70v456c0 81 -12 86 -93 93v19h287"],1033:[662,14,988,10,954,"576 366h109c154 0 269 -49 269 -184c0 -115 -94 -182 -239 -182h-337v19c79 2 96 18 96 94v472c0 28 -8 39 -35 39h-141c-29 0 -35 -12 -35 -39v-324c0 -100 -2 -275 -151 -275c-58 0 -102 14 -102 73c0 39 33 55 56 55c55 0 50 -79 80 -79c67 0 71 152 71 255v260 c0 77 -28 92 -86 93v19h534v-19c-75 -6 -89 -18 -89 -95v-182zM576 326v-243c0 -34 16 -45 62 -45c112 0 201 22 201 141s-90 147 -185 147h-78"],1034:[662,0,1017,19,983,"605 366h109c154 0 269 -49 269 -184c0 -115 -94 -182 -239 -182h-337v19c79 2 96 18 96 94v213h-293v-213c0 -73 14 -90 88 -94v-19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h279v-19c-73 -6 -88 -17 -88 -95v-182h293v182c0 79 -12 89 -88 95v19h279v-19 c-74 -6 -89 -18 -89 -95v-182zM605 326v-243c0 -34 16 -45 62 -45c112 0 201 22 201 141s-90 147 -185 147h-78"],1035:[662,0,803,18,786,"786 0h-283v19c78 2 96 13 96 100v120c0 87 -47 133 -108 133c-48 0 -112 -22 -164 -78v-175c0 -81 19 -96 89 -100v-19h-287v19c78 2 96 13 96 100v469c0 26 -11 36 -34 36h-15c-93 0 -107 -14 -127 -95c-3 -11 -5 -23 -7 -37h-24l7 170h510l5 -168h-24 c-1 8 -6 26 -10 40c-23 79 -64 90 -135 90h-9c-25 0 -35 -7 -35 -28v-263c28 36 72 60 104 77c30 16 63 26 102 26c102 0 168 -64 168 -195v-122c0 -81 15 -96 85 -100v-19"],1036:[928,0,690,19,686,"255 757l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32c0 -16 -9 -29 -30 -42l-154 -97h-40zM686 0h-191c-32 29 -66 83 -118 171c-50 84 -96 128 -109 137c-13 8 -32 13 -56 14v-211c0 -77 16 -86 89 -92v-19h-282v19c79 4 91 23 91 110v420c0 74 -11 89 -90 94v19h282 v-19c-83 -6 -90 -18 -90 -95v-186c33 0 58 2 71 7c76 27 99 90 125 165c28 81 64 142 154 142c50 0 75 -28 75 -63c0 -24 -14 -58 -49 -58c-57 0 -49 57 -75 57c-34 0 -55 -60 -73 -111c-29 -84 -63 -134 -112 -156v-2c56 -23 90 -52 133 -114c55 -80 91 -142 124 -169 s61 -40 101 -41v-19"],1038:[915,15,711,15,694,"510 848c0 -62 -82 -91 -135 -91s-135 30 -135 91c0 44 34 67 62 67c14 0 24 -8 24 -25c0 -33 -44 -17 -44 -41c0 -22 21 -40 93 -40s93 18 93 40c0 24 -44 8 -44 41c0 17 13 25 27 25c30 0 59 -23 59 -67zM694 662v-18c-49 -6 -85 -39 -111 -100l-127 -300 c-33 -77 -59 -132 -80 -165c-41 -65 -90 -94 -143 -94c-44 0 -80 20 -80 54c0 23 18 42 46 42c13 0 30 -6 49 -17c12 -7 22 -10 28 -10c26 0 55 27 87 80l-240 422c-17 30 -34 51 -49 63s-34 21 -59 25v18h268v-18c-47 -2 -71 -15 -71 -38c0 -17 18 -55 53 -116l144 -254 l106 254c22 53 33 89 33 107c0 26 -21 41 -62 47v18h208"],1039:[662,153,715,19,696,"696 0h-189c-56 0 -103 -22 -126 -101c-4 -13 -9 -41 -10 -50v-2h-24v2c-2 9 -6 37 -10 50c-23 79 -70 101 -126 101h-192v19c74 6 89 18 89 95v437c0 71 -14 86 -89 92v19h279v-19c-78 -5 -88 -21 -88 -105v-470c0 -26 7 -30 35 -30h225c28 0 35 4 35 31v480 c0 73 -13 90 -87 94v19h278v-19c-78 -5 -89 -17 -89 -103v-426c0 -79 19 -88 89 -95v-19"],1040:[674,0,713,9,701,"701 0h-255v19c36 0 43 2 55 9c8 4 14 15 14 24c0 15 -7 42 -19 70l-41 94h-262l-46 -114c-5 -13 -9 -30 -9 -42c0 -31 22 -41 70 -41v-19h-199v19c58 6 67 27 126 167l206 488h20l246 -563c28 -65 42 -86 94 -92v-19zM441 256l-116 276l-115 -276h231"],1041:[662,0,611,19,577,"217 366h74c125 0 286 -20 286 -184c0 -111 -94 -182 -239 -182h-319v19c78 2 96 18 96 94v437c0 78 -15 88 -96 93v19h512l5 -168h-24c-1 8 -6 26 -10 40c-23 79 -80 90 -126 90h-124c-28 0 -35 -8 -35 -36v-222zM217 326v-243c0 -34 1 -45 44 -45c112 0 201 22 201 141 s-90 147 -185 147h-60"],1042:[662,0,651,19,595,"424 359v-1c66 -11 93 -29 122 -55c32 -29 49 -71 49 -115c0 -111 -94 -188 -239 -188h-337v19c79 2 96 18 96 94v437c0 79 -15 88 -96 93v19h280c173 0 262 -51 262 -157c0 -41 -16 -82 -41 -104c-24 -21 -44 -29 -96 -42zM217 376h92c101 0 150 41 150 124 c0 84 -58 124 -177 124h-41c-17 0 -24 -9 -24 -32v-216zM217 336v-253c0 -34 16 -45 62 -45c84 0 119 4 163 43c25 22 38 65 38 108c0 48 -14 85 -47 107c-60 40 -98 40 -216 40"],1043:[662,0,571,19,544,"544 483h-24c-1 8 -6 36 -10 50c-23 79 -80 91 -126 91h-141c-28 0 -35 -4 -35 -36v-476c0 -75 13 -89 91 -93v-19h-280v19c75 5 87 17 87 95v436c0 74 -12 89 -87 93v19h520"],1044:[662,153,665,14,646,"646 -153h-24c-1 8 -6 38 -10 52c-23 79 -70 101 -126 101h-312c-56 0 -103 -22 -126 -101c-4 -14 -9 -44 -10 -52h-24v172h20c107 0 145 138 146 531c0 77 -28 92 -86 93v19h552v-19c-75 -6 -89 -18 -89 -95v-433c0 -64 11 -96 89 -96v-172zM455 82v506 c0 28 -8 36 -35 36h-159c-25 0 -35 0 -35 -36c0 -313 -18 -468 -73 -550h265c29 0 37 13 37 44"],1045:[662,0,629,22,607,"607 169l-46 -169h-539v19c77 5 87 18 87 95v436c0 74 -12 89 -87 93v19h530l4 -143h-24c-15 90 -39 105 -155 105h-131c-28 0 -35 -4 -35 -36v-221h151c86 0 101 17 113 96h23v-233h-23c-12 84 -27 97 -113 97h-151v-242c0 -42 27 -47 101 -47h36c143 0 186 25 231 131 h28"],1046:[676,0,1021,8,1013,"1013 0h-191c-32 29 -65 80 -118 167c-76 125 -74 155 -145 155v-211c0 -77 15 -87 87 -92v-19h-261v19c72 4 77 16 77 92v211c-73 0 -69 -30 -145 -155c-53 -87 -86 -138 -118 -167h-191v19c121 22 138 80 225 206c43 62 72 96 128 119l2 2c-49 22 -76 72 -107 155 c-19 51 -40 108 -74 108c-26 0 -18 -57 -76 -57c-35 0 -49 33 -49 57c0 35 29 67 79 67c86 0 121 -61 151 -142c36 -96 68 -172 175 -172v187c0 76 -8 90 -90 94v19h277v-19c-83 -6 -90 -18 -90 -95v-186c122 0 136 76 174 172c32 81 65 142 151 142c50 0 79 -32 79 -67 c0 -24 -14 -57 -49 -57c-58 0 -50 57 -76 57c-34 0 -55 -57 -74 -108c-31 -83 -58 -133 -107 -155l3 -2c56 -23 85 -57 128 -119c87 -126 104 -184 225 -206v-19"],1047:[676,14,576,28,545,"354 349v-1c91 -6 191 -65 191 -158c0 -74 -39 -129 -100 -164c-49 -28 -96 -40 -163 -40c-115 0 -198 46 -254 128l18 17c74 -70 131 -101 210 -101c114 0 174 54 174 152c0 50 -27 87 -62 110c-43 28 -67 34 -159 34v40c89 0 107 6 142 27c51 30 58 82 58 121 c0 71 -57 124 -148 124c-108 0 -176 -81 -191 -198h-24l4 236h20c5 -21 20 -33 38 -33c16 0 51 12 71 18c37 10 69 15 105 15c164 0 227 -73 227 -169c0 -89 -75 -149 -157 -158"],1048:[662,0,723,19,704,"704 0h-279v19c78 5 88 21 88 105v379l-303 -407c0 -57 19 -74 87 -77l1 -19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h280v-19c-73 -6 -89 -17 -89 -95v-384l303 405c0 57 -21 68 -89 74v19h280v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19"],1049:[915,0,723,19,704,"496 848c0 -62 -82 -91 -135 -91s-135 30 -135 91c0 44 34 67 62 67c14 0 24 -8 24 -25c0 -33 -44 -17 -44 -41c0 -22 21 -40 93 -40s93 18 93 40c0 24 -44 8 -44 41c0 17 13 25 27 25c30 0 59 -23 59 -67zM704 0h-279v19c78 5 88 21 88 105v379l-303 -407 c2 -59 19 -74 87 -77l1 -19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h280v-19c-73 -6 -89 -17 -89 -95v-384l302 405c-3 60 -20 68 -88 74v19h280v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19"],1050:[676,0,690,19,686,"686 0h-191c-32 29 -66 83 -118 171c-50 84 -96 128 -109 137c-13 8 -32 13 -56 14v-211c0 -77 16 -86 89 -92v-19h-282v19c79 4 91 23 91 110v420c0 74 -11 89 -90 94v19h282v-19c-83 -6 -90 -18 -90 -95v-186c33 0 58 2 71 7c76 27 99 90 125 165c28 81 64 142 154 142 c50 0 75 -28 75 -63c0 -24 -14 -58 -49 -58c-57 0 -49 57 -75 57c-34 0 -55 -60 -73 -111c-29 -84 -63 -134 -112 -156v-2c56 -23 90 -52 133 -114c55 -80 91 -142 124 -169s61 -40 101 -41v-19"],1051:[662,14,683,9,664,"664 0h-279v19c78 5 88 21 88 106v460c0 28 -8 39 -35 39h-141c-29 0 -35 -12 -35 -39v-324c0 -100 -2 -275 -151 -275c-58 0 -102 14 -102 73c0 39 33 55 56 55c55 0 50 -79 80 -79c67 0 71 152 71 255v260c0 77 -28 92 -86 93v19h534v-19c-75 -6 -89 -18 -89 -95v-437 c0 -71 14 -86 89 -92v-19"],1052:[662,0,893,19,871,"871 0h-280v19c79 5 90 21 90 104v449l-255 -572h-14l-252 549v-398c0 -110 16 -128 93 -132v-19h-234v19c83 6 97 20 97 132v398c0 76 -13 89 -95 94v19h198l231 -502l221 502h199v-19c-72 -1 -87 -18 -87 -93v-438c0 -71 15 -88 88 -93v-19"],1053:[662,0,726,19,704,"704 0h-279v19c78 5 88 21 88 105v191h-303v-202c0 -73 14 -90 88 -94v-19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h279v-19c-73 -6 -88 -17 -88 -95v-189h303v189c0 79 -12 89 -88 95v19h279v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19"],1054:[676,14,729,36,690,"690 331c0 -206 -135 -345 -327 -345c-194 0 -327 140 -327 348c0 203 132 342 327 342c196 0 327 -147 327 -345zM576 337c0 114 -34 208 -91 256c-36 30 -76 47 -123 47c-54 0 -104 -22 -143 -67c-43 -49 -69 -146 -69 -241c0 -119 29 -209 90 -265 c34 -31 78 -45 124 -45c50 0 94 15 129 48c55 53 83 147 83 267"],1055:[662,0,724,19,705,"705 0h-279v19c78 5 88 21 88 105v460c0 31 -10 40 -37 40h-229c-29 0 -38 -9 -38 -41v-470c0 -73 14 -90 88 -94v-19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h686v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19"],1056:[662,0,571,19,535,"19 662h249c100 0 172 -25 217 -63c33 -28 50 -69 50 -119c0 -53 -20 -98 -57 -131c-58 -52 -107 -61 -214 -61c-26 0 -32 1 -59 3v-179c0 -76 13 -89 94 -93v-19h-280v19c78 6 84 17 84 103v429c0 74 -10 86 -84 92v19zM205 588v-257c23 -2 31 -3 51 -3 c110 0 170 57 170 147c0 110 -50 149 -186 149c-29 0 -35 -9 -35 -36"],1057:[676,14,677,36,641,"622 131l19 -18c-58 -83 -155 -127 -273 -127c-91 0 -178 32 -236 89c-61 60 -96 151 -96 250c0 100 33 183 90 247c64 71 150 104 243 104c39 0 79 -4 119 -15c21 -6 52 -18 69 -18c19 0 36 12 42 33h20l9 -227h-23c-12 55 -27 84 -52 111c-44 47 -96 76 -161 76 c-151 0 -240 -122 -240 -295c0 -110 25 -188 72 -239c44 -47 109 -72 178 -72c90 0 145 30 220 101"],1058:[662,0,618,30,592,"592 492h-24c-22 110 -41 128 -147 128h-59v-509c0 -76 14 -88 96 -92v-19h-292v19c83 5 94 16 94 104v497h-60c-106 0 -126 -18 -146 -128h-24l7 170h548"],1059:[662,15,711,15,694,"694 662v-18c-49 -6 -85 -39 -111 -100l-127 -300c-33 -77 -59 -132 -80 -165c-41 -65 -90 -94 -143 -94c-44 0 -80 20 -80 54c0 23 18 42 46 42c13 0 30 -6 49 -17c12 -7 22 -10 28 -10c26 0 55 27 87 80l-240 422c-17 30 -34 51 -49 63s-34 21 -59 25v18h268v-18 c-47 -2 -71 -15 -71 -38c0 -17 18 -55 53 -116l144 -254l106 254c22 53 33 89 33 107c0 26 -21 41 -62 47v18h208"],1060:[662,0,769,38,731,"435 580v-20c139 0 296 -64 296 -230c0 -158 -161 -227 -271 -227h-25v-27c0 -43 19 -53 103 -57v-19h-306v19c66 0 101 16 101 56v28h-17c-188 0 -278 96 -278 227c0 166 153 230 295 230v20c0 45 -15 63 -101 63v19h306v-19c-87 0 -103 -22 -103 -63zM433 523v-383 c93 0 189 65 189 178c0 97 -60 205 -189 205zM335 140v383c-111 0 -188 -107 -188 -205c0 -94 67 -178 188 -178"],1061:[662,0,716,9,703,"703 0h-296v19l26 2c32 2 50 11 50 29c0 16 -17 47 -51 98l-95 141l-119 -149c-37 -46 -53 -74 -53 -89c0 -19 18 -28 76 -32v-19h-232v19c52 5 68 17 145 114l156 195l-106 155c-96 141 -117 153 -183 160v19h301v-19l-29 -2c-28 -2 -46 -5 -46 -28 c0 -29 30 -67 83 -145l44 -64l112 140c30 37 40 52 40 67c0 23 -14 30 -68 32v19h237v-19c-64 -4 -89 -21 -152 -99l-143 -177l192 -274c39 -56 58 -68 111 -74v-19"],1062:[662,153,715,19,696,"696 -153h-24c-1 8 -6 38 -10 52c-23 79 -70 101 -126 101h-517v19c74 6 89 18 89 95v437c0 71 -14 86 -89 92v19h279v-19c-78 -5 -88 -21 -88 -105v-470c0 -26 7 -30 35 -30h225c28 0 35 4 35 31v480c0 73 -13 90 -87 94v19h278v-19c-78 -5 -89 -17 -89 -103v-426 c0 -78 12 -89 89 -95v-172"],1063:[662,0,657,3,639,"639 0h-279v19c74 6 88 18 88 95v201c-34 -18 -99 -46 -182 -46c-101 0 -174 19 -174 154v124c0 79 -12 90 -89 96v19h275v-19c-73 -6 -84 -16 -84 -96v-115c0 -88 29 -119 116 -119c63 0 117 26 138 34v220c0 61 -6 70 -75 76v19h266v-19c-74 -6 -89 -16 -89 -105v-424 c0 -77 14 -89 89 -95v-19"],1064:[662,0,994,29,965,"965 0h-936v19c74 6 89 18 89 95v437c0 71 -14 86 -89 92v19h266v-19c-65 0 -75 -21 -75 -105v-470c0 -26 7 -30 35 -30h151c28 0 35 4 35 31v482c0 71 -9 84 -75 92v19h265v-19c-78 -5 -88 -21 -88 -105v-471c0 -25 7 -29 35 -29h163c25 0 33 4 33 31v480 c0 73 -13 90 -87 94l-1 19h279v-19c-78 -5 -89 -17 -89 -103v-426c0 -78 12 -89 89 -95v-19"],1065:[662,153,994,29,965,"965 -153h-24c0 3 -6 38 -10 52c-23 79 -70 101 -126 101h-776v19c74 6 89 18 89 95v437c0 71 -14 86 -89 92v19h266v-19c-65 0 -75 -21 -75 -105v-470c0 -26 7 -30 35 -30h151c28 0 35 4 35 31v482c0 71 -9 84 -75 92v19h265v-19c-78 -5 -88 -21 -88 -105v-471 c0 -25 7 -29 35 -29h163c25 0 33 4 33 31v480c0 73 -13 90 -87 94l-1 19h279v-19c-78 -5 -89 -17 -89 -103v-426c0 -78 12 -89 89 -95v-172"],1066:[662,0,737,13,703,"342 366h96c154 0 265 -49 265 -184c0 -115 -96 -182 -241 -182h-318v19c79 2 96 18 96 94v507h-60c-106 0 -123 -17 -143 -128h-24l7 170h418v-19c-74 -6 -96 -18 -96 -95v-182zM342 326v-243c0 -34 9 -45 49 -45c108 0 197 22 197 141s-86 147 -181 147h-65"],1067:[662,0,884,19,865,"865 0h-280v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h280v-19c-73 -6 -89 -17 -89 -95v-434c0 -73 15 -91 89 -95v-19zM217 366h99c154 0 263 -49 263 -184c0 -115 -94 -182 -239 -182h-321v19c79 2 96 18 96 94v437c0 79 -15 88 -96 93v19h294v-19 c-74 -6 -96 -18 -96 -95v-182zM217 326v-243c0 -34 6 -45 52 -45c112 0 195 22 195 141s-84 147 -179 147h-68"],1068:[662,0,612,19,578,"217 366h99c154 0 262 -49 262 -184c0 -115 -94 -182 -239 -182h-320v19c79 2 96 18 96 94v437c0 79 -15 88 -96 93v19h294v-19c-74 -6 -96 -18 -96 -95v-182zM217 326v-243c0 -34 6 -45 52 -45c112 0 194 22 194 141s-83 147 -178 147h-68"],1069:[676,14,651,30,613,"51 676h20c5 -21 22 -33 40 -33c16 0 49 12 69 18c38 11 77 15 114 15c89 0 173 -35 233 -108c54 -66 86 -149 86 -249c0 -99 -38 -184 -96 -244c-56 -57 -143 -89 -236 -89c-113 0 -196 44 -251 125l19 18c73 -69 127 -99 213 -99c94 0 162 50 200 125 c24 46 35 103 35 168h-292v44h291c-8 158 -91 269 -224 269c-62 0 -115 -29 -157 -76c-24 -27 -33 -57 -44 -112h-24"],1070:[676,14,902,19,863,"210 359h88c9 189 122 317 283 317c169 0 282 -147 282 -345c0 -206 -117 -345 -282 -345c-162 0 -276 131 -283 329h-88v-202c0 -73 14 -90 88 -94v-19h-279v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h279v-19c-73 -6 -88 -17 -88 -95v-189zM755 337 c0 114 -20 208 -69 256c-31 30 -65 47 -106 47c-47 0 -90 -22 -124 -67c-36 -49 -50 -146 -50 -241c0 -119 16 -209 68 -265c30 -31 68 -45 108 -45c43 0 81 15 111 48c47 53 62 147 62 267"],1071:[662,0,637,3,618,"618 0h-280v19c81 4 94 17 94 93v198h-37l-230 -310h-162v19c33 2 69 17 94 50l185 246c-117 14 -197 68 -197 176c0 143 121 171 274 171h259v-19c-74 -6 -84 -18 -84 -92v-429c0 -86 6 -97 84 -103v-19zM432 348v225c0 39 -13 51 -52 51c-46 0 -83 -2 -113 -15 c-46 -20 -73 -59 -73 -121c0 -90 69 -140 179 -140h59"],1072:[460,10,450,37,446,"446 66v-28c-30 -38 -56 -48 -90 -48c-37 0 -59 20 -64 73h-1c-53 -60 -106 -73 -149 -73c-62 0 -105 38 -105 104c0 52 31 91 70 117c30 20 71 39 184 81v54c0 62 -37 87 -82 87c-40 0 -70 -19 -70 -46c0 -18 6 -21 6 -42c0 -19 -20 -41 -46 -41c-21 0 -43 19 -43 46 c0 26 16 58 51 80c28 18 70 30 115 30c56 0 94 -16 118 -45s32 -50 32 -111v-191c0 -46 13 -66 31 -66c16 0 26 5 43 19zM291 130v134c-62 -22 -107 -47 -132 -70c-24 -22 -34 -38 -34 -69c0 -53 30 -77 69 -77c20 0 45 5 62 16c29 20 35 37 35 66"],1073:[685,10,507,39,478,"84 347l2 -1c44 91 110 114 176 114c122 0 216 -91 216 -229c0 -139 -90 -241 -225 -241c-148 0 -214 130 -214 263c0 134 43 381 260 381h67c46 0 67 12 75 51h20c-2 -27 -9 -94 -73 -118c-38 -14 -85 -6 -130 -11c-103 -12 -168 -108 -174 -209zM388 204 c0 68 -18 137 -50 178c-24 30 -52 50 -95 50c-69 0 -114 -59 -114 -159c0 -79 16 -151 53 -205c22 -32 52 -50 88 -50c74 0 118 70 118 186"],1074:[450,0,474,24,438,"307 237v-1c69 -7 131 -41 131 -110c0 -41 -22 -82 -59 -103c-27 -15 -63 -23 -104 -23h-251v15c54 1 62 10 62 62v297c0 53 -7 57 -62 61v15h211c118 0 175 -42 175 -114c0 -65 -52 -94 -103 -99zM170 391v-113c0 -26 6 -31 51 -31c63 0 107 29 107 86s-27 89 -123 89 c-21 0 -35 -3 -35 -31zM170 193v-125c0 -31 10 -40 42 -40c74 0 135 17 135 97c0 86 -70 94 -129 94c-42 0 -48 -7 -48 -26"],1075:[450,0,394,17,387,"387 309h-17c-13 76 -50 111 -175 111c-26 0 -32 -8 -32 -32v-316c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v309c0 42 -10 45 -62 47v15h365"],1076:[450,137,462,14,439,"439 450v-15c-51 -4 -62 -10 -62 -69v-284c0 -63 10 -63 61 -67v-152h-18c-34 124 -60 137 -98 137h-186c-33 0 -70 -13 -104 -137h-18v152c82 0 99 61 99 184v167c0 54 -22 64 -71 69v15h397zM293 81v298c0 38 -6 43 -40 43h-70c-25 0 -37 -7 -37 -42v-201 c0 -44 -8 -110 -30 -151h135c26 0 42 13 42 53"],1077:[460,10,466,38,437,"421 164l16 -7c-39 -109 -109 -167 -209 -167c-118 0 -190 89 -190 227c0 141 81 243 207 243c62 0 107 -24 139 -69c20 -28 30 -62 34 -116h-308c0 -105 41 -213 153 -213c67 0 109 28 158 102zM112 303h204c-11 81 -32 124 -98 124c-56 0 -95 -49 -106 -124"],1078:[456,0,721,14,707,"707 0h-132l-102 164c-34 54 -37 56 -72 61v-158c0 -35 8 -49 48 -51l20 -1v-15h-218v15l23 2c31 3 43 16 43 50v158c-29 -2 -35 -6 -69 -60l-102 -165h-132v15c23 2 40 8 53 19c13 12 39 41 58 81c40 84 67 109 116 125v2c-88 44 -72 137 -112 137 c-13 0 -32 -15 -56 -15c-27 0 -45 18 -45 44c0 30 26 48 59 48c47 0 70 -24 89 -63c20 -40 40 -94 78 -123c16 -12 37 -17 63 -17v124c0 49 -14 54 -61 59v14h207v-14c-50 -5 -62 -21 -62 -57v-126c25 0 48 6 66 17c31 19 58 88 83 132c20 36 47 54 83 54 c39 0 61 -23 61 -48c0 -26 -20 -44 -46 -44c-22 0 -40 15 -54 15c-45 0 -41 -89 -114 -137v-2c47 -21 75 -44 116 -124c20 -39 46 -71 58 -82s30 -17 53 -19v-15"],1079:[460,10,390,14,357,"228 242v-1c64 -6 129 -40 129 -112c0 -43 -27 -82 -62 -106c-34 -23 -76 -33 -125 -33c-77 0 -118 32 -156 87l14 14c49 -46 77 -65 130 -65c73 0 107 47 107 98c0 76 -52 101 -145 101v28c42 0 65 5 88 17c29 15 45 46 45 74c0 60 -35 88 -83 88 c-74 0 -106 -53 -121 -133h-17l7 161h13c3 -15 14 -23 26 -23c10 0 22 8 36 12c25 7 36 11 58 11c46 0 79 -5 106 -18c38 -19 61 -51 61 -88c0 -59 -56 -102 -111 -112"],1080:[450,0,525,23,502,"502 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -54 12 -59 61 -64v-15h-207v15c50 4 62 15 62 59v256l-187 -258c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-256l187 257c0 42 -11 53 -62 57v15h208"],1081:[704,0,525,23,502,"402 637c0 -62 -82 -91 -135 -91s-135 30 -135 91c0 44 34 67 62 67c14 0 24 -8 24 -25c0 -33 -44 -17 -44 -41c0 -22 21 -40 93 -40s93 18 93 40c0 24 -44 8 -44 41c0 17 13 25 27 25c30 0 59 -23 59 -67zM502 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -54 12 -59 61 -64 v-15h-207v15c50 4 62 15 62 59v256l-187 -258c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-256l187 257c0 42 -11 53 -62 57v15h208"],1082:[456,0,503,23,495,"495 0h-132l-109 164c-35 52 -39 56 -72 61v-158c0 -35 12 -49 52 -51l23 -1v-15h-234v15l28 2c39 3 47 16 47 50v310c0 49 -14 54 -61 59v14h207v-14c-50 -5 -62 -21 -62 -57v-126c25 0 48 6 66 17c29 18 52 78 75 122c22 42 51 64 91 64c39 0 61 -23 61 -48 c0 -26 -20 -44 -46 -44c-22 0 -40 15 -54 15c-45 0 -41 -89 -114 -137v-2c47 -21 82 -44 123 -124c20 -39 46 -71 58 -82s30 -17 53 -19v-15"],1083:[450,10,499,8,476,"476 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -54 12 -59 61 -64v-15h-207v15c50 4 62 15 62 59v305c0 38 -6 43 -40 43h-70c-25 0 -37 -10 -37 -45v-198c0 -69 -3 -189 -105 -189c-40 0 -70 10 -70 50c0 27 23 38 38 38c38 0 35 -54 55 -54c46 0 49 104 49 175v167 c0 54 -12 64 -61 69v15h387"],1084:[450,0,617,23,594,"594 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -54 12 -59 61 -64v-15h-213v15c55 4 68 15 68 59v274h-1l-152 -348h-9l-167 344h-1v-272c0 -40 13 -56 66 -57v-15h-161v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h134l157 -326l143 326h136"],1085:[450,0,525,23,502,"502 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -54 12 -59 61 -64v-15h-207v15c50 4 62 15 62 59v141h-187v-143c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-129h187v130c0 42 -11 53 -62 57v15h208"],1086:[460,10,512,35,476,"476 231c0 -139 -90 -241 -225 -241c-121 0 -216 99 -216 238s90 232 225 232c122 0 216 -91 216 -229zM386 204c0 68 -18 137 -50 178c-24 30 -52 50 -95 50c-69 0 -116 -59 -116 -159c0 -79 16 -151 53 -205c22 -32 54 -50 90 -50c74 0 118 70 118 186"],1087:[450,0,525,23,502,"502 450v-15c-49 -2 -62 -5 -62 -67v-293c0 -54 12 -55 61 -60v-15h-204v15c50 4 59 15 59 59v298c0 39 -20 50 -45 50h-100c-26 0 -42 -11 -42 -50v-300c0 -39 11 -53 62 -57v-15h-208v15c51 4 62 9 62 63v292c0 62 -12 62 -61 65v15h478"],1088:[460,217,499,-2,463,"152 458v-77c44 55 88 79 144 79c97 0 167 -89 167 -213c0 -145 -85 -257 -204 -257c-42 0 -71 10 -107 43v-159c0 -63 13 -75 88 -76v-15h-242v15c59 6 70 17 70 69v470c0 47 -7 57 -41 57c-9 0 -16 0 -25 -1v16c55 17 91 30 144 51zM152 334v-246c0 -30 57 -68 104 -68 c72 0 121 77 121 187c0 117 -49 193 -123 193c-46 0 -102 -36 -102 -66"],1089:[460,10,456,41,428,"414 156l14 -9c-32 -62 -52 -91 -82 -115c-34 -28 -72 -42 -115 -42c-111 0 -190 93 -190 222c0 83 30 152 84 197c40 33 88 51 135 51c84 0 154 -47 154 -103c0 -23 -21 -42 -47 -42c-22 0 -40 17 -48 46l-6 22c-10 37 -23 49 -59 49c-81 0 -136 -71 -136 -175 c0 -115 63 -195 155 -195c57 0 93 24 141 94"],1090:[450,0,434,8,426,"426 309h-17c-13 76 -38 113 -118 113c-26 0 -32 -8 -32 -32v-318c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v311c0 28 -8 32 -34 32c-78 0 -103 -37 -116 -113h-17l5 141h408"],1091:[450,218,491,8,483,"483 450v-15c-24 -3 -35 -13 -50 -51l-164 -409c-56 -140 -99 -193 -175 -193c-43 0 -70 25 -70 58c0 25 19 46 43 46c18 0 36 -3 54 -13c11 -6 23 -7 29 -7c42 0 93 122 93 146c0 15 -27 66 -46 106l-136 283c-10 22 -27 31 -53 35v14h205v-15c-43 -2 -57 -9 -57 -27 c0 -11 7 -27 13 -41l120 -256l105 274c3 7 4 22 4 26c0 16 -17 24 -48 24v15h133"],1092:[662,217,678,43,635,"379 660v-253c15 29 48 53 91 53c103 0 165 -91 165 -233c0 -86 -21 -156 -60 -197c-26 -27 -59 -40 -103 -40c-42 0 -78 24 -93 53v-169c0 -63 13 -75 88 -76v-15h-238v15c59 6 70 17 70 69v176c-15 -29 -51 -53 -93 -53c-44 0 -77 13 -103 40c-39 41 -60 111 -60 197 c0 142 62 233 165 233c43 0 76 -24 91 -53v132c0 47 -7 57 -41 57c-9 0 -16 0 -25 -1v16c55 17 88 30 140 51zM379 357v-262c0 -29 37 -75 88 -75c24 0 45 23 59 56c17 41 23 99 23 157c0 99 -28 197 -82 197c-50 0 -88 -45 -88 -73zM299 95v260c0 28 -37 75 -88 75 c-54 0 -82 -98 -82 -197c0 -58 6 -116 23 -157c14 -33 35 -56 59 -56c51 0 88 46 88 75"],1093:[450,0,489,14,476,"476 0h-201v15c33 2 40 6 40 24c0 7 -2 12 -6 18l-92 143l-79 -122c-14 -22 -19 -38 -19 -45c0 -13 11 -18 40 -18v-15h-145v15c33 3 47 9 75 50l112 165l-94 145c-31 47 -47 60 -77 60h-9v15h207v-15c-30 -1 -43 -7 -43 -22c0 -13 17 -47 46 -89l18 -26l28 39 c25 35 35 60 35 76c0 14 -10 20 -40 22v15h158v-15c-32 -1 -62 -17 -81 -44l-83 -120l128 -196c28 -43 51 -60 82 -60v-15"],1094:[450,137,525,23,502,"502 450v-15c-51 -4 -62 -9 -62 -63v-292c0 -62 12 -62 61 -65v-152h-15c-38 137 -70 137 -112 137h-351v15c49 2 62 5 62 67v293c0 54 -12 55 -61 60v15h208v-15c-50 -4 -63 -15 -63 -59v-298c0 -39 14 -50 40 -50h105c26 0 42 11 42 50v300c0 39 -14 53 -65 57v15h211"],1095:[450,0,512,18,489,"489 450v-15c-51 -4 -62 -9 -62 -63v-295c0 -52 12 -57 61 -62v-15h-207v15c50 4 62 16 62 62v138c-27 -11 -67 -32 -130 -32c-77 0 -134 12 -134 105v84c0 57 -12 58 -61 63v15h208v-15c-49 -4 -63 -9 -63 -63v-78c0 -60 17 -81 83 -81c48 0 81 18 97 24v142 c0 38 -14 52 -65 56v15h211"],1096:[450,0,768,23,745,"745 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -58 12 -61 61 -64v-15h-721v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h205v-15c-49 -5 -60 -16 -60 -58v-299c0 -39 16 -50 45 -50h86c31 0 42 11 42 49v300c0 42 -20 55 -60 58v15h204v-15c-40 -3 -60 -16 -60 -58 v-299c0 -39 16 -50 45 -50h86c31 0 42 11 42 50v300c0 42 -11 53 -60 57v15h206"],1097:[450,137,768,23,745,"745 450v-15c-51 -4 -62 -10 -62 -69v-287c0 -61 12 -61 61 -64v-152h-15c-34 124 -66 137 -100 137h-606v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h205v-15c-51 -5 -60 -16 -60 -58v-299c0 -39 16 -50 45 -50h86c31 0 42 11 42 49v300c0 42 -20 54 -59 58h-1v15 h204v-15c-41 -4 -60 -16 -60 -58v-299c0 -39 16 -50 45 -50h86c31 0 42 11 42 50v300c0 42 -11 53 -60 57v15h206"],1098:[450,0,539,8,507,"251 252h66c105 0 190 -36 190 -128c0 -79 -71 -124 -170 -124h-232v15c51 4 62 6 62 64v312c0 27 -21 31 -44 31c-56 0 -81 -23 -98 -101h-17l8 129h297v-15c-54 -5 -62 -16 -62 -58v-125zM251 224v-165c0 -24 3 -31 34 -31c77 0 131 18 131 99s-55 97 -120 97h-45"],1099:[450,0,670,23,646,"646 0h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-305c0 -40 11 -52 62 -56v-16zM169 252h66c105 0 190 -36 190 -128c0 -79 -71 -124 -170 -124h-232v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15 c-54 -5 -62 -16 -62 -58v-125zM169 224v-165c0 -24 3 -31 34 -31c77 0 131 18 131 99s-55 97 -120 97h-45"],1100:[450,0,457,23,425,"169 252h66c105 0 190 -36 190 -128c0 -79 -71 -124 -170 -124h-232v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-125zM169 224v-165c0 -24 3 -31 34 -31c77 0 131 18 131 99s-55 97 -120 97h-45"],1101:[460,10,444,14,410,"59 457h15c3 -15 9 -23 22 -23c15 0 25 7 37 12c17 7 37 14 70 14c142 0 207 -114 207 -240c0 -132 -80 -230 -208 -230c-108 0 -155 94 -188 157l15 9c46 -72 87 -94 147 -94c95 0 147 73 153 162h-178v33h179c-1 103 -49 175 -133 175c-92 0 -116 -64 -133 -118h-17"],1102:[460,10,738,23,703,"169 248h93c8 128 96 212 225 212c122 0 216 -91 216 -229c0 -139 -90 -241 -225 -241c-117 0 -211 93 -216 225h-93v-143c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-129zM613 204 c0 68 -18 137 -50 178c-24 30 -52 50 -95 50c-69 0 -116 -59 -116 -159c0 -79 16 -151 53 -205c22 -32 54 -50 90 -50c74 0 118 70 118 186"],1103:[450,0,471,4,448,"448 450v-15c-50 -4 -62 -10 -62 -69v-287c0 -54 12 -57 61 -62v-17h-202v15c48 2 57 9 57 61v130h-19l-155 -206h-124v15c30 3 55 29 70 47l119 147c-79 10 -141 54 -141 126c0 101 86 115 190 115h206zM302 234v157c0 25 -6 31 -30 31c-65 0 -129 -14 -129 -93 c0 -61 44 -95 119 -95h40"],1105:[622,10,466,38,437,"385 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM186 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM421 164l16 -7c-39 -109 -109 -167 -209 -167c-118 0 -190 89 -190 227 c0 141 81 243 207 243c62 0 107 -24 139 -69c20 -28 30 -62 34 -116h-308c0 -105 41 -213 153 -213c67 0 109 28 158 102zM112 303h204c-11 81 -32 124 -98 124c-56 0 -95 -49 -106 -124"],1106:[683,218,512,6,439,"439 306v-306c0 -142 -59 -218 -170 -218c-54 0 -93 23 -93 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -29 42 -29c14 0 28 9 34 19c11 20 14 45 14 121v349c0 71 -25 102 -74 102c-41 0 -70 -16 -112 -63v-241c0 -69 10 -81 68 -87v-15h-216v15 c58 8 64 17 64 87v429h-79v33h79v13c0 43 -8 47 -51 47c-4 0 -9 0 -12 -1v16l27 8c57 17 80 24 115 36l5 -3v-116h213v-33h-213v-155c46 61 88 84 151 84c76 0 119 -55 119 -154"],1107:[679,0,394,17,387,"108 508l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32c0 -16 -9 -29 -30 -42l-154 -97h-40zM387 309h-17c-13 76 -50 111 -175 111c-26 0 -32 -8 -32 -32v-316c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v309c0 42 -10 45 -62 47v15h365"],1108:[460,10,444,34,430,"415 156l15 -9c-33 -63 -80 -157 -188 -157c-128 0 -208 98 -208 230c0 126 65 240 207 240c33 0 53 -7 70 -14c12 -5 22 -12 37 -12c13 0 19 8 22 23h15l12 -143h-16c-17 54 -42 118 -134 118c-84 0 -132 -72 -133 -175h179v-33h-178c6 -89 58 -162 153 -162 c60 0 101 22 147 94"],1109:[459,10,389,49,346,"154 301l104 -63c64 -39 88 -66 88 -123c0 -67 -64 -125 -140 -125c-21 0 -50 1 -73 9c-24 8 -35 9 -46 9c-12 0 -18 -2 -24 -12h-13v157h16c21 -97 58 -141 127 -141c51 0 83 33 83 74c0 31 -20 57 -53 75l-54 30c-83 46 -120 94 -120 145c0 79 56 123 138 123 c24 0 46 -1 67 -11c11 -5 21 -8 28 -8c4 0 8 1 16 10h11l5 -136h-15c-23 90 -53 123 -113 123c-43 0 -75 -21 -75 -68c0 -22 15 -51 43 -68"],1110:[683,0,278,29,266,"193 632c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51zM266 0h-237v15c69 4 79 13 79 89v227c0 47 -8 63 -33 63c-9 0 -24 0 -42 -5v16l155 55l4 -4v-351c0 -74 8 -85 74 -90v-15"],1111:[622,0,278,1,299,"299 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM100 572c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 27 22 49 49 49s50 -23 50 -50zM264 0h-237v15c69 4 79 13 79 89v227c0 47 -8 63 -33 63c-9 0 -24 0 -42 -5v16l154 55l5 -4 v-351c0 -74 8 -85 74 -90v-15"],1112:[683,218,278,-77,187,"187 632c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51s51 -23 51 -51zM186 457v-457c0 -142 -59 -218 -170 -218c-54 0 -93 23 -93 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -28 42 -28c14 0 28 8 34 18c11 20 14 45 14 121v379 c0 43 -9 60 -32 60c-10 0 -24 0 -40 -3l-5 -1v16c59 18 97 31 156 54"],1113:[450,10,702,8,670,"414 252h66c105 0 190 -36 190 -128c0 -79 -71 -124 -170 -124h-232v15c51 4 62 6 62 64v300c0 38 -6 43 -40 43h-70c-25 0 -37 -10 -37 -45v-198c0 -69 -3 -189 -105 -189c-40 0 -70 10 -70 50c0 27 23 38 38 38c38 0 35 -54 55 -54c46 0 49 104 49 175v167 c0 54 -12 64 -61 69v15h387v-15c-51 -4 -62 -10 -62 -69v-114zM414 224v-165c0 -24 3 -31 34 -31c77 0 131 18 131 99s-55 97 -120 97h-45"],1114:[450,0,721,23,689,"433 245h66c105 0 190 -29 190 -121c0 -79 -71 -124 -170 -124h-232v15c51 4 62 6 62 64v136h-180v-143c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v287c0 54 -12 64 -61 69v15h207v-15c-54 -5 -62 -16 -62 -58v-132h180v133c0 42 -11 53 -62 57v15h208v-15 c-48 -4 -62 -9 -62 -58v-132zM433 215v-156c0 -24 3 -31 34 -31c77 0 131 16 131 97s-55 90 -120 90h-45"],1115:[683,0,512,6,499,"499 0h-212v15c58 6 68 18 68 87v198c0 70 -25 106 -74 106c-40 0 -70 -17 -112 -63v-241c0 -69 10 -81 68 -87v-15h-216v15c58 8 64 17 64 87v429h-79v33h79v8c0 43 -8 52 -51 52c-4 0 -9 0 -12 -1v16l27 8c57 17 80 24 115 36l5 -3v-116h213v-33h-213v-155 c46 60 88 84 147 84c82 0 123 -54 123 -159v-199c0 -69 6 -77 60 -87v-15"],1116:[679,0,503,23,495,"165 508l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32c0 -16 -9 -29 -30 -42l-154 -97h-40zM495 0h-132l-109 164c-35 52 -39 56 -72 61v-158c0 -35 12 -49 52 -51l23 -1v-15h-234v15l28 2c39 3 47 16 47 50v310c0 49 -14 54 -61 59v14h207v-14c-50 -5 -62 -21 -62 -57 v-126c25 0 48 6 66 17c29 18 52 78 75 122c22 42 51 64 91 64c39 0 61 -23 61 -48c0 -26 -20 -44 -46 -44c-22 0 -40 15 -54 15c-45 0 -41 -89 -114 -137v-2c47 -21 82 -44 123 -124c20 -39 46 -71 58 -82s30 -17 53 -19v-15"],1118:[704,218,491,8,483,"393 637c0 -62 -82 -91 -135 -91s-135 30 -135 91c0 44 34 67 62 67c14 0 24 -8 24 -25c0 -33 -44 -17 -44 -41c0 -22 21 -40 93 -40s93 18 93 40c0 24 -44 8 -44 41c0 17 13 25 27 25c30 0 59 -23 59 -67zM483 450v-15c-24 -3 -35 -13 -50 -51l-164 -409 c-56 -140 -99 -193 -175 -193c-43 0 -70 25 -70 58c0 25 19 46 43 46c18 0 36 -3 54 -13c11 -6 23 -7 29 -7c42 0 90 122 90 146c0 15 -26 66 -45 106l-134 283c-10 22 -27 31 -53 35v14h205v-15c-43 -2 -57 -9 -57 -27c0 -11 7 -27 13 -41l117 -256l108 274c3 7 4 22 4 26 c0 16 -17 24 -48 24v15h133"],1119:[450,137,518,23,495,"495 450v-15c-51 -4 -62 -9 -62 -63v-292c0 -62 12 -62 61 -65v-15h-117c-42 0 -82 0 -110 -137h-17c-28 137 -68 137 -110 137h-117v15c49 2 62 5 62 67v293c0 54 -12 55 -61 60v15h208v-15c-50 -4 -63 -15 -63 -59v-298c0 -39 14 -50 40 -50h98c26 0 42 11 42 50v300 c0 39 -14 53 -65 57v15h211"],1122:[662,0,746,26,713,"335 366h109c154 0 269 -49 269 -184c0 -115 -94 -182 -239 -182h-337v19c79 2 96 18 96 94v392c0 23 -13 31 -34 31h-15c-93 0 -107 -14 -127 -65c-4 -11 -5 -23 -7 -37h-24l7 140h200c0 58 -24 64 -96 69v19h294v-19c-65 -6 -96 -10 -96 -69h200l5 -138h-24 c-1 8 -4 27 -10 40c-23 49 -56 60 -127 60h-9c-23 0 -35 -8 -35 -30v-140zM335 326v-243c0 -34 16 -45 62 -45c112 0 201 22 201 141s-90 147 -185 147h-78"],1123:[683,0,539,8,507,"251 252h66c105 0 190 -36 190 -128c0 -79 -71 -124 -170 -124h-232v15c51 4 62 8 62 64v317c-2 18 -11 26 -34 26c-78 0 -95 -35 -108 -101h-17l8 129h151v114c0 47 -7 53 -41 53c-9 0 -16 0 -25 -1v16c55 17 91 30 144 51l6 -2v-231h151l8 -129h-17 c-13 66 -30 101 -110 101c-26 0 -32 -8 -32 -32v-138zM251 224v-165c0 -24 3 -31 34 -31c77 0 131 18 131 99s-55 97 -120 97h-45"],1130:[662,0,998,6,992,"992 0h-290v19c45 3 54 20 54 49c0 26 -11 55 -32 89c-55 87 -117 143 -174 147v-193c0 -78 19 -88 93 -92v-19h-286v19c79 6 91 15 91 104v181c-57 -4 -119 -60 -174 -147c-21 -34 -32 -63 -32 -89c0 -29 9 -46 54 -49v-19h-290v19c121 9 137 148 219 230 c42 43 93 79 186 99l-213 314h584l-203 -314c75 -3 152 -56 194 -99c82 -82 98 -221 219 -230v-19zM701 617h-353l179 -269"],1131:[450,0,722,14,708,"708 0h-204v15c32 2 38 14 38 33c0 18 -8 36 -23 59c-36 56 -78 96 -116 102v-143c0 -46 13 -48 56 -51v-15h-196v15c43 3 56 5 56 51v143c-38 -6 -80 -47 -116 -102c-15 -23 -23 -41 -23 -59c0 -19 6 -31 38 -33v-15h-204v15c86 6 97 108 154 164c29 29 78 57 134 57v2 l-159 212h412l-137 -211v-3c60 0 106 -28 136 -57c57 -56 69 -158 154 -164v-15zM501 422h-233l123 -174"],1138:[676,14,729,36,690,"690 331c0 -206 -135 -345 -327 -345c-194 0 -327 140 -327 348c0 203 132 342 327 342c196 0 327 -147 327 -345zM575 358c-4 104 -37 190 -90 235c-36 30 -76 47 -123 47c-54 0 -104 -22 -143 -67c-41 -47 -67 -140 -69 -219c60 54 100 69 145 69 c66 0 132 -105 204 -105c23 0 48 11 76 40zM576 317c-33 -38 -81 -68 -138 -68c-75 0 -143 105 -212 105c-23 0 -47 -11 -76 -41c3 -110 32 -193 90 -246c34 -31 78 -45 124 -45c50 0 94 15 129 48c52 51 83 144 83 247"],1139:[460,10,512,35,476,"476 231c0 -139 -90 -241 -225 -241c-121 0 -216 99 -216 238s90 232 225 232c122 0 216 -91 216 -229zM384 240c-5 55 -23 107 -48 142c-25 29 -52 50 -95 50c-69 0 -116 -59 -116 -159c0 -10 0 -20 1 -30c33 32 63 44 90 44c53 0 83 -65 128 -65c11 0 25 5 40 18z M386 204v10c-22 -23 -56 -44 -92 -44c-57 0 -83 65 -126 65c-12 0 -25 -6 -40 -19c6 -56 22 -107 50 -148c22 -32 54 -50 90 -50c74 0 118 70 118 186"],1140:[676,11,766,16,760,"399 161l133 373c29 82 62 142 152 142c50 0 76 -28 76 -63c0 -24 -13 -58 -48 -58c-57 0 -49 57 -75 57c-24 0 -39 -30 -52 -67l-202 -556h-15l-244 544c-43 97 -58 109 -108 110v19h265v-19l-28 -2c-32 -2 -45 -11 -45 -31c0 -16 9 -40 39 -107"],1141:[456,14,539,19,532,"280 114l79 219c19 53 51 123 116 123c39 0 57 -23 57 -48c0 -26 -20 -44 -46 -44c-22 0 -33 15 -47 15c-23 0 -36 -31 -50 -68l-105 -277c-14 -37 -22 -48 -28 -48c-8 0 -22 31 -29 47l-117 287c-40 98 -53 113 -91 115v15h196v-15c-34 -3 -46 -10 -46 -27 c0 -10 3 -23 9 -38l99 -256h3"],1168:[803,0,571,19,544,"544 803l-5 -179h-296c-28 0 -35 -4 -35 -36v-476c0 -75 13 -89 91 -93v-19h-280v19c75 5 87 17 87 95v436c0 74 -12 89 -87 93v19h365c46 0 103 12 126 91c4 14 9 42 10 50h24"],1169:[558,0,394,17,387,"387 558l-5 -138h-192c-22 0 -27 -10 -27 -32v-316c0 -40 11 -53 62 -57v-15h-208v15c51 4 62 6 62 64v309c0 42 -10 45 -62 47v15h196c127 0 144 36 157 108h17"],8453:[676,14,837,48,795,"795 170c0 -106 -70 -184 -173 -184c-92 0 -166 76 -166 183c0 106 70 177 173 177c94 0 166 -69 166 -176zM725 150c0 52 -14 104 -37 136c-20 23 -41 38 -74 38c-52 0 -88 -44 -88 -121c0 -61 12 -115 40 -157c17 -25 42 -38 69 -38c57 0 90 53 90 142zM646 676 l-450 -690h-49l453 690h46zM334 443l10 -7c-24 -48 -39 -70 -62 -88c-26 -22 -55 -32 -88 -32c-86 0 -146 71 -146 170c0 63 22 116 64 150c31 25 68 40 103 40c65 0 119 -36 119 -79c0 -18 -16 -32 -36 -32c-17 0 -30 13 -36 35l-5 17c-8 28 -18 36 -45 36 c-62 0 -105 -53 -105 -132c0 -89 48 -150 119 -150c44 0 71 18 108 72"],8455:[676,14,598,28,561,"389 366v-40c-92 0 -148 -7 -191 -35c-35 -23 -55 -59 -55 -109c0 -98 69 -152 184 -152c61 0 101 27 121 57c32 49 36 82 76 82c23 0 37 -12 37 -40c0 -52 -64 -98 -129 -120c-53 -18 -99 -23 -131 -23c-67 0 -124 12 -173 40c-61 35 -100 92 -100 166 c0 110 100 150 191 156v1c-41 5 -85 24 -115 54c-25 25 -42 58 -42 98c0 96 75 175 242 175c36 0 68 -5 105 -15c20 -6 55 -18 71 -18c18 0 33 12 38 33h20l10 -227h-23c-15 117 -90 189 -198 189c-112 0 -163 -64 -163 -148c0 -40 19 -77 58 -98c36 -20 78 -26 167 -26"],8470:[676,14,1012,7,966,"966 307c0 -88 -53 -160 -139 -160c-89 0 -139 74 -139 158c0 86 51 161 139 161c85 0 139 -75 139 -159zM888 304c0 96 -21 140 -63 140c-39 0 -59 -45 -59 -139s19 -136 60 -136c40 0 62 43 62 135zM962 0h-270v87h270v-87zM556 213v188c0 100 0 275 149 275 c58 0 102 -14 102 -73c0 -39 -33 -55 -56 -55c-55 0 -50 79 -80 79c-67 0 -71 -152 -71 -255v-383h-18l-324 503v-231c0 -100 0 -275 -149 -275c-58 0 -102 14 -102 73c0 39 33 55 56 55c55 0 50 -79 80 -79c67 0 71 152 71 255v269c-27 43 -48 67 -63 74s-35 9 -61 10v19 h180"],8471:[676,14,760,38,722,"246 520h143c54 0 95 -14 119 -34c19 -16 27 -39 27 -67s-10 -53 -31 -72c-31 -29 -60 -34 -117 -34c-15 0 -16 1 -31 2v-97c0 -42 7 -49 51 -51v-15h-161v15c43 3 46 9 46 56v232c0 40 -6 47 -46 50v15zM356 479v-142c13 -1 15 -2 26 -2c60 0 86 32 86 82 c0 61 -19 81 -93 81c-16 0 -19 -5 -19 -19zM722 329c0 -192 -150 -343 -341 -343c-193 0 -343 152 -343 346c0 193 153 344 347 344c186 0 337 -155 337 -347zM667 330c0 169 -129 304 -289 304c-154 0 -285 -140 -285 -303c0 -166 131 -303 288 -303c156 0 286 138 286 302 "],8478:[667,101,780,69,763,"763 0h-173l-26 33l-138 -134l-27 28l140 136l-195 242c-11 -1 -22 -2 -33 -2c-12 0 -23 1 -35 2v-133v-43c0 -92 35 -102 118 -105v-24h-325v24c83 3 118 13 118 105v54v355c0 92 -35 102 -118 105v24h286c112 0 275 -38 275 -178c0 -98 -98 -154 -183 -172 c52 -64 99 -132 154 -194l135 132l27 -28l-136 -132c41 -42 74 -71 136 -73v-22zM276 567v-232c17 -1 33 -2 50 -2c107 0 202 17 202 147c0 117 -51 155 -164 155c-49 0 -88 -10 -88 -68"],8482:[662,-256,980,30,957,"957 662v-20c-43 -3 -56 -16 -56 -55v-254c0 -48 0 -49 50 -55v-20h-170v20c31 4 35 5 42 9c5 4 7 13 7 45v236l-154 -312h-11l-151 310v-223c0 -48 10 -60 53 -65v-20h-131v20c42 5 52 17 52 65v249c-13 30 -39 49 -69 50v20h121l154 -309l160 309h103zM375 574h-20 c-14 49 -32 68 -67 68h-50v-308c0 -48 0 -50 50 -56v-20h-171v20c50 6 50 8 50 56v308h-49c-36 0 -55 -19 -68 -68h-20v88h345v-88"],8485:[662,218,424,35,391,"219 265v-2c119 -22 172 -96 172 -196c0 -162 -102 -285 -260 -285c-54 0 -96 23 -96 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 37 -26 52 -26c56 0 123 98 123 227c0 116 -33 188 -140 188h-55v15l160 170v2h-197v15l199 195v2h-118c-63 0 -78 -15 -87 -88h-19 l4 118h331v-15l-195 -195v-2h195v-15"],8486:[676,0,744,29,715,"715 0h-286l7 150c85 21 141 132 141 239c0 142 -74 251 -205 251c-136 0 -205 -131 -205 -251c0 -98 52 -214 140 -239l9 -150h-287v160h19c1 -61 24 -76 68 -76h149l-2 37c-139 39 -210 121 -210 266c0 142 117 289 319 289c198 0 319 -140 319 -289 c0 -146 -78 -228 -213 -266l-2 -37h171c39 0 47 24 49 74h19v-158"],8489:[463,0,360,32,276,"276 0h-124v343c0 29 -5 73 -43 73c-35 0 -42 -41 -47 -68h-30c8 63 46 115 114 115c81 0 130 -38 130 -122v-341"],8491:[871,0,722,15,707,"141 186l205 487c-49 5 -86 47 -86 99c0 55 45 99 101 99c53 0 98 -46 98 -100c0 -52 -40 -94 -91 -99l245 -561c28 -65 42 -86 94 -92v-19h-255v19c36 0 43 2 55 9c8 4 14 15 14 24c0 15 -7 42 -19 70l-41 94h-262l-46 -114c-5 -13 -9 -30 -9 -42c0 -31 22 -41 70 -41 v-19h-199v19c58 6 67 27 126 167zM425 772c0 36 -30 65 -67 65c-34 0 -64 -30 -64 -65c0 -37 29 -66 64 -66c38 0 67 29 67 66zM447 257l-116 275l-115 -275h231"],8494:[676,17,843,35,808,"808 330h-630v-176c0 -24 0 -25 16 -44c48 -57 130 -95 230 -95c101 0 183 35 247 113h71c-87 -97 -173 -145 -318 -145c-220 0 -389 153 -389 347c0 187 161 346 389 346c187 0 374 -118 384 -346zM666 387v121c0 25 -7 31 -20 48c-41 52 -135 87 -222 87 c-89 0 -182 -43 -230 -95c-14 -14 -16 -18 -16 -46v-118c0 -17 4 -20 19 -20h446c17 0 23 4 23 23"],8514:[662,0,559,13,485,"485 0h-87v588h-385l18 74h454v-662"],8515:[662,0,559,13,485,"485 0h-454l-18 74h385v588h87v-662"],8516:[662,0,630,21,609,"609 0h-95l-199 300l-199 -300h-95l250 374v288h88v-288"],8522:[692,0,664,45,602,"291 552h101c125 0 210 -61 210 -177c0 -124 -84 -177 -208 -177h-103v-132h267v-66h-333v486h-114v-180h-66v246h180v140h66v-140zM291 264h100c80 0 145 28 145 111s-64 111 -144 111h-101v-222"],8523:[676,13,778,28,736,"43 552l-15 11c29 73 84 113 151 113c58 0 107 -26 170 -91c75 66 135 91 216 91c107 0 171 -50 171 -150c0 -81 -55 -159 -157 -218l-38 -22c28 -68 35 -104 35 -149c0 -90 -67 -150 -152 -150c-79 0 -137 45 -137 124c0 72 38 118 155 168c-41 88 -76 143 -132 206 c-65 -86 -92 -134 -92 -180c0 -30 15 -42 65 -47v-21h-216v21c50 0 69 19 94 59c46 73 71 122 126 196c-47 61 -91 92 -152 92c-39 0 -60 -13 -92 -53zM644 489c0 85 -53 134 -124 134c-43 0 -86 -17 -146 -64c58 -68 98 -126 152 -239c87 56 118 100 118 169zM497 102 c0 51 -7 84 -40 145c-86 -39 -117 -81 -117 -140c0 -49 32 -88 78 -88c47 0 79 33 79 83"],12398:[661,41,901,37,840,"840 308c0 -157 -99 -349 -306 -349c-10 0 -21 0 -31 1c168 31 252 167 252 308c0 173 -123 354 -307 354c-186 0 -327 -155 -327 -301c0 -85 47 -166 160 -214c68 72 121 194 125 364c0 9 -20 10 -20 20c27 9 67 24 100 39c6 -3 9 -9 9 -16c0 -6 -3 -13 -7 -19 c-47 -199 -80 -339 -200 -499c-8 -3 -16 -5 -22 -5c-26 0 -55 9 -74 22c3 3 43 29 54 53c-9 -4 -32 -18 -38 -19c-43 19 -171 107 -171 246c0 240 239 368 438 368c93 0 195 -24 267 -108c58 -67 98 -147 98 -245"],57427:[450,0,632,26,604,"604 0h-255v15l24 1c48 2 64 16 64 51v140l-30 21l-159 -175c-10 -11 -13 -18 -13 -23c0 -9 11 -15 25 -15h20v-15h-254v15c52 3 95 14 145 68l172 188l-33 24c-155 113 -191 140 -254 140v15h236v-14c-44 0 -60 -8 -60 -27c0 -14 10 -31 32 -46l173 -119v130 c0 47 -13 54 -72 61v15h239v-16c-79 -5 -83 -12 -83 -63v-289c0 -52 0 -55 83 -67v-15"],57428:[516,10,688,37,679,"649 378l30 -11c-16 -47 -51 -71 -85 -71c-42 0 -82 32 -82 90v81l-78 -47v-306c0 -46 12 -67 30 -67c16 0 26 5 43 19v-28c-30 -38 -56 -48 -90 -48c-36 0 -58 19 -64 69l-3 -2c-34 -47 -72 -67 -128 -67c-111 0 -185 87 -185 215c0 142 93 255 208 255 c40 0 69 -11 107 -43l187 99l6 -4v-124c0 -41 23 -59 48 -59c24 0 49 17 56 49zM354 102v230c0 53 -51 100 -105 100c-76 0 -125 -74 -125 -187c0 -123 54 -203 138 -203c31 0 56 11 74 32c9 10 18 21 18 28"],57429:[475,14,571,20,563,"533 288l30 -11c-16 -47 -51 -71 -85 -71c-42 0 -82 32 -82 90v59l-46 -14c-8 -6 -18 -10 -31 -10c-26 0 -42 27 -48 49c-13 45 -20 62 -46 62c-52 0 -90 -39 -90 -90c0 -25 13 -50 35 -68c19 -16 37 -20 75 -21v-30h-11c-71 0 -120 -43 -120 -104 c0 -62 44 -107 107 -107c50 0 106 22 156 62l12 -12c-46 -56 -107 -86 -179 -86c-46 0 -97 13 -131 34c-35 21 -59 63 -59 103c0 41 24 82 61 102c22 12 42 18 82 24v2c-77 16 -116 52 -116 107c0 70 66 117 164 117c38 0 88 -13 113 -30c28 -19 41 -48 43 -66l56 17l6 -4 v-94c0 -41 23 -59 48 -59c24 0 49 17 56 49"],57430:[459,11,632,10,624,"594 292l30 -11c-13 -37 -43 -71 -85 -71c-51 0 -82 42 -82 90v81l-77 -47c12 -31 17 -64 17 -97c0 -75 -25 -148 -84 -197c-38 -31 -86 -51 -135 -51c-58 0 -154 32 -154 103c0 25 23 42 47 42c27 0 41 -23 48 -46c12 -42 13 -70 65 -70c96 0 136 90 136 174 c0 94 -48 195 -155 195c-69 0 -105 -41 -141 -94l-14 9c43 82 93 157 197 157c69 0 127 -37 160 -97l117 68l6 -4v-124c0 -30 14 -59 48 -59c29 0 50 22 56 49"],57431:[459,12,624,29,595,"263 3v-15c-131 0 -234 77 -234 252c0 71 15 125 48 163c33 37 69 56 109 56c56 0 98 -32 126 -96c24 64 66 96 124 96c42 0 79 -19 111 -56s48 -91 48 -165c0 -175 -101 -250 -234 -250v15c93 0 144 84 144 238c0 92 -8 190 -84 190c-42 0 -75 -42 -97 -116 c20 -51 31 -99 31 -145c0 -68 -20 -101 -43 -101s-43 36 -43 109c0 48 9 94 30 137c-23 76 -49 116 -99 116c-70 0 -81 -108 -81 -200c0 -146 61 -228 144 -228"],57437:[459,10,452,16,436,"436 230h-127c55 -35 76 -62 76 -115c0 -67 -64 -125 -140 -125c-21 0 -50 1 -73 9c-24 8 -35 9 -46 9c-12 0 -18 -2 -24 -12h-13v157h16c21 -97 58 -141 127 -141c51 0 83 33 83 74c0 31 -20 57 -53 75l-54 30c-23 13 -43 26 -59 39h-133v31h101c-20 24 -29 49 -29 75 c0 79 56 123 138 123c24 0 46 -1 67 -11c11 -5 21 -8 28 -8c4 0 8 1 16 10h11l5 -136h-15c-23 90 -53 123 -113 123c-43 0 -75 -21 -75 -68c0 -22 15 -51 43 -68l66 -40h177v-31"],57448:[683,287,524,9,487,"487 15v-163c0 -77 -47 -139 -108 -139c-70 0 -128 23 -128 55c0 15 12 27 28 27c21 0 29 -16 43 -32s32 -31 54 -31c44 0 56 47 56 91v177h-157v15c58 6 68 18 68 87v198c0 70 -25 106 -74 106c-40 0 -70 -17 -112 -63v-241c0 -69 10 -81 68 -87v-15h-216v15 c58 8 64 17 64 87v471c0 43 -8 51 -51 51c-4 0 -9 0 -12 -1v16l27 8c57 17 80 24 115 36l5 -3v-304c46 60 88 84 147 84c82 0 123 -54 123 -159v-199c0 -69 6 -77 60 -87"],57506:[460,218,561,24,539,"539 17l-116 -55c-18 -134 -107 -180 -218 -180c-104 0 -143 37 -143 69c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -42 72 -42c42 0 99 29 119 108l-116 -54l-17 36l132 61v97c-44 -48 -99 -74 -157 -74c-94 0 -160 89 -160 215c0 144 96 255 220 255 c40 0 70 -8 116 -35l54 32h11v-451l97 48zM341 127v206c0 66 -31 98 -93 98c-85 0 -138 -72 -138 -190c0 -69 22 -134 56 -163c20 -18 46 -27 75 -27c32 0 66 12 88 32c8 7 12 21 12 44"],57523:[683,218,541,32,457,"452 461l5 -4c-1 -33 -2 -66 -2 -99v-358c0 -114 -39 -218 -170 -218c-33 0 -93 12 -93 55c0 23 19 39 41 39c42 0 51 -60 90 -60c14 0 26 7 34 18c16 24 14 94 14 121v405c0 12 0 28 -6 38c-12 17 -51 19 -78 19h-19h-84v-327c0 -55 12 -71 68 -75v-15h-220v15 c61 2 68 24 68 81v321h-67v33h68c9 75 12 133 72 186c40 35 95 47 147 47c43 0 125 -9 125 -68c0 -24 -9 -41 -35 -41c-42 0 -60 84 -121 84c-28 0 -56 -12 -75 -32c-27 -28 -30 -67 -30 -105v-26v-45h154c39 0 76 5 114 11"],57533:[662,218,710,15,660,"660 620h-152c46 -3 83 -28 83 -62c0 -28 -19 -46 -42 -46c-18 0 -37 13 -37 37c0 17 10 20 10 29c0 8 -12 14 -26 14c-56 0 -89 -50 -120 -205h107l-6 -32h-108l-67 -290c-29 -127 -71 -283 -210 -283c-49 0 -77 26 -77 62c0 28 19 46 42 46c18 0 37 -13 37 -37 c0 -17 -10 -20 -10 -29c0 -8 8 -14 22 -14c43 0 69 47 93 155l86 390h-91l7 32h92c22 71 35 104 68 151c28 41 73 78 130 82h-219v42h388v-42"],57534:[757,218,1102,15,1073,"1073 757l-25 -101l-8 1c1 10 1 20 1 27c0 28 -21 48 -57 48h-40l-81 -297c-4 -13 -7 -25 -7 -35c0 -26 6 -34 30 -35l20 -1v-9h-169v9c37 4 50 17 59 49l88 319c-97 0 -116 -13 -140 -72l-12 2l23 95h318zM660 620h-152c46 -3 83 -28 83 -62c0 -28 -19 -46 -42 -46 c-18 0 -37 13 -37 37c0 17 10 20 10 29c0 8 -12 14 -26 14c-56 0 -89 -50 -120 -205h107l-6 -32h-108l-67 -290c-29 -127 -71 -283 -210 -283c-49 0 -77 26 -77 62c0 28 19 46 42 46c18 0 37 -13 37 -37c0 -17 -10 -20 -10 -29c0 -8 8 -14 22 -14c43 0 69 47 93 155l86 390 h-91l7 32h92c22 71 35 104 68 151c28 41 73 78 130 82h-219v42h388v-42"],57565:[933,0,516,73,445,"445 420l-118 -42l-3 3v51c-27 -38 -58 -54 -103 -54c-88 0 -148 70 -148 172c0 114 75 204 167 204c32 0 53 -8 84 -34v125c0 33 -7 41 -37 41c-6 0 -11 0 -18 -1v13c52 13 80 21 118 35l4 -2v-453c0 -37 6 -46 35 -46c4 0 5 0 19 1v-13zM324 468v184 c0 42 -39 80 -82 80c-61 0 -100 -59 -100 -150c0 -98 43 -162 111 -162c24 0 44 9 59 26c7 8 12 16 12 22zM304 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],57566:[933,0,500,57,439,"439 386h-169v12c46 5 54 15 54 70v158c0 56 -20 85 -59 85c-32 0 -56 -13 -90 -50v-193c0 -55 8 -65 55 -70v-12h-173v12c46 7 51 14 51 70v377c0 34 -6 41 -41 41c-3 0 -7 0 -9 -1v13c67 17 85 25 113 35l4 -3v-243c37 48 71 67 118 67c65 0 98 -43 98 -127v-159 c0 -55 5 -62 48 -70v-12zM302 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],57567:[754,0,778,92,699,"699 386h-174v12c44 5 52 14 52 60v165c0 63 -16 89 -62 89c-38 0 -62 -14 -86 -48v-202c0 -52 12 -63 58 -64v-12h-179v12c45 3 54 8 54 57v169c0 55 -17 88 -52 88c-29 0 -69 -15 -85 -34c-5 -6 -10 -12 -10 -14v-222c0 -34 12 -42 54 -44v-12h-177v12 c45 1 56 12 56 58v199c0 39 -7 53 -28 53c-9 0 -15 -1 -26 -4v14c44 12 71 21 111 36l7 -2v-60h1c53 55 87 62 123 62c43 0 70 -22 85 -67c43 46 84 67 130 67c65 0 93 -50 93 -144v-162c0 -36 10 -46 34 -48l21 -2v-12zM447 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51 c0 28 23 51 51 51c29 0 51 -23 51 -51"],57568:[920,0,500,40,444,"40 920h193c80 0 130 -20 166 -50c27 -23 45 -62 45 -102c0 -110 -112 -158 -214 -158c-21 0 -34 1 -55 2v-140c0 -61 10 -71 75 -74v-12h-210v12c63 5 68 13 68 82v351c0 60 -8 69 -68 77v12zM175 862v-218c18 -1 33 -2 49 -2c88 0 144 50 144 122 c0 88 -56 127 -165 127c-23 0 -28 -8 -28 -29zM313 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],57569:[757,0,389,81,318,"165 631l83 -51c51 -31 70 -53 70 -98c0 -54 -51 -100 -112 -100c-17 0 -40 1 -58 7c-19 6 -28 7 -37 7c-10 0 -14 -1 -19 -9h-11v125h13c17 -77 47 -113 102 -113c41 0 66 27 66 60c0 24 -16 45 -42 60l-43 24c-66 37 -96 75 -96 116c0 63 44 98 110 98 c19 0 37 -1 54 -9c8 -4 16 -6 22 -6c3 0 6 1 13 8h9l4 -109h-12c-19 72 -43 98 -91 98c-34 0 -60 -16 -60 -54c0 -18 13 -40 35 -54zM254 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],57570:[754,0,500,60,429,"429 754v-12c-19 -2 -29 -11 -40 -41l-120 -327c-42 -113 -79 -154 -140 -154c-35 0 -56 20 -56 46c0 20 15 37 34 37c15 0 27 -2 42 -10c9 -5 16 -6 21 -6c11 0 27 16 40 35c16 23 32 74 32 87c0 12 -19 48 -34 80l-106 226c-8 18 -21 25 -42 28v11h164v-12 c-34 -1 -46 -7 -46 -21c0 -9 6 -22 11 -33l89 -200l78 221c2 5 3 11 3 14c0 13 -12 19 -37 19v12h107zM301 51c0 -29 -22 -51 -52 -51c-28 0 -50 22 -50 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],58108:[756,218,722,15,707,"707 0h-255v19l45 4c14 1 24 15 24 29c0 15 -7 42 -19 70l-41 94h-3l-179 -434h-59l180 434h-201l-46 -114c-5 -13 -9 -30 -9 -42c0 -31 22 -41 70 -41v-19h-199v19c58 6 67 27 126 167l206 488h20l114 -262l143 344h58l-171 -413l102 -232c29 -65 42 -86 94 -92v-19z M432 293l-101 239l-115 -275h201"],58110:[756,217,667,17,593,"422 349v-1c101 -18 171 -71 171 -170c0 -111 -94 -178 -239 -178h-126l-89 -217h-59l89 217h-152v19c79 2 96 18 96 94v437c0 79 -15 88 -96 93v19h280c55 0 101 -6 139 -18l47 112h58l-55 -134c48 -28 73 -72 73 -127c0 -90 -51 -128 -137 -146zM450 537l-64 -154 c48 19 71 54 71 107c0 17 -2 33 -7 47zM322 368l92 221c-34 25 -91 36 -175 36c-17 0 -24 -9 -24 -32v-227h63c15 0 30 0 44 2zM360 320l-116 -280c9 -2 20 -3 33 -3c112 0 201 23 201 142c0 91 -48 128 -118 141zM215 109l89 216c-8 1 -16 1 -24 1h-65v-217"],58112:[756,217,587,11,577,"577 494h-25c-8 77 -27 113 -83 125l-243 -588c13 -8 34 -11 66 -12v-19h-79l-90 -217h-59l90 217h-143v19c76 5 88 17 88 105v427c0 73 -10 86 -87 92v19h417l39 94h58l-39 -94h84zM413 624h-176c-28 0 -36 -8 -36 -40v-471"],58114:[756,218,722,48,675,"675 0h-405l-91 -218h-59l91 218h-163l299 674h20l65 -143l93 225h58l-121 -291zM524 92l-111 253l-105 -253h216zM383 413l-52 119l-195 -440h113"],58116:[756,217,611,12,597,"597 169l-46 -169h-317l-89 -217h-59l89 217h-163v19c77 5 87 18 87 95v436c0 74 -12 89 -87 93v19h438l39 94h58l-39 -94h33l5 -143h-25c-7 38 -14 62 -40 78l-95 -229c55 6 69 29 79 96h23v-234h-23c-11 78 -25 95 -96 97l-119 -288c14 -2 31 -2 52 -2 c179 0 222 26 267 132h28zM328 368l102 246c-41 8 -102 10 -194 10c-28 0 -35 -4 -35 -36v-220h127zM311 327h-110v-263"],58118:[756,217,612,10,598,"598 176l-25 -176h-383l-90 -217h-59l90 217h-121v15l259 360c9 12 35 46 41 57c12 24 16 39 26 64l53 128h-156c-43 0 -102 -2 -134 -35c-30 -30 -34 -58 -41 -98h-26l21 171h352l39 94h58l-39 -94h115v-15l-193 -273c-38 -53 -63 -81 -97 -137c-15 -23 -17 -40 -28 -66 l-55 -133h193c39 0 84 4 117 28c37 27 47 68 60 110h23"],58120:[756,217,722,18,703,"703 0h-279v19c78 5 88 21 88 105v191h-132l-121 -292c11 -2 23 -3 38 -4v-19h-47l-90 -217h-59l90 217h-173v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h280v-19c-73 -6 -89 -17 -89 -95v-189h131l116 280c-9 2 -20 3 -33 4v19h43l39 94h58l-39 -94h179v-19 c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19zM512 359v189c0 30 -2 50 -9 64l-105 -253h114zM322 315h-113v-202c0 -24 1 -42 6 -56"],58122:[756,218,722,34,688,"565 756l-48 -117c106 -55 171 -169 171 -308c0 -206 -135 -345 -327 -345c-39 0 -75 6 -108 16l-91 -220h-59l100 241c-105 54 -169 166 -169 311c0 203 132 342 327 342c38 0 74 -6 106 -16l40 96h58zM375 298l-105 -254c28 -15 59 -22 92 -22c50 0 94 15 129 48 c55 53 83 147 83 267c0 107 -30 196 -81 246l-83 -200c43 0 59 24 66 58h25c-7 -28 -11 -51 -11 -80c0 -30 4 -94 11 -125h-25c-9 38 -22 62 -58 62h-43zM352 383l97 233c-27 16 -56 24 -89 24c-54 0 -104 -22 -143 -67c-43 -49 -69 -146 -69 -241c0 -111 25 -197 78 -254 l91 220c-42 0 -53 -21 -67 -62h-25c7 26 10 59 10 87c0 30 -4 86 -11 118h25c14 -41 24 -58 63 -58h40"],58124:[756,218,333,-24,438,"438 756l-221 -534v-110c0 -75 16 -90 98 -93v-19h-190l-90 -218h-59l90 218h-48v19c26 1 45 2 59 7l38 91v434c0 79 -12 87 -97 92v19h297v-19c-84 -4 -98 -16 -98 -92v-188l163 393h58"],58126:[756,217,731,33,723,"723 0h-303v19l27 1c29 1 42 10 42 24c0 26 -55 84 -130 163l-77 -185c10 -1 20 -2 33 -3v-19h-42l-90 -217h-59l90 217h-181v19c79 4 91 19 91 106v424c0 74 -11 89 -90 94v19h282v-19c-83 -6 -90 -18 -90 -95v-200l210 190l40 93c-5 7 -16 10 -60 12v19h73l39 94h58 l-39 -94h128v-19c-68 -5 -87 -15 -156 -81l-22 -21l-96 -232l166 -181c83 -91 110 -109 156 -109v-19zM400 449l-67 -65l28 -31zM318 249l-66 68l-26 -21v-185c0 -29 2 -49 9 -62"],58128:[756,218,702,15,687,"687 0h-255v19c38 2 69 -1 69 33c0 15 -6 37 -19 70l-63 161l-208 -501h-59l239 574l-69 177h-2l-167 -431c-5 -13 -9 -30 -9 -42c0 -31 22 -41 70 -41v-19h-199v19c58 6 70 27 126 167l196 488h20l83 -199l117 281h58l-145 -351l123 -294c27 -65 42 -86 94 -92v-19"],58130:[756,217,889,12,864,"864 0h-280v19c79 5 90 21 90 104v449l-255 -572h-14l-31 67l-118 -284h-59l146 351l-190 415v-398c0 -110 16 -128 93 -132v-19h-234v19c83 6 97 20 97 132v398c0 76 -13 89 -95 94v19h198l184 -400l205 494h58l-232 -561l16 -35l221 502h199v-19 c-72 -1 -87 -18 -87 -93v-438c0 -71 15 -88 88 -93v-19"],58132:[756,218,722,12,707,"707 662v-19c-38 -4 -53 -7 -66 -18c-19 -17 -29 -39 -29 -118v-518h-18l-187 232l-182 -439h-59l203 487l-216 269v-388c0 -103 16 -120 93 -131v-19h-234v19c82 9 97 24 97 131v440c-33 41 -48 53 -97 53v19h170l230 -289l109 262c-13 4 -28 6 -51 8v19h62l39 94h58 l-39 -94h117zM568 179v340c0 32 -2 56 -7 73l-110 -267"],58134:[756,217,643,29,614,"614 0h-411l-90 -217h-59l90 217h-115v171h25c0 -60 35 -86 85 -86h40l87 210h-40c-46 0 -57 -32 -63 -77h-23v233h23c0 -56 22 -76 65 -76h71l86 205h-226c-52 0 -71 -20 -81 -89h-25v171h366l39 94h58l-39 -94h113v-169h-25c-10 64 -28 87 -81 87h-41l-85 -205h56 c47 0 65 21 66 76h23v-233h-23c0 51 -25 77 -69 77h-86l-87 -210h259c62 0 92 27 92 86h25v-171"],58136:[756,218,722,34,688,"580 756l-51 -124c99 -57 159 -168 159 -301c0 -206 -135 -345 -327 -345c-34 0 -65 4 -95 12l-89 -216h-59l97 235c-112 52 -181 166 -181 317c0 203 132 342 327 342c43 0 83 -7 119 -21l42 101h58zM504 572l-221 -535c24 -10 51 -15 79 -15c50 0 94 15 129 48 c55 53 83 147 83 267c0 99 -26 183 -70 235zM236 68l225 541c-30 20 -64 31 -101 31c-54 0 -104 -22 -143 -67c-43 -49 -69 -146 -69 -241c0 -118 28 -208 88 -264"],58138:[756,217,722,18,703,"703 0h-279v19c78 5 88 21 88 105v464c0 7 0 14 -2 19l-242 -586c8 -1 18 -2 29 -2v-19h-38l-91 -217h-59l91 217h-182v19c78 5 89 17 89 103v426c0 78 -12 89 -89 95v19h457l39 94h58l-39 -94h170v-19c-74 -6 -89 -18 -89 -95v-437c0 -71 14 -86 89 -92v-19zM459 624 h-214c-26 0 -36 -6 -36 -33v-478c0 -31 2 -52 11 -66"],58140:[756,218,557,16,565,"565 756l-67 -162c30 -27 44 -67 44 -114c0 -96 -79 -174 -169 -186l-112 -272c10 -2 21 -3 35 -3v-19h-44l-90 -218h-59l90 218h-177v19c78 6 84 17 84 103v429c0 74 -10 86 -84 92v19h259c74 0 134 -13 178 -36l54 130h58zM333 337l87 210c-24 56 -83 78 -183 78 c-29 0 -35 -9 -35 -36v-258c23 -2 41 -3 61 -3c26 0 50 3 70 9zM212 46l103 244c-14 -1 -30 -2 -44 -2c-26 0 -42 1 -69 3v-179c0 -31 2 -52 10 -66"],58142:[756,217,624,30,600,"600 204l-28 -204h-364l-90 -217h-59l90 217h-119v15l241 279l17 40l-258 313v15h394l39 94h58l-39 -94h74v-161h-25c-10 64 -32 96 -70 111l-93 -225l17 -20l-48 -55l-90 -217h211c77 0 104 33 119 109h23zM329 434l79 189c-9 1 -18 1 -27 1h-208zM226 185l-78 -90h41"],58144:[756,218,611,17,593,"593 492h-25c-15 72 -31 105 -70 119l-142 -343v-157c0 -76 14 -88 96 -92v-19h-207l-90 -218h-59l90 218h-26v19c14 0 28 5 38 10l56 133v458h-60c-106 0 -132 -18 -152 -128h-25l7 170h437l39 94h58l-39 -94h67zM356 408l87 211c-9 1 -18 1 -28 1h-59v-212"],58146:[756,218,722,29,703,"703 658v-19c-10 3 -21 5 -32 5c-29 0 -57 -7 -83 -19l-171 -415v-99c0 -78 19 -88 103 -92v-19h-190l-91 -218h-59l91 218h-57v19c32 2 55 5 70 11l31 75v190c-30 242 -102 328 -205 329c-18 0 -54 -11 -73 -18l-8 16c34 30 88 52 134 52c127 0 205 -82 230 -239h2 c19 96 77 169 143 207l47 114h58l-37 -88c11 2 22 3 33 3c22 0 41 -1 64 -13zM421 360l80 193c-42 -51 -70 -119 -80 -193"],58148:[756,217,763,35,728,"598 756l-85 -204c113 -21 215 -88 215 -222c0 -158 -161 -227 -271 -227h-25v-17c0 -54 32 -63 103 -67v-19h-252l-90 -217h-58l94 226v10h4l36 86c-158 14 -234 104 -234 225c0 166 153 230 295 230v20c0 45 -15 63 -101 63v19h272l39 94h58zM458 559l34 81 c-50 -7 -60 -27 -60 -60v-20c9 0 17 -1 26 -1zM430 491l13 31c-5 0 -9 1 -13 1v-32zM430 352v-212c93 0 189 65 189 178c0 78 -40 164 -123 194zM332 256v267c-111 0 -188 -107 -188 -205c0 -81 50 -155 141 -174zM330 85v18h-4l-31 -75c23 10 35 27 35 57"],58150:[756,217,722,10,704,"704 0h-296v19l26 2c32 2 50 11 50 29c0 16 -17 47 -51 98l-81 119l-200 -484h-59l90 217h-173v19c52 5 68 17 145 114l156 195l-106 155c-96 141 -117 153 -183 160v19h301v-19l-29 -1c-28 -1 -46 -6 -46 -29c0 -29 30 -67 83 -145l29 -43l137 331h58l-39 -94h180v-19 c-64 -4 -89 -21 -152 -99l-143 -177l192 -274c39 -56 58 -68 111 -74v-19zM445 492l42 52c30 37 40 52 40 67c0 14 -5 22 -21 26zM266 198l-47 -58c-32 -40 -53 -74 -53 -89c0 -12 7 -20 28 -26"],58152:[756,217,743,22,724,"724 676v-19c-43 -9 -47 -33 -47 -67c0 -17 4 -57 4 -79c0 -163 -146 -206 -257 -206v-194c0 -78 19 -88 103 -92v-19h-243l-90 -217h-92l217 522c-110 0 -254 44 -254 206c0 27 4 58 4 79c0 34 -4 58 -47 67v19h8c75 0 149 -36 149 -197c0 -67 47 -137 143 -137v220 c0 49 -10 81 -101 81v19h247l39 94h92l-172 -414c94 1 140 71 140 137c0 161 71 197 149 197h8zM424 556l31 76c-26 -13 -31 -37 -31 -70v-6zM321 87l-22 -52c14 9 20 25 22 52"],58154:[756,217,744,29,715,"715 0h-286l7 161c85 21 141 131 141 238c0 83 -26 152 -74 194l-194 -467l7 -126h-60l-90 -217h-58l90 217h-169v171h25c1 -61 18 -76 62 -76h122l16 40c-132 40 -201 120 -201 262c0 136 117 279 319 279c37 0 71 -5 102 -13l39 93h58l-46 -111 c105 -47 166 -143 166 -248c0 -146 -80 -227 -215 -265l-2 -37h154c41 0 60 24 62 74h25v-169zM272 177l185 446c-25 11 -53 17 -85 17c-136 0 -205 -121 -205 -241c0 -84 38 -181 105 -222"],58212:[756,240,673,55,665,"643 756l-41 -98c38 -9 63 -27 63 -61c0 -32 -18 -53 -53 -53c-22 0 -34 12 -47 25l-164 -396c22 -5 44 -11 64 -18c76 -27 101 -85 101 -132c0 -157 -129 -230 -252 -230c-23 0 -45 3 -67 9l-18 -42h-59l27 63c-21 12 -45 35 -56 53l18 16c10 -14 34 -29 51 -37l95 228 c-117 12 -250 34 -250 169c0 230 260 414 480 414h12l39 90h57zM347 184l173 418c-12 3 -33 6 -46 6c-149 0 -327 -129 -327 -293c0 -101 97 -116 200 -131zM359 72l-95 -231c13 -2 25 -3 37 -3c96 0 175 52 175 129c0 66 -55 92 -117 105"],58216:[756,218,557,8,645,"645 653l-32 -154l-21 2c3 22 3 27 3 33c0 58 -15 78 -112 84l-107 -257h93l-11 -36h-97l-127 -307c7 -1 16 -2 25 -2v-16h-32l-90 -218h-59l90 218h-160v16c58 4 68 26 83 78l123 442c7 25 10 45 10 61c0 28 -10 34 -76 40v16h291l43 103h58l-43 -103h148zM426 620h-30 c-46 0 -61 -6 -68 -32l-64 -227h54zM303 325h-49l-58 -210c-7 -25 -14 -45 -14 -60c0 -6 0 -11 3 -15"],58220:[773,218,645,-72,675,"675 498l-267 -354c-17 -23 -38 -54 -38 -73c0 -26 15 -37 35 -37c29 0 69 17 91 35l8 -15c-58 -49 -99 -72 -146 -72c-58 0 -80 37 -80 71c0 44 12 68 100 162l162 172l-195 -55l-358 -550h-59l345 530l-244 -69l-10 13l278 355c18 22 38 57 38 75c0 21 -15 35 -35 35 c-29 0 -69 -17 -91 -35l-8 15c59 49 99 72 146 72c58 0 80 -32 80 -66c0 -45 -23 -73 -113 -168l-162 -172l193 54l218 335h58l-205 -315l251 71"],58224:[756,218,708,7,668,"396 756l-24 -90c168 -1 296 -126 296 -325c0 -288 -203 -526 -452 -548v23c202 44 341 280 341 479c0 39 -5 85 -13 120c-160 -28 -260 -277 -292 -415h-53l-57 -218h-59l215 824c-14 0 -28 -1 -44 -4l-75 -280h-43l72 270c-58 -15 -124 -44 -185 -89l-16 18 c109 89 203 132 306 142l25 93h58zM355 600l-97 -372c67 105 162 199 275 223c-29 77 -97 131 -178 149"],58368:[683,218,541,32,457,"452 461l5 -4c-1 -33 -2 -66 -2 -99v-358c0 -114 -39 -218 -170 -218c-33 0 -93 12 -93 55c0 23 19 39 41 39c42 0 51 -60 90 -60c14 0 26 7 34 18c16 24 14 94 14 121v405c0 12 0 28 -6 38c-12 17 -51 19 -78 19h-19h-84v-327c0 -55 12 -71 68 -75v-15h-220v15 c61 2 68 24 68 81v321h-67v33h68c9 75 12 133 72 186c40 35 95 47 147 47c43 0 125 -9 125 -68c0 -24 -9 -41 -35 -41c-42 0 -60 84 -121 84c-28 0 -56 -12 -75 -32c-27 -28 -30 -67 -30 -105v-26v-45h154c39 0 76 5 114 11"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Alphabets/Regular/Main.js");
RizkyAdiSaputra/cdnjs
ajax/libs/mathjax/2.5.1/jax/output/SVG/fonts/STIX-Web/Alphabets/Regular/Main.js
JavaScript
mit
69,598
/* * /MathJax/jax/output/HTML-CSS/fonts/Latin-Modern/Size7/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.LatinModernMathJax_Size7={directory:"Size7/Regular",family:"LatinModernMathJax_Size7",testString:"\u00A0\u0302\u0303\u0306\u030C\u0311\u032C\u032D\u032E\u032F\u0330\u2016\u2044\u20E9\u2223",32:[0,0,332,0,0],40:[1745,1245,875,277,823],41:[1745,1245,875,52,598],47:[3560,3060,2572,57,2517],91:[1750,1250,667,321,647],92:[3560,3060,2572,55,2515],93:[1750,1250,667,20,346],123:[1750,1250,902,147,755],124:[2053,1553,278,100,179],125:[1750,1250,902,147,755],160:[0,0,332,0,0],770:[749,-569,1896,0,1896],771:[773,-527,1915,0,1915],774:[743,-573,1920,0,1920],780:[743,-563,1896,0,1896],785:[761,-591,1920,0,1920],812:[-96,276,1896,0,1896],813:[-108,288,1896,0,1896],814:[-96,266,1920,0,1920],815:[-118,288,1920,0,1920],816:[-118,364,1915,0,1915],8214:[2053,1553,424,57,369],8260:[3560,3060,2572,57,2517],8425:[772,-504,2985,0,2985],8739:[2053,1553,278,100,179],8741:[2053,1553,424,57,369],8968:[1750,1250,623,221,595],8969:[1750,1250,623,28,402],8970:[1750,1250,623,221,595],8971:[1750,1250,623,28,402],9001:[1750,1250,908,204,852],9002:[1750,1250,908,56,704],9140:[772,-504,2985,0,2985],9141:[-74,342,2985,0,2985],9180:[796,-502,4032,0,4032],9181:[-72,366,4032,0,4032],9182:[854,-493,4006,0,4006],9183:[-62,423,4006,0,4006],9184:[873,-605,4082,0,4082],9185:[-175,443,4082,0,4082],10214:[1750,1250,1007,353,985],10215:[1750,1250,1007,22,654],10216:[1750,1250,908,204,852],10217:[1750,1250,908,56,704],10218:[1750,1250,1362,204,1306],10219:[1750,1250,1362,56,1158],10222:[1776,1276,647,294,591],10223:[1776,1276,647,56,353],57344:[367,-133,222,0,222],57345:[367,-133,222,0,222],57346:[367,-133,222,0,222],57347:[748,0,902,400,502],57348:[1202,0,278,100,179],57349:[1202,0,278,100,179],57350:[1202,0,278,100,179],57351:[748,0,902,400,502],57352:[711,-601,208,0,208],57353:[631,-601,139,0,139],57354:[631,-601,208,0,208],57355:[631,-601,208,0,208],57356:[631,-601,139,0,139],57357:[711,-601,208,0,208],57358:[711,-521,205,0,205],57359:[631,-601,137,0,137],57360:[631,-601,205,0,205],57361:[631,-601,205,0,205],57362:[631,-601,137,0,137],57363:[711,-521,205,0,205],57364:[711,-521,226,0,226],57365:[631,-601,151,0,151],57366:[711,-521,226,0,226],57367:[-171,201,208,0,208],57368:[-171,201,139,0,139],57369:[-171,281,208,0,208],57370:[-171,281,208,0,208],57371:[-171,201,139,0,139],57372:[-171,201,208,0,208],57373:[-91,281,205,0,205],57374:[-171,201,137,0,137],57375:[-171,201,205,0,205],57376:[-171,201,205,0,205],57377:[-171,201,137,0,137],57378:[-91,281,205,0,205],57379:[510,10,507,0,507],57380:[270,-230,337,0,337],57381:[270,-230,507,0,507],57382:[270,-230,507,0,507],57383:[270,-230,337,0,337],57384:[510,10,507,0,507],57385:[506,0,500,230,270],57386:[337,0,500,230,270],57387:[505,0,500,20,480],57388:[505,0,500,20,480],57389:[337,0,500,230,270],57390:[506,0,500,230,270],57391:[510,10,386,0,386],57392:[270,-230,97,0,97],57393:[510,10,386,0,386],57394:[270,-230,386,0,386],57395:[270,-230,386,0,386],57396:[270,-230,96,0,96],57397:[510,10,386,0,386],57398:[510,10,386,0,386],57399:[510,10,499,0,499],57400:[270,-230,332,0,332],57401:[510,10,499,0,499],57402:[380,0,572,56,516],57403:[254,0,572,266,306],57404:[380,0,572,56,516],57405:[510,10,380,0,380],57406:[270,-230,95,0,95],57407:[510,10,380,0,380],57408:[510,10,380,0,380],57409:[510,10,507,0,507],57410:[270,-230,337,0,337],57411:[270,-230,507,0,507],57412:[270,-230,507,0,507],57413:[270,-230,337,0,337],57414:[510,10,507,0,507],57415:[506,0,572,266,306],57416:[337,0,572,266,306],57417:[505,0,572,56,516],57418:[505,0,572,56,516],57419:[337,0,572,266,306],57420:[506,0,572,266,306],57421:[510,10,580,0,580],57422:[270,-230,386,0,386],57423:[510,10,580,0,580],57424:[510,10,580,0,580],57425:[270,-230,386,0,386],57426:[510,10,580,0,580],57427:[510,10,499,0,499],57428:[270,-230,333,0,333],57429:[510,10,499,0,499],57430:[510,10,499,0,499],57431:[270,-230,333,0,333],57432:[510,10,499,0,499],57433:[498,0,632,55,576],57434:[332,0,632,296,336],57435:[498,0,632,86,546],57436:[498,0,632,86,546],57437:[332,0,632,296,336],57438:[498,0,632,55,576],57439:[550,-230,507,0,507],57440:[270,-230,337,0,337],57441:[510,10,507,0,507],57442:[510,10,507,0,507],57443:[270,-230,337,0,337],57444:[550,-230,507,0,507],57445:[550,50,507,0,507],57446:[270,-230,337,0,337],57447:[510,10,507,0,507],57448:[510,10,507,0,507],57449:[270,-230,337,0,337],57450:[550,50,507,0,507],57451:[503,-230,513,0,513],57452:[270,-230,341,0,341],57453:[270,-230,512,0,512],57454:[270,-230,512,0,512],57455:[270,-230,341,0,341],57456:[503,-230,513,0,513],57457:[270,3,512,0,512],57458:[270,-230,341,0,341],57459:[270,-230,513,0,513],57460:[270,-230,512,0,512],57461:[270,-230,341,0,341],57462:[270,3,513,0,513],57463:[512,0,441,112,152],57464:[341,0,441,112,152],57465:[513,0,441,112,385],57466:[513,0,441,112,385],57467:[341,0,441,112,152],57468:[512,0,441,112,152],57469:[512,0,441,289,329],57470:[341,0,441,289,329],57471:[513,0,441,56,329],57472:[513,0,441,56,329],57473:[341,0,441,289,329],57474:[512,0,441,289,329],57475:[432,172,515,0,515],57476:[432,-68,343,0,343],57477:[672,-68,514,0,514],57478:[672,-68,514,0,514],57479:[432,-68,343,0,343],57480:[432,172,515,0,515],57481:[515,0,896,266,840],57482:[343,0,896,266,630],57483:[514,0,896,56,630],57484:[514,0,896,56,630],57485:[343,0,896,266,630],57486:[515,0,896,266,840],57487:[750,250,507,0,507],57488:[510,10,337,0,337],57489:[510,10,507,0,507],57490:[510,10,507,0,507],57491:[510,10,337,0,337],57492:[750,250,507,0,507],57493:[506,0,992,266,726],57494:[337,0,992,266,726],57495:[505,0,992,56,936],57496:[505,0,992,56,936],57497:[337,0,992,266,726],57498:[506,0,992,266,726],57499:[750,250,507,0,507],57500:[750,250,337,0,337],57501:[990,490,507,0,507],57502:[990,490,507,0,507],57503:[750,250,337,0,337],57504:[750,250,507,0,507],57505:[600,-133,515,0,515],57506:[367,-133,343,0,343],57507:[367,100,514,0,514],57508:[367,100,514,0,514],57509:[367,-133,343,0,343],57510:[600,-133,515,0,515],57511:[520,20,504,0,504],57512:[367,-133,336,0,336],57513:[367,-133,505,0,505],57514:[367,-133,505,0,505],57515:[367,-133,336,0,336],57516:[520,20,504,0,504],57517:[505,0,652,209,443],57518:[336,0,652,209,443],57519:[504,0,652,56,596],57520:[504,0,652,56,596],57521:[336,0,652,209,443],57522:[505,0,652,209,443],57523:[520,20,533,0,533],57524:[367,-133,356,0,356],57525:[520,20,533,0,533],57526:[533,0,652,56,596],57527:[356,0,652,209,443],57528:[533,0,652,56,596],57529:[520,20,384,0,384],57530:[367,-133,97,0,97],57531:[520,20,384,0,384],57532:[367,-133,384,0,384],57533:[367,-133,384,0,384],57534:[367,-133,97,0,97],57535:[520,20,384,0,384],57536:[520,20,384,0,384],57537:[520,20,406,0,406],57538:[367,-133,102,0,102],57539:[520,20,406,0,406],57540:[520,20,406,0,406],57541:[520,20,497,0,497],57542:[367,-133,331,0,331],57543:[520,20,497,0,497],57544:[520,20,497,0,497],57545:[367,-133,331,0,331],57546:[520,20,497,0,497],57547:[617,117,506,0,506],57548:[464,-36,337,0,337],57549:[464,-36,506,0,506],57550:[464,-36,506,0,506],57551:[464,-36,337,0,337],57552:[617,117,506,0,506],57553:[520,20,519,0,519],57554:[367,-133,346,0,346],57555:[367,-133,519,0,519],57556:[367,-133,519,0,519],57557:[367,-133,346,0,346],57558:[520,20,519,0,519],57559:[519,0,652,209,443],57560:[346,0,652,209,443],57561:[519,0,652,56,596],57562:[519,0,652,56,596],57563:[346,0,652,209,443],57564:[519,0,652,209,443],57565:[524,0,652,56,596],57566:[349,0,652,209,443],57567:[523,0,652,56,596],57568:[520,20,524,0,524],57569:[367,-133,349,0,349],57570:[520,20,523,0,523],57571:[468,-31,492,0,492],57572:[347,-153,327,0,327],57573:[347,-153,492,0,492],57574:[347,-153,492,0,492],57575:[347,-153,327,0,327],57576:[468,-31,492,0,492],57577:[492,0,612,209,403],57578:[327,0,612,209,403],57579:[492,0,612,87,524],57580:[492,0,612,87,524],57581:[327,0,612,209,403],57582:[492,0,612,209,403],57583:[468,-31,484,0,484],57584:[347,-153,322,0,322],57585:[468,-31,484,0,484],57586:[484,0,549,56,492],57587:[322,0,549,177,371],57588:[484,0,549,56,492],57589:[-103,143,189,0,189],57590:[-103,143,190,0,190],57591:[-103,143,189,0,189],57592:[-103,293,189,0,189],57593:[-103,293,190,0,190],57594:[-103,293,189,0,189],57595:[670,-630,189,0,189],57596:[670,-630,190,0,190],57597:[670,-630,189,0,189],57598:[820,-630,189,0,189],57599:[820,-630,190,0,190],57600:[820,-630,189,0,189],57601:[1526,0,647,294,591],57602:[998,0,647,294,396],57603:[1526,0,647,294,591],57604:[1526,0,647,56,353],57605:[998,0,647,251,353],57606:[1526,0,647,56,353],57607:[1000,0,1007,353,985],57608:[1000,0,1007,353,714],57609:[1000,0,1007,353,985],57610:[1000,0,1007,22,654],57611:[1000,0,1007,293,654],57612:[1000,0,1007,22,654],57613:[724,-493,1002,0,1002],57614:[724,-622,994,0,994],57615:[854,-622,2003,0,2003],57616:[724,-493,1001,0,1001],57617:[-62,294,1002,0,1002],57618:[-192,294,994,0,994],57619:[-192,423,2003,0,2003],57620:[-62,294,1001,0,1001],57621:[796,-502,2016,0,2016],57622:[796,-694,994,0,994],57623:[796,-502,2016,0,2016],57624:[-72,366,2016,0,2016],57625:[-264,366,994,0,994],57626:[-72,366,2016,0,2016],57627:[772,-504,1493,0,1493],57628:[772,-712,995,0,995],57629:[772,-504,1492,0,1492],57630:[-74,342,1493,0,1493],57631:[-282,342,995,0,995],57632:[-74,342,1492,0,1492],57633:[873,-605,2041,0,2041],57634:[873,-771,1360,0,1360],57635:[873,-605,2041,0,2041],57636:[-175,443,2041,0,2041],57637:[-341,443,1360,0,1360],57638:[-175,443,2041,0,2041],57639:[270,-230,222,0,222],57640:[270,-230,222,0,222],57641:[270,-230,222,0,222],57642:[1202,0,424,57,369],57643:[1202,0,424,57,369],57644:[1202,0,424,57,369],57645:[464,-36,222,0,222],57646:[464,-36,222,0,222],57647:[464,-36,222,0,222],57648:[561,61,222,0,222],57649:[561,61,222,0,222],57650:[561,61,222,0,222],57651:[640,0,1056,702,742],57652:[620,0,1056,702,1076]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"LatinModernMathJax_Size7"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Size7/Regular/Main.js"]);
tholu/cdnjs
ajax/libs/mathjax/2.5.2/jax/output/HTML-CSS/fonts/Latin-Modern/Size7/Regular/Main.js
JavaScript
mit
10,573
/* * /MathJax/jax/output/SVG/fonts/STIX-Web/Shapes/Bold/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax.SVG.FONTDATA.FONTS["STIXMathJax_Shapes-bold"]={directory:"Shapes/Bold",family:"STIXMathJax_Shapes",weight:"bold",id:"STIXWEBSHAPESB",32:[0,0,250,0,0,""],160:[0,0,250,0,0,""],9251:[31,120,500,40,460,"460 -120h-420v151h42v-76h336v76h42v-151"],9655:[791,284,1043,70,1008,"1008 253l-938 -537v1075zM831 253l-673 386v-772"],9665:[791,284,1043,35,973,"973 -284l-938 537l938 538v-1075zM885 -133v772l-673 -386"],9708:[811,127,1145,35,1110,"688 239c0 -63 -52 -115 -115 -115s-115 52 -115 115s52 115 115 115s115 -52 115 -115zM1110 -127h-1075l538 938zM958 -39l-385 673l-386 -673h771"],57344:[610,25,1184,808,912,"912 -25h-104v635h104v-635"],57345:[704,-75,1198,808,1224,"1224 600h-312v-525h-104v629h416v-104"],57520:[752,-531,0,100,417,"417 680h-245v-149h-72v221h317v-72"],57521:[-50,271,0,100,417,"417 -271h-317v72h245v149h72v-221"],57522:[-50,271,0,99,416,"416 -271h-317v221h72v-149h245v-72"],57614:[405,-101,714,211,503,"503 101h-88v304h88v-304zM299 101h-88v304h88v-304"],57615:[399,-107,315,0,315,"315 311h-315v88h315v-88zM315 107h-315v88h315v-88"],57999:[175,0,325,-1,326,"326 0h-327v175h327v-175"],58000:[175,0,633,-1,634,"634 0h-635v175h635v-175"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Shapes/Bold/Main.js");
js-data/cdnjs
ajax/libs/mathjax/2.5.1/jax/output/SVG/fonts/STIX-Web/Shapes/Bold/Main.js
JavaScript
mit
1,934
/* * /MathJax/jax/output/SVG/fonts/STIX-Web/Size2/Regular/Main.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax.SVG.FONTDATA.FONTS.STIXMathJax_Size2={directory:"Size2/Regular",family:"STIXMathJax_Size2",id:"STIXWEBSIZE2",32:[0,0,250,0,0,""],40:[1566,279,589,139,503,"503 -243v-36c-213 200 -364 513 -364 922c0 400 151 752 364 923v-33c-134 -138 -269 -432 -269 -890c0 -456 135 -721 269 -886"],41:[1566,279,608,114,478,"114 1530v36c213 -200 364 -514 364 -923c0 -400 -151 -751 -364 -922v33c134 138 269 435 269 889c0 460 -135 722 -269 887"],47:[1566,279,806,25,781,"781 1566l-676 -1845h-80l676 1845h80"],91:[1566,279,459,190,422,"422 -279h-232v1845h232v-40h-156v-1765h156v-40"],92:[1566,279,806,25,781,"781 -279h-80l-676 1845h80"],93:[1566,279,459,37,269,"269 -279h-232v40h156v1765h-156v40h232v-1845"],123:[1566,279,717,124,531,"531 -239v-40c-152 23 -254 147 -254 415v248c0 90 -47 224 -153 243v32c106 20 153 154 153 244v248c0 268 106 402 254 415v-40c-83 -4 -164 -120 -164 -219c0 -30 5 -193 5 -204v-130c0 -148 -56 -267 -188 -330c132 -64 188 -181 188 -329v-131 c0 -11 -5 -173 -5 -203c0 -100 46 -181 164 -219"],125:[1566,279,717,186,593,"593 660v-32c-106 -20 -153 -154 -153 -244v-248c0 -268 -106 -402 -254 -415v40c83 4 164 120 164 219c0 30 -5 193 -5 204v130c0 148 56 266 188 329c-132 64 -188 182 -188 330v131c0 11 5 173 5 203c0 100 -46 181 -164 219v40c152 -23 254 -147 254 -415v-248 c0 -90 47 -224 153 -243"],160:[0,0,250,0,0,""],710:[777,-564,979,0,979,"979 564h-99l-390 145l-391 -145h-99l466 213h48"],711:[777,-564,979,0,979,"979 777l-465 -213h-48l-466 213h99l391 -145l390 145h99"],732:[760,-608,977,-2,977,"951 760h26c-19 -106 -96 -152 -227 -152c-129 0 -148 16 -351 60c-94 20 -162 31 -201 31c-94 0 -155 -31 -174 -91h-26c20 112 99 152 215 152c62 0 182 -21 356 -61c94 -22 164 -32 206 -32c99 0 161 32 176 93"],759:[-117,269,977,-2,977,"951 -117h26c-19 -106 -96 -152 -227 -152c-129 0 -148 16 -351 60c-94 20 -162 31 -201 31c-94 0 -155 -31 -174 -91h-26c20 112 99 152 215 152c62 0 182 -21 356 -61c94 -22 164 -32 206 -32c99 0 161 32 176 93"],770:[777,-564,979,0,979,"979 564h-99l-390 145l-391 -145h-99l466 213h48"],771:[760,-608,979,0,979,"953 760h26c-19 -106 -96 -152 -227 -152c-129 0 -148 16 -351 60c-94 20 -162 31 -201 31c-94 0 -155 -31 -174 -91h-26c20 112 99 152 215 152c62 0 182 -21 356 -61c94 -22 164 -32 206 -32c99 0 161 32 176 93"],773:[820,-770,1500,0,1500,"1500 770h-1500v50h1500v-50"],780:[777,-564,979,0,979,"979 777l-465 -213h-48l-466 213h99l391 -145l390 145h99"],816:[-117,269,979,0,979,"953 -117h26c-19 -106 -96 -152 -227 -152c-129 0 -148 16 -351 60c-94 20 -162 31 -201 31c-94 0 -155 -31 -174 -91h-26c20 112 99 152 215 152c62 0 182 -21 356 -61c94 -22 164 -32 206 -32c99 0 161 32 176 93"],818:[-127,177,1500,0,1500,"1500 -177h-1500v50h1500v-50"],824:[662,0,0,-720,-6,"-6 662l-645 -662h-69l645 662h69"],8254:[820,-770,1500,0,1500,"1500 770h-1500v50h1500v-50"],8400:[749,-584,1307,0,1308,"1308 584h-1308v5c96 46 142 85 202 160l20 -19c-23 -33 -16 -27 -46 -58c-9 -9 -14 -16 -14 -24c0 -10 8 -14 26 -14h1120v-50"],8401:[749,-584,1308,0,1308,"1308 584h-1308v50h1120c18 0 26 4 26 14c0 8 -5 15 -14 24c-30 31 -23 25 -46 58l20 19c60 -75 106 -114 202 -160v-5"],8406:[735,-482,1308,0,1308,"1308 584h-1137c-18 0 -26 -10 -26 -20c0 -8 7 -16 14 -25s8 -11 29 -41l-20 -16c-62 67 -77 84 -168 122v10c91 37 106 52 168 121l20 -16c-22 -28 -20 -28 -31 -40c-9 -9 -12 -14 -12 -23c0 -16 17 -22 27 -22h1136v-50"],8407:[735,-482,1308,0,1308,"1308 614v-10c-91 -38 -106 -55 -168 -122l-20 16c21 30 22 32 29 41s14 17 14 25c0 10 -8 20 -26 20h-1137v50h1136c10 0 27 6 27 22c0 9 -3 14 -12 23c-11 12 -9 12 -31 40l20 16c62 -69 77 -84 168 -121"],8428:[-123,288,1308,0,1308,"1308 -123v-5c-96 -46 -142 -85 -202 -160l-20 19c23 33 16 27 46 58c9 9 14 16 14 24c0 10 -8 14 -26 14h-1120v50h1308"],8429:[-123,288,1308,0,1308,"1308 -173h-1120c-18 0 -26 -4 -26 -14c0 -8 5 -15 14 -24c30 -31 23 -25 46 -58l-20 -19c-60 75 -106 114 -202 160v5h1308v-50"],8430:[-26,279,1308,0,1308,"1308 -177h-1137c-18 0 -26 -10 -26 -20c0 -8 7 -16 14 -25s8 -11 29 -41l-20 -16c-62 67 -77 84 -168 122v10c91 37 106 52 168 121l20 -16c-22 -28 -20 -28 -31 -40c-9 -9 -12 -14 -12 -23c0 -16 17 -22 27 -22h1136v-50"],8431:[-26,279,1308,0,1308,"1308 -147v-10c-91 -38 -106 -55 -168 -122l-20 16c21 30 22 32 29 41s14 17 14 25c0 10 -8 20 -26 20h-1137v50h1136c10 0 27 6 27 22c0 9 -3 14 -12 23c-11 12 -9 12 -31 40l20 16c62 -69 77 -84 168 -121"],8730:[2056,404,1124,110,1157,"1157 2056l-590 -2460h-59l-250 1032c-11 46 -26 82 -64 82c-17 0 -46 -10 -69 -28l-15 27l183 127h28l239 -989h7l529 2209h61"],8731:[2056,404,1124,110,1157,"344 1171l-13 2c16 52 50 88 106 88c51 0 84 -29 84 -74c0 -26 -17 -58 -47 -77c48 -18 76 -42 76 -95c0 -84 -80 -127 -161 -127c-39 0 -60 19 -60 38c0 11 10 19 23 19c8 0 17 -3 32 -14c20 -14 31 -17 46 -17c40 0 71 30 71 77c0 41 -20 66 -57 78c-11 4 -23 5 -55 5 v12c21 7 35 13 46 19c27 15 44 36 44 68c0 37 -23 55 -58 55c-34 0 -54 -17 -77 -57zM1157 2056l-590 -2460h-59l-250 1032c-11 46 -26 82 -64 82c-17 0 -46 -10 -69 -28l-15 27l183 127h28l239 -989h7l529 2209h61"],8732:[2056,404,1124,110,1157,"563 982h-56v-90h-50v90h-152v43l170 233h32v-233h56v-43zM457 1025v175l-128 -175h128zM1157 2056l-590 -2460h-59l-250 1032c-11 46 -26 82 -64 82c-17 0 -46 -10 -69 -28l-15 27l183 127h28l239 -989h7l529 2209h61"],8968:[1566,279,524,190,479,"479 1526h-213v-1805h-76v1845h289v-40"],8969:[1566,279,526,47,336,"336 -279h-76v1805h-213v40h289v-1845"],8970:[1566,279,524,190,479,"479 -279h-289v1845h76v-1805h213v-40"],8971:[1566,279,526,47,336,"336 -279h-289v40h213v1805h76v-1845"],9140:[766,-544,1606,74,1532,"1532 544h-66v156h-1326v-156h-66v222h1458v-222"],9141:[139,83,1606,74,1532,"1532 -83h-1458v222h66v-156h1326v156h66v-222"],9168:[690,189,266,100,166,"166 -189h-66v879h66v-879"],9180:[66,147,1460,0,1460,"1460 -147h-36c-130 79 -333 147 -695 147c-363 0 -563 -68 -693 -147h-36c159 124 407 213 729 213c319 0 572 -89 731 -213"],9181:[785,-572,1460,0,1460,"1424 785h36c-159 -124 -412 -213 -731 -213c-322 0 -570 89 -729 213h36c130 -79 330 -147 693 -147c362 0 565 68 695 147"],9182:[143,81,1460,0,1460,"1460 -81h-33c-17 54 -93 84 -173 84c-23 0 -150 -3 -160 -3h-105c-117 0 -208 41 -258 110h-2c-50 -69 -140 -110 -257 -110h-105c-10 0 -82 3 -162 3c-79 0 -142 -22 -172 -84h-33c19 81 117 147 329 147h200c69 0 172 21 189 77h25c16 -56 120 -77 190 -77h199 c212 0 309 -66 328 -147"],9183:[797,-573,1460,0,1460,"1427 797h33c-19 -81 -116 -147 -328 -147h-199c-70 0 -174 -21 -190 -77h-25c-17 56 -120 77 -189 77h-200c-212 0 -310 66 -329 147h33c30 -62 93 -84 172 -84c80 0 152 3 162 3h105c117 0 207 -41 257 -110h2c50 69 141 110 258 110h105c10 0 137 -3 160 -3 c80 0 156 30 173 84"],9184:[66,212,1886,0,1886,"1886 -212l-240 212h-1406l-240 -211v52l217 225h1452l217 -226v-52"],9185:[842,-564,1886,0,1886,"1886 789l-217 -225h-1452l-217 226v52l240 -212h1406l240 211v-52"],10098:[1566,279,688,230,651,"651 -279h-71l-350 329v1187l350 329h71l-336 -361v-1123"],10099:[1566,279,688,37,458,"458 50l-350 -329h-71l336 361v1123l-336 361h71l350 -329v-1187"],10214:[1566,279,555,190,517,"517 -279h-327v1845h327v-40h-77v-1765h77v-40zM384 -239v1765c-71 0 -118 -17 -118 -99v-1556c0 -74 42 -110 118 -110"],10215:[1566,279,555,38,365,"365 -279h-327v40h77v1765h-77v40h327v-1845zM289 -140v1556c0 74 -42 110 -118 110v-1765c71 0 118 17 118 99"],10216:[1566,279,622,95,531,"531 -279h-90l-346 922l346 923h90l-341 -923"],10217:[1566,279,622,91,527,"527 643l-346 -922h-90l341 922l-341 923h90"],10218:[1566,279,901,93,793,"793 -279h-71l-350 922l350 923h71l-336 -923zM514 -279h-71l-350 922l350 923h71l-336 -923"],10219:[1566,279,901,108,808,"808 644l-350 -923h-71l336 923l-336 922h71zM529 644l-350 -923h-71l336 923l-336 922h71"],10627:[1566,279,827,122,692,"692 -279h-173c-153 0 -244 147 -244 415v248c0 90 -47 224 -153 243v32c106 20 153 154 153 244v248c0 268 91 415 244 415h173v-33h-116v-1779h116v-33zM516 -246v1779h-7c-83 0 -144 -127 -144 -226c0 -30 5 -193 5 -204v-130c0 -148 -56 -267 -188 -330 c132 -64 188 -181 188 -329v-131c0 -11 -5 -173 -5 -203c0 -100 61 -226 144 -226h7"],10628:[1565,280,827,135,705,"705 659v-32c-106 -20 -153 -154 -153 -244v-248c0 -268 -91 -415 -244 -415h-173v33h116v1779h-116v33h173c153 0 244 -147 244 -415v-248c0 -90 47 -224 153 -243zM457 183v130c0 148 56 267 188 330c-132 64 -188 181 -188 329v131c0 11 5 173 5 203 c0 100 -61 226 -144 226h-7v-1779h7c83 0 144 127 144 226c0 30 -5 193 -5 204"],10629:[1566,282,793,155,693,"693 -238v-44c-300 161 -538 436 -538 922c0 478 238 765 538 926v-44c-30 -18 -57 -40 -84 -64c-85 -98 -148 -328 -148 -818c0 -497 59 -718 147 -815c27 -21 58 -47 85 -63zM516 -96c-89 143 -115 355 -115 736c0 378 26 592 115 737c-139 -140 -266 -361 -266 -735 c0 -380 127 -599 266 -738"],10630:[1566,282,793,100,638,"100 1522v44c300 -161 538 -436 538 -922c0 -478 -238 -765 -538 -926v44c30 18 57 40 84 64c85 98 148 328 148 818c0 497 -59 718 -147 815c-27 21 -58 47 -85 63zM543 642c0 380 -127 599 -266 738c89 -143 115 -355 115 -736c0 -378 -26 -592 -115 -737 c139 140 266 361 266 735"],11004:[1586,289,906,133,773,"773 -289h-100v1875h100v-1875zM503 -289h-100v1875h100v-1875zM233 -289h-100v1875h100v-1875"],11007:[1586,289,636,133,503,"503 -289h-370v1875h370v-1875zM403 -189v1675h-170v-1675h170"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Size2/Regular/Main.js");
perdona/cdnjs
ajax/libs/mathjax/2.5.0/jax/output/SVG/fonts/STIX-Web/Size2/Regular/Main.js
JavaScript
mit
9,764
// Load modules var Boom = require('boom'); var Hoek = require('hoek'); var Cryptiles = require('cryptiles'); var Crypto = require('./crypto'); var Utils = require('./utils'); // Declare internals var internals = {}; // Hawk authentication /* req: node's HTTP request object or an object as follows: var request = { method: 'GET', url: '/resource/4?a=1&b=2', host: 'example.com', port: 8080, authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="' }; credentialsFunc: required function to lookup the set of Hawk credentials based on the provided credentials id. The credentials include the MAC key, MAC algorithm, and other attributes (such as username) needed by the application. This function is the equivalent of verifying the username and password in Basic authentication. var credentialsFunc = function (id, callback) { // Lookup credentials in database db.lookup(id, function (err, item) { if (err || !item) { return callback(err); } var credentials = { // Required key: item.key, algorithm: item.algorithm, // Application specific user: item.user }; return callback(null, credentials); }); }; options: { hostHeaderName: optional header field name, used to override the default 'Host' header when used behind a cache of a proxy. Apache2 changes the value of the 'Host' header while preserving the original (which is what the module must verify) in the 'x-forwarded-host' header field. Only used when passed a node Http.ServerRequest object. nonceFunc: optional nonce validation function. The function signature is function(key, nonce, ts, callback) where 'callback' must be called using the signature function(err). timestampSkewSec: optional number of seconds of permitted clock skew for incoming timestamps. Defaults to 60 seconds. Provides a +/- skew which means actual allowed window is double the number of seconds. localtimeOffsetMsec: optional local clock time offset express in a number of milliseconds (positive or negative). Defaults to 0. payload: optional payload for validation. The client calculates the hash value and includes it via the 'hash' header attribute. The server always ensures the value provided has been included in the request MAC. When this option is provided, it validates the hash value itself. Validation is done by calculating a hash value over the entire payload (assuming it has already be normalized to the same format and encoding used by the client to calculate the hash on request). If the payload is not available at the time of authentication, the authenticatePayload() method can be used by passing it the credentials and attributes.hash returned in the authenticate callback. host: optional host name override. Only used when passed a node request object. port: optional port override. Only used when passed a node request object. } callback: function (err, credentials, artifacts) { } */ exports.authenticate = function (req, credentialsFunc, options, callback) { callback = Hoek.nextTick(callback); // Default options options.nonceFunc = options.nonceFunc || internals.nonceFunc; options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds // Application time var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing // Convert node Http request object to a request configuration object var request = Utils.parseRequest(req, options); if (request instanceof Error) { return callback(Boom.badRequest(request.message)); } // Parse HTTP Authorization header var attributes = Utils.parseAuthorizationHeader(request.authorization); if (attributes instanceof Error) { return callback(attributes); } // Construct artifacts container var artifacts = { method: request.method, host: request.host, port: request.port, resource: request.url, ts: attributes.ts, nonce: attributes.nonce, hash: attributes.hash, ext: attributes.ext, app: attributes.app, dlg: attributes.dlg, mac: attributes.mac, id: attributes.id }; // Verify required header attributes if (!attributes.id || !attributes.ts || !attributes.nonce || !attributes.mac) { return callback(Boom.badRequest('Missing attributes'), null, artifacts); } // Fetch Hawk credentials credentialsFunc(attributes.id, function (err, credentials) { if (err) { return callback(err, credentials || null, artifacts); } if (!credentials) { return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, artifacts); } if (!credentials.key || !credentials.algorithm) { return callback(Boom.internal('Invalid credentials'), credentials, artifacts); } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return callback(Boom.internal('Unknown algorithm'), credentials, artifacts); } // Calculate MAC var mac = Crypto.calculateMac('header', credentials, artifacts); if (!Cryptiles.fixedTimeComparison(mac, attributes.mac)) { return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, artifacts); } // Check payload hash if (options.payload || options.payload === '') { if (!attributes.hash) { return callback(Boom.unauthorized('Missing required payload hash', 'Hawk'), credentials, artifacts); } var hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.contentType); if (!Cryptiles.fixedTimeComparison(hash, attributes.hash)) { return callback(Boom.unauthorized('Bad payload hash', 'Hawk'), credentials, artifacts); } } // Check nonce options.nonceFunc(credentials.key, attributes.nonce, attributes.ts, function (err) { if (err) { return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials, artifacts); } // Check timestamp staleness if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) { var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec); return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts); } // Successful authentication return callback(null, credentials, artifacts); }); }); }; // Authenticate payload hash - used when payload cannot be provided during authenticate() /* payload: raw request payload credentials: from authenticate callback artifacts: from authenticate callback contentType: req.headers['content-type'] */ exports.authenticatePayload = function (payload, credentials, artifacts, contentType) { var calculatedHash = Crypto.calculatePayloadHash(payload, credentials.algorithm, contentType); return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash); }; // Authenticate payload hash - used when payload cannot be provided during authenticate() /* calculatedHash: the payload hash calculated using Crypto.calculatePayloadHash() artifacts: from authenticate callback */ exports.authenticatePayloadHash = function (calculatedHash, artifacts) { return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash); }; // Generate a Server-Authorization header for a given response /* credentials: {}, // Object received from authenticate() artifacts: {} // Object received from authenticate(); 'mac', 'hash', and 'ext' - ignored options: { ext: 'application-specific', // Application specific data sent via the ext attribute payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided) contentType: 'application/json', // Payload content-type (ignored if hash provided) hash: 'U4MKKSmiVxk37JCCrAVIjV=' // Pre-calculated payload hash } */ exports.header = function (credentials, artifacts, options) { // Prepare inputs options = options || {}; if (!artifacts || typeof artifacts !== 'object' || typeof options !== 'object') { return ''; } artifacts = Hoek.clone(artifacts); delete artifacts.mac; artifacts.hash = options.hash; artifacts.ext = options.ext; // Validate credentials if (!credentials || !credentials.key || !credentials.algorithm) { // Invalid credential object return ''; } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return ''; } // Calculate payload hash if (!artifacts.hash && (options.payload || options.payload === '')) { artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType); } var mac = Crypto.calculateMac('response', credentials, artifacts); // Construct header var header = 'Hawk mac="' + mac + '"' + (artifacts.hash ? ', hash="' + artifacts.hash + '"' : ''); if (artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '') { // Other falsey values allowed header += ', ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) + '"'; } return header; }; /* * Arguments and options are the same as authenticate() with the exception that the only supported options are: * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port' */ exports.authenticateBewit = function (req, credentialsFunc, options, callback) { callback = Hoek.nextTick(callback); // Application time var now = Utils.now(options.localtimeOffsetMsec); // Convert node Http request object to a request configuration object var request = Utils.parseRequest(req, options); if (request instanceof Error) { return callback(Boom.badRequest(request.message)); } // Extract bewit // 1 2 3 4 var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/); if (!resource) { return callback(Boom.unauthorized(null, 'Hawk')); } // Bewit not empty if (!resource[3]) { return callback(Boom.unauthorized('Empty bewit', 'Hawk')); } // Verify method is GET if (request.method !== 'GET' && request.method !== 'HEAD') { return callback(Boom.unauthorized('Invalid method', 'Hawk')); } // No other authentication if (request.authorization) { return callback(Boom.badRequest('Multiple authentications')); } // Parse bewit var bewitString = Hoek.base64urlDecode(resource[3]); if (bewitString instanceof Error) { return callback(Boom.badRequest('Invalid bewit encoding')); } // Bewit format: id\exp\mac\ext ('\' is used because it is a reserved header attribute character) var bewitParts = bewitString.split('\\'); if (bewitParts.length !== 4) { return callback(Boom.badRequest('Invalid bewit structure')); } var bewit = { id: bewitParts[0], exp: parseInt(bewitParts[1], 10), mac: bewitParts[2], ext: bewitParts[3] || '' }; if (!bewit.id || !bewit.exp || !bewit.mac) { return callback(Boom.badRequest('Missing bewit attributes')); } // Construct URL without bewit var url = resource[1]; if (resource[4]) { url += resource[2] + resource[4]; } // Check expiration if (bewit.exp * 1000 <= now) { return callback(Boom.unauthorized('Access expired', 'Hawk'), null, bewit); } // Fetch Hawk credentials credentialsFunc(bewit.id, function (err, credentials) { if (err) { return callback(err, credentials || null, bewit.ext); } if (!credentials) { return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, bewit); } if (!credentials.key || !credentials.algorithm) { return callback(Boom.internal('Invalid credentials'), credentials, bewit); } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return callback(Boom.internal('Unknown algorithm'), credentials, bewit); } // Calculate MAC var mac = Crypto.calculateMac('bewit', credentials, { ts: bewit.exp, nonce: '', method: 'GET', resource: url, host: request.host, port: request.port, ext: bewit.ext }); if (!Cryptiles.fixedTimeComparison(mac, bewit.mac)) { return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, bewit); } // Successful authentication return callback(null, credentials, bewit); }); }; /* * options are the same as authenticate() with the exception that the only supported options are: * 'nonceFunc', 'timestampSkewSec', 'localtimeOffsetMsec' */ exports.authenticateMessage = function (host, port, message, authorization, credentialsFunc, options, callback) { callback = Hoek.nextTick(callback); // Default options options.nonceFunc = options.nonceFunc || internals.nonceFunc; options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds // Application time var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing // Validate authorization if (!authorization.id || !authorization.ts || !authorization.nonce || !authorization.hash || !authorization.mac) { return callback(Boom.badRequest('Invalid authorization')); } // Fetch Hawk credentials credentialsFunc(authorization.id, function (err, credentials) { if (err) { return callback(err, credentials || null); } if (!credentials) { return callback(Boom.unauthorized('Unknown credentials', 'Hawk')); } if (!credentials.key || !credentials.algorithm) { return callback(Boom.internal('Invalid credentials'), credentials); } if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { return callback(Boom.internal('Unknown algorithm'), credentials); } // Construct artifacts container var artifacts = { ts: authorization.ts, nonce: authorization.nonce, host: host, port: port, hash: authorization.hash }; // Calculate MAC var mac = Crypto.calculateMac('message', credentials, artifacts); if (!Cryptiles.fixedTimeComparison(mac, authorization.mac)) { return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials); } // Check payload hash var hash = Crypto.calculatePayloadHash(message, credentials.algorithm); if (!Cryptiles.fixedTimeComparison(hash, authorization.hash)) { return callback(Boom.unauthorized('Bad message hash', 'Hawk'), credentials); } // Check nonce options.nonceFunc(credentials.key, authorization.nonce, authorization.ts, function (err) { if (err) { return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials); } // Check timestamp staleness if (Math.abs((authorization.ts * 1000) - now) > (options.timestampSkewSec * 1000)) { return callback(Boom.unauthorized('Stale timestamp'), credentials); } // Successful authentication return callback(null, credentials); }); }); }; internals.nonceFunc = function (key, nonce, ts, nonceCallback) { return nonceCallback(); // No validation };
kowall116/roadTrip
node_modules/gulp-nodemon/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/lib/server.js
JavaScript
mit
17,819
/** * plugin.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /*global tinymce:true */ tinymce.PluginManager.add('insertdatetime', function(editor) { var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' '); var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' '); var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' '); var monthsLong = "January February March April May June July August September October November December".split(' '); var menuItems = [], lastFormat, defaultButtonTimeFormat; function getDateTime(fmt, date) { function addZeros(value, len) { value = "" + value; if (value.length < len) { for (var i = 0; i < (len - value.length); i++) { value = "0" + value; } } return value; } date = date || new Date(); fmt = fmt.replace("%D", "%m/%d/%Y"); fmt = fmt.replace("%r", "%I:%M:%S %p"); fmt = fmt.replace("%Y", "" + date.getFullYear()); fmt = fmt.replace("%y", "" + date.getYear()); fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2)); fmt = fmt.replace("%d", addZeros(date.getDate(), 2)); fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2)); fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2)); fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2)); fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1)); fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM")); fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()])); fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()])); fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()])); fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()])); fmt = fmt.replace("%%", "%"); return fmt; } function insertDateTime(format) { var html = getDateTime(format); if (editor.settings.insertdatetime_element) { var computerTime; if (/%[HMSIp]/.test(format)) { computerTime = getDateTime("%Y-%m-%dT%H:%M"); } else { computerTime = getDateTime("%Y-%m-%d"); } html = '<time datetime="' + computerTime + '">' + html + '</time>'; var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); if (timeElm) { editor.dom.setOuterHTML(timeElm, html); return; } } editor.insertContent(html); } editor.addCommand('mceInsertDate', function() { insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d"))); }); editor.addCommand('mceInsertTime', function() { insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S'))); }); editor.addButton('insertdatetime', { type: 'splitbutton', title: 'Insert date/time', onclick: function() { insertDateTime(lastFormat || defaultButtonTimeFormat); }, menu: menuItems }); tinymce.each(editor.settings.insertdatetime_formats || [ "%H:%M:%S", "%Y-%m-%d", "%I:%M:%S %p", "%D" ], function(fmt) { if (!defaultButtonTimeFormat) { defaultButtonTimeFormat = fmt; } menuItems.push({ text: getDateTime(fmt), onclick: function() { lastFormat = fmt; insertDateTime(fmt); } }); }); editor.addMenuItem('insertdatetime', { icon: 'date', text: 'Insert date/time', menu: menuItems, context: 'insert' }); });
menuka94/cdnjs
ajax/libs/tinymce/4.3.5/plugins/insertdatetime/plugin.js
JavaScript
mit
3,491
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Exception; /** * Thrown when a scope widening injection is detected. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class ScopeWideningInjectionException extends RuntimeException { private $sourceServiceId; private $sourceScope; private $destServiceId; private $destScope; public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null) { parent::__construct(sprintf( 'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. ' .'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. ' .'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.', $sourceServiceId, $destServiceId, $sourceServiceId, $destScope, $destServiceId ), 0, $previous); $this->sourceServiceId = $sourceServiceId; $this->sourceScope = $sourceScope; $this->destServiceId = $destServiceId; $this->destScope = $destScope; } public function getSourceServiceId() { return $this->sourceServiceId; } public function getSourceScope() { return $this->sourceScope; } public function getDestServiceId() { return $this->destServiceId; } public function getDestScope() { return $this->destScope; } }
AlondraHA/pagina
vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Exception/ScopeWideningInjectionException.php
PHP
mit
1,943
var escapeHtmlChar = require('./_escapeHtmlChar'), toString = require('./toString'); /** Used to match HTML entities and HTML characters. */ var reUnescapedHtml = /[&<>"']/g, reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, &amp; pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } module.exports = escape;
tbone849/magic8
dist/node_modules/lodash/escape.js
JavaScript
mit
1,444
"use strict";angular.module("ngLocale",[],["$provide",function(e){function r(e){e+="";var r=e.indexOf(".");return r==-1?0:e.length-r-1}function i(e,i){var a=i;void 0===a&&(a=Math.min(r(e),3));var s=Math.pow(10,a),n=(e*s|0)%s;return{v:a,f:n}}var a={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["priekšpusdienā","pēcpusdienā"],DAY:["svētdiena","pirmdiena","otrdiena","trešdiena","ceturtdiena","piektdiena","sestdiena"],ERANAMES:["pirms mūsu ēras","mūsu ērā"],ERAS:["p.m.ē.","m.ē."],FIRSTDAYOFWEEK:0,MONTH:["janvāris","februāris","marts","aprīlis","maijs","jūnijs","jūlijs","augusts","septembris","oktobris","novembris","decembris"],SHORTDAY:["Sv","Pr","Ot","Tr","Ce","Pk","Se"],SHORTMONTH:["janv.","febr.","marts","apr.","maijs","jūn.","jūl.","aug.","sept.","okt.","nov.","dec."],STANDALONEMONTH:["Janvāris","Februāris","Marts","Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],WEEKENDRANGE:[5,6],fullDate:"EEEE, y. 'gada' d. MMMM",longDate:"y. 'gada' d. MMMM",medium:"y. 'gada' d. MMM HH:mm:ss",mediumDate:"y. 'gada' d. MMM",mediumTime:"HH:mm:ss",short:"dd.MM.yy HH:mm",shortDate:"dd.MM.yy",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"€",DECIMAL_SEP:",",GROUP_SEP:" ",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:0,lgSize:0,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:" ¤",posPre:"",posSuf:" ¤"}]},id:"lv-lv",localeID:"lv_LV",pluralCat:function(e,r){var s=i(e,r);return e%10==0||e%100>=11&&e%100<=19||2==s.v&&s.f%100>=11&&s.f%100<=19?a.ZERO:e%10==1&&e%100!=11||2==s.v&&s.f%10==1&&s.f%100!=11||2!=s.v&&s.f%10==1?a.ONE:a.OTHER}})}]); //# sourceMappingURL=angular-locale_lv-lv.min.js.map
kennynaoh/cdnjs
ajax/libs/angular-i18n/1.6.0/angular-locale_lv-lv.min.js
JavaScript
mit
1,797
.label,label{display:block;width:100%}.label[for],label[for]{display:block;width:100%;padding-top:0.5em;padding-bottom:0.5em;cursor:pointer}.field{padding-top:0.5em;padding-bottom:0.5em;padding-left:0.5em;padding-right:0.5em;display:block;width:100%;font-size:0.9em;font-weight:normal;background-color:#fff;border:1px solid #c4c4c4;border-radius:4px;box-shadow:0 3px 3px -3px #d0d0d0 inset;resize:vertical;-webkit-appearance:none;-moz-appearance:none;appearance:none}.label__field{padding-top:0.5em;padding-bottom:0.5em;padding-left:0.5em;padding-right:0.5em;display:block;width:100%;font-size:0.9em;font-weight:normal;background-color:#fff;border:1px solid #c4c4c4;border-radius:4px;box-shadow:0 3px 3px -3px #d0d0d0 inset;resize:vertical;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-top:0.5em}.field--error{border:1px solid #EF4F52;border-left-width:3px;color:#EF4F52}.field--success{border:1px solid #66BB6A;border-left-width:3px}.field--disabled,.field:disabled{color:#b7b7b7;cursor:not-allowed;background-color:#eaeaea;border:1px solid #c4c4c4}.field--super{font-size:3em}.field--xlarge{font-size:2em}.field--large{font-size:1.5em}.field--medium{font-size:0.9em}.field--small{font-size:0.8em}.field--xsmall{font-size:0.65em}.choice{padding-top:0.5em;padding-bottom:0.5em;display:block;font-size:0.9em;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.choice--error{color:#EF4F52}.choice--success{color:#66BB6A}.choice--disabled,.choice:disabled{color:#b7b7b7;cursor:not-allowed}.choice--super{font-size:3em}.choice--xlarge{font-size:2em}.choice--large{font-size:1.5em}.choice--medium{font-size:0.9em}.choice--small{font-size:0.8em}.choice--xsmall{font-size:0.65em}select.choice{padding-top:0.5em;padding-bottom:0.5em;padding-left:0.5em;padding-right:0.5em;display:block;width:100%;font-size:0.9em;font-weight:normal;background-color:#fff;border:1px solid #c4c4c4;border-radius:4px;box-shadow:0 3px 3px -3px #d0d0d0 inset;resize:vertical;-webkit-appearance:none;-moz-appearance:none;appearance:none}select:not([multiple]).choice{padding-top:0.5em;padding-bottom:0.5em;display:block;font-size:0.9em;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-appearance:menulist;-moz-appearance:menulist;appearance:menulist;height:2.5em}select:not([multiple]).choice--super{font-size:3em}select:not([multiple]).choice--xlarge{font-size:2em}select:not([multiple]).choice--large{font-size:1.5em}select:not([multiple]).choice--medium{font-size:0.9em}select:not([multiple]).choice--small{font-size:0.8em}select:not([multiple]).choice--xsmall{font-size:0.65em}select.choice--error{border:1px solid #EF4F52;border-left-width:3px;color:#EF4F52}select.choice--success{border:1px solid #66BB6A;border-left-width:3px}select.choice--disabled,select.choice:disabled{color:#b7b7b7;cursor:not-allowed;background-color:#eaeaea;border:1px solid #c4c4c4}.choice input{margin-right:0.1em;font-size:2em}.choice input:disabled{color:#b7b7b7;cursor:not-allowed}.input-group{display:-webkit-flex;display:-ms-flexbox;display:flex}.input-group .field{-webkit-flex:1;-ms-flex:1;flex:1}.input-group .field:not(:first-child):not(:last-child){border-radius:0;border-right:0;border-left:0}.input-group .field:first-child{border-radius:4px 0 0 4px;border-right:0}.input-group .field:last-child{border-radius:0 4px 4px 0;border-left:0}.input-group .button:first-child{border-radius:4px 0 0 4px;border-right:0}.input-group .button:last-child{border-radius:0 4px 4px 0;border-left:0}.field-group{display:block}.field-group .field:not(:first-child){border-top:0}.field-group .field:not(:first-child):not(:last-child){border-radius:0}.field-group .field:first-child{border-radius:4px 4px 0 0}.field-group .field:last-child{border-radius:0 0 4px 4px}.field-group-inline{display:-webkit-flex;display:-ms-flexbox;display:flex}.field-group-inline .field:not(:first-child){border-left:0}.field-group-inline .field:not(:first-child):not(:last-child){border-radius:0}.field-group-inline .field:first-child{border-radius:4px 0 0 4px}.field-group-inline .field:last-child{border-radius:0 4px 4px 0}.fieldset,fieldset{display:block;width:100%;border:0;padding:0;margin:0.5em 0}.fieldset.list,fieldset.list{display:block;width:100%;border:0;padding:0;margin:0.5em 0}.legend,legend{display:block;width:100%;padding-top:0.3em;padding-bottom:0.3em}.fieldset--disabled .field,fieldset:disabled .field{color:#b7b7b7;cursor:not-allowed;background-color:#eaeaea;border:1px solid #c4c4c4}.fieldset--disabled .choice,fieldset:disabled .choice{color:#b7b7b7;cursor:not-allowed}.form-element{padding-top:0.5em;padding-bottom:0.5em}
perosb/jsdelivr
files/blazecss/1.0.0-rc5/inputs.css
CSS
mit
4,652
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("lang/datatype-date-format_th",function(e){e.Intl.add("datatype-date-format","th",{a:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],A:["\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18","\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"],b:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],B:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],c:"%a %d %b %Y, %k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 %Z",p:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],P:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],x:"%d/%m/%Y",X:"%k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35"})},"3.17.1");
luigimannoni/cdnjs
ajax/libs/yui/3.17.1/datatype-date-format/lang/datatype-date-format_th.js
JavaScript
mit
2,022
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('event-move', function (Y, NAME) { /** * Adds lower level support for "gesturemovestart", "gesturemove" and "gesturemoveend" events, which can be used to create drag/drop * interactions which work across touch and mouse input devices. They correspond to "touchstart", "touchmove" and "touchend" on a touch input * device, and "mousedown", "mousemove", "mouseup" on a mouse based input device. * * <p>Documentation for the gesturemove triplet of events can be found on the <a href="../classes/YUI.html#event_gesturemove">YUI</a> global, * along with the other supported events.</p> @example YUI().use('event-move', function (Y) { Y.one('#myNode').on('gesturemovestart', function (e) { Y.log('gesturemovestart Fired.'); }); Y.one('#myNode').on('gesturemove', function (e) { Y.log('gesturemove Fired.'); }); Y.one('#myNode').on('gesturemoveend', function (e) { Y.log('gesturemoveend Fired.'); }); }); * @module event-gestures * @submodule event-move */ var GESTURE_MAP = Y.Event._GESTURE_MAP, EVENT = { start: GESTURE_MAP.start, end: GESTURE_MAP.end, move: GESTURE_MAP.move }, START = "start", MOVE = "move", END = "end", GESTURE_MOVE = "gesture" + MOVE, GESTURE_MOVE_END = GESTURE_MOVE + END, GESTURE_MOVE_START = GESTURE_MOVE + START, _MOVE_START_HANDLE = "_msh", _MOVE_HANDLE = "_mh", _MOVE_END_HANDLE = "_meh", _DEL_MOVE_START_HANDLE = "_dmsh", _DEL_MOVE_HANDLE = "_dmh", _DEL_MOVE_END_HANDLE = "_dmeh", _MOVE_START = "_ms", _MOVE = "_m", MIN_TIME = "minTime", MIN_DISTANCE = "minDistance", PREVENT_DEFAULT = "preventDefault", BUTTON = "button", OWNER_DOCUMENT = "ownerDocument", CURRENT_TARGET = "currentTarget", TARGET = "target", NODE_TYPE = "nodeType", SUPPORTS_POINTER = Y.config.win && ("msPointerEnabled" in Y.config.win.navigator), MS_TOUCH_ACTION_COUNT = 'msTouchActionCount', MS_INIT_TOUCH_ACTION = 'msInitTouchAction', _defArgsProcessor = function(se, args, delegate) { var iConfig = (delegate) ? 4 : 3, config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {}; if (!(PREVENT_DEFAULT in config)) { config[PREVENT_DEFAULT] = se.PREVENT_DEFAULT; } return config; }, _getRoot = function(node, subscriber) { return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT); }, //Checks to see if the node is the document, and if it is, returns the documentElement. _checkDocumentElem = function(node) { var elem = node.getDOMNode(); if (node.compareTo(Y.config.doc) && elem.documentElement) { return elem.documentElement; } else { return false; } }, _normTouchFacade = function(touchFacade, touch, params) { touchFacade.pageX = touch.pageX; touchFacade.pageY = touch.pageY; touchFacade.screenX = touch.screenX; touchFacade.screenY = touch.screenY; touchFacade.clientX = touch.clientX; touchFacade.clientY = touch.clientY; touchFacade[TARGET] = touchFacade[TARGET] || touch[TARGET]; touchFacade[CURRENT_TARGET] = touchFacade[CURRENT_TARGET] || touch[CURRENT_TARGET]; touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0) }, /* In IE10 touch mode, gestures will not work properly unless the -ms-touch-action CSS property is set to something other than 'auto'. Read http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx for more info. To get around this, we set -ms-touch-action: none which is the same as e.preventDefault() on touch environments. This tells the browser to fire DOM events for all touch events, and not perform any default behavior. The user can over-ride this by setting a more lenient -ms-touch-action property on a node (such as pan-x, pan-y, etc.) via CSS when subscribing to the 'gesturemovestart' event. */ _setTouchActions = function (node) { var elem = _checkDocumentElem(node) || node.getDOMNode(), num = node.getData(MS_TOUCH_ACTION_COUNT); //Checks to see if msTouchAction is supported. if (SUPPORTS_POINTER) { if (!num) { num = 0; node.setData(MS_INIT_TOUCH_ACTION, elem.style.msTouchAction); } elem.style.msTouchAction = Y.Event._DEFAULT_TOUCH_ACTION; num++; node.setData(MS_TOUCH_ACTION_COUNT, num); } }, /* Resets the element's -ms-touch-action property back to the original value, This is called on detach() and detachDelegate(). */ _unsetTouchActions = function (node) { var elem = _checkDocumentElem(node) || node.getDOMNode(), num = node.getData(MS_TOUCH_ACTION_COUNT), initTouchAction = node.getData(MS_INIT_TOUCH_ACTION); if (SUPPORTS_POINTER) { num--; node.setData(MS_TOUCH_ACTION_COUNT, num); if (num === 0 && elem.style.msTouchAction !== initTouchAction) { elem.style.msTouchAction = initTouchAction; } } }, _prevent = function(e, preventDefault) { if (preventDefault) { // preventDefault is a boolean or a function if (!preventDefault.call || preventDefault(e)) { e.preventDefault(); } } }, define = Y.Event.define; Y.Event._DEFAULT_TOUCH_ACTION = 'none'; /** * Sets up a "gesturemovestart" event, that is fired on touch devices in response to a single finger "touchstart", * and on mouse based devices in response to a "mousedown". The subscriber can specify the minimum time * and distance thresholds which should be crossed before the "gesturemovestart" is fired and for the mouse, * which button should initiate a "gesturemovestart". This event can also be listened for using node.delegate(). * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler, * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemovestart", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemovestart * @for YUI * @param type {string} "gesturemovestart" * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousedown or touchstart.touches[0]) which contains position co-ordinates. * @param cfg {Object} Optional. An object which specifies: * * <dl> * <dt>minDistance (defaults to 0)</dt> * <dd>The minimum distance threshold which should be crossed before the gesturemovestart is fired</dd> * <dt>minTime (defaults to 0)</dt> * <dd>The minimum time threshold for which the finger/mouse should be help down before the gesturemovestart is fired</dd> * <dt>button (no default)</dt> * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd> * <dt>preventDefault (defaults to false)</dt> * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd> * </dl> * * @return {EventHandle} the detach handle */ define(GESTURE_MOVE_START, { on: function (node, subscriber, ce) { //Set -ms-touch-action on IE10 and set preventDefault to true _setTouchActions(node); subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], this._onStart, this, node, subscriber, ce); }, delegate : function(node, subscriber, ce, filter) { var se = this; subscriber[_DEL_MOVE_START_HANDLE] = node.delegate(EVENT[START], function(e) { se._onStart(e, node, subscriber, ce, true); }, filter); }, detachDelegate : function(node, subscriber, ce, filter) { var handle = subscriber[_DEL_MOVE_START_HANDLE]; if (handle) { handle.detach(); subscriber[_DEL_MOVE_START_HANDLE] = null; } _unsetTouchActions(node); }, detach: function (node, subscriber, ce) { var startHandle = subscriber[_MOVE_START_HANDLE]; if (startHandle) { startHandle.detach(); subscriber[_MOVE_START_HANDLE] = null; } _unsetTouchActions(node); }, processArgs : function(args, delegate) { var params = _defArgsProcessor(this, args, delegate); if (!(MIN_TIME in params)) { params[MIN_TIME] = this.MIN_TIME; } if (!(MIN_DISTANCE in params)) { params[MIN_DISTANCE] = this.MIN_DISTANCE; } return params; }, _onStart : function(e, node, subscriber, ce, delegate) { if (delegate) { node = e[CURRENT_TARGET]; } var params = subscriber._extra, fireStart = true, minTime = params[MIN_TIME], minDistance = params[MIN_DISTANCE], button = params.button, preventDefault = params[PREVENT_DEFAULT], root = _getRoot(node, subscriber), startXY; if (e.touches) { if (e.touches.length === 1) { _normTouchFacade(e, e.touches[0], params); } else { fireStart = false; } } else { fireStart = (button === undefined) || (button === e.button); } Y.log("gesturemovestart: params = button:" + button + ", minTime = " + minTime + ", minDistance = " + minDistance, "event-gestures"); if (fireStart) { _prevent(e, preventDefault); if (minTime === 0 || minDistance === 0) { Y.log("gesturemovestart: No minTime or minDistance. Firing immediately", "event-gestures"); this._start(e, node, ce, params); } else { startXY = [e.pageX, e.pageY]; if (minTime > 0) { Y.log("gesturemovestart: minTime specified. Setup timer.", "event-gestures"); Y.log("gesturemovestart: initialTime for minTime = " + new Date().getTime(), "event-gestures"); params._ht = Y.later(minTime, this, this._start, [e, node, ce, params]); params._hme = root.on(EVENT[END], Y.bind(function() { this._cancel(params); }, this)); } if (minDistance > 0) { Y.log("gesturemovestart: minDistance specified. Setup native mouse/touchmove listener to measure distance.", "event-gestures"); Y.log("gesturemovestart: initialXY for minDistance = " + startXY, "event-gestures"); params._hm = root.on(EVENT[MOVE], Y.bind(function(em) { if (Math.abs(em.pageX - startXY[0]) > minDistance || Math.abs(em.pageY - startXY[1]) > minDistance) { Y.log("gesturemovestart: minDistance hit.", "event-gestures"); this._start(e, node, ce, params); } }, this)); } } } }, _cancel : function(params) { if (params._ht) { params._ht.cancel(); params._ht = null; } if (params._hme) { params._hme.detach(); params._hme = null; } if (params._hm) { params._hm.detach(); params._hm = null; } }, _start : function(e, node, ce, params) { if (params) { this._cancel(params); } e.type = GESTURE_MOVE_START; Y.log("gesturemovestart: Firing start: " + new Date().getTime(), "event-gestures"); node.setData(_MOVE_START, e); ce.fire(e); }, MIN_TIME : 0, MIN_DISTANCE : 0, PREVENT_DEFAULT : false }); /** * Sets up a "gesturemove" event, that is fired on touch devices in response to a single finger "touchmove", * and on mouse based devices in response to a "mousemove". * * <p>By default this event is only fired when the same node * has received a "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without an initial "gesturemovestart".</p> * * <p>By default this event sets up it's internal "touchmove" and "mousemove" DOM listeners on the document element. The subscriber * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler, * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemove", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemove * @for YUI * @param type {string} "gesturemove" * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousemove or touchmove.touches[0]) which contains position co-ordinates. * @param cfg {Object} Optional. An object which specifies: * <dl> * <dt>standAlone (defaults to false)</dt> * <dd>true, if the subscriber should be notified even if a "gesturemovestart" has not occured on the same node.</dd> * <dt>root (defaults to document)</dt> * <dd>The node to which the internal DOM listeners should be attached.</dd> * <dt>preventDefault (defaults to false)</dt> * <dd>Can be set to true/false to prevent default behavior as soon as the touchmove or mousemove is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd> * </dl> * * @return {EventHandle} the detach handle */ define(GESTURE_MOVE, { on : function (node, subscriber, ce) { _setTouchActions(node); var root = _getRoot(node, subscriber, EVENT[MOVE]), moveHandle = root.on(EVENT[MOVE], this._onMove, this, node, subscriber, ce); subscriber[_MOVE_HANDLE] = moveHandle; }, delegate : function(node, subscriber, ce, filter) { var se = this; subscriber[_DEL_MOVE_HANDLE] = node.delegate(EVENT[MOVE], function(e) { se._onMove(e, node, subscriber, ce, true); }, filter); }, detach : function (node, subscriber, ce) { var moveHandle = subscriber[_MOVE_HANDLE]; if (moveHandle) { moveHandle.detach(); subscriber[_MOVE_HANDLE] = null; } _unsetTouchActions(node); }, detachDelegate : function(node, subscriber, ce, filter) { var handle = subscriber[_DEL_MOVE_HANDLE]; if (handle) { handle.detach(); subscriber[_DEL_MOVE_HANDLE] = null; } _unsetTouchActions(node); }, processArgs : function(args, delegate) { return _defArgsProcessor(this, args, delegate); }, _onMove : function(e, node, subscriber, ce, delegate) { if (delegate) { node = e[CURRENT_TARGET]; } var fireMove = subscriber._extra.standAlone || node.getData(_MOVE_START), preventDefault = subscriber._extra.preventDefault; Y.log("onMove initial fireMove check:" + fireMove,"event-gestures"); if (fireMove) { if (e.touches) { if (e.touches.length === 1) { _normTouchFacade(e, e.touches[0]); } else { fireMove = false; } } if (fireMove) { _prevent(e, preventDefault); Y.log("onMove second fireMove check:" + fireMove,"event-gestures"); e.type = GESTURE_MOVE; ce.fire(e); } } }, PREVENT_DEFAULT : false }); /** * Sets up a "gesturemoveend" event, that is fired on touch devices in response to a single finger "touchend", * and on mouse based devices in response to a "mouseup". * * <p>By default this event is only fired when the same node * has received a "gesturemove" or "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without a preceding "gesturemovestart" or "gesturemove".</p> * * <p>By default this event sets up it's internal "touchend" and "mouseup" DOM listeners on the document element. The subscriber * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler, * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemoveend", fn, null, context, arg1, arg2, arg3)</code></p> * * * @event gesturemoveend * @for YUI * @param type {string} "gesturemoveend" * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mouseup or touchend.changedTouches[0]). * @param cfg {Object} Optional. An object which specifies: * <dl> * <dt>standAlone (defaults to false)</dt> * <dd>true, if the subscriber should be notified even if a "gesturemovestart" or "gesturemove" has not occured on the same node.</dd> * <dt>root (defaults to document)</dt> * <dd>The node to which the internal DOM listeners should be attached.</dd> * <dt>preventDefault (defaults to false)</dt> * <dd>Can be set to true/false to prevent default behavior as soon as the touchend or mouseup is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd> * </dl> * * @return {EventHandle} the detach handle */ define(GESTURE_MOVE_END, { on : function (node, subscriber, ce) { _setTouchActions(node); var root = _getRoot(node, subscriber), endHandle = root.on(EVENT[END], this._onEnd, this, node, subscriber, ce); subscriber[_MOVE_END_HANDLE] = endHandle; }, delegate : function(node, subscriber, ce, filter) { var se = this; subscriber[_DEL_MOVE_END_HANDLE] = node.delegate(EVENT[END], function(e) { se._onEnd(e, node, subscriber, ce, true); }, filter); }, detachDelegate : function(node, subscriber, ce, filter) { var handle = subscriber[_DEL_MOVE_END_HANDLE]; if (handle) { handle.detach(); subscriber[_DEL_MOVE_END_HANDLE] = null; } _unsetTouchActions(node); }, detach : function (node, subscriber, ce) { var endHandle = subscriber[_MOVE_END_HANDLE]; if (endHandle) { endHandle.detach(); subscriber[_MOVE_END_HANDLE] = null; } _unsetTouchActions(node); }, processArgs : function(args, delegate) { return _defArgsProcessor(this, args, delegate); }, _onEnd : function(e, node, subscriber, ce, delegate) { if (delegate) { node = e[CURRENT_TARGET]; } var fireMoveEnd = subscriber._extra.standAlone || node.getData(_MOVE) || node.getData(_MOVE_START), preventDefault = subscriber._extra.preventDefault; if (fireMoveEnd) { if (e.changedTouches) { if (e.changedTouches.length === 1) { _normTouchFacade(e, e.changedTouches[0]); } else { fireMoveEnd = false; } } if (fireMoveEnd) { _prevent(e, preventDefault); e.type = GESTURE_MOVE_END; ce.fire(e); node.clearData(_MOVE_START); node.clearData(_MOVE); } } }, PREVENT_DEFAULT : false }); }, '3.17.1', {"requires": ["node-base", "event-touch", "event-synthetic"]});
AlexisArce/cdnjs
ajax/libs/yui/3.17.1/event-move/event-move-debug.js
JavaScript
mit
21,565
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/app-transitions/app-transitions.js']) { __coverage__['build/app-transitions/app-transitions.js'] = {"path":"build/app-transitions/app-transitions.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":46}}},"2":{"name":"AppTransitions","line":40,"loc":{"start":{"line":40,"column":0},"end":{"line":40,"column":26}}},"3":{"name":"(anonymous_3)","line":222,"loc":{"start":{"line":222,"column":21},"end":{"line":222,"column":44}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":242,"column":41}},"2":{"start":{"line":40,"column":0},"end":{"line":40,"column":28}},"3":{"start":{"line":42,"column":0},"end":{"line":60,"column":2}},"4":{"start":{"line":76,"column":0},"end":{"line":91,"column":2}},"5":{"start":{"line":93,"column":0},"end":{"line":231,"column":2}},"6":{"start":{"line":223,"column":8},"end":{"line":223,"column":46}},"7":{"start":{"line":225,"column":8},"end":{"line":227,"column":9}},"8":{"start":{"line":226,"column":12},"end":{"line":226,"column":43}},"9":{"start":{"line":229,"column":8},"end":{"line":229,"column":27}},"10":{"start":{"line":234,"column":0},"end":{"line":234,"column":35}},"11":{"start":{"line":235,"column":0},"end":{"line":235,"column":36}},"12":{"start":{"line":237,"column":0},"end":{"line":239,"column":3}}},"branchMap":{"1":{"line":225,"type":"if","locations":[{"start":{"line":225,"column":8},"end":{"line":225,"column":8}},{"start":{"line":225,"column":8},"end":{"line":225,"column":8}}]},"2":{"line":225,"type":"binary-expr","locations":[{"start":{"line":225,"column":12},"end":{"line":225,"column":23}},{"start":{"line":225,"column":27},"end":{"line":225,"column":47}}]}},"code":["(function () { YUI.add('app-transitions', function (Y, NAME) {","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","@module app","@submodule app-transitions","@since 3.5.0","**/","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","View transitions provide an nice way to move from one \"page\" to the next that is","both pleasant to the user and helps to communicate a hierarchy between sections","of an application.","","When the `\"app-transitions\"` module is used, it will automatically mix itself","into `Y.App` and transition between `activeView` changes using the following","effects:",""," - **`fade`**: Cross-fades between the old an new active views.",""," - **`slideLeft`**: The old and new active views are positioned next to each"," other and both slide to the left.",""," - **`slideRight`**: The old and new active views are positioned next to each"," other and both slide to the right.","","**Note:** Transitions are an opt-in feature and are enabled via an app's","`transitions` attribute.","","@class App.Transitions","@uses App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitions() {}","","AppTransitions.ATTRS = {"," /**"," Whether or not this application should use view transitions, and if so then"," which ones or `true` for the defaults which are specified by the"," `transitions` prototype property.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @attribute transitions"," @type Boolean|Object"," @default false"," @since 3.5.0"," **/"," transitions: {"," setter: '_setTransitions',"," value : false"," }","};","","/**","Collect of transitions -> fx.","","A transition (e.g. \"fade\") is a simple name given to a configuration of fx to","apply, consisting of `viewIn` and `viewOut` properties who's values are names of","fx registered on `Y.Transition.fx`.","","By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.","","@property FX","@type Object","@static","@since 3.5.0","**/","AppTransitions.FX = {"," fade: {"," viewIn : 'app:fadeIn',"," viewOut: 'app:fadeOut'"," },",""," slideLeft: {"," viewIn : 'app:slideLeft',"," viewOut: 'app:slideLeft'"," },",""," slideRight: {"," viewIn : 'app:slideRight',"," viewOut: 'app:slideRight'"," }","};","","AppTransitions.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default transitions to use when the `activeView` changes.",""," The following are types of changes for which transitions can be defined that"," correspond to the relationship between the new and previous `activeView`:",""," * `navigate`: The default transition to use when changing the `activeView`"," of the application.",""," * `toChild`: The transition to use when the new `activeView` is configured"," as a child of the previously active view via its `parent` property as"," defined in this app's `views`.",""," * `toParent`: The transition to use when the new `activeView` is"," configured as the `parent` of the previously active view as defined in"," this app's `views`.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @property transitions"," @type Object"," @default"," {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," }"," @since 3.5.0"," **/"," transitions: {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," transitions: true,"," users : new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/');"," // => Creates a new `Y.UsersView` and transitions to it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," // Does not override `showView()` but does use `options.transitions`.",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Setter for `transitions` attribute.",""," When specified as `true`, the defaults will be use as specified by the"," `transitions` prototype property.",""," @method _setTransitions"," @param {Boolean|Object} transitions The new `transitions` attribute value."," @return {Mixed} The processed value which represents the new state."," @protected"," @see App.Base.showView()"," @since 3.5.0"," **/"," _setTransitions: function (transitions) {"," var defTransitions = this.transitions;",""," if (transitions && transitions === true) {"," return Y.merge(defTransitions);"," }",""," return transitions;"," }","};","","// -- Namespace ----------------------------------------------------------------","Y.App.Transitions = AppTransitions;","Y.Base.mix(Y.App, [AppTransitions]);","","Y.mix(Y.App.CLASS_NAMES, {"," transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')","});","","","}, '3.17.1', {\"requires\": [\"app-base\"]});","","}());"]}; } var __cov_2_u5xavh62mdqarWSEoI8Q = __coverage__['build/app-transitions/app-transitions.js']; __cov_2_u5xavh62mdqarWSEoI8Q.s['1']++;YUI.add('app-transitions',function(Y,NAME){__cov_2_u5xavh62mdqarWSEoI8Q.f['1']++;__cov_2_u5xavh62mdqarWSEoI8Q.s['2']++;function AppTransitions(){__cov_2_u5xavh62mdqarWSEoI8Q.f['2']++;}__cov_2_u5xavh62mdqarWSEoI8Q.s['3']++;AppTransitions.ATTRS={transitions:{setter:'_setTransitions',value:false}};__cov_2_u5xavh62mdqarWSEoI8Q.s['4']++;AppTransitions.FX={fade:{viewIn:'app:fadeIn',viewOut:'app:fadeOut'},slideLeft:{viewIn:'app:slideLeft',viewOut:'app:slideLeft'},slideRight:{viewIn:'app:slideRight',viewOut:'app:slideRight'}};__cov_2_u5xavh62mdqarWSEoI8Q.s['5']++;AppTransitions.prototype={transitions:{navigate:'fade',toChild:'slideLeft',toParent:'slideRight'},_setTransitions:function(transitions){__cov_2_u5xavh62mdqarWSEoI8Q.f['3']++;__cov_2_u5xavh62mdqarWSEoI8Q.s['6']++;var defTransitions=this.transitions;__cov_2_u5xavh62mdqarWSEoI8Q.s['7']++;if((__cov_2_u5xavh62mdqarWSEoI8Q.b['2'][0]++,transitions)&&(__cov_2_u5xavh62mdqarWSEoI8Q.b['2'][1]++,transitions===true)){__cov_2_u5xavh62mdqarWSEoI8Q.b['1'][0]++;__cov_2_u5xavh62mdqarWSEoI8Q.s['8']++;return Y.merge(defTransitions);}else{__cov_2_u5xavh62mdqarWSEoI8Q.b['1'][1]++;}__cov_2_u5xavh62mdqarWSEoI8Q.s['9']++;return transitions;}};__cov_2_u5xavh62mdqarWSEoI8Q.s['10']++;Y.App.Transitions=AppTransitions;__cov_2_u5xavh62mdqarWSEoI8Q.s['11']++;Y.Base.mix(Y.App,[AppTransitions]);__cov_2_u5xavh62mdqarWSEoI8Q.s['12']++;Y.mix(Y.App.CLASS_NAMES,{transitioning:Y.ClassNameManager.getClassName('app','transitioning')});},'3.17.1',{'requires':['app-base']});
narikei/cdnjs
ajax/libs/yui/3.17.1/app-transitions/app-transitions-coverage.js
JavaScript
mit
12,569
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("datatable-highlight",function(e,t){function r(){}var n=e.ClassNameManager.getClassName;r.ATTRS={highlightRows:{value:!1,setter:"_setHighlightRows",validator:e.Lang.isBoolean},highlightCols:{value:!1,setter:"_setHighlightCols",validator:e.Lang.isBoolean},highlightCells:{value:!1,setter:"_setHighlightCells",validator:e.Lang.isBoolean}},r.prototype={highlightClassNames:{row:n(t,"row"),col:n(t,"col"),cell:n(t,"cell")},_colSelector:".{prefix}-data .{prefix}-col-{col}",_colNameRegex:"{prefix}-col-(\\S*)",_highlightDelegates:{},_setHighlightRows:function(t){var n=this._highlightDelegates;return n.row&&n.row.detach(),t===!0&&(n.row=this.delegate("hover",e.bind(this._highlightRow,this),e.bind(this._highlightRow,this),"tbody tr")),t},_setHighlightCols:function(t){var n=this._highlightDelegates;n.col&&n.col.detach(),t===!0&&(this._buildColSelRegex(),n.col=this.delegate("hover",e.bind(this._highlightCol,this),e.bind(this._highlightCol,this),"tr td"))},_setHighlightCells:function(t){var n=this._highlightDelegates;return n.cell&&n.cell.detach(),t===!0&&(n.cell=this.delegate("hover",e.bind(this._highlightCell,this),e.bind(this._highlightCell,this),"tbody td")),t},_highlightRow:function(e){e.currentTarget.toggleClass(this.highlightClassNames.row,e.phase==="over")},_highlightCol:function(t){var n=this._colNameRegex.exec(t.currentTarget.getAttribute("class")),r=e.Lang.sub(this._colSelector,{prefix:this._cssPrefix,col:n[1]});this.view.tableNode.all(r).toggleClass(this.highlightClassNames.col,t.phase==="over")},_highlightCell:function(e){e.currentTarget.toggleClass(this.highlightClassNames.cell,e.phase==="over")},_buildColSelRegex:function(){var t=this._colNameRegex,n;typeof t=="string"&&(this._colNameRegex=new RegExp(e.Lang.sub(t,{prefix:this._cssPrefix})))}},e.DataTable.Highlight=r,e.Base.mix(e.DataTable,[e.DataTable.Highlight])},"3.17.1",{requires:["datatable-base","event-hover"],skinnable:!0});
samthor/cdnjs
ajax/libs/yui/3.17.1/datatable-highlight/datatable-highlight-min.js
JavaScript
mit
2,066
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-datatable-paginator-wrapper { border: none; padding: 0; } .yui3-datatable-paginator { padding: 3px; white-space: nowrap; } .yui3-datatable-paginator .yui3-paginator-content { position: relative; } .yui3-datatable-paginator .yui3-paginator-page-select { position: absolute; right: 0; top: 0; } .yui3-datatable-paginator .yui3-datatable-paginator-group { display: inline-block; zoom: 1; *display: inline; } .yui3-datatable-paginator .yui3-datatable-paginator-control { display: inline-block; zoom: 1; *display: inline; margin: 0 3px; padding: 0 0.2em; text-align: center; text-decoration: none; line-height: 1.5; border: 1px solid transparent; border-radius: 3px; background: transparent; } .yui3-datatable-paginator .yui3-datatable-paginator-control-disabled, .yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover { cursor: default; } .yui3-datatable-paginator .yui3-datatable-paginator-group input { width: 3em; } .yui3-datatable-paginator form { text-align: center; margin: 0 2em; } .yui3-datatable-paginator .yui3-datatable-paginator-per-page { text-align: right; } /* FOR USE WHEN DISPLAYING ICONS .yui3-datatable-paginator .control-first, .yui3-datatable-paginator .control-last, .yui3-datatable-paginator .control-prev, .yui3-datatable-paginator .control-next { text-indent: -999px; direction: ltr; overflow: hidden; position: relative; width: 1em; } */
AMoo-Miki/cdnjs
ajax/libs/yui/3.17.1/datatable-paginator/assets/datatable-paginator-core.css
CSS
mit
1,650
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("json-parse-shim",function(Y,NAME){var _UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},_revive=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e};Y.JSON.parse=function(s,reviver){typeof s!="string"&&(s+=""),s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,"")))return _revive(eval("("+s+")"),reviver);throw new SyntaxError("JSON.parse")},Y.JSON.parse.isShim=!0},"3.17.1",{requires:["json-parse"]});
coupang/cdnjs
ajax/libs/yui/3.17.1/json-parse-shim/json-parse-shim-min.js
JavaScript
mit
1,147
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/text-accentfold/text-accentfold.js']) { __coverage__['build/text-accentfold/text-accentfold.js'] = {"path":"build/text-accentfold/text-accentfold.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":46}}},"2":{"name":"(anonymous_2)","line":75,"loc":{"start":{"line":75,"column":13},"end":{"line":75,"column":31}}},"3":{"name":"(anonymous_3)","line":102,"loc":{"start":{"line":102,"column":13},"end":{"line":102,"column":35}}},"4":{"name":"(anonymous_4)","line":128,"loc":{"start":{"line":128,"column":12},"end":{"line":128,"column":38}}},"5":{"name":"(anonymous_5)","line":129,"loc":{"start":{"line":129,"column":39},"end":{"line":129,"column":55}}},"6":{"name":"(anonymous_6)","line":144,"loc":{"start":{"line":144,"column":10},"end":{"line":144,"column":27}}},"7":{"name":"(anonymous_7)","line":151,"loc":{"start":{"line":151,"column":32},"end":{"line":151,"column":57}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":162,"column":69}},"2":{"start":{"line":59,"column":0},"end":{"line":157,"column":2}},"3":{"start":{"line":76,"column":8},"end":{"line":76,"column":19}},"4":{"start":{"line":78,"column":8},"end":{"line":83,"column":9}},"5":{"start":{"line":79,"column":12},"end":{"line":82,"column":13}},"6":{"start":{"line":81,"column":16},"end":{"line":81,"column":28}},"7":{"start":{"line":85,"column":8},"end":{"line":85,"column":21}},"8":{"start":{"line":103,"column":8},"end":{"line":104,"column":41}},"9":{"start":{"line":106,"column":8},"end":{"line":106,"column":69}},"10":{"start":{"line":129,"column":8},"end":{"line":131,"column":11}},"11":{"start":{"line":130,"column":12},"end":{"line":130,"column":47}},"12":{"start":{"line":145,"column":8},"end":{"line":147,"column":9}},"13":{"start":{"line":146,"column":12},"end":{"line":146,"column":54}},"14":{"start":{"line":149,"column":8},"end":{"line":149,"column":36}},"15":{"start":{"line":151,"column":8},"end":{"line":153,"column":11}},"16":{"start":{"line":152,"column":12},"end":{"line":152,"column":49}},"17":{"start":{"line":155,"column":8},"end":{"line":155,"column":21}},"18":{"start":{"line":159,"column":0},"end":{"line":159,"column":29}}},"branchMap":{"1":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":12},"end":{"line":79,"column":12}},{"start":{"line":79,"column":12},"end":{"line":79,"column":12}}]},"2":{"line":79,"type":"binary-expr","locations":[{"start":{"line":79,"column":16},"end":{"line":79,"column":47}},{"start":{"line":80,"column":20},"end":{"line":80,"column":58}}]},"3":{"line":106,"type":"cond-expr","locations":[{"start":{"line":106,"column":22},"end":{"line":106,"column":46}},{"start":{"line":106,"column":49},"end":{"line":106,"column":68}}]},"4":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]}},"code":["(function () { YUI.add('text-accentfold', function (Y, NAME) {","","/**"," * Text utilities."," *"," * @module text"," * @since 3.3.0"," */","","/**"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," *"," * @module text"," * @submodule text-accentfold"," */","","/**"," * <p>"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," * </p>"," *"," * <p>"," * This implementation is not comprehensive, and should only be used as a last"," * resort when accent folding can't be done on the server. A comprehensive"," * accent folding implementation would require much more character data to be"," * sent to the browser, resulting in a significant performance penalty. This"," * implementation strives for a compromise between usefulness and performance."," * </p>"," *"," * <p>"," * Accent folding is a destructive operation that can't be reversed, and may"," * change or destroy the actual meaning of the text depending on the language."," * It should not be used on strings that will later be displayed to a user,"," * unless this is done with the understanding that linguistic meaning may be"," * lost and that you may in fact confuse or insult the user by doing so."," * </p>"," *"," * <p>"," * When used for matching, accent folding is likely to produce erroneous matches"," * for languages in which characters with diacritics are considered different"," * from their base characters, or where correct folding would map to other"," * character sequences than just stripped characters. For example, in German"," * \"ü\" is a character that's clearly different from \"u\" and should match \"ue\""," * instead. The word \"betrügen\" means \"to defraud\", while \"betrugen\" is the past"," * tense of \"to behave\". The name \"Müller\" is expected to match \"Mueller\", but"," * not \"Muller\". On the other hand, accent folding falls short for languages"," * where different base characters are expected to match. In Japanese, for"," * example, hiragana and katakana characters with the same pronunciation (\"あ\""," * and \"ア\") are commonly treated as equivalent for lookups, but accent folding"," * treats them as different."," * </p>"," *"," * @class Text.AccentFold"," * @static"," */","","var YArray = Y.Array,"," Text = Y.Text,"," FoldData = Text.Data.AccentFold,","","AccentFold = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," * Returns <code>true</code> if the specified string contains one or more"," * characters that can be folded, <code>false</code> otherwise."," *"," * @method canFold"," * @param {String} string String to test."," * @return {Boolean}"," * @static"," */"," canFold: function (string) {"," var letter;",""," for (letter in FoldData) {"," if (FoldData.hasOwnProperty(letter) &&"," string.search(FoldData[letter]) !== -1) {"," return true;"," }"," }",""," return false;"," },",""," /**"," * Compares the accent-folded versions of two strings and returns"," * <code>true</code> if they're the same, <code>false</code> otherwise. If"," * a custom comparison function is supplied, the accent-folded strings will"," * be passed to that function for comparison."," *"," * @method compare"," * @param {String} a First string to compare."," * @param {String} b Second string to compare."," * @param {Function} func (optional) Custom comparison function. Should"," * return a truthy or falsy value."," * @return {Boolean} Results of the comparison."," * @static"," */"," compare: function (a, b, func) {"," var aFolded = AccentFold.fold(a),"," bFolded = AccentFold.fold(b);",""," return func ? !!func(aFolded, bFolded) : aFolded === bFolded;"," },",""," /**"," * <p>"," * Returns a copy of <em>haystack</em> containing only the strings for which"," * the supplied function returns <code>true</code>."," * </p>"," *"," * <p>"," * While comparisons will be made using accent-folded strings, the returned"," * array of matches will contain the original strings that were passed in."," * </p>"," *"," * @method filter"," * @param {Array} haystack Array of strings to filter."," * @param {Function} func Comparison function. Will receive an accent-folded"," * haystack string as an argument, and should return a truthy or falsy"," * value."," * @return {Array} Filtered copy of <em>haystack</em>."," * @static"," */"," filter: function (haystack, func) {"," return YArray.filter(haystack, function (item) {"," return func(AccentFold.fold(item));"," });"," },",""," /**"," * Accent-folds the specified string or array of strings and returns a copy"," * in which common accented letters have been converted to their closest"," * non-accented, lowercase forms."," *"," * @method fold"," * @param {String|Array} input String or array of strings to be folded."," * @return {String|Array} Folded string or array of strings."," * @static"," */"," fold: function (input) {"," if (Y.Lang.isArray(input)) {"," return YArray.map(input, AccentFold.fold);"," }",""," input = input.toLowerCase();",""," Y.Object.each(FoldData, function (regex, letter) {"," input = input.replace(regex, letter);"," });",""," return input;"," }","};","","Text.AccentFold = AccentFold;","","","}, '3.17.1', {\"requires\": [\"array-extras\", \"text-data-accentfold\"]});","","}());"]}; } var __cov_cvaboJVbsSHhirz7LcJjyg = __coverage__['build/text-accentfold/text-accentfold.js']; __cov_cvaboJVbsSHhirz7LcJjyg.s['1']++;YUI.add('text-accentfold',function(Y,NAME){__cov_cvaboJVbsSHhirz7LcJjyg.f['1']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['2']++;var YArray=Y.Array,Text=Y.Text,FoldData=Text.Data.AccentFold,AccentFold={canFold:function(string){__cov_cvaboJVbsSHhirz7LcJjyg.f['2']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['3']++;var letter;__cov_cvaboJVbsSHhirz7LcJjyg.s['4']++;for(letter in FoldData){__cov_cvaboJVbsSHhirz7LcJjyg.s['5']++;if((__cov_cvaboJVbsSHhirz7LcJjyg.b['2'][0]++,FoldData.hasOwnProperty(letter))&&(__cov_cvaboJVbsSHhirz7LcJjyg.b['2'][1]++,string.search(FoldData[letter])!==-1)){__cov_cvaboJVbsSHhirz7LcJjyg.b['1'][0]++;__cov_cvaboJVbsSHhirz7LcJjyg.s['6']++;return true;}else{__cov_cvaboJVbsSHhirz7LcJjyg.b['1'][1]++;}}__cov_cvaboJVbsSHhirz7LcJjyg.s['7']++;return false;},compare:function(a,b,func){__cov_cvaboJVbsSHhirz7LcJjyg.f['3']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['8']++;var aFolded=AccentFold.fold(a),bFolded=AccentFold.fold(b);__cov_cvaboJVbsSHhirz7LcJjyg.s['9']++;return func?(__cov_cvaboJVbsSHhirz7LcJjyg.b['3'][0]++,!!func(aFolded,bFolded)):(__cov_cvaboJVbsSHhirz7LcJjyg.b['3'][1]++,aFolded===bFolded);},filter:function(haystack,func){__cov_cvaboJVbsSHhirz7LcJjyg.f['4']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['10']++;return YArray.filter(haystack,function(item){__cov_cvaboJVbsSHhirz7LcJjyg.f['5']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['11']++;return func(AccentFold.fold(item));});},fold:function(input){__cov_cvaboJVbsSHhirz7LcJjyg.f['6']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['12']++;if(Y.Lang.isArray(input)){__cov_cvaboJVbsSHhirz7LcJjyg.b['4'][0]++;__cov_cvaboJVbsSHhirz7LcJjyg.s['13']++;return YArray.map(input,AccentFold.fold);}else{__cov_cvaboJVbsSHhirz7LcJjyg.b['4'][1]++;}__cov_cvaboJVbsSHhirz7LcJjyg.s['14']++;input=input.toLowerCase();__cov_cvaboJVbsSHhirz7LcJjyg.s['15']++;Y.Object.each(FoldData,function(regex,letter){__cov_cvaboJVbsSHhirz7LcJjyg.f['7']++;__cov_cvaboJVbsSHhirz7LcJjyg.s['16']++;input=input.replace(regex,letter);});__cov_cvaboJVbsSHhirz7LcJjyg.s['17']++;return input;}};__cov_cvaboJVbsSHhirz7LcJjyg.s['18']++;Text.AccentFold=AccentFold;},'3.17.1',{'requires':['array-extras','text-data-accentfold']});
dbeckwith/cdnjs
ajax/libs/yui/3.17.1/text-accentfold/text-accentfold-coverage.js
JavaScript
mit
11,486
/*! * Globalize v1.0.0-alpha.5 2014-08-19T00:47Z Released under the MIT license * http://git.io/TrdQbw */ !function(a,b){"function"==typeof define&&define.amd?define(["cldr","../globalize","cldr/event","cldr/supplemental"],b):"object"==typeof exports?module.exports=b(require("cldrjs"),require("globalize")):b(a.Cldr,a.Globalize)}(this,function(a,b){function c(a,b){h(a,b,{skip:[/dates\/calendars\/gregorian\/days\/.*\/short/,/supplemental\/timeData\/(?!001)/,/supplemental\/weekData\/(?!001)/]})}var d=b._alwaysArray,e=b._createError,f=b._formatMessage,g=b._isPlainObject,h=b._validateCldr,i=b._validateDefaultLocale,j=b._validatePresence,k=b._validateType,l=function(a,b){k(a,b,"undefined"==typeof a||a instanceof Date,"Date")},m=function(a,b){k(a,b,"undefined"==typeof a||"string"==typeof a||g(a),"String or plain Object")},n=function(a,b){k(a,b,"undefined"==typeof a||"string"==typeof a,"a string")},o=function(a){var b,c=[];for(b in a)c.push(a[b]);return c},p=function(a){var b=[];return b=o(a.main("dates/calendars/gregorian/dateTimeFormats/availableFormats")),b=b.concat(o(a.main("dates/calendars/gregorian/timeFormats"))),b=b.concat(o(a.main("dates/calendars/gregorian/dateFormats"))),b=b.concat(o(a.main("dates/calendars/gregorian/dateTimeFormats")).map(function(b,c){return"string"!=typeof b?b:f(b,[a.main(["dates/calendars/gregorian/timeFormats",c]),a.main(["dates/calendars/gregorian/dateFormats",c])])})),b.map(function(a){return{pattern:a}})},q=function(a,b){return e("E_INVALID_PAR_VALUE","Invalid `{name}` value ({value}).",{name:a,value:b})},r=function(a,b){var c;switch("string"==typeof a&&(a={skeleton:a}),!0){case"skeleton"in a:c=b.main(["dates/calendars/gregorian/dateTimeFormats/availableFormats",a.skeleton]);break;case"date"in a:case"time"in a:c=b.main(["dates/calendars/gregorian","date"in a?"dateFormats":"timeFormats",a.date||a.time]);break;case"datetime"in a:c=b.main(["dates/calendars/gregorian/dateTimeFormats",a.datetime]),c&&(c=f(c,[b.main(["dates/calendars/gregorian/timeFormats",a.datetime]),b.main(["dates/calendars/gregorian/dateFormats",a.datetime])]));break;case"pattern"in a:c=a.pattern;break;default:throw q({name:"pattern",value:a})}return c},s=["sun","mon","tue","wed","thu","fri","sat"],t=function(a){return s.indexOf(a.supplemental.weekData.firstDay())},u=function(a,b){return(a.getDay()-t(b)+7)%7},v=function(a,b){var c=864e5;return(b.getTime()-a.getTime())/c},w=function(a,b){switch(a=new Date(a.getTime()),b){case"year":a.setMonth(0);case"month":a.setDate(1);case"day":a.setHours(0);case"hour":a.setMinutes(0);case"minute":a.setSeconds(0);case"second":a.setMilliseconds(0)}return a},x=function(a){return Math.floor(v(w(a,"year"),a))},y=function(a){return a-w(a,"day")},z=/([a-z])\1*|'[^']+'|''|./gi,A=function(a,b,c){var d;for("string"!=typeof a&&(a=String(a)),d=a.length;b>d;d+=1)a=c?a+"0":"0"+a;return a},B=function(a,b,c){var d=["abbreviated","wide","narrow"];return b.replace(z,function(b){var e,f,g=b.charAt(0),h=b.length;switch("j"===g&&(g=c.supplemental.timeData.preferred()),g){case"G":f=c.main(["dates/calendars/gregorian/eras",3>=h?"eraAbbr":4===h?"eraNames":"eraNarrow",a.getFullYear()<0?0:1]);break;case"y":f=String(a.getFullYear()),e=!0,2===h&&(f=f.substr(f.length-2));break;case"Y":f=new Date(a.getTime()),f.setDate(f.getDate()+7-(u(a,c)-t(c))-c.supplemental.weekData.minDays()),f=String(f.getFullYear()),e=!0,2===h&&(f=f.substr(f.length-2));break;case"u":case"U":throw new Error("Not implemented");case"Q":case"q":f=Math.ceil((a.getMonth()+1)/3),2>=h?e=!0:f=c.main(["dates/calendars/gregorian/quarters","Q"===g?"format":"stand-alone",d[h-3],f]);break;case"M":case"L":f=a.getMonth()+1,2>=h?e=!0:f=c.main(["dates/calendars/gregorian/months","M"===g?"format":"stand-alone",d[h-3],f]);break;case"w":f=u(w(a,"year"),c),f=Math.ceil((x(a)+f)/7)-(7-f>=c.supplemental.weekData.minDays()?0:1),e=!0;break;case"W":f=u(w(a,"month"),c),f=Math.ceil((a.getDate()+f)/7)-(7-f>=c.supplemental.weekData.minDays()?0:1);break;case"d":f=a.getDate(),e=!0;break;case"D":f=x(a)+1,e=!0;break;case"F":f=Math.floor(a.getDate()/7)+1;break;case"g+":throw new Error("Not implemented");case"e":case"c":if(2>=h){f=u(a,c)+1,e=!0;break}case"E":f=s[a.getDay()],f=6===h?c.main(["dates/calendars/gregorian/days","c"===g?"stand-alone":"format","short",f])||c.main(["dates/calendars/gregorian/days","c"===g?"stand-alone":"format","abbreviated",f]):c.main(["dates/calendars/gregorian/days","c"===g?"stand-alone":"format",d[3>h?0:h-3],f]);break;case"a":f=c.main(["dates/calendars/gregorian/dayPeriods/format/wide",a.getHours()<12?"am":"pm"]);break;case"h":f=a.getHours()%12||12,e=!0;break;case"H":f=a.getHours(),e=!0;break;case"K":f=a.getHours()%12,e=!0;break;case"k":f=a.getHours()||24,e=!0;break;case"m":f=a.getMinutes(),e=!0;break;case"s":f=a.getSeconds(),e=!0;break;case"S":f=Math.round(a.getMilliseconds()*Math.pow(10,h-3)),e=!0;break;case"A":f=Math.round(y(a)*Math.pow(10,h-3)),e=!0;break;case"z":case"Z":case"O":case"v":case"V":case"X":case"x":throw new Error("Not implemented");default:return b}return e&&(f=A(f,h)),f})},C=function(a,b,c){var d,e=[],f=["abbreviated","wide","narrow"];return d=b.match(z).every(function(b){function d(){return 1===k?l=/\d/:void 0}function g(){return 1===k?l=/\d\d?/:void 0}function h(){return 2===k?l=/\d\d/:void 0}function i(b){var d,e,f=c.main(b);for(d in f)if(e=new RegExp("^"+f[d]),e.test(a))return m.value=d,l=new RegExp(f[d]);return null}var j,k,l,m={};switch(m.type=b,j=b.charAt(0),k=b.length,j){case"G":i(["dates/calendars/gregorian/eras",3>=k?"eraAbbr":4===k?"eraNames":"eraNarrow"]);break;case"y":case"Y":l=1===k?/\d+/:2===k?/\d\d/:new RegExp("\\d{"+k+",}");break;case"u":case"U":throw new Error("Not implemented");case"Q":case"q":d()||h()||i(["dates/calendars/gregorian/quarters","Q"===j?"format":"stand-alone",f[k-3]]);break;case"M":case"L":g()||h()||i(["dates/calendars/gregorian/months","M"===j?"format":"stand-alone",f[k-3]]);break;case"D":3>=k&&(l=new RegExp("\\d{"+k+",3}"));break;case"W":case"F":d();break;case"g+":throw new Error("Not implemented");case"e":case"c":if(2>=k){d()||h();break}case"E":6===k?i(["dates/calendars/gregorian/days",["c"===j?"stand-alone":"format"],"short"])||i(["dates/calendars/gregorian/days",["c"===j?"stand-alone":"format"],"abbreviated"]):i(["dates/calendars/gregorian/days",["c"===j?"stand-alone":"format"],f[3>k?0:k-3]]);break;case"a":i(["dates/calendars/gregorian/dayPeriods/format/wide"]);break;case"w":case"d":case"h":case"H":case"K":case"k":case"j":case"m":case"s":g()||h();break;case"S":l=new RegExp("\\d{"+k+"}");break;case"A":l=new RegExp("\\d{"+(k+5)+"}");break;case"z":case"Z":case"O":case"v":case"V":case"X":case"x":throw new Error("Not implemented");case"'":m.type="literal",l="'"===b.charAt(1)?/'/:/'[^']+'/;break;default:m.type="literal",l=/./}return l?(a=a.replace(new RegExp("^"+l.source),function(a){return m.lexeme=a,""}),m.lexeme?(e.push(m),!0):!1):!1}),d?e:[]},D=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();a.setDate(1>b?1:c>b?b:c)},E=function(a,b){var c=a.getDate();a.setDate(1),a.setMonth(b),D(a,c)},F=function(){function a(a,b,c){return b>a||a>c}return function(b,c,d){var e,f,g,h,i,j=0,k=1,l=2,m=3,n=4,o=5,p=6,q=new Date,r=C(b,c,d),s=[],t=["year","month","day","hour","minute","second","milliseconds"];return r.length&&(i=r.every(function(b){var c,i,r,t;if("literal"===b.type)return!0;switch(i=b.type.charAt(0),t=b.type.length,"j"===i&&(i=d.supplemental.timeData.preferred()),i){case"G":s.push(j),f=+b.value;break;case"y":if(r=+b.lexeme,2===t){if(a(r,0,99))return!1;c=100*Math.floor(q.getFullYear()/100),r+=c,r>q.getFullYear()+20&&(r-=100)}q.setFullYear(r),s.push(j);break;case"Y":case"u":case"U":throw new Error("Not implemented");case"Q":case"q":break;case"M":case"L":if(r=2>=t?+b.lexeme:+b.value,a(r,1,12))return!1;E(q,r-1),s.push(k);break;case"w":case"W":break;case"d":if(r=+b.lexeme,a(r,1,31))return!1;D(q,r),s.push(l);break;case"D":if(r=+b.lexeme,a(r,1,366))return!1;q.setMonth(0),q.setDate(r),s.push(l);break;case"F":break;case"g+":throw new Error("Not implemented");case"e":case"c":case"E":break;case"a":e=b.value;break;case"h":if(r=+b.lexeme,a(r,1,12))return!1;g=h=!0,q.setHours(12===r?0:r),s.push(m);break;case"K":if(r=+b.lexeme,a(r,0,11))return!1;g=h=!0,q.setHours(r),s.push(m);break;case"k":if(r=+b.lexeme,a(r,1,24))return!1;g=!0,q.setHours(24===r?0:r),s.push(m);break;case"H":if(r=+b.lexeme,a(r,0,23))return!1;g=!0,q.setHours(r),s.push(m);break;case"m":if(r=+b.lexeme,a(r,0,59))return!1;q.setMinutes(r),s.push(n);break;case"s":if(r=+b.lexeme,a(r,0,59))return!1;q.setSeconds(r),s.push(o);break;case"A":q.setHours(0),q.setMinutes(0),q.setSeconds(0);case"S":r=Math.round(+b.lexeme*Math.pow(10,3-t)),q.setMilliseconds(r),s.push(p);break;case"z":case"Z":case"O":case"v":case"V":case"X":case"x":throw new Error("Not implemented")}return!0}))&&(!g||!e^h)?(0===f&&q.setFullYear(-1*q.getFullYear()+1),h&&"pm"===e&&q.setHours(q.getHours()+12),s=Math.max.apply(null,s),q=w(q,t[s])):null}}();return b.formatDate=b.prototype.formatDate=function(a,b){var d,e;return j(a,"value"),j(b,"pattern"),l(a,"value"),m(b,"pattern"),d=this.cldr,i(d),d.on("get",c),b=r(b,d),e=B(a,b,d),d.off("get",c),e},b.parseDate=b.prototype.parseDate=function(a,b){var e,f;return j(a,"value"),n(a,"value"),e=this.cldr,i(e),e.on("get",c),b=b?d(b):p(e),b.some(function(b){return m(b,"patterns"),b=r(b,e),f=F(a,b,e),!!f}),e.off("get",c),f||null},b});
tjbp/cdnjs
ajax/libs/globalize/1.0.0-alpha.5/globalize/date.min.js
JavaScript
mit
9,384
"use strict";angular.module("ngLocale",[],["$provide",function(e){var E={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["上午","下午"],DAY:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ERANAMES:["西元前","西元"],ERAS:["西元前","西元"],FIRSTDAYOFWEEK:6,MONTH:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],SHORTDAY:["週日","週一","週二","週三","週四","週五","週六"],SHORTMONTH:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],STANDALONEMONTH:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],WEEKENDRANGE:[5,6],fullDate:"y年M月d日 EEEE",longDate:"y年M月d日",medium:"y年M月d日 ah:mm:ss",mediumDate:"y年M月d日",mediumTime:"ah:mm:ss",short:"y/M/d ah:mm",shortDate:"y/M/d",shortTime:"ah:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"NT$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"zh-tw",localeID:"zh_TW",pluralCat:function(e,a){return E.OTHER}})}]); //# sourceMappingURL=angular-locale_zh-tw.min.js.map
sajochiu/cdnjs
ajax/libs/angular-i18n/1.6.0-rc.0/angular-locale_zh-tw.min.js
JavaScript
mit
1,339
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night [for=ac-input] { /* autocomplete label color */ color: #CBCBCB; } .yui3-skin-night .yui3-aclist-content { font-size: 100%; background-color: #151515; color: #ccc; border: 1px solid #303030; -moz-box-shadow: 0 0 17px rgba(0,0,0,0.58); -webkit-box-shadow: 0 0 17px rgba(0,0,0,0.58); box-shadow: 0 0 17px rgba(0,0,0,0.58); } .yui3-skin-night .yui3-aclist-item-active { background-color: #2F3030; background: -moz-linear-gradient( 0% 100% 90deg, #252626 0%, #333434 100% ); background: -webkit-gradient( linear, left top, left bottom, from(#333434), to(#252626) ); } .yui3-skin-night .yui3-aclist-item-hover { background-color: #262727; background: -moz-linear-gradient( 0% 100% 90deg, #202121 0%, #282929 100% ); background: -webkit-gradient( linear, left top, left bottom, from(#282929), to(#202121) ); } .yui3-skin-night .yui3-aclist-item { padding: 0 1em; /*0.4em 1em 0.6em*/ line-height: 2.25; } .yui3-skin-night .yui3-aclist-item-active { outline: none; } .yui3-skin-night .yui3-highlight { color:#EFEFEF; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* Horizontal Slider */ /* Use thumbUrl /build/slider-base/assets/skins/sam-dark/thumb-x.png */ .yui3-skin-night .yui3-slider-x .yui3-slider-rail, .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-left, .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-right { background-image: url(rail-x.png); background-repeat: repeat-x; /* alternate: rail-x-lines.png */ } .yui3-skin-night .yui3-slider-x .yui3-slider-rail { height: 26px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb { height: 26px; width: 21px; } .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-left { background-position: 0 -20px; height: 20px; left: -2px; width: 5px; } .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-right { background-position: 0 -40px; height: 20px; right: -2px; width: 5px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb-image { left: 0; top: -10px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb-shadow { left: 0; opacity: 0.15; filter: alpha(opacity=15); top: -50px; } /* Vertical Slider */ /* Use thumbUrl /build/slider-base/assets/skins/sam-dark/thumb-y.png */ .yui3-skin-night .yui3-slider-y .yui3-slider-rail, .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-top, .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-bottom { background-image: url(rail-y.png); background-repeat: repeat-y; /* alternate: rail-y-lines.png */ } .yui3-skin-night .yui3-slider-y .yui3-slider-rail { width: 26px; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb { width: 26px; height: 15px; } .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-top { background-position: -20px 0; width: 20px; top: -2px; height: 5px; } .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-bottom { background-position: -40px 0; width: 20px; bottom: -2px; height: 5px; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb-image { left: -10px; top: 0; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb-shadow { left: -50px; opacity: 0.15; filter: alpha(opacity=15); top: 0; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* Horizontal Slider */ /* Use thumbUrl /build/slider-base/assets/skins/night/thumb-x.png */ .yui3-skin-night .yui3-slider-x .yui3-slider-rail, .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-left, .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-right { background-image: url(rail-x.png); background-repeat: repeat-x; /* alternate: rail-x-lines.png */ } .yui3-skin-night .yui3-slider-x .yui3-slider-rail { height: 25px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb { height: 26px; width: 21px; } .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-left { background-position: 0 -20px; height: 20px; left: -5px; width: 5px; } .yui3-skin-night .yui3-slider-x .yui3-slider-rail-cap-right { background-position: 0 -40px; height: 20px; right: -5px; width: 5px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb-image { left: 0; top: -10px; } .yui3-skin-night .yui3-slider-x .yui3-slider-thumb-shadow { left: 0; opacity: 0.15; filter: alpha(opacity=15); top: -50px; } /* Vertical Slider */ /* Use thumbUrl /build/slider-base/assets/skins/night/thumb-y.png */ .yui3-skin-night .yui3-slider-y .yui3-slider-rail, .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-top, .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-bottom { background-image: url(rail-y.png); background-repeat: repeat-y; /* alternate: rail-y-lines.png */ } .yui3-skin-night .yui3-slider-y .yui3-slider-rail { width: 25px; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb { width: 26px; height: 21px; } .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-top { background-position: -20px 0; width: 20px; top: -5px; height: 5px; } .yui3-skin-night .yui3-slider-y .yui3-slider-rail-cap-bottom { background-position: -40px 0; width: 20px; bottom: -5px; height: 5px; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb-image { left: -10px; top: 0; } .yui3-skin-night .yui3-slider-y .yui3-slider-thumb-shadow { left: -50px; opacity: 0.15; filter: alpha(opacity=15); top: 0; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* basic skin styles */ .yui3-skin-night .yui3-datatable { color:#8E8E8E; font-family: HelveticaNeue,arial,helvetica,clean,sans-serif; } .yui3-skin-night .yui3-datatable-table { border: 1px solid #323434; border-collapse: separate; border-spacing: 0; color: #8E8E8E; margin: 0; padding: 0; } .yui3-skin-night .yui3-datatable-caption { color: #474747; font: italic 85%/1 HelveticaNeue,arial,helvetica,clean,sans-serif; padding: 1em 0; text-align: center; } .yui3-skin-night .yui3-datatable-cell, .yui3-skin-night .yui3-datatable-header { border-left: 1px solid #303030;/* inner column border */ border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; /*to make ths where the title is really long work*/ padding: 4px 10px 4px 10px; /* cell padding */ } .yui3-skin-night .yui3-datatable-cell:first-child, .yui3-skin-night .yui3-datatable-first-header { border-left-width: 0; } .yui3-skin-night .yui3-datatable-header { /* header gradient */ background-color:#3b3c3d; background: -moz-linear-gradient( 0% 100% 90deg, #242526 0%, #3b3c3d 96%, #2C2D2F 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#242526), color-stop(0.96, #3b3c3d), to(#2C2D2F) ); color: #eee; font-weight: normal; text-align: left; vertical-align: bottom; white-space: nowrap; } /* striping: even - #0e0e0e (darkest) odd - #1d1e1e (lighter) */ .yui3-skin-night .yui3-datatable-cell { background-color: transparent; } .yui3-skin-night .yui3-datatable-even .yui3-datatable-cell { background-color: #0e0e0e; } .yui3-skin-night .yui3-datatable-odd .yui3-datatable-cell { background-color: #1d1e1e; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-dial { color:#fff; } .yui3-skin-night .yui3-dial-handle{ /*container. top left corner used for trig positioning*/ background:#439EDE; opacity:0.3; -moz-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.9) inset; -webkit-box-shadow:1px 1px 1px rgba(0, 0, 0, 0.9) inset; /*Chrome 7/Win bug*/ box-shadow:1px 1px 1px rgba(0, 0, 0, 0.9) inset; cursor:pointer; font-size:1px; } .yui3-skin-night .yui3-dial-ring { background:#595B5B; background:-moz-linear-gradient(0% 100% 315deg, #5E6060, #2D2E2F); background:-webkit-gradient(linear, 50% 0%, 100% 100%, from(#636666), to(#424344)); -moz-box-shadow:1px 1px 2px rgba(0, 0, 0, 0.7) inset; -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) inset; /*Chrome 7/Win bug*/ box-shadow:1px 1px 5px rgba(0, 0, 0, 0.4) inset; } .yui3-skin-night .yui3-dial-center-button{ -moz-box-shadow:-1px -1px 2px rgba(0, 0, 0, 0.3) inset, 1px 1px 2px rgba(0, 0, 0, 0.5); -webkit-box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.3) inset, 1px 1px 2px rgba(0, 0, 0, 0.5); /*Chrome 7/Win bug*/ box-shadow:-1px -1px 2px rgba(0, 0, 0, 0.3) inset, 1px 1px 2px rgba(0, 0, 0, 0.5); background:#DDDBD4; background:-moz-radial-gradient( 30% 30% 0deg, circle farthest-side, #999C9C 24%, #898989 41%, #535555 87%) repeat scroll 0 0 transparent; background:-webkit-gradient( radial, 15 15, 15, 30 30, 40, from(#999C9C), to(#535555), color-stop(.2,#898989)); cursor:pointer; opacity:0.7; /*text-align:center;*/ } .yui3-skin-night .yui3-dial-reset-string{ color:#fff; font-size:72%; text-decoration:none; } .yui3-skin-night .yui3-dial-label{ color:#CBCBCB; margin-bottom:0.8em; } .yui3-skin-night .yui3-dial-value-string{ margin-left:0.5em; color:#DCDCDC; font-size:130%; } .yui3-skin-night .yui3-dial-value { visibility:hidden; position:absolute; top:0; left:102%; width:4em; } .yui3-skin-night .yui3-dial-north-mark{ position:absolute; border-left:2px solid #434343; height:5px; left:50%; top:-7px; font-size:1px; } .yui3-skin-night .yui3-dial-marker { background-color:#A0D8FF; opacity:0.2; font-size:1px; } .yui3-skin-night .yui3-dial-marker-max-min{ background-color:#FF0404; opacity:0.6; } .yui3-skin-night .yui3-dial-ring-vml, .yui3-skin-night .yui3-dial-center-button-vml, .yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min, .yui3-skin-night v\:oval.yui3-dial-marker-max-min, .yui3-skin-night .yui3-dial-marker-vml, .yui3-skin-night .yui3-dial-handle-vml { background: none; opacity:1; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-tabview-panel{ background-color:#333333; color:#808080; padding:1px; } .yui3-skin-night .yui3-tab-panel p{ margin:10px; } .yui3-skin-night .yui3-tabview-list { background-color:#0f0f0f; border-top:1px solid #000; text-align:center; height:46px; background: -moz-linear-gradient( 0% 100% 90deg, #0f0f0f 0%, #1e1e1e 96%, #292929 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#0f0f0f), color-stop(0.96, #1e1e1e), to(#292929) ); } .yui3-skin-night .yui3-tabview-list li { margin-top:8px; } .yui3-skin-night .yui3-tabview-list li a{ border:solid 1px #0c0c0c; border-right-style:none; -moz-box-shadow: 0 1px #222222; -webkit-box-shadow: 0 1px #222222; box-shadow: 0 1px #222222; text-shadow: 0 -1px 0 rgba(0,0,0,0.7); font-size:85%; text-align:center; color: #fff; padding: 6px 28px; background-color:#555658; background: -moz-linear-gradient( 0% 100% 90deg, #343536 0%, #555658 96%, #3E3F41 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#343536), color-stop(0.96, #555658), to(#3E3F41) ); } .yui3-skin-night .yui3-tabview-list li.yui3-tab-selected a { background-color:#2B2D2D; background: -moz-linear-gradient( 0% 100% 90deg, #242526 0%, #3b3c3d 96%, #2C2D2F 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#242526), color-stop(0.96, #3b3c3d), to(#2C2D2F) ); } .yui3-skin-night .yui3-tabview-list li:first-child a{ -moz-border-radius:6px 0 0 6px; -webkit-border-radius:6px 0 0 6px; border-radius:6px 0 0 6px; } .yui3-skin-night .yui3-tabview-list li:last-child a{ border-right-style:solid; -moz-border-radius:0 6px 6px 0; -webkit-border-radius:0 6px 6px 0; border-radius:0 6px 6px 0; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-datatable-sortable-column { cursor: pointer; } .yui3-skin-night .yui3-datatable-columns .yui3-datatable-sorted, .yui3-skin-night .yui3-datatable-sortable-column:hover { background-color: #4D4E4F; *background: #505152 url(../../../../assets/skins/night/sprite.png) repeat-x 0 -100px; background-image: -webkit-gradient( linear, 0 0, 0 100%, from(rgba(255,255,255, 0.2)), color-stop(40%, rgba(255,255,255, 0.1)), color-stop(80%, rgba(255,255,255, 0.01)), to(transparent)); background-image: -webkit-linear-gradient( rgba(255,255,255, 0.2), rgba(255,255,255, 0.1) 40%, rgba(255,255,255, 0.01) 80%, transparent); background-image: -moz-linear-gradient( top, rgba(255,255,255, 0.2), rgba(255,255,255, 0.1) 40%, rgba(255,255,255, 0.01) 80%, transparent); background-image: -ms-linear-gradient( rgba(255,255,255, 0.2), rgba(255,255,255, 0.1) 40%, rgba(255,255,255, 0.01) 80%, transparent); background-image: -o-linear-gradient( rgba(255,255,255, 0.2), rgba(255,255,255, 0.1) 40%, rgba(255,255,255, 0.01) 80%, transparent); background-image: linear-gradient( rgba(255,255,255, 0.2), rgba(255,255,255, 0.1) 40%, rgba(255,255,255, 0.01) 80%, transparent); } .yui3-skin-night .yui3-datatable-sort-liner { display: block; height: 100%; position: relative; padding-right: 15px; position: relative; } .yui3-skin-night .yui3-datatable-sort-indicator { position: absolute; right: 0; bottom: .5ex; width: 7px; height: 10px; background: url(sort-arrow-sprite.png) no-repeat 0 0; _background: url(sort-arrow-sprite-ie.png) no-repeat 0 0; overflow: hidden; } .yui3-skin-night .yui3-datatable-sorted .yui3-datatable-sort-indicator { background-position: 0 -10px; } .yui3-skin-night .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator { background-position: 0 -20px; } .yui3-skin-night .yui3-datatable-data .yui3-datatable-even .yui3-datatable-sorted { background-color: #262626; color: #B3B2B2; } .yui3-skin-night .yui3-datatable-data .yui3-datatable-odd .yui3-datatable-sorted { background-color: #393A3A; color: #CBCBCB; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night .yui3-calendarnav-nextmonth { width: 0; height: 0; padding: 0; margin: 0; border: 10px solid transparent; position: absolute; /* ie6 height fix */ font-size: 0; line-height: 0; /* ie6 transparent fix */ _border-left-color: black; _border-top-color: black; _border-right-color: black; _border-bottom-color: black; _filter: chroma(color=black); } .yui3-skin-night .yui3-calendarnav-prevmonth:hover, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-nextmonth:hover, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-nextmonth:hover { border-right-color: #0066CC; } .yui3-skin-night .yui3-calendarnav-nextmonth:hover, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-prevmonth:hover, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-prevmonth:hover { border-left-color: #0066CC; } .yui3-skin-night .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled, .yui3-skin-night .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled:hover, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled:hover, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled:hover { cursor: default; border-right-color: #CCCCCC; border-left-color: transparent; } .yui3-skin-night .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled, .yui3-skin-night .yui3-calendarnav-nextmonth.yui3-calendarnav-month-disabled:hover, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled, [dir="rtl"] .yui3-skin-night .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled:hover, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-prevmonth.yui3-calendarnav-month-disabled:hover { cursor: default; border-left-color: #CCCCCC; border-right-color: transparent; } .yui3-skin-night .yui3-calendarnav-prevmonth { border-right-color: #FFFFFF; left: 0; margin-left: -10px; } .yui3-skin-night .yui3-calendarnav-nextmonth { border-left-color: #FFFFFF; right: 0; margin-right: -10px; } [dir="rtl"] .yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-prevmonth { left: auto; right: 0; border-left-color: #FFFFFF; border-right-color: transparent; } [dir="rtl"] .yui3-skin-night .yui3-calendarnav-nextmonth, .yui3-skin-night [dir="rtl"] .yui3-calendarnav-nextmonth { left: 0; right: auto; border-right-color: #FFFFFF; border-left-color: transparent; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-calendar-day-highlighted { background-color: #555555; } .yui3-skin-night .yui3-calendar-day-selected.yui3-calendar-day-highlighted { background-color: #777777; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-datatable .yui3-datatable-highlight-row td { background-color: #38383f; } .yui3-skin-night .yui3-datatable tr .yui3-datatable-highlight-col { background-color: #38383f; } .yui3-skin-night .yui3-datatable tr .yui3-datatable-highlight-cell { background-color: #38383f; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ /* Vertical menus and submenus */ .yui3-skin-night .yui3-menu-content, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-content { font-size: 100%; line-height: 2.25; /* 18px 1.5*/ *line-height: 1.45; /* For IE */ border: solid 1px #303030; background: #151515; /*padding: 3px 0;*/ } .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-content { font-size: 100%; } /* Horizontal menus */ .yui3-skin-night .yui3-menu-horizontal .yui3-menu-content { line-height: 2; /* ~24px */ *line-height: 1.9; /* For IE */ background-color:#3b3c3d; background: -moz-linear-gradient( 0% 100% 90deg, #242526 0%, #3b3c3d 96%, #2C2D2F 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#242526), color-stop(0.96, #3b3c3d), to(#2C2D2F) ); padding: 0; } .yui3-skin-night .yui3-menu ul, .yui3-skin-night .yui3-menu ul ul { margin-top: 3px; padding-top: 3px; border-top: solid 1px #303030; } .yui3-skin-night .yui3-menu ul.first-of-type { border: 0; margin: 0; padding: 0; } .yui3-skin-night .yui3-menu-horizontal ul { padding: 0; margin: 0; border: 0; } .yui3-skin-night .yui3-menu li, .yui3-skin-night .yui3-menu .yui3-menu li { /* For and IE 6 (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode only): Used to collapse superfluous white space between <li> elements that is triggered by the "display" property of the <a> elements being set to "block" by node-menunav-core.css file. */ _border-bottom: solid 1px #151515; } .yui3-skin-night .yui3-menu-horizontal li { _border-bottom: 0; } .yui3-skin-night .yui3-menubuttonnav li { border-right: solid 1px #ccc; } .yui3-skin-night .yui3-splitbuttonnav li { border-right: solid 1px #303030; } .yui3-skin-night .yui3-menubuttonnav li li, .yui3-skin-night .yui3-splitbuttonnav li li { border-right: 0; } /* Menuitems and menu labels */ .yui3-skin-night .yui3-menu-label, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-label, .yui3-skin-night .yui3-menuitem-content, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menuitem-content { /*padding: 0 20px;*/ padding: 0 1em; /*background-color: #2F3030;*/ color: #fff; text-decoration: none; cursor: default; /* Necessary specify values for border, position and margin to override values specified in the selectors that follow. */ float: none; border: 0; margin: 0; } .yui3-skin-night .yui3-menu-horizontal .yui3-menu-label, .yui3-skin-night .yui3-menu-horizontal .yui3-menuitem-content { padding: 0 10px; border-style: solid; border-color: #303030; border-width: 1px 0; margin: -1px 0; float: left; /* Ensures that menu labels clear floated descendents. Also gets negative margins working in IE 7 (Strict Mode). */ width: auto; } .yui3-skin-night .yui3-menu-label, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-label { background: url(vertical-menu-submenu-indicator.png) right center no-repeat; } .yui3-skin-night .yui3-menu-horizontal .yui3-menu-label { background: none; } .yui3-skin-night .yui3-menubuttonnav .yui3-menu-label, .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label { background-image: none; } .yui3-skin-night .yui3-menubuttonnav .yui3-menu-label { padding-right: 0; } .yui3-skin-night .yui3-menubuttonnav .yui3-menu-label em { font-style: normal; padding-right: 20px; display: block; background: url(horizontal-menu-submenu-indicator.png) right center no-repeat; } .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label { padding: 0; } .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label a { float: left; width: auto; color: #fff; text-decoration: none; cursor: default; padding: 0 5px 0 10px; } .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label .yui3-menu-toggle { padding: 0; /* Overide padding applied by the preceeding rule. */ border-left: solid 1px #303030; width: 15px; overflow: hidden; text-indent: -1000px; background: url(horizontal-menu-submenu-indicator.png) 3px center no-repeat; } /* Selected menuitem */ .yui3-skin-night .yui3-menu-label-active, .yui3-skin-night .yui3-menu-label-menuvisible, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-label-active, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menu-label-menuvisible { background-color: #292a2a; } .yui3-skin-night .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-night .yui3-menu .yui3-menu .yui3-menuitem-active .yui3-menuitem-content { background-image: none; background-color: #292a2a; background: -moz-linear-gradient( 0% 100% 90deg, #252626 0%, #333434 100% ); background: -webkit-gradient( linear, left top, left bottom, from(#333434), to(#252626) ); /* Undo values set for "border-left-width" and "margin-left" when the root menu has a class of "yui-menubuttonnav" or "yui-splitbuttonnav" applied. */ border-left-width: 0; margin-left: 0; } .yui3-skin-night .yui3-menu-horizontal .yui3-menu-label-active, .yui3-skin-night .yui3-menu-horizontal .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-night .yui3-menu-horizontal .yui3-menu-label-menuvisible { border-color: #303030; background-color:#555658; background: -moz-linear-gradient( 0% 100% 90deg, #343536 0%, #555658 96%, #3E3F41 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#343536), color-stop(0.96, #555658), to(#3E3F41) ); } .yui3-skin-night .yui3-menubuttonnav .yui3-menu-label-active, .yui3-skin-night .yui3-menubuttonnav .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-night .yui3-menubuttonnav .yui3-menu-label-menuvisible, .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label-active, .yui3-skin-night .yui3-splitbuttonnav .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label-menuvisible { border-left-width: 1px; margin-left: -1px; } .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label-menuvisible { border-color: #303030; background: transparent; } .yui3-skin-night .yui3-splitbuttonnav .yui3-menu-label-menuvisible .yui3-menu-toggle { border-color: #303030; background-color: #505050; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-scrollview-scrollbar { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate(0, 0); } .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first, .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle, .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last { border-radius:3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; background-color:#808080; opacity:0.3; filter:alpha(opacity=30); /*IE*/ /* background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==); */ } .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-first, .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last { border-bottom-right-radius:0; border-bottom-left-radius:0; -webkit-border-bottom-right-radius:0; -webkit-border-bottom-left-radius:0; -moz-border-radius-bottomright:0; -moz-border-radius-bottomleft:0; } .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-last { border-radius:0; border-bottom-right-radius:3px; border-bottom-left-radius:3px; -webkit-border-radius:0; -webkit-border-bottom-right-radius:3px; -webkit-border-bottom-left-radius:3px; -webkit-transform: translate3d(0, 0, 0); -moz-border-radius:0; -moz-border-radius-bottomright:3px; -moz-border-radius-bottomleft:3px; -moz-transform: translate(0, 0); } .yui3-skin-night .yui3-scrollview-scrollbar .yui3-scrollview-middle { border-radius:0; -webkit-border-radius: 0; -moz-border-radius: 0; -webkit-transform: translate3d(0,0,0) scaleY(1); -webkit-transform-origin: 0 0; -moz-transform: translate(0,0) scaleY(1); -moz-transform-origin: 0 0; } .yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first, .yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { border-top-right-radius: 0; border-bottom-left-radius: 3px; -webkit-border-top-right-radius: 0; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-topright: 0; -moz-border-radius-bottomleft: 3px; } .yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last { border-bottom-left-radius: 0; border-top-right-radius: 3px; -webkit-border-bottom-left-radius: 0; -webkit-border-top-right-radius: 3px; -moz-border-radius-bottomleft: 0; -moz-border-radius-topright: 3px; } .yui3-skin-night .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle { -webkit-transform: translate3d(0,0,0) scaleX(1); -webkit-transform-origin: 0 0; -moz-transform: translate(0,0) scaleX(1); -moz-transform-origin: 0 0; } .yui3-skin-night .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child, .yui3-skin-night .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child { background-color: #aaa; background-image: none; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-datatable-message-content { background-color: #0e0e0e; border: 0 none; border-bottom: 1px solid #303030; padding: 4px 10px; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night{ background-color:#000; font-family: HelveticaNeue,arial,helvetica,clean,sans-serif; color:#fff; } .yui3-skin-night .yui3-overlay-content ul, ol, li { margin: 0; padding: 0; list-style:none; zoom:1; } .yui3-skin-night .yui3-overlay-content li{ *float:left; } .yui3-skin-night .yui3-overlay-content { background-color:#6d6e6e; -moz-box-shadow:0 0 17px rgba(0,0,0,0.58); -webkit-box-shadow:0 0 17px rgba(0,0,0,0.58); box-shadow:0 0 17px rgba(0,0,0,0.58); -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; } .yui3-skin-night .yui3-overlay-content .yui3-widget-hd { background-color:#6d6e6e; -moz-border-radius:7px 7px 0 0; -webkit-border-radius:7px 7px 0 0; border-radius:7px 7px 0 0; color: #fff; margin:0; padding:20px 22px 0; font-size:147%; } /*** background of bd and ft ***/ .yui3-skin-night .yui3-overlay-content .yui3-widget-bd { padding:11px 22px 17px; font-size:92%; /*margin-bottom:-1px; this was needed on ipad to close gap between ft and bd*/ } .yui3-skin-night .yui3-overlay .yui3-widget-bd li{ margin: 0.04em; } /*.yui3-skin-night .yui3-widget-bd li:last-child{ margin-bottom:0.4em; }*/ .yui3-skin-night .yui3-overlay-content .yui3-widget-ft{ background-color:#575858; border-top:solid 1px #494a4a; -moz-border-radius:0 0 7px 7px; -webkit-border-radius:0 0 7px 7px; border-radius:0 0 7px 7px; padding:17px 25px 20px; text-align:center; /*font-size:92%;*/ } /* For Buttons */ .yui3-skin-night .yui3-overlay-content .yui3-widget-ft li { margin:3px; display:inline-block; } .yui3-skin-night .yui3-overlay-content .yui3-widget-ft li a{ border:solid 1px #1B1C1C; border-radius: 6px; -moz-box-shadow: 0 1px #677478; -webkit-box-shadow: 0 1px #677478; box-shadow: 0 1px #677478; text-shadow: 0 -1px 0 rgba(0,0,0,0.7); font-size:85%; text-align:center; color: #fff; padding: 6px 28px; background-color:#2B2D2D; background: -moz-linear-gradient( 0% 100% 90deg, #242526 0%, #3b3c3d 96%, #2C2D2F 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#242526), color-stop(0.96, #3b3c3d), to(#2C2D2F) ); } .yui3-skin-night .yui3-overlay .yui3-widget-ft li:first-child { margin-left:0; } .yui3-skin-night .yui3-overlay .yui3-widget-ft li:last-child { margin-right:0; } .yui3-skin-night .yui3-overlay .yui3-widget-ft li:last-child a { border:solid 1px #520E00; -moz-box-shadow: 0 1px #7D5D57; -webkit-box-shadow: 0 1px #7D5D57; box-shadow: 0 1px #7D5D57; background-color:#901704; background: -moz-linear-gradient( 100% 0% 270deg, #ab1c0b, #7b1400 ); background: -webkit-gradient( linear, left top, left bottom, from(#ab1c0b), to(#7b1400) ); margin-right: 0; } /* .yui3-skin-night .yui3-overlay .yui3-widget-ft li{ display:inline-block; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; background-color:#252525; background: -moz-linear-gradient( 100% 0% 270deg, #3f3f3f, #0e0e0e ); background: -webkit-gradient( linear, left top, left bottom, from(#3f3f3f), to(#0e0e0e) ); line-height:32px; width:100px; margin:0px 5px 0px 5px; } .yui3-skin-night .yui3-overlay .yui3-widget-ft li:first-child { margin-left:0px; } .yui3-skin-night .yui3-overlay .yui3-widget-ft li:last-child { background-color:#901704; background: -moz-linear-gradient( 100% 0% 270deg, #ab1c0b, #7b1400 ); background: -webkit-gradient( linear, left top, left bottom, from(#ab1c0b), to(#7b1400) ); margin-right: 0px; } */ #yui3-widget-mask{ background-color:#000; opacity:0.5; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-calendar-content { padding:10px; color: #CBCBCB; border: 1px solid #303030; background: #151515; /* Old browsers */ background: -moz-linear-gradient(top, #222222 0%, #151515 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222222), color-stop(100%,#151515)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #222222 0%,#151515 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #222222 0%,#151515 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, #222222 0%,#151515 100%); /* IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#151515',GradientType=0 ); /* IE6-9 */ background: linear-gradient(top, #222222 0%,#151515 100%); /* W3C */ -moz-border-radius: 5px; border-radius: 5px; } .yui3-skin-night .yui3-calendar-grid { padding:5px; border-collapse: collapse; } .yui3-skin-night .yui3-calendar-header { padding-bottom:10px; } .yui3-skin-night .yui3-calendar-header-label { margin: 0; font-size: 1em; font-weight: bold; text-align: center; width: 100%; } .yui3-skin-night .yui3-calendar-day, .yui3-skin-night .yui3-calendar-prevmonth-day, .yui3-skin-night .yui3-calendar-nextmonth-day { padding:5px; border: 1px solid #151515; background: #262727; text-align:center; } .yui3-skin-night .yui3-calendar-day:hover { background: #383939; color: #FFFFFF; } .yui3-skin-night .yui3-calendar-selection-disabled, .yui3-skin-night .yui3-calendar-selection-disabled:hover { background: #151515; color: #596060; } .yui3-skin-night .yui3-calendar-weekday { color: #4F4F4F; font-weight: bold; text-align: center; } .yui3-skin-night .yui3-calendar-prevmonth-day, .yui3-skin-night .yui3-calendar-nextmonth-day { color: #4F4F4F; } .yui3-skin-night .yui3-calendar-day { font-weight: bold; } .yui3-skin-night .yui3-calendar-day-selected { background-color: #505151; color: #fff; } .yui3-skin-night .yui3-calendar-left-grid { margin-right:1em; } [dir="rtl"] .yui3-skin-night .yui3-calendar-left-grid, .yui3-skin-night [dir="rtl"] .yui3-calendar-left-grid { margin-right: auto; margin-left: 1em; } .yui3-skin-sam .yui3-calendar-right-grid { margin-left:1em; } [dir="rtl"] .yui3-skin-night .yui3-calendar-right-grid, .yui3-skin-night [dir="rtl"] .yui3-calendar-right-grid { margin-left: auto; margin-right: 1em; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-datatable-paginator { background: white url(../../../../assets/skins/night/sprite.png) repeat-x 0 0; background-image: -webkit-linear-gradient(transparent 40%, hsla(0, 0%, 0%, 0.21)); background-image: -moz-linear-gradient(top, transparent 40%, hsla(0, 0%, 0%, 0.21)); background-image: -ms-linear-gradient(transparent 40%, hsla(0, 0%, 0%, 0.21)); background-image: -o-linear-gradient(transparent 40%, hsla(0, 0%, 0%, 0.21)); background-image: linear-gradient(transparent 40%, hsla(0, 0%, 0%, 0.21)); } .yui3-datatable-paginator .yui3-datatable-paginator-control { color: #242D42; } .yui3-datatable-paginator .yui3-datatable-paginator-control-first:hover, .yui3-datatable-paginator .yui3-datatable-paginator-control-last:hover, .yui3-datatable-paginator .yui3-datatable-paginator-control-prev:hover, .yui3-datatable-paginator .yui3-datatable-paginator-control-next:hover { box-shadow: 0 1px 2px #292442; } .yui3-datatable-paginator .yui3-datatable-paginator-control-first:active, .yui3-datatable-paginator .yui3-datatable-paginator-control-last:active, .yui3-datatable-paginator .yui3-datatable-paginator-control-prev:active, .yui3-datatable-paginator .yui3-datatable-paginator-control-next:active { box-shadow: inset 0 1px 1px #292442; background: #E0DEED; background: hsla(250, 30%, 90%, 0.3); } .yui3-datatable-paginator .yui3-datatable-paginator-control-disabled, .yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover { color: #BDC7DB; border-color: transparent; box-shadow: none; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-resize-handle-inner-r, .yui3-resize-handle-inner-l, .yui3-resize-handle-inner-t, .yui3-resize-handle-inner-b, .yui3-resize-handle-inner-tr, .yui3-resize-handle-inner-br, .yui3-resize-handle-inner-tl, .yui3-resize-handle-inner-bl { background-repeat: no-repeat; background: url(arrows.png) no-repeat 0 0; display: block; height: 15px; overflow: hidden; text-indent: -99999em; width: 15px; } .yui3-resize-handle-inner-br { background-position: -30px 0; bottom: -2px; right: -2px; } .yui3-resize-handle-inner-tr { background-position: -58px 0; bottom: 0; right: -2px; } .yui3-resize-handle-inner-bl { background-position: -75px 0; bottom: -2px; right: -2px; } .yui3-resize-handle-inner-tl { background-position: -47px 0; bottom: 0; right: -2px; } .yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t { background-position: -15px 0; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-panel { color: #FFFFFF; font-family: HelveticaNeue, arial, helvetica, clean, sans-serif; } .yui3-skin-night .yui3-panel-content { background: #6D6E6E; -webkit-box-shadow: 0 0 20px #000; -moz-box-shadow: 0 0 20px #000; box-shadow: 0 0 20px #000; border: 1px solid black; -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px; } .yui3-skin-night .yui3-panel .yui3-widget-hd { padding: 11px 57px 11px 22px; /* Room for close button. */ min-height: 17px; /* For the close button */ _height: 17px; /* IE6 */ -webkit-border-top-left-radius: 7px; -webkit-border-top-right-radius: 7px; -moz-border-radius-topleft: 7px; -moz-border-radius-topright: 7px; border-top-left-radius: 7px; border-top-right-radius: 7px; font-weight: bold; color: white; background-color: #555658; background: -moz-linear-gradient( 0% 100% 90deg, #343536 0%, #555658 96%, #3E3F41 100% ); background: -webkit-gradient( linear, left bottom, left top, from(#343536), color-stop(0.96, #555658), to(#3E3F41) ); } .yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-widget-buttons { padding: 11px; } .yui3-skin-night .yui3-panel .yui3-widget-bd { padding: 11px 22px 17px; } .yui3-skin-night .yui3-panel .yui3-widget-ft { background-color: #575858; border-top: 1px solid #494A4A; padding: 6px 16px 8px; text-align: center; -webkit-border-bottom-right-radius: 7px; -webkit-border-bottom-left-radius: 7px; -moz-border-radius-bottomright: 7px; -moz-border-radius-bottomleft: 7px; border-bottom-right-radius: 7px; border-bottom-left-radius: 7px; } .yui3-skin-night .yui3-panel .yui3-widget-ft .yui3-widget-buttons { bottom: 0; position: relative; right: auto; width: 100%; text-align: center; padding-bottom: 0; margin-left: -5px; margin-right: -5px; } .yui3-skin-night .yui3-panel .yui3-widget-ft .yui3-button { margin: 5px; } /* Support for icon-based [x] "close" button in the header. Nicolas Gallagher: "CSS image replacement with pseudo-elements (NIR)" http://nicolasgallagher.com/css-image-replacement-with-pseudo-elements/ */ .yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close { /* Reset base button styles */ background: transparent; filter: none; border: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; /* Structure */ width: 22px; height: 17px; padding: 0; overflow: hidden; vertical-align: top; /* IE < 8 :( */ *font-size: 0; *line-height: 0; *letter-spacing: -1000px; *color: #86A5EC; *background: url(sprite_icons.png) no-repeat center 3px; } .yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close:hover { background-color: #333; } .yui3-skin-night .yui3-panel .yui3-widget-hd .yui3-button-close:before { /* Displays the [x] icon in place of the "Close" text. Note: The `width` of this pseudo element is the same as its "host" element. */ content: url(sprite_icons.png); display: inline-block; text-align: center; font-size: 0; line-height: 0; width: 22px; margin: 3px 0 0 1px; } .yui3-skin-night .yui3-panel-hidden .yui3-widget-hd .yui3-button-close { /* Required for IE > 7 to deal with pseudo :before element */ display: none; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-widget-mask { background-color: black; zoom: 1; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=40)"; filter: alpha(opacity=40); opacity: 0.4; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-sam .yui3-datatable-scroll-columns { border-collapse: separate; border-spacing: 0; font-family: HelveticaNeue,arial,helvetica,clean,sans-serif; margin: 0; padding: 0; top: 0; left: 0; } .yui3-skin-sam .yui3-datatable-scroll-columns .yui3-datatable-header { padding: 0; } .yui3-skin-sam .yui3-datatable-x-scroller, .yui3-skin-sam .yui3-datatable-y-scroller-container { border: 1px solid #303030; border-left-color: #323434; } .yui3-skin-sam .yui3-datatable-scrollable-x .yui3-datatable-y-scroller-container, .yui3-skin-sam .yui3-datatable-x-scroller .yui3-datatable-table, .yui3-skin-sam .yui3-datatable-y-scroller .yui3-datatable-table { border: 0 none; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-skin-night .yui3-scrollview { -webkit-tap-highlight-color: rgba(0,0,0,0); } .yui3-skin-night .yui3-scrollview{ color:#fff; background-color:#000; } .yui3-skin-night .yui3-scrollview-vert .yui3-scrollview-content { /*border:1px solid #303030; If the ScrollView needs a border add it here */ border-top:0; background-color:#000; font-family: HelveticaNeue,arial,helvetica,clean,sans-serif; color:#fff; } /* For IE 6/7 - needs a background color (above) to pick up events, and zoom, to fill the UL */ .yui3-skin-night .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-item { *zoom:1; } /* For IE7 - needs zoom, otherwise clipped content is not rendered */ .yui3-skin-night .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-list { *zoom:1; list-style:none; /*need these since reset is not required*/ padding:0; /*need these since reset is not required*/ margin:0; /*need these since reset is not required*/ } .yui3-skin-night .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-item { border-bottom: 1px solid #303030; padding: 15px 20px 16px; font-size: 100%; font-weight: bold; background-color:#151515; cursor:pointer; } .yui3-skin-night .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-list.selected{ background-color:#2C2D2E; background: -moz-linear-gradient( 0% 100% 90deg, #252626 0%, #333434 100% ); background: -webkit-gradient( linear, left top, left bottom, from(#333434), to(#252626) ); border-top:solid 1px #4b4b4b; border-bottom:solid 1px #3e3f3f; margin-top:-1px; } /* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */
margaritis/cdnjs
ajax/libs/yui/3.17.1/assets/skin/night/skin.css
CSS
mit
45,519
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/datatable-head/datatable-head.js']) { __coverage__['build/datatable-head/datatable-head.js'] = {"path":"build/datatable-head/datatable-head.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0},"b":{"1":[0,0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":161,"loc":{"start":{"line":161,"column":18},"end":{"line":161,"column":30}}},"3":{"name":"(anonymous_3)","line":186,"loc":{"start":{"line":186,"column":12},"end":{"line":186,"column":24}}},"4":{"name":"(anonymous_4)","line":273,"loc":{"start":{"line":273,"column":25},"end":{"line":273,"column":38}}},"5":{"name":"(anonymous_5)","line":286,"loc":{"start":{"line":286,"column":12},"end":{"line":286,"column":24}}},"6":{"name":"(anonymous_6)","line":303,"loc":{"start":{"line":303,"column":22},"end":{"line":303,"column":34}}},"7":{"name":"(anonymous_7)","line":316,"loc":{"start":{"line":316,"column":16},"end":{"line":316,"column":28}}},"8":{"name":"(anonymous_8)","line":343,"loc":{"start":{"line":343,"column":17},"end":{"line":343,"column":35}}},"9":{"name":"(anonymous_9)","line":413,"loc":{"start":{"line":413,"column":19},"end":{"line":413,"column":35}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":532,"column":75}},"2":{"start":{"line":11,"column":0},"end":{"line":14,"column":22}},"3":{"start":{"line":82,"column":0},"end":{"line":529,"column":3}},"4":{"start":{"line":164,"column":8},"end":{"line":166,"column":42}},"5":{"start":{"line":168,"column":8},"end":{"line":174,"column":9}},"6":{"start":{"line":169,"column":12},"end":{"line":169,"column":60}},"7":{"start":{"line":171,"column":12},"end":{"line":173,"column":67}},"8":{"start":{"line":187,"column":8},"end":{"line":197,"column":56}},"9":{"start":{"line":199,"column":8},"end":{"line":256,"column":9}},"10":{"start":{"line":200,"column":12},"end":{"line":200,"column":22}},"11":{"start":{"line":202,"column":12},"end":{"line":249,"column":13}},"12":{"start":{"line":203,"column":16},"end":{"line":248,"column":17}},"13":{"start":{"line":204,"column":20},"end":{"line":204,"column":33}},"14":{"start":{"line":206,"column":20},"end":{"line":243,"column":21}},"15":{"start":{"line":207,"column":24},"end":{"line":207,"column":44}},"16":{"start":{"line":208,"column":24},"end":{"line":215,"column":26}},"17":{"start":{"line":217,"column":24},"end":{"line":218,"column":71}},"18":{"start":{"line":220,"column":24},"end":{"line":222,"column":25}},"19":{"start":{"line":221,"column":28},"end":{"line":221,"column":69}},"20":{"start":{"line":224,"column":24},"end":{"line":226,"column":25}},"21":{"start":{"line":225,"column":28},"end":{"line":225,"column":72}},"22":{"start":{"line":228,"column":24},"end":{"line":230,"column":25}},"23":{"start":{"line":229,"column":28},"end":{"line":229,"column":68}},"24":{"start":{"line":232,"column":24},"end":{"line":234,"column":25}},"25":{"start":{"line":233,"column":28},"end":{"line":233,"column":91}},"26":{"start":{"line":236,"column":24},"end":{"line":239,"column":25}},"27":{"start":{"line":237,"column":28},"end":{"line":238,"column":72}},"28":{"start":{"line":241,"column":24},"end":{"line":242,"column":78}},"29":{"start":{"line":245,"column":20},"end":{"line":247,"column":23}},"30":{"start":{"line":251,"column":12},"end":{"line":251,"column":32}},"31":{"start":{"line":253,"column":12},"end":{"line":255,"column":13}},"32":{"start":{"line":254,"column":16},"end":{"line":254,"column":69}},"33":{"start":{"line":258,"column":8},"end":{"line":258,"column":22}},"34":{"start":{"line":260,"column":8},"end":{"line":260,"column":20}},"35":{"start":{"line":274,"column":8},"end":{"line":274,"column":52}},"36":{"start":{"line":276,"column":8},"end":{"line":276,"column":22}},"37":{"start":{"line":287,"column":8},"end":{"line":292,"column":9}},"38":{"start":{"line":289,"column":12},"end":{"line":291,"column":57}},"39":{"start":{"line":304,"column":8},"end":{"line":306,"column":12}},"40":{"start":{"line":317,"column":8},"end":{"line":317,"column":74}},"41":{"start":{"line":344,"column":8},"end":{"line":344,"column":33}},"42":{"start":{"line":345,"column":8},"end":{"line":345,"column":58}},"43":{"start":{"line":347,"column":8},"end":{"line":347,"column":32}},"44":{"start":{"line":414,"column":8},"end":{"line":417,"column":57}},"45":{"start":{"line":419,"column":8},"end":{"line":519,"column":9}},"46":{"start":{"line":421,"column":12},"end":{"line":421,"column":32}},"47":{"start":{"line":425,"column":12},"end":{"line":425,"column":35}},"48":{"start":{"line":427,"column":12},"end":{"line":472,"column":13}},"49":{"start":{"line":428,"column":16},"end":{"line":428,"column":48}},"50":{"start":{"line":429,"column":16},"end":{"line":429,"column":33}},"51":{"start":{"line":430,"column":16},"end":{"line":430,"column":37}},"52":{"start":{"line":432,"column":16},"end":{"line":453,"column":17}},"53":{"start":{"line":433,"column":20},"end":{"line":433,"column":51}},"54":{"start":{"line":434,"column":20},"end":{"line":434,"column":44}},"55":{"start":{"line":436,"column":20},"end":{"line":436,"column":33}},"56":{"start":{"line":438,"column":20},"end":{"line":440,"column":21}},"57":{"start":{"line":439,"column":24},"end":{"line":439,"column":42}},"58":{"start":{"line":442,"column":20},"end":{"line":452,"column":21}},"59":{"start":{"line":443,"column":24},"end":{"line":443,"column":51}},"60":{"start":{"line":444,"column":24},"end":{"line":444,"column":37}},"61":{"start":{"line":446,"column":24},"end":{"line":446,"column":66}},"62":{"start":{"line":449,"column":24},"end":{"line":449,"column":30}},"63":{"start":{"line":451,"column":24},"end":{"line":451,"column":41}},"64":{"start":{"line":455,"column":16},"end":{"line":471,"column":17}},"65":{"start":{"line":457,"column":20},"end":{"line":469,"column":21}},"66":{"start":{"line":458,"column":24},"end":{"line":458,"column":57}},"67":{"start":{"line":459,"column":24},"end":{"line":459,"column":52}},"68":{"start":{"line":461,"column":24},"end":{"line":461,"column":44}},"69":{"start":{"line":463,"column":24},"end":{"line":468,"column":25}},"70":{"start":{"line":466,"column":28},"end":{"line":466,"column":54}},"71":{"start":{"line":467,"column":28},"end":{"line":467,"column":63}},"72":{"start":{"line":470,"column":20},"end":{"line":470,"column":32}},"73":{"start":{"line":475,"column":12},"end":{"line":477,"column":13}},"74":{"start":{"line":476,"column":16},"end":{"line":476,"column":33}},"75":{"start":{"line":479,"column":12},"end":{"line":479,"column":35}},"76":{"start":{"line":481,"column":12},"end":{"line":518,"column":13}},"77":{"start":{"line":482,"column":16},"end":{"line":482,"column":48}},"78":{"start":{"line":483,"column":16},"end":{"line":483,"column":33}},"79":{"start":{"line":484,"column":16},"end":{"line":484,"column":37}},"80":{"start":{"line":486,"column":16},"end":{"line":512,"column":17}},"81":{"start":{"line":487,"column":20},"end":{"line":487,"column":33}},"82":{"start":{"line":488,"column":20},"end":{"line":488,"column":44}},"83":{"start":{"line":490,"column":20},"end":{"line":490,"column":56}},"84":{"start":{"line":492,"column":20},"end":{"line":492,"column":33}},"85":{"start":{"line":495,"column":20},"end":{"line":495,"column":44}},"86":{"start":{"line":497,"column":20},"end":{"line":501,"column":21}},"87":{"start":{"line":498,"column":24},"end":{"line":498,"column":58}},"88":{"start":{"line":500,"column":24},"end":{"line":500,"column":56}},"89":{"start":{"line":503,"column":20},"end":{"line":511,"column":21}},"90":{"start":{"line":507,"column":24},"end":{"line":507,"column":51}},"91":{"start":{"line":508,"column":24},"end":{"line":508,"column":30}},"92":{"start":{"line":510,"column":24},"end":{"line":510,"column":66}},"93":{"start":{"line":514,"column":16},"end":{"line":517,"column":17}},"94":{"start":{"line":516,"column":20},"end":{"line":516,"column":32}},"95":{"start":{"line":521,"column":8},"end":{"line":525,"column":9}},"96":{"start":{"line":522,"column":12},"end":{"line":522,"column":32}},"97":{"start":{"line":524,"column":12},"end":{"line":524,"column":30}},"98":{"start":{"line":527,"column":8},"end":{"line":527,"column":23}}},"branchMap":{"1":{"line":165,"type":"binary-expr","locations":[{"start":{"line":165,"column":20},"end":{"line":165,"column":24}},{"start":{"line":165,"column":28},"end":{"line":165,"column":49}},{"start":{"line":166,"column":20},"end":{"line":166,"column":41}}]},"2":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":8},"end":{"line":168,"column":8}},{"start":{"line":168,"column":8},"end":{"line":168,"column":8}}]},"3":{"line":168,"type":"binary-expr","locations":[{"start":{"line":168,"column":12},"end":{"line":168,"column":16}},{"start":{"line":168,"column":20},"end":{"line":168,"column":37}}]},"4":{"line":188,"type":"binary-expr","locations":[{"start":{"line":188,"column":23},"end":{"line":188,"column":37}},{"start":{"line":189,"column":25},"end":{"line":189,"column":65}}]},"5":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":8},"end":{"line":199,"column":8}},{"start":{"line":199,"column":8},"end":{"line":199,"column":8}}]},"6":{"line":199,"type":"binary-expr","locations":[{"start":{"line":199,"column":12},"end":{"line":199,"column":17}},{"start":{"line":199,"column":21},"end":{"line":199,"column":28}}]},"7":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":12},"end":{"line":202,"column":12}},{"start":{"line":202,"column":12},"end":{"line":202,"column":12}}]},"8":{"line":212,"type":"binary-expr","locations":[{"start":{"line":212,"column":43},"end":{"line":212,"column":52}},{"start":{"line":212,"column":56},"end":{"line":212,"column":63}},{"start":{"line":213,"column":44},"end":{"line":213,"column":63}}]},"9":{"line":217,"type":"cond-expr","locations":[{"start":{"line":218,"column":28},"end":{"line":218,"column":65}},{"start":{"line":218,"column":68},"end":{"line":218,"column":70}}]},"10":{"line":220,"type":"if","locations":[{"start":{"line":220,"column":24},"end":{"line":220,"column":24}},{"start":{"line":220,"column":24},"end":{"line":220,"column":24}}]},"11":{"line":224,"type":"if","locations":[{"start":{"line":224,"column":24},"end":{"line":224,"column":24}},{"start":{"line":224,"column":24},"end":{"line":224,"column":24}}]},"12":{"line":228,"type":"if","locations":[{"start":{"line":228,"column":24},"end":{"line":228,"column":24}},{"start":{"line":228,"column":24},"end":{"line":228,"column":24}}]},"13":{"line":232,"type":"if","locations":[{"start":{"line":232,"column":24},"end":{"line":232,"column":24}},{"start":{"line":232,"column":24},"end":{"line":232,"column":24}}]},"14":{"line":236,"type":"if","locations":[{"start":{"line":236,"column":24},"end":{"line":236,"column":24}},{"start":{"line":236,"column":24},"end":{"line":236,"column":24}}]},"15":{"line":242,"type":"binary-expr","locations":[{"start":{"line":242,"column":28},"end":{"line":242,"column":46}},{"start":{"line":242,"column":50},"end":{"line":242,"column":68}}]},"16":{"line":253,"type":"if","locations":[{"start":{"line":253,"column":12},"end":{"line":253,"column":12}},{"start":{"line":253,"column":12},"end":{"line":253,"column":12}}]},"17":{"line":287,"type":"if","locations":[{"start":{"line":287,"column":8},"end":{"line":287,"column":8}},{"start":{"line":287,"column":8},"end":{"line":287,"column":8}}]},"18":{"line":419,"type":"if","locations":[{"start":{"line":419,"column":8},"end":{"line":419,"column":8}},{"start":{"line":419,"column":8},"end":{"line":419,"column":8}}]},"19":{"line":419,"type":"binary-expr","locations":[{"start":{"line":419,"column":12},"end":{"line":419,"column":25}},{"start":{"line":419,"column":29},"end":{"line":419,"column":40}}]},"20":{"line":438,"type":"if","locations":[{"start":{"line":438,"column":20},"end":{"line":438,"column":20}},{"start":{"line":438,"column":20},"end":{"line":438,"column":20}}]},"21":{"line":442,"type":"if","locations":[{"start":{"line":442,"column":20},"end":{"line":442,"column":20}},{"start":{"line":442,"column":20},"end":{"line":442,"column":20}}]},"22":{"line":442,"type":"binary-expr","locations":[{"start":{"line":442,"column":24},"end":{"line":442,"column":41}},{"start":{"line":442,"column":45},"end":{"line":442,"column":60}}]},"23":{"line":455,"type":"if","locations":[{"start":{"line":455,"column":16},"end":{"line":455,"column":16}},{"start":{"line":455,"column":16},"end":{"line":455,"column":16}}]},"24":{"line":457,"type":"if","locations":[{"start":{"line":457,"column":20},"end":{"line":457,"column":20}},{"start":{"line":457,"column":20},"end":{"line":457,"column":20}}]},"25":{"line":503,"type":"if","locations":[{"start":{"line":503,"column":20},"end":{"line":503,"column":20}},{"start":{"line":503,"column":20},"end":{"line":503,"column":20}}]},"26":{"line":503,"type":"binary-expr","locations":[{"start":{"line":503,"column":24},"end":{"line":503,"column":32}},{"start":{"line":503,"column":36},"end":{"line":503,"column":51}}]},"27":{"line":514,"type":"if","locations":[{"start":{"line":514,"column":16},"end":{"line":514,"column":16}},{"start":{"line":514,"column":16},"end":{"line":514,"column":16}}]}},"code":["(function () { YUI.add('datatable-head', function (Y, NAME) {","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-head","@since 3.5.0","**/","var Lang = Y.Lang,"," fromTemplate = Lang.sub,"," isArray = Lang.isArray,"," toArray = Y.Array;","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided array of column configuration objects into a rendered","`<thead>` based on the data in those objects.","","","The structure of the column data is expected to be a single array of objects,","where each object corresponds to a `<th>`. Those objects may contain a","`children` property containing a similarly structured array to indicate the","nested cells should be grouped under the parent column's colspan in a separate","row of header cells. E.g.","","<pre><code>","new Y.DataTable.HeaderView({"," container: tableNode,"," columns: ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]","}).render();","</code></pre>","","This would translate to the following visualization:","","<pre>","---------------------","| | name |","| |---------------","| id | First | Last |","---------------------","</pre>","","Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `title` - The content of the 'title' attribute of the `<th>`"," * `className` - Adds this string of CSS classes to the column header","","Through the life of instantiation and rendering, the column objects will have","the following properties added to them:",""," * `id` - (Defaulted by DataTable) The id to assign the rendered column"," * `_colspan` - To supply the `<th>` attribute"," * `_rowspan` - To supply the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column","","The column object is also used to provide values for {placeholder} tokens in the","instance's `CELL_TEMPLATE`, so you can modify the template and include other","column object properties to populate them.","","@class HeaderView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," Template used to create the table's header cell markup. Override this to"," customize how header cell markup is created.",""," @property CELL_TEMPLATE"," @type {String}"," @default '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}{title}>{content}</th>'"," @since 3.5.0"," **/"," CELL_TEMPLATE:"," '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}{title}>{content}</th>',",""," /**"," The data representation of the header rows to render. This is assigned by"," parsing the `columns` configuration array, and is used by the render()"," method.",""," @property columns"," @type {Array[]}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //columns: null,",""," /**"," Template used to create the table's header row markup. Override this to"," customize the row markup.",""," @property ROW_TEMPLATE"," @type {String}"," @default '<tr>{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE:"," '<tr>{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `source` property of"," the configuration object passed to the constructor.",""," @property source"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //source: null,",""," /**"," HTML templates used to create the `<thead>` containing the table headers.",""," @property THEAD_TEMPLATE"," @type {String}"," @default '<thead class=\"{className}\">{content}</thead>'"," @since 3.6.0"," **/"," THEAD_TEMPLATE: '<thead class=\"{className}\"></thead>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base.",""," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attribute with setter? to host to use property this.host"," // for performance"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Creates the `<thead>` Node content by assembling markup generated by"," populating the `ROW_TEMPLATE` and `CELL_TEMPLATE` templates with content"," from the `columns` property.",""," @method render"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," thead = this.theadNode ||"," (this.theadNode = this._createTHeadNode()),"," columns = this.columns,"," defaults = {"," _colspan: 1,"," _rowspan: 1,"," abbr: '',"," title: ''"," },"," i, len, j, jlen, col, html, content, values;",""," if (thead && columns) {"," html = '';",""," if (columns.length) {"," for (i = 0, len = columns.length; i < len; ++i) {"," content = '';",""," for (j = 0, jlen = columns[i].length; j < jlen; ++j) {"," col = columns[i][j];"," values = Y.merge("," defaults,"," col, {"," className: this.getClassName('header'),"," content : col.label || col.key ||"," (\"Column \" + (j + 1))"," }"," );",""," values._id = col._id ?"," ' data-yui3-col-id=\"' + col._id + '\"' : '';",""," if (col.abbr) {"," values.abbr = ' abbr=\"' + col.abbr + '\"';"," }",""," if (col.title) {"," values.title = ' title=\"' + col.title + '\"';"," }",""," if (col.className) {"," values.className += ' ' + col.className;"," }",""," if (col._first) {"," values.className += ' ' + this.getClassName('first', 'header');"," }",""," if (col._id) {"," values.className +="," ' ' + this.getClassName('col', col._id);"," }",""," content += fromTemplate("," col.headerTemplate || this.CELL_TEMPLATE, values);"," }",""," html += fromTemplate(this.ROW_TEMPLATE, {"," content: content"," });"," }"," }",""," thead.setHTML(html);",""," if (thead.get('parentNode') !== table) {"," table.insertBefore(thead, table.one('tfoot, tbody'));"," }"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," Handles changes in the source's columns attribute. Redraws the headers.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this.columns = this._parseColumns(e.newVal);",""," this.render();"," },",""," /**"," Binds event subscriptions from the UI and the source (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," if (!this._eventHandles.columnsChange) {"," // TODO: How best to decouple this?"," this._eventHandles.columnsChange ="," this.after('columnsChange',"," Y.bind('_afterColumnsChange', this));"," }"," },",""," /**"," Creates the `<thead>` node that will store the header rows and cells.",""," @method _createTHeadNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTHeadNode: function () {"," return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE, {"," className: this.getClassName('columns')"," }));"," },",""," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(Y.Object.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Initializes the instance. Reads the following configuration properties:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;"," this.columns = this._parseColumns(config.columns);",""," this._eventHandles = [];"," },",""," /**"," Translate the input column format into a structure useful for rendering a"," `<thead>`, rows, and cells. The structure of the input is expected to be a"," single array of objects, where each object corresponds to a `<th>`. Those"," objects may contain a `children` property containing a similarly structured"," array to indicate the nested cells should be grouped under the parent"," column's colspan in a separate row of header cells. E.g.",""," <pre><code>"," ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]"," </code></pre>",""," would indicate two header rows with the first column 'id' being assigned a"," `rowspan` of `2`, the 'name' column appearing in the first row with a"," `colspan` of `2`, and the 'firstName' and 'lastName' columns appearing in"," the second row, below the 'name' column.",""," <pre>"," ---------------------"," | | name |"," | |---------------"," | id | First | Last |"," ---------------------"," </pre>",""," Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `title` - The content of the 'title' attribute of the `<th>`"," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells"," in this column only.",""," The output structure is basically a simulation of the `<thead>` structure"," with arrays for rows and objects for cells. Column objects have the"," following properties added to them:",""," * `id` - (Defaulted by DataTable) The id to assign the rendered"," column"," * `_colspan` - Per the `<th>` attribute"," * `_rowspan` - Per the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column",""," The column object is also used to provide values for {placeholder}"," replacement in the `CELL_TEMPLATE`, so you can modify the template and"," include other column object properties to populate them.",""," @method _parseColumns"," @param {Object[]} data Array of column object data"," @return {Array[]} An array of arrays corresponding to the header row"," structure to render"," @protected"," @since 3.5.0"," **/"," _parseColumns: function (data) {"," var columns = [],"," stack = [],"," rowSpan = 1,"," entry, row, col, children, parent, i, len, j;",""," if (isArray(data) && data.length) {"," // don't modify the input array"," data = data.slice();",""," // First pass, assign colspans and calculate row count for"," // non-nested headers' rowspan"," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," row[i] = col = Y.merge(row[i]);"," children = col.children;",""," Y.stamp(col);",""," if (!col.id) {"," col.id = Y.guid();"," }",""," if (isArray(children) && children.length) {"," stack.push([children, -1]);"," entry[1] = i;",""," rowSpan = Math.max(rowSpan, stack.length);",""," // break to let the while loop process the children"," break;"," } else {"," col._colspan = 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," if (stack.length > 1) {"," entry = stack[stack.length - 2];"," parent = entry[0][entry[1]];",""," parent._colspan = 0;",""," for (i = 0, len = row.length; i < len; ++i) {"," // Can't use .length because in 3+ rows, colspan"," // needs to aggregate the colspans of children"," row[i]._parent = parent;"," parent._colspan += row[i]._colspan;"," }"," }"," stack.pop();"," }"," }",""," // Second pass, build row arrays and assign rowspan"," for (i = 0; i < rowSpan; ++i) {"," columns.push([]);"," }",""," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," col = row[i];"," children = col.children;",""," columns[stack.length - 1].push(col);",""," entry[1] = i;",""," // collect the IDs of parent cols"," col._headers = [col.id];",""," for (j = stack.length - 2; j >= 0; --j) {"," parent = stack[j][0][stack[j][1]];",""," col._headers.unshift(parent.id);"," }",""," if (children && children.length) {"," // parent cells must assume rowspan 1 (long story)",""," // break to let the while loop process the children"," stack.push([children, -1]);"," break;"," } else {"," col._rowspan = rowSpan - stack.length + 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," stack.pop();"," }"," }"," }",""," for (i = 0, len = columns.length; i < len; i += col._rowspan) {"," col = columns[i][0];",""," col._first = true;"," }",""," return columns;"," }","});","","","}, '3.17.1', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});","","}());"]}; } var __cov_oz_EZwVpuABhbsLfLpaJeQ = __coverage__['build/datatable-head/datatable-head.js']; __cov_oz_EZwVpuABhbsLfLpaJeQ.s['1']++;YUI.add('datatable-head',function(Y,NAME){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['1']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['2']++;var Lang=Y.Lang,fromTemplate=Lang.sub,isArray=Lang.isArray,toArray=Y.Array;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['3']++;Y.namespace('DataTable').HeaderView=Y.Base.create('tableHeader',Y.View,[],{CELL_TEMPLATE:'<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}{title}>{content}</th>',ROW_TEMPLATE:'<tr>{content}</tr>',THEAD_TEMPLATE:'<thead class="{className}"></thead>',getClassName:function(){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['2']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['4']++;var host=this.host,NAME=(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['1'][0]++,host)&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['1'][1]++,host.constructor.NAME)||(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['1'][2]++,this.constructor.NAME);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['5']++;if((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['3'][0]++,host)&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['3'][1]++,host.getClassName)){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['2'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['6']++;return host.getClassName.apply(host,arguments);}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['2'][1]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['7']++;return Y.ClassNameManager.getClassName.apply(Y.ClassNameManager,[NAME].concat(toArray(arguments,0,true)));}},render:function(){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['3']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['8']++;var table=this.get('container'),thead=(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['4'][0]++,this.theadNode)||(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['4'][1]++,this.theadNode=this._createTHeadNode()),columns=this.columns,defaults={_colspan:1,_rowspan:1,abbr:'',title:''},i,len,j,jlen,col,html,content,values;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['9']++;if((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['6'][0]++,thead)&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['6'][1]++,columns)){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['5'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['10']++;html='';__cov_oz_EZwVpuABhbsLfLpaJeQ.s['11']++;if(columns.length){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['7'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['12']++;for(i=0,len=columns.length;i<len;++i){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['13']++;content='';__cov_oz_EZwVpuABhbsLfLpaJeQ.s['14']++;for(j=0,jlen=columns[i].length;j<jlen;++j){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['15']++;col=columns[i][j];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['16']++;values=Y.merge(defaults,col,{className:this.getClassName('header'),content:(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['8'][0]++,col.label)||(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['8'][1]++,col.key)||(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['8'][2]++,'Column '+(j+1))});__cov_oz_EZwVpuABhbsLfLpaJeQ.s['17']++;values._id=col._id?(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['9'][0]++,' data-yui3-col-id="'+col._id+'"'):(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['9'][1]++,'');__cov_oz_EZwVpuABhbsLfLpaJeQ.s['18']++;if(col.abbr){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['10'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['19']++;values.abbr=' abbr="'+col.abbr+'"';}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['10'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['20']++;if(col.title){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['11'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['21']++;values.title=' title="'+col.title+'"';}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['11'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['22']++;if(col.className){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['12'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['23']++;values.className+=' '+col.className;}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['12'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['24']++;if(col._first){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['13'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['25']++;values.className+=' '+this.getClassName('first','header');}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['13'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['26']++;if(col._id){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['14'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['27']++;values.className+=' '+this.getClassName('col',col._id);}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['14'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['28']++;content+=fromTemplate((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['15'][0]++,col.headerTemplate)||(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['15'][1]++,this.CELL_TEMPLATE),values);}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['29']++;html+=fromTemplate(this.ROW_TEMPLATE,{content:content});}}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['7'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['30']++;thead.setHTML(html);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['31']++;if(thead.get('parentNode')!==table){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['16'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['32']++;table.insertBefore(thead,table.one('tfoot, tbody'));}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['16'][1]++;}}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['5'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['33']++;this.bindUI();__cov_oz_EZwVpuABhbsLfLpaJeQ.s['34']++;return this;},_afterColumnsChange:function(e){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['4']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['35']++;this.columns=this._parseColumns(e.newVal);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['36']++;this.render();},bindUI:function(){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['5']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['37']++;if(!this._eventHandles.columnsChange){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['17'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['38']++;this._eventHandles.columnsChange=this.after('columnsChange',Y.bind('_afterColumnsChange',this));}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['17'][1]++;}},_createTHeadNode:function(){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['6']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['39']++;return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE,{className:this.getClassName('columns')}));},destructor:function(){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['7']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['40']++;new Y.EventHandle(Y.Object.values(this._eventHandles)).detach();},initializer:function(config){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['8']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['41']++;this.host=config.host;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['42']++;this.columns=this._parseColumns(config.columns);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['43']++;this._eventHandles=[];},_parseColumns:function(data){__cov_oz_EZwVpuABhbsLfLpaJeQ.f['9']++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['44']++;var columns=[],stack=[],rowSpan=1,entry,row,col,children,parent,i,len,j;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['45']++;if((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['19'][0]++,isArray(data))&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['19'][1]++,data.length)){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['18'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['46']++;data=data.slice();__cov_oz_EZwVpuABhbsLfLpaJeQ.s['47']++;stack.push([data,-1]);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['48']++;while(stack.length){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['49']++;entry=stack[stack.length-1];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['50']++;row=entry[0];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['51']++;i=entry[1]+1;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['52']++;for(len=row.length;i<len;++i){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['53']++;row[i]=col=Y.merge(row[i]);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['54']++;children=col.children;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['55']++;Y.stamp(col);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['56']++;if(!col.id){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['20'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['57']++;col.id=Y.guid();}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['20'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['58']++;if((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['22'][0]++,isArray(children))&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['22'][1]++,children.length)){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['21'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['59']++;stack.push([children,-1]);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['60']++;entry[1]=i;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['61']++;rowSpan=Math.max(rowSpan,stack.length);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['62']++;break;}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['21'][1]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['63']++;col._colspan=1;}}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['64']++;if(i>=len){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['23'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['65']++;if(stack.length>1){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['24'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['66']++;entry=stack[stack.length-2];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['67']++;parent=entry[0][entry[1]];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['68']++;parent._colspan=0;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['69']++;for(i=0,len=row.length;i<len;++i){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['70']++;row[i]._parent=parent;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['71']++;parent._colspan+=row[i]._colspan;}}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['24'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['72']++;stack.pop();}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['23'][1]++;}}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['73']++;for(i=0;i<rowSpan;++i){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['74']++;columns.push([]);}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['75']++;stack.push([data,-1]);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['76']++;while(stack.length){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['77']++;entry=stack[stack.length-1];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['78']++;row=entry[0];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['79']++;i=entry[1]+1;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['80']++;for(len=row.length;i<len;++i){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['81']++;col=row[i];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['82']++;children=col.children;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['83']++;columns[stack.length-1].push(col);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['84']++;entry[1]=i;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['85']++;col._headers=[col.id];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['86']++;for(j=stack.length-2;j>=0;--j){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['87']++;parent=stack[j][0][stack[j][1]];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['88']++;col._headers.unshift(parent.id);}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['89']++;if((__cov_oz_EZwVpuABhbsLfLpaJeQ.b['26'][0]++,children)&&(__cov_oz_EZwVpuABhbsLfLpaJeQ.b['26'][1]++,children.length)){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['25'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['90']++;stack.push([children,-1]);__cov_oz_EZwVpuABhbsLfLpaJeQ.s['91']++;break;}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['25'][1]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['92']++;col._rowspan=rowSpan-stack.length+1;}}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['93']++;if(i>=len){__cov_oz_EZwVpuABhbsLfLpaJeQ.b['27'][0]++;__cov_oz_EZwVpuABhbsLfLpaJeQ.s['94']++;stack.pop();}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['27'][1]++;}}}else{__cov_oz_EZwVpuABhbsLfLpaJeQ.b['18'][1]++;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['95']++;for(i=0,len=columns.length;i<len;i+=col._rowspan){__cov_oz_EZwVpuABhbsLfLpaJeQ.s['96']++;col=columns[i][0];__cov_oz_EZwVpuABhbsLfLpaJeQ.s['97']++;col._first=true;}__cov_oz_EZwVpuABhbsLfLpaJeQ.s['98']++;return columns;}});},'3.17.1',{'requires':['datatable-core','view','classnamemanager']});
stefanocudini/cdnjs
ajax/libs/yui/3.17.1/datatable-head/datatable-head-coverage.js
JavaScript
mit
43,128
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/node-core/node-core.js']) { __coverage__['build/node-core/node-core.js'] = {"path":"build/node-core/node-core.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"287":0,"288":0,"289":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"296":0,"297":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"306":0,"307":0,"308":0,"309":0,"310":0,"311":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"318":0,"319":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"331":0,"332":0,"333":0,"334":0,"335":0,"336":0,"337":0,"338":0,"339":0,"340":0,"341":0,"342":0,"343":0,"344":0,"345":0,"346":0,"347":0,"348":0,"349":0,"350":0,"351":0,"352":0,"353":0,"354":0,"355":0,"356":0,"357":0,"358":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"367":0,"368":0,"369":0,"370":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":0,"389":0,"390":0,"391":0,"392":0,"393":0,"394":0,"395":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0,0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0,0],"54":[0,0],"55":[0,0],"56":[0,0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0],"75":[0,0],"76":[0,0],"77":[0,0],"78":[0,0],"79":[0,0],"80":[0,0],"81":[0,0],"82":[0,0],"83":[0,0],"84":[0,0,0],"85":[0,0],"86":[0,0,0],"87":[0,0],"88":[0,0],"89":[0,0],"90":[0,0],"91":[0,0],"92":[0,0],"93":[0,0],"94":[0,0],"95":[0,0],"96":[0,0],"97":[0,0],"98":[0,0],"99":[0,0],"100":[0,0],"101":[0,0],"102":[0,0],"103":[0,0],"104":[0,0],"105":[0,0,0,0,0],"106":[0,0],"107":[0,0],"108":[0,0],"109":[0,0],"110":[0,0],"111":[0,0],"112":[0,0],"113":[0,0],"114":[0,0],"115":[0,0],"116":[0,0],"117":[0,0],"118":[0,0],"119":[0,0],"120":[0,0],"121":[0,0],"122":[0,0],"123":[0,0],"124":[0,0],"125":[0,0],"126":[0,0],"127":[0,0],"128":[0,0],"129":[0,0],"130":[0,0],"131":[0,0],"132":[0,0],"133":[0,0],"134":[0,0],"135":[0,0],"136":[0,0],"137":[0,0],"138":[0,0],"139":[0,0],"140":[0,0],"141":[0,0],"142":[0,0],"143":[0,0],"144":[0,0,0],"145":[0,0],"146":[0,0],"147":[0,0],"148":[0,0],"149":[0,0],"150":[0,0],"151":[0,0],"152":[0,0],"153":[0,0],"154":[0,0],"155":[0,0],"156":[0,0],"157":[0,0],"158":[0,0,0],"159":[0,0],"160":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":40}}},"2":{"name":"(anonymous_2)","line":37,"loc":{"start":{"line":37,"column":13},"end":{"line":37,"column":28}}},"3":{"name":"(anonymous_3)","line":78,"loc":{"start":{"line":78,"column":14},"end":{"line":78,"column":27}}},"4":{"name":"(anonymous_4)","line":82,"loc":{"start":{"line":82,"column":12},"end":{"line":82,"column":24}}},"5":{"name":"(anonymous_5)","line":85,"loc":{"start":{"line":85,"column":12},"end":{"line":85,"column":24}}},"6":{"name":"(anonymous_6)","line":97,"loc":{"start":{"line":97,"column":21},"end":{"line":97,"column":36}}},"7":{"name":"(anonymous_7)","line":146,"loc":{"start":{"line":146,"column":20},"end":{"line":146,"column":35}}},"8":{"name":"(anonymous_8)","line":164,"loc":{"start":{"line":164,"column":18},"end":{"line":164,"column":38}}},"9":{"name":"(anonymous_9)","line":194,"loc":{"start":{"line":194,"column":19},"end":{"line":194,"column":47}}},"10":{"name":"(anonymous_10)","line":196,"loc":{"start":{"line":196,"column":33},"end":{"line":196,"column":44}}},"11":{"name":"(anonymous_11)","line":233,"loc":{"start":{"line":233,"column":22},"end":{"line":233,"column":52}}},"12":{"name":"(anonymous_12)","line":238,"loc":{"start":{"line":238,"column":27},"end":{"line":238,"column":39}}},"13":{"name":"(anonymous_13)","line":275,"loc":{"start":{"line":275,"column":13},"end":{"line":275,"column":28}}},"14":{"name":"(anonymous_14)","line":315,"loc":{"start":{"line":315,"column":24},"end":{"line":315,"column":44}}},"15":{"name":"(anonymous_15)","line":339,"loc":{"start":{"line":339,"column":24},"end":{"line":339,"column":39}}},"16":{"name":"(anonymous_16)","line":360,"loc":{"start":{"line":360,"column":14},"end":{"line":360,"column":25}}},"17":{"name":"(anonymous_17)","line":394,"loc":{"start":{"line":394,"column":9},"end":{"line":394,"column":24}}},"18":{"name":"(anonymous_18)","line":418,"loc":{"start":{"line":418,"column":10},"end":{"line":418,"column":25}}},"19":{"name":"(anonymous_19)","line":444,"loc":{"start":{"line":444,"column":9},"end":{"line":444,"column":29}}},"20":{"name":"(anonymous_20)","line":468,"loc":{"start":{"line":468,"column":14},"end":{"line":468,"column":32}}},"21":{"name":"(anonymous_21)","line":472,"loc":{"start":{"line":472,"column":35},"end":{"line":472,"column":50}}},"22":{"name":"(anonymous_22)","line":486,"loc":{"start":{"line":486,"column":14},"end":{"line":486,"column":30}}},"23":{"name":"(anonymous_23)","line":491,"loc":{"start":{"line":491,"column":32},"end":{"line":491,"column":47}}},"24":{"name":"(anonymous_24)","line":506,"loc":{"start":{"line":506,"column":15},"end":{"line":506,"column":33}}},"25":{"name":"(anonymous_25)","line":522,"loc":{"start":{"line":522,"column":11},"end":{"line":522,"column":25}}},"26":{"name":"(anonymous_26)","line":535,"loc":{"start":{"line":535,"column":13},"end":{"line":535,"column":26}}},"27":{"name":"(anonymous_27)","line":559,"loc":{"start":{"line":559,"column":14},"end":{"line":559,"column":45}}},"28":{"name":"(anonymous_28)","line":577,"loc":{"start":{"line":577,"column":15},"end":{"line":577,"column":46}}},"29":{"name":"(anonymous_29)","line":595,"loc":{"start":{"line":595,"column":14},"end":{"line":595,"column":32}}},"30":{"name":"(anonymous_30)","line":609,"loc":{"start":{"line":609,"column":10},"end":{"line":609,"column":28}}},"31":{"name":"(anonymous_31)","line":621,"loc":{"start":{"line":621,"column":14},"end":{"line":621,"column":27}}},"32":{"name":"(anonymous_32)","line":635,"loc":{"start":{"line":635,"column":9},"end":{"line":635,"column":28}}},"33":{"name":"(anonymous_33)","line":646,"loc":{"start":{"line":646,"column":9},"end":{"line":646,"column":28}}},"34":{"name":"(anonymous_34)","line":666,"loc":{"start":{"line":666,"column":10},"end":{"line":666,"column":29}}},"35":{"name":"(anonymous_35)","line":679,"loc":{"start":{"line":679,"column":12},"end":{"line":679,"column":30}}},"36":{"name":"(anonymous_36)","line":702,"loc":{"start":{"line":702,"column":13},"end":{"line":702,"column":31}}},"37":{"name":"(anonymous_37)","line":718,"loc":{"start":{"line":718,"column":18},"end":{"line":718,"column":42}}},"38":{"name":"(anonymous_38)","line":735,"loc":{"start":{"line":735,"column":13},"end":{"line":735,"column":33}}},"39":{"name":"(anonymous_39)","line":748,"loc":{"start":{"line":748,"column":43},"end":{"line":748,"column":58}}},"40":{"name":"(anonymous_40)","line":774,"loc":{"start":{"line":774,"column":12},"end":{"line":774,"column":44}}},"41":{"name":"(anonymous_41)","line":798,"loc":{"start":{"line":798,"column":8},"end":{"line":798,"column":28}}},"42":{"name":"(anonymous_42)","line":801,"loc":{"start":{"line":801,"column":8},"end":{"line":801,"column":28}}},"43":{"name":"(anonymous_43)","line":819,"loc":{"start":{"line":819,"column":15},"end":{"line":819,"column":32}}},"44":{"name":"(anonymous_44)","line":827,"loc":{"start":{"line":827,"column":16},"end":{"line":827,"column":27}}},"45":{"name":"(anonymous_45)","line":836,"loc":{"start":{"line":836,"column":11},"end":{"line":836,"column":22}}},"46":{"name":"(anonymous_46)","line":846,"loc":{"start":{"line":846,"column":16},"end":{"line":846,"column":27}}},"47":{"name":"(anonymous_47)","line":869,"loc":{"start":{"line":869,"column":15},"end":{"line":869,"column":31}}},"48":{"name":"(anonymous_48)","line":881,"loc":{"start":{"line":881,"column":32},"end":{"line":881,"column":47}}},"49":{"name":"(anonymous_49)","line":910,"loc":{"start":{"line":910,"column":23},"end":{"line":910,"column":42}}},"50":{"name":"(anonymous_50)","line":914,"loc":{"start":{"line":914,"column":16},"end":{"line":914,"column":48}}},"51":{"name":"(anonymous_51)","line":922,"loc":{"start":{"line":922,"column":21},"end":{"line":922,"column":49}}},"52":{"name":"(anonymous_52)","line":924,"loc":{"start":{"line":924,"column":35},"end":{"line":924,"column":46}}},"53":{"name":"(anonymous_53)","line":928,"loc":{"start":{"line":928,"column":38},"end":{"line":928,"column":53}}},"54":{"name":"(anonymous_54)","line":951,"loc":{"start":{"line":951,"column":24},"end":{"line":951,"column":54}}},"55":{"name":"(anonymous_55)","line":956,"loc":{"start":{"line":956,"column":27},"end":{"line":956,"column":39}}},"56":{"name":"(anonymous_56)","line":962,"loc":{"start":{"line":962,"column":24},"end":{"line":962,"column":39}}},"57":{"name":"(anonymous_57)","line":975,"loc":{"start":{"line":975,"column":13},"end":{"line":975,"column":44}}},"58":{"name":"(anonymous_58)","line":978,"loc":{"start":{"line":978,"column":18},"end":{"line":978,"column":33}}},"59":{"name":"(anonymous_59)","line":995,"loc":{"start":{"line":995,"column":10},"end":{"line":995,"column":26}}},"60":{"name":"(anonymous_60)","line":1008,"loc":{"start":{"line":1008,"column":10},"end":{"line":1008,"column":32}}},"61":{"name":"(anonymous_61)","line":1010,"loc":{"start":{"line":1010,"column":34},"end":{"line":1010,"column":56}}},"62":{"name":"(anonymous_62)","line":1017,"loc":{"start":{"line":1017,"column":11},"end":{"line":1017,"column":33}}},"63":{"name":"(anonymous_63)","line":1020,"loc":{"start":{"line":1020,"column":34},"end":{"line":1020,"column":56}}},"64":{"name":"(anonymous_64)","line":1040,"loc":{"start":{"line":1040,"column":10},"end":{"line":1040,"column":32}}},"65":{"name":"(anonymous_65)","line":1042,"loc":{"start":{"line":1042,"column":41},"end":{"line":1042,"column":63}}},"66":{"name":"(anonymous_66)","line":1054,"loc":{"start":{"line":1054,"column":12},"end":{"line":1054,"column":23}}},"67":{"name":"(anonymous_67)","line":1065,"loc":{"start":{"line":1065,"column":13},"end":{"line":1065,"column":28}}},"68":{"name":"(anonymous_68)","line":1076,"loc":{"start":{"line":1076,"column":12},"end":{"line":1076,"column":31}}},"69":{"name":"(anonymous_69)","line":1090,"loc":{"start":{"line":1090,"column":13},"end":{"line":1090,"column":28}}},"70":{"name":"(anonymous_70)","line":1093,"loc":{"start":{"line":1093,"column":28},"end":{"line":1093,"column":46}}},"71":{"name":"(anonymous_71)","line":1108,"loc":{"start":{"line":1108,"column":9},"end":{"line":1108,"column":20}}},"72":{"name":"(anonymous_72)","line":1118,"loc":{"start":{"line":1118,"column":10},"end":{"line":1118,"column":21}}},"73":{"name":"(anonymous_73)","line":1122,"loc":{"start":{"line":1122,"column":16},"end":{"line":1122,"column":27}}},"74":{"name":"(anonymous_74)","line":1130,"loc":{"start":{"line":1130,"column":13},"end":{"line":1130,"column":24}}},"75":{"name":"(anonymous_75)","line":1154,"loc":{"start":{"line":1154,"column":10},"end":{"line":1154,"column":21}}},"76":{"name":"(anonymous_76)","line":1163,"loc":{"start":{"line":1163,"column":13},"end":{"line":1163,"column":24}}},"77":{"name":"(anonymous_77)","line":1167,"loc":{"start":{"line":1167,"column":14},"end":{"line":1167,"column":25}}},"78":{"name":"(anonymous_78)","line":1196,"loc":{"start":{"line":1196,"column":17},"end":{"line":1196,"column":28}}},"79":{"name":"(anonymous_79)","line":1254,"loc":{"start":{"line":1254,"column":25},"end":{"line":1254,"column":40}}},"80":{"name":"(anonymous_80)","line":1270,"loc":{"start":{"line":1270,"column":24},"end":{"line":1270,"column":39}}},"81":{"name":"(anonymous_81)","line":1290,"loc":{"start":{"line":1290,"column":8},"end":{"line":1290,"column":24}}},"82":{"name":"(anonymous_82)","line":1360,"loc":{"start":{"line":1360,"column":28},"end":{"line":1360,"column":59}}},"83":{"name":"(anonymous_83)","line":1361,"loc":{"start":{"line":1361,"column":33},"end":{"line":1361,"column":44}}},"84":{"name":"(anonymous_84)","line":1481,"loc":{"start":{"line":1481,"column":3},"end":{"line":1481,"column":20}}},"85":{"name":"(anonymous_85)","line":1482,"loc":{"start":{"line":1482,"column":31},"end":{"line":1482,"column":58}}},"86":{"name":"(anonymous_86)","line":1495,"loc":{"start":{"line":1495,"column":35},"end":{"line":1495,"column":50}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1612,"column":53}},"2":{"start":{"line":25,"column":0},"end":{"line":91,"column":6}},"3":{"start":{"line":38,"column":8},"end":{"line":40,"column":9}},"4":{"start":{"line":39,"column":12},"end":{"line":39,"column":36}},"5":{"start":{"line":42,"column":8},"end":{"line":47,"column":9}},"6":{"start":{"line":43,"column":12},"end":{"line":43,"column":44}},"7":{"start":{"line":44,"column":12},"end":{"line":46,"column":13}},"8":{"start":{"line":45,"column":16},"end":{"line":45,"column":28}},"9":{"start":{"line":49,"column":8},"end":{"line":49,"column":68}},"10":{"start":{"line":51,"column":8},"end":{"line":53,"column":9}},"11":{"start":{"line":52,"column":12},"end":{"line":52,"column":29}},"12":{"start":{"line":55,"column":8},"end":{"line":55,"column":35}},"13":{"start":{"line":56,"column":8},"end":{"line":58,"column":9}},"14":{"start":{"line":57,"column":12},"end":{"line":57,"column":27}},"15":{"start":{"line":60,"column":8},"end":{"line":60,"column":24}},"16":{"start":{"line":68,"column":8},"end":{"line":68,"column":26}},"17":{"start":{"line":70,"column":8},"end":{"line":70,"column":32}},"18":{"start":{"line":72,"column":8},"end":{"line":74,"column":9}},"19":{"start":{"line":73,"column":12},"end":{"line":73,"column":32}},"20":{"start":{"line":79,"column":8},"end":{"line":79,"column":23}},"21":{"start":{"line":80,"column":8},"end":{"line":88,"column":9}},"22":{"start":{"line":81,"column":12},"end":{"line":87,"column":14}},"23":{"start":{"line":83,"column":16},"end":{"line":83,"column":46}},"24":{"start":{"line":86,"column":16},"end":{"line":86,"column":36}},"25":{"start":{"line":90,"column":8},"end":{"line":90,"column":19}},"26":{"start":{"line":94,"column":0},"end":{"line":94,"column":18}},"27":{"start":{"line":95,"column":0},"end":{"line":95,"column":23}},"28":{"start":{"line":97,"column":0},"end":{"line":109,"column":2}},"29":{"start":{"line":98,"column":4},"end":{"line":106,"column":5}},"30":{"start":{"line":99,"column":8},"end":{"line":105,"column":9}},"31":{"start":{"line":100,"column":12},"end":{"line":100,"column":32}},"32":{"start":{"line":101,"column":15},"end":{"line":105,"column":9}},"33":{"start":{"line":102,"column":12},"end":{"line":102,"column":32}},"34":{"start":{"line":104,"column":12},"end":{"line":104,"column":54}},"35":{"start":{"line":108,"column":4},"end":{"line":108,"column":24}},"36":{"start":{"line":117,"column":0},"end":{"line":117,"column":21}},"37":{"start":{"line":122,"column":0},"end":{"line":122,"column":36}},"38":{"start":{"line":124,"column":0},"end":{"line":124,"column":34}},"39":{"start":{"line":125,"column":0},"end":{"line":125,"column":35}},"40":{"start":{"line":135,"column":0},"end":{"line":135,"column":23}},"41":{"start":{"line":146,"column":0},"end":{"line":151,"column":2}},"42":{"start":{"line":147,"column":4},"end":{"line":149,"column":5}},"43":{"start":{"line":148,"column":8},"end":{"line":148,"column":59}},"44":{"start":{"line":150,"column":4},"end":{"line":150,"column":16}},"45":{"start":{"line":164,"column":0},"end":{"line":181,"column":2}},"46":{"start":{"line":165,"column":4},"end":{"line":178,"column":5}},"47":{"start":{"line":166,"column":9},"end":{"line":173,"column":9}},"48":{"start":{"line":167,"column":12},"end":{"line":172,"column":13}},"49":{"start":{"line":168,"column":16},"end":{"line":168,"column":33}},"50":{"start":{"line":169,"column":19},"end":{"line":172,"column":13}},"51":{"start":{"line":171,"column":16},"end":{"line":171,"column":33}},"52":{"start":{"line":174,"column":11},"end":{"line":178,"column":5}},"53":{"start":{"line":175,"column":8},"end":{"line":175,"column":19}},"54":{"start":{"line":176,"column":11},"end":{"line":178,"column":5}},"55":{"start":{"line":177,"column":8},"end":{"line":177,"column":19}},"56":{"start":{"line":180,"column":4},"end":{"line":180,"column":15}},"57":{"start":{"line":194,"column":0},"end":{"line":221,"column":2}},"58":{"start":{"line":195,"column":4},"end":{"line":220,"column":5}},"59":{"start":{"line":196,"column":8},"end":{"line":218,"column":10}},"60":{"start":{"line":197,"column":12},"end":{"line":199,"column":20}},"61":{"start":{"line":201,"column":12},"end":{"line":203,"column":13}},"62":{"start":{"line":202,"column":16},"end":{"line":202,"column":40}},"63":{"start":{"line":205,"column":12},"end":{"line":207,"column":13}},"64":{"start":{"line":206,"column":16},"end":{"line":206,"column":40}},"65":{"start":{"line":208,"column":12},"end":{"line":208,"column":37}},"66":{"start":{"line":210,"column":12},"end":{"line":210,"column":50}},"67":{"start":{"line":212,"column":12},"end":{"line":214,"column":13}},"68":{"start":{"line":213,"column":16},"end":{"line":213,"column":49}},"69":{"start":{"line":216,"column":12},"end":{"line":216,"column":56}},"70":{"start":{"line":217,"column":12},"end":{"line":217,"column":23}},"71":{"start":{"line":233,"column":0},"end":{"line":242,"column":2}},"72":{"start":{"line":234,"column":4},"end":{"line":241,"column":5}},"73":{"start":{"line":235,"column":8},"end":{"line":235,"column":34}},"74":{"start":{"line":236,"column":8},"end":{"line":236,"column":52}},"75":{"start":{"line":238,"column":8},"end":{"line":240,"column":11}},"76":{"start":{"line":239,"column":12},"end":{"line":239,"column":41}},"77":{"start":{"line":275,"column":0},"end":{"line":304,"column":2}},"78":{"start":{"line":276,"column":4},"end":{"line":278,"column":12}},"79":{"start":{"line":280,"column":4},"end":{"line":301,"column":5}},"80":{"start":{"line":281,"column":8},"end":{"line":288,"column":9}},"81":{"start":{"line":282,"column":12},"end":{"line":282,"column":44}},"82":{"start":{"line":283,"column":12},"end":{"line":285,"column":13}},"83":{"start":{"line":284,"column":16},"end":{"line":284,"column":28}},"84":{"start":{"line":286,"column":15},"end":{"line":288,"column":9}},"85":{"start":{"line":287,"column":12},"end":{"line":287,"column":24}},"86":{"start":{"line":290,"column":8},"end":{"line":300,"column":9}},"87":{"start":{"line":291,"column":12},"end":{"line":291,"column":86}},"88":{"start":{"line":292,"column":12},"end":{"line":292,"column":46}},"89":{"start":{"line":293,"column":12},"end":{"line":293,"column":58}},"90":{"start":{"line":294,"column":12},"end":{"line":299,"column":13}},"91":{"start":{"line":295,"column":16},"end":{"line":295,"column":44}},"92":{"start":{"line":296,"column":16},"end":{"line":298,"column":17}},"93":{"start":{"line":297,"column":20},"end":{"line":297,"column":64}},"94":{"start":{"line":303,"column":4},"end":{"line":303,"column":20}},"95":{"start":{"line":315,"column":0},"end":{"line":329,"column":2}},"96":{"start":{"line":316,"column":4},"end":{"line":317,"column":16}},"97":{"start":{"line":319,"column":4},"end":{"line":326,"column":5}},"98":{"start":{"line":320,"column":8},"end":{"line":320,"column":23}},"99":{"start":{"line":321,"column":8},"end":{"line":321,"column":31}},"100":{"start":{"line":323,"column":8},"end":{"line":323,"column":43}},"101":{"start":{"line":324,"column":11},"end":{"line":326,"column":5}},"102":{"start":{"line":325,"column":8},"end":{"line":325,"column":25}},"103":{"start":{"line":328,"column":4},"end":{"line":328,"column":15}},"104":{"start":{"line":339,"column":0},"end":{"line":350,"column":2}},"105":{"start":{"line":340,"column":4},"end":{"line":341,"column":12}},"106":{"start":{"line":343,"column":4},"end":{"line":347,"column":5}},"107":{"start":{"line":344,"column":8},"end":{"line":344,"column":55}},"108":{"start":{"line":345,"column":11},"end":{"line":347,"column":5}},"109":{"start":{"line":346,"column":8},"end":{"line":346,"column":25}},"110":{"start":{"line":349,"column":4},"end":{"line":349,"column":15}},"111":{"start":{"line":352,"column":0},"end":{"line":849,"column":9}},"112":{"start":{"line":361,"column":8},"end":{"line":363,"column":33}},"113":{"start":{"line":365,"column":8},"end":{"line":381,"column":9}},"114":{"start":{"line":366,"column":12},"end":{"line":366,"column":36}},"115":{"start":{"line":367,"column":12},"end":{"line":367,"column":70}},"116":{"start":{"line":368,"column":12},"end":{"line":368,"column":91}},"117":{"start":{"line":369,"column":12},"end":{"line":369,"column":34}},"118":{"start":{"line":371,"column":12},"end":{"line":373,"column":13}},"119":{"start":{"line":372,"column":16},"end":{"line":372,"column":32}},"120":{"start":{"line":375,"column":12},"end":{"line":377,"column":13}},"121":{"start":{"line":376,"column":16},"end":{"line":376,"column":57}},"122":{"start":{"line":380,"column":12},"end":{"line":380,"column":35}},"123":{"start":{"line":382,"column":8},"end":{"line":382,"column":19}},"124":{"start":{"line":395,"column":8},"end":{"line":395,"column":16}},"125":{"start":{"line":397,"column":8},"end":{"line":401,"column":9}},"126":{"start":{"line":398,"column":12},"end":{"line":398,"column":38}},"127":{"start":{"line":400,"column":12},"end":{"line":400,"column":34}},"128":{"start":{"line":403,"column":8},"end":{"line":407,"column":9}},"129":{"start":{"line":404,"column":12},"end":{"line":404,"column":45}},"130":{"start":{"line":405,"column":15},"end":{"line":407,"column":9}},"131":{"start":{"line":406,"column":12},"end":{"line":406,"column":23}},"132":{"start":{"line":408,"column":8},"end":{"line":408,"column":19}},"133":{"start":{"line":419,"column":8},"end":{"line":420,"column":16}},"134":{"start":{"line":422,"column":8},"end":{"line":428,"column":9}},"135":{"start":{"line":423,"column":12},"end":{"line":423,"column":47}},"136":{"start":{"line":424,"column":15},"end":{"line":428,"column":9}},"137":{"start":{"line":425,"column":12},"end":{"line":425,"column":51}},"138":{"start":{"line":427,"column":12},"end":{"line":427,"column":63}},"139":{"start":{"line":430,"column":8},"end":{"line":430,"column":19}},"140":{"start":{"line":445,"column":8},"end":{"line":445,"column":44}},"141":{"start":{"line":447,"column":8},"end":{"line":457,"column":9}},"142":{"start":{"line":448,"column":12},"end":{"line":448,"column":49}},"143":{"start":{"line":450,"column":12},"end":{"line":456,"column":13}},"144":{"start":{"line":451,"column":16},"end":{"line":451,"column":56}},"145":{"start":{"line":452,"column":19},"end":{"line":456,"column":13}},"146":{"start":{"line":453,"column":16},"end":{"line":453,"column":51}},"147":{"start":{"line":455,"column":16},"end":{"line":455,"column":61}},"148":{"start":{"line":459,"column":8},"end":{"line":459,"column":20}},"149":{"start":{"line":469,"column":8},"end":{"line":475,"column":9}},"150":{"start":{"line":470,"column":12},"end":{"line":470,"column":36}},"151":{"start":{"line":472,"column":12},"end":{"line":474,"column":21}},"152":{"start":{"line":473,"column":16},"end":{"line":473,"column":31}},"153":{"start":{"line":477,"column":8},"end":{"line":477,"column":20}},"154":{"start":{"line":487,"column":8},"end":{"line":487,"column":21}},"155":{"start":{"line":488,"column":8},"end":{"line":494,"column":9}},"156":{"start":{"line":489,"column":12},"end":{"line":489,"column":34}},"157":{"start":{"line":491,"column":12},"end":{"line":493,"column":21}},"158":{"start":{"line":492,"column":16},"end":{"line":492,"column":37}},"159":{"start":{"line":496,"column":8},"end":{"line":496,"column":19}},"160":{"start":{"line":507,"column":8},"end":{"line":507,"column":30}},"161":{"start":{"line":509,"column":8},"end":{"line":511,"column":9}},"162":{"start":{"line":510,"column":12},"end":{"line":510,"column":36}},"163":{"start":{"line":512,"column":8},"end":{"line":512,"column":32}},"164":{"start":{"line":523,"column":8},"end":{"line":523,"column":30}},"165":{"start":{"line":525,"column":8},"end":{"line":530,"column":9}},"166":{"start":{"line":526,"column":12},"end":{"line":526,"column":66}},"167":{"start":{"line":527,"column":12},"end":{"line":529,"column":13}},"168":{"start":{"line":528,"column":16},"end":{"line":528,"column":65}},"169":{"start":{"line":532,"column":8},"end":{"line":532,"column":21}},"170":{"start":{"line":536,"column":8},"end":{"line":537,"column":55}},"171":{"start":{"line":538,"column":8},"end":{"line":542,"column":9}},"172":{"start":{"line":539,"column":12},"end":{"line":539,"column":29}},"173":{"start":{"line":541,"column":12},"end":{"line":541,"column":23}},"174":{"start":{"line":543,"column":8},"end":{"line":543,"column":19}},"175":{"start":{"line":561,"column":8},"end":{"line":564,"column":9}},"176":{"start":{"line":563,"column":12},"end":{"line":563,"column":30}},"177":{"start":{"line":566,"column":8},"end":{"line":566,"column":89}},"178":{"start":{"line":578,"column":8},"end":{"line":581,"column":9}},"179":{"start":{"line":580,"column":12},"end":{"line":580,"column":30}},"180":{"start":{"line":582,"column":8},"end":{"line":582,"column":90}},"181":{"start":{"line":596,"column":8},"end":{"line":596,"column":91}},"182":{"start":{"line":610,"column":8},"end":{"line":610,"column":87}},"183":{"start":{"line":622,"column":8},"end":{"line":622,"column":62}},"184":{"start":{"line":636,"column":8},"end":{"line":636,"column":67}},"185":{"start":{"line":647,"column":8},"end":{"line":647,"column":21}},"186":{"start":{"line":649,"column":8},"end":{"line":653,"column":9}},"187":{"start":{"line":650,"column":12},"end":{"line":650,"column":69}},"188":{"start":{"line":651,"column":12},"end":{"line":651,"column":39}},"189":{"start":{"line":652,"column":12},"end":{"line":652,"column":45}},"190":{"start":{"line":655,"column":8},"end":{"line":655,"column":37}},"191":{"start":{"line":667,"column":8},"end":{"line":667,"column":53}},"192":{"start":{"line":680,"column":8},"end":{"line":680,"column":30}},"193":{"start":{"line":682,"column":8},"end":{"line":684,"column":9}},"194":{"start":{"line":683,"column":12},"end":{"line":683,"column":46}},"195":{"start":{"line":686,"column":8},"end":{"line":688,"column":9}},"196":{"start":{"line":687,"column":12},"end":{"line":687,"column":27}},"197":{"start":{"line":690,"column":8},"end":{"line":690,"column":20}},"198":{"start":{"line":703,"column":8},"end":{"line":703,"column":30}},"199":{"start":{"line":704,"column":8},"end":{"line":706,"column":9}},"200":{"start":{"line":705,"column":12},"end":{"line":705,"column":45}},"201":{"start":{"line":707,"column":8},"end":{"line":707,"column":71}},"202":{"start":{"line":708,"column":8},"end":{"line":708,"column":20}},"203":{"start":{"line":719,"column":8},"end":{"line":721,"column":9}},"204":{"start":{"line":720,"column":12},"end":{"line":720,"column":38}},"205":{"start":{"line":723,"column":8},"end":{"line":723,"column":99}},"206":{"start":{"line":736,"column":8},"end":{"line":737,"column":21}},"207":{"start":{"line":739,"column":8},"end":{"line":739,"column":21}},"208":{"start":{"line":741,"column":8},"end":{"line":743,"column":9}},"209":{"start":{"line":742,"column":12},"end":{"line":742,"column":26}},"210":{"start":{"line":745,"column":8},"end":{"line":745,"column":25}},"211":{"start":{"line":747,"column":8},"end":{"line":756,"column":9}},"212":{"start":{"line":748,"column":12},"end":{"line":755,"column":15}},"213":{"start":{"line":749,"column":16},"end":{"line":749,"column":56}},"214":{"start":{"line":750,"column":16},"end":{"line":754,"column":17}},"215":{"start":{"line":751,"column":19},"end":{"line":751,"column":38}},"216":{"start":{"line":753,"column":20},"end":{"line":753,"column":47}},"217":{"start":{"line":758,"column":8},"end":{"line":758,"column":26}},"218":{"start":{"line":759,"column":8},"end":{"line":759,"column":32}},"219":{"start":{"line":761,"column":8},"end":{"line":761,"column":45}},"220":{"start":{"line":775,"column":8},"end":{"line":776,"column":16}},"221":{"start":{"line":778,"column":8},"end":{"line":780,"column":9}},"222":{"start":{"line":779,"column":12},"end":{"line":779,"column":24}},"223":{"start":{"line":782,"column":8},"end":{"line":784,"column":9}},"224":{"start":{"line":783,"column":12},"end":{"line":783,"column":24}},"225":{"start":{"line":786,"column":8},"end":{"line":786,"column":42}},"226":{"start":{"line":787,"column":8},"end":{"line":787,"column":42}},"227":{"start":{"line":799,"column":12},"end":{"line":799,"column":62}},"228":{"start":{"line":802,"column":12},"end":{"line":802,"column":53}},"229":{"start":{"line":803,"column":12},"end":{"line":805,"column":52}},"230":{"start":{"line":807,"column":12},"end":{"line":814,"column":13}},"231":{"start":{"line":808,"column":16},"end":{"line":808,"column":53}},"232":{"start":{"line":809,"column":19},"end":{"line":814,"column":13}},"233":{"start":{"line":810,"column":16},"end":{"line":810,"column":53}},"234":{"start":{"line":812,"column":16},"end":{"line":812,"column":62}},"235":{"start":{"line":813,"column":16},"end":{"line":813,"column":57}},"236":{"start":{"line":815,"column":12},"end":{"line":815,"column":24}},"237":{"start":{"line":820,"column":8},"end":{"line":820,"column":30}},"238":{"start":{"line":821,"column":8},"end":{"line":824,"column":65}},"239":{"start":{"line":828,"column":8},"end":{"line":828,"column":45}},"240":{"start":{"line":837,"column":8},"end":{"line":837,"column":54}},"241":{"start":{"line":838,"column":8},"end":{"line":838,"column":20}},"242":{"start":{"line":847,"column":8},"end":{"line":847,"column":26}},"243":{"start":{"line":851,"column":0},"end":{"line":851,"column":16}},"244":{"start":{"line":852,"column":0},"end":{"line":852,"column":19}},"245":{"start":{"line":869,"column":0},"end":{"line":898,"column":2}},"246":{"start":{"line":870,"column":4},"end":{"line":870,"column":17}},"247":{"start":{"line":872,"column":4},"end":{"line":890,"column":5}},"248":{"start":{"line":873,"column":8},"end":{"line":889,"column":9}},"249":{"start":{"line":874,"column":12},"end":{"line":874,"column":32}},"250":{"start":{"line":875,"column":12},"end":{"line":875,"column":44}},"251":{"start":{"line":876,"column":15},"end":{"line":889,"column":9}},"252":{"start":{"line":877,"column":12},"end":{"line":877,"column":28}},"253":{"start":{"line":878,"column":15},"end":{"line":889,"column":9}},"254":{"start":{"line":879,"column":12},"end":{"line":879,"column":34}},"255":{"start":{"line":880,"column":15},"end":{"line":889,"column":9}},"256":{"start":{"line":881,"column":12},"end":{"line":885,"column":15}},"257":{"start":{"line":882,"column":16},"end":{"line":884,"column":17}},"258":{"start":{"line":883,"column":20},"end":{"line":883,"column":41}},"259":{"start":{"line":886,"column":12},"end":{"line":886,"column":24}},"260":{"start":{"line":888,"column":12},"end":{"line":888,"column":44}},"261":{"start":{"line":897,"column":4},"end":{"line":897,"column":30}},"262":{"start":{"line":900,"column":0},"end":{"line":900,"column":27}},"263":{"start":{"line":910,"column":0},"end":{"line":912,"column":2}},"264":{"start":{"line":911,"column":4},"end":{"line":911,"column":70}},"265":{"start":{"line":914,"column":0},"end":{"line":920,"column":2}},"266":{"start":{"line":915,"column":4},"end":{"line":915,"column":32}},"267":{"start":{"line":916,"column":4},"end":{"line":919,"column":5}},"268":{"start":{"line":917,"column":8},"end":{"line":917,"column":53}},"269":{"start":{"line":922,"column":0},"end":{"line":949,"column":2}},"270":{"start":{"line":923,"column":4},"end":{"line":948,"column":5}},"271":{"start":{"line":924,"column":8},"end":{"line":946,"column":10}},"272":{"start":{"line":925,"column":12},"end":{"line":926,"column":33}},"273":{"start":{"line":928,"column":12},"end":{"line":942,"column":15}},"274":{"start":{"line":929,"column":16},"end":{"line":932,"column":27}},"275":{"start":{"line":934,"column":16},"end":{"line":936,"column":17}},"276":{"start":{"line":935,"column":20},"end":{"line":935,"column":59}},"277":{"start":{"line":937,"column":16},"end":{"line":937,"column":42}},"278":{"start":{"line":938,"column":16},"end":{"line":938,"column":45}},"279":{"start":{"line":939,"column":16},"end":{"line":941,"column":17}},"280":{"start":{"line":940,"column":20},"end":{"line":940,"column":45}},"281":{"start":{"line":945,"column":12},"end":{"line":945,"column":43}},"282":{"start":{"line":951,"column":0},"end":{"line":960,"column":2}},"283":{"start":{"line":952,"column":4},"end":{"line":959,"column":5}},"284":{"start":{"line":953,"column":8},"end":{"line":953,"column":34}},"285":{"start":{"line":954,"column":8},"end":{"line":954,"column":45}},"286":{"start":{"line":956,"column":8},"end":{"line":958,"column":11}},"287":{"start":{"line":957,"column":12},"end":{"line":957,"column":43}},"288":{"start":{"line":962,"column":0},"end":{"line":972,"column":2}},"289":{"start":{"line":963,"column":4},"end":{"line":963,"column":33}},"290":{"start":{"line":964,"column":4},"end":{"line":967,"column":5}},"291":{"start":{"line":965,"column":8},"end":{"line":965,"column":43}},"292":{"start":{"line":966,"column":8},"end":{"line":966,"column":33}},"293":{"start":{"line":969,"column":4},"end":{"line":969,"column":21}},"294":{"start":{"line":970,"column":4},"end":{"line":970,"column":27}},"295":{"start":{"line":971,"column":4},"end":{"line":971,"column":15}},"296":{"start":{"line":974,"column":0},"end":{"line":1199,"column":9}},"297":{"start":{"line":976,"column":8},"end":{"line":976,"column":39}},"298":{"start":{"line":978,"column":8},"end":{"line":983,"column":11}},"299":{"start":{"line":979,"column":12},"end":{"line":979,"column":53}},"300":{"start":{"line":980,"column":12},"end":{"line":982,"column":13}},"301":{"start":{"line":981,"column":16},"end":{"line":981,"column":30}},"302":{"start":{"line":985,"column":8},"end":{"line":985,"column":19}},"303":{"start":{"line":996,"column":8},"end":{"line":996,"column":49}},"304":{"start":{"line":1009,"column":8},"end":{"line":1009,"column":28}},"305":{"start":{"line":1010,"column":8},"end":{"line":1013,"column":11}},"306":{"start":{"line":1011,"column":12},"end":{"line":1011,"column":31}},"307":{"start":{"line":1012,"column":12},"end":{"line":1012,"column":67}},"308":{"start":{"line":1014,"column":8},"end":{"line":1014,"column":24}},"309":{"start":{"line":1018,"column":8},"end":{"line":1018,"column":28}},"310":{"start":{"line":1020,"column":8},"end":{"line":1027,"column":11}},"311":{"start":{"line":1021,"column":12},"end":{"line":1021,"column":56}},"312":{"start":{"line":1022,"column":12},"end":{"line":1024,"column":13}},"313":{"start":{"line":1023,"column":16},"end":{"line":1023,"column":55}},"314":{"start":{"line":1026,"column":12},"end":{"line":1026,"column":75}},"315":{"start":{"line":1028,"column":8},"end":{"line":1028,"column":24}},"316":{"start":{"line":1041,"column":8},"end":{"line":1041,"column":28}},"317":{"start":{"line":1042,"column":8},"end":{"line":1046,"column":11}},"318":{"start":{"line":1043,"column":12},"end":{"line":1043,"column":31}},"319":{"start":{"line":1044,"column":12},"end":{"line":1044,"column":38}},"320":{"start":{"line":1045,"column":12},"end":{"line":1045,"column":59}},"321":{"start":{"line":1055,"column":8},"end":{"line":1055,"column":50}},"322":{"start":{"line":1066,"column":8},"end":{"line":1066,"column":69}},"323":{"start":{"line":1077,"column":8},"end":{"line":1077,"column":63}},"324":{"start":{"line":1091,"column":8},"end":{"line":1091,"column":19}},"325":{"start":{"line":1092,"column":8},"end":{"line":1092,"column":23}},"326":{"start":{"line":1093,"column":8},"end":{"line":1097,"column":11}},"327":{"start":{"line":1094,"column":12},"end":{"line":1096,"column":13}},"328":{"start":{"line":1095,"column":16},"end":{"line":1095,"column":33}},"329":{"start":{"line":1099,"column":8},"end":{"line":1099,"column":28}},"330":{"start":{"line":1109,"column":8},"end":{"line":1109,"column":34}},"331":{"start":{"line":1119,"column":8},"end":{"line":1119,"column":31}},"332":{"start":{"line":1131,"column":8},"end":{"line":1134,"column":35}},"333":{"start":{"line":1136,"column":8},"end":{"line":1144,"column":9}},"334":{"start":{"line":1137,"column":12},"end":{"line":1141,"column":13}},"335":{"start":{"line":1138,"column":16},"end":{"line":1140,"column":17}},"336":{"start":{"line":1139,"column":20},"end":{"line":1139,"column":50}},"337":{"start":{"line":1143,"column":12},"end":{"line":1143,"column":56}},"338":{"start":{"line":1146,"column":8},"end":{"line":1146,"column":20}},"339":{"start":{"line":1155,"column":8},"end":{"line":1155,"column":34}},"340":{"start":{"line":1164,"column":8},"end":{"line":1164,"column":38}},"341":{"start":{"line":1168,"column":8},"end":{"line":1171,"column":17}},"342":{"start":{"line":1173,"column":8},"end":{"line":1187,"column":9}},"343":{"start":{"line":1174,"column":12},"end":{"line":1174,"column":28}},"344":{"start":{"line":1175,"column":12},"end":{"line":1175,"column":35}},"345":{"start":{"line":1176,"column":12},"end":{"line":1178,"column":13}},"346":{"start":{"line":1177,"column":16},"end":{"line":1177,"column":37}},"347":{"start":{"line":1180,"column":12},"end":{"line":1182,"column":13}},"348":{"start":{"line":1181,"column":16},"end":{"line":1181,"column":62}},"349":{"start":{"line":1184,"column":12},"end":{"line":1186,"column":13}},"350":{"start":{"line":1185,"column":16},"end":{"line":1185,"column":57}},"351":{"start":{"line":1188,"column":8},"end":{"line":1188,"column":31}},"352":{"start":{"line":1197,"column":8},"end":{"line":1197,"column":27}},"353":{"start":{"line":1201,"column":0},"end":{"line":1245,"column":3}},"354":{"start":{"line":1254,"column":0},"end":{"line":1286,"column":2}},"355":{"start":{"line":1255,"column":4},"end":{"line":1260,"column":12}},"356":{"start":{"line":1262,"column":4},"end":{"line":1268,"column":5}},"357":{"start":{"line":1263,"column":8},"end":{"line":1263,"column":74}},"358":{"start":{"line":1264,"column":8},"end":{"line":1264,"column":34}},"359":{"start":{"line":1265,"column":8},"end":{"line":1267,"column":9}},"360":{"start":{"line":1266,"column":12},"end":{"line":1266,"column":30}},"361":{"start":{"line":1270,"column":4},"end":{"line":1283,"column":7}},"362":{"start":{"line":1271,"column":8},"end":{"line":1271,"column":49}},"363":{"start":{"line":1273,"column":8},"end":{"line":1275,"column":9}},"364":{"start":{"line":1274,"column":12},"end":{"line":1274,"column":37}},"365":{"start":{"line":1277,"column":8},"end":{"line":1277,"column":34}},"366":{"start":{"line":1278,"column":8},"end":{"line":1280,"column":9}},"367":{"start":{"line":1279,"column":12},"end":{"line":1279,"column":49}},"368":{"start":{"line":1282,"column":8},"end":{"line":1282,"column":22}},"369":{"start":{"line":1285,"column":4},"end":{"line":1285,"column":43}},"370":{"start":{"line":1288,"column":0},"end":{"line":1288,"column":22}},"371":{"start":{"line":1290,"column":0},"end":{"line":1292,"column":2}},"372":{"start":{"line":1291,"column":4},"end":{"line":1291,"column":31}},"373":{"start":{"line":1294,"column":0},"end":{"line":1294,"column":19}},"374":{"start":{"line":1300,"column":0},"end":{"line":1357,"column":6}},"375":{"start":{"line":1360,"column":0},"end":{"line":1381,"column":3}},"376":{"start":{"line":1361,"column":4},"end":{"line":1380,"column":6}},"377":{"start":{"line":1362,"column":8},"end":{"line":1365,"column":16}},"378":{"start":{"line":1367,"column":8},"end":{"line":1369,"column":9}},"379":{"start":{"line":1368,"column":12},"end":{"line":1368,"column":54}},"380":{"start":{"line":1371,"column":8},"end":{"line":1371,"column":56}},"381":{"start":{"line":1373,"column":8},"end":{"line":1377,"column":9}},"382":{"start":{"line":1374,"column":12},"end":{"line":1374,"column":29}},"383":{"start":{"line":1376,"column":12},"end":{"line":1376,"column":39}},"384":{"start":{"line":1379,"column":8},"end":{"line":1379,"column":19}},"385":{"start":{"line":1387,"column":0},"end":{"line":1486,"column":3}},"386":{"start":{"line":1482,"column":4},"end":{"line":1485,"column":6}},"387":{"start":{"line":1483,"column":8},"end":{"line":1483,"column":56}},"388":{"start":{"line":1484,"column":8},"end":{"line":1484,"column":19}},"389":{"start":{"line":1495,"column":0},"end":{"line":1502,"column":2}},"390":{"start":{"line":1496,"column":4},"end":{"line":1496,"column":26}},"391":{"start":{"line":1497,"column":4},"end":{"line":1499,"column":5}},"392":{"start":{"line":1498,"column":8},"end":{"line":1498,"column":38}},"393":{"start":{"line":1501,"column":4},"end":{"line":1501,"column":16}},"394":{"start":{"line":1504,"column":0},"end":{"line":1554,"column":3}},"395":{"start":{"line":1556,"column":0},"end":{"line":1609,"column":3}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":8},"end":{"line":42,"column":8}},{"start":{"line":42,"column":8},"end":{"line":42,"column":8}}]},"3":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":12},"end":{"line":44,"column":12}},{"start":{"line":44,"column":12},"end":{"line":44,"column":12}}]},"4":{"line":49,"type":"cond-expr","locations":[{"start":{"line":49,"column":42},"end":{"line":49,"column":55}},{"start":{"line":49,"column":58},"end":{"line":49,"column":67}}]},"5":{"line":51,"type":"if","locations":[{"start":{"line":51,"column":8},"end":{"line":51,"column":8}},{"start":{"line":51,"column":8},"end":{"line":51,"column":8}}]},"6":{"line":51,"type":"binary-expr","locations":[{"start":{"line":51,"column":12},"end":{"line":51,"column":15}},{"start":{"line":51,"column":19},"end":{"line":51,"column":41}},{"start":{"line":51,"column":45},"end":{"line":51,"column":82}}]},"7":{"line":55,"type":"binary-expr","locations":[{"start":{"line":55,"column":14},"end":{"line":55,"column":17}},{"start":{"line":55,"column":21},"end":{"line":55,"column":34}}]},"8":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":8},"end":{"line":56,"column":8}},{"start":{"line":56,"column":8},"end":{"line":56,"column":8}}]},"9":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":8},"end":{"line":72,"column":8}},{"start":{"line":72,"column":8},"end":{"line":72,"column":8}}]},"10":{"line":80,"type":"if","locations":[{"start":{"line":80,"column":8},"end":{"line":80,"column":8}},{"start":{"line":80,"column":8},"end":{"line":80,"column":8}}]},"11":{"line":81,"type":"cond-expr","locations":[{"start":{"line":82,"column":12},"end":{"line":84,"column":13}},{"start":{"line":85,"column":12},"end":{"line":87,"column":13}}]},"12":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":4},"end":{"line":98,"column":4}},{"start":{"line":98,"column":4},"end":{"line":98,"column":4}}]},"13":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]},"14":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":15},"end":{"line":101,"column":15}},{"start":{"line":101,"column":15},"end":{"line":101,"column":15}}]},"15":{"line":108,"type":"binary-expr","locations":[{"start":{"line":108,"column":11},"end":{"line":108,"column":15}},{"start":{"line":108,"column":19},"end":{"line":108,"column":23}}]},"16":{"line":147,"type":"if","locations":[{"start":{"line":147,"column":4},"end":{"line":147,"column":4}},{"start":{"line":147,"column":4},"end":{"line":147,"column":4}}]},"17":{"line":148,"type":"cond-expr","locations":[{"start":{"line":148,"column":33},"end":{"line":148,"column":37}},{"start":{"line":148,"column":40},"end":{"line":148,"column":58}}]},"18":{"line":148,"type":"binary-expr","locations":[{"start":{"line":148,"column":40},"end":{"line":148,"column":50}},{"start":{"line":148,"column":54},"end":{"line":148,"column":58}}]},"19":{"line":165,"type":"if","locations":[{"start":{"line":165,"column":4},"end":{"line":165,"column":4}},{"start":{"line":165,"column":4},"end":{"line":165,"column":4}}]},"20":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":9},"end":{"line":166,"column":9}},{"start":{"line":166,"column":9},"end":{"line":166,"column":9}}]},"21":{"line":166,"type":"binary-expr","locations":[{"start":{"line":166,"column":13},"end":{"line":166,"column":35}},{"start":{"line":166,"column":39},"end":{"line":166,"column":63}}]},"22":{"line":167,"type":"if","locations":[{"start":{"line":167,"column":12},"end":{"line":167,"column":12}},{"start":{"line":167,"column":12},"end":{"line":167,"column":12}}]},"23":{"line":167,"type":"binary-expr","locations":[{"start":{"line":167,"column":16},"end":{"line":167,"column":32}},{"start":{"line":167,"column":36},"end":{"line":167,"column":55}}]},"24":{"line":169,"type":"if","locations":[{"start":{"line":169,"column":19},"end":{"line":169,"column":19}},{"start":{"line":169,"column":19},"end":{"line":169,"column":19}}]},"25":{"line":169,"type":"binary-expr","locations":[{"start":{"line":169,"column":24},"end":{"line":169,"column":32}},{"start":{"line":169,"column":36},"end":{"line":169,"column":47}},{"start":{"line":170,"column":21},"end":{"line":170,"column":27}},{"start":{"line":170,"column":31},"end":{"line":170,"column":48}}]},"26":{"line":174,"type":"if","locations":[{"start":{"line":174,"column":11},"end":{"line":174,"column":11}},{"start":{"line":174,"column":11},"end":{"line":174,"column":11}}]},"27":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":11},"end":{"line":176,"column":11}},{"start":{"line":176,"column":11},"end":{"line":176,"column":11}}]},"28":{"line":195,"type":"if","locations":[{"start":{"line":195,"column":4},"end":{"line":195,"column":4}},{"start":{"line":195,"column":4},"end":{"line":195,"column":4}}]},"29":{"line":195,"type":"binary-expr","locations":[{"start":{"line":195,"column":8},"end":{"line":195,"column":12}},{"start":{"line":195,"column":16},"end":{"line":195,"column":18}},{"start":{"line":195,"column":22},"end":{"line":195,"column":45}}]},"30":{"line":201,"type":"if","locations":[{"start":{"line":201,"column":12},"end":{"line":201,"column":12}},{"start":{"line":201,"column":12},"end":{"line":201,"column":12}}]},"31":{"line":201,"type":"binary-expr","locations":[{"start":{"line":201,"column":16},"end":{"line":201,"column":23}},{"start":{"line":201,"column":27},"end":{"line":201,"column":40}}]},"32":{"line":205,"type":"if","locations":[{"start":{"line":205,"column":12},"end":{"line":205,"column":12}},{"start":{"line":205,"column":12},"end":{"line":205,"column":12}}]},"33":{"line":205,"type":"binary-expr","locations":[{"start":{"line":205,"column":16},"end":{"line":205,"column":23}},{"start":{"line":205,"column":27},"end":{"line":205,"column":40}}]},"34":{"line":210,"type":"binary-expr","locations":[{"start":{"line":210,"column":27},"end":{"line":210,"column":34}},{"start":{"line":210,"column":38},"end":{"line":210,"column":42}}]},"35":{"line":212,"type":"if","locations":[{"start":{"line":212,"column":12},"end":{"line":212,"column":12}},{"start":{"line":212,"column":12},"end":{"line":212,"column":12}}]},"36":{"line":216,"type":"binary-expr","locations":[{"start":{"line":216,"column":13},"end":{"line":216,"column":38}},{"start":{"line":216,"column":44},"end":{"line":216,"column":54}}]},"37":{"line":234,"type":"if","locations":[{"start":{"line":234,"column":4},"end":{"line":234,"column":4}},{"start":{"line":234,"column":4},"end":{"line":234,"column":4}}]},"38":{"line":235,"type":"binary-expr","locations":[{"start":{"line":235,"column":18},"end":{"line":235,"column":25}},{"start":{"line":235,"column":29},"end":{"line":235,"column":33}}]},"39":{"line":280,"type":"if","locations":[{"start":{"line":280,"column":4},"end":{"line":280,"column":4}},{"start":{"line":280,"column":4},"end":{"line":280,"column":4}}]},"40":{"line":281,"type":"if","locations":[{"start":{"line":281,"column":8},"end":{"line":281,"column":8}},{"start":{"line":281,"column":8},"end":{"line":281,"column":8}}]},"41":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":12},"end":{"line":283,"column":12}},{"start":{"line":283,"column":12},"end":{"line":283,"column":12}}]},"42":{"line":286,"type":"if","locations":[{"start":{"line":286,"column":15},"end":{"line":286,"column":15}},{"start":{"line":286,"column":15},"end":{"line":286,"column":15}}]},"43":{"line":290,"type":"if","locations":[{"start":{"line":290,"column":8},"end":{"line":290,"column":8}},{"start":{"line":290,"column":8},"end":{"line":290,"column":8}}]},"44":{"line":290,"type":"binary-expr","locations":[{"start":{"line":290,"column":12},"end":{"line":290,"column":25}},{"start":{"line":290,"column":29},"end":{"line":290,"column":49}}]},"45":{"line":291,"type":"cond-expr","locations":[{"start":{"line":291,"column":59},"end":{"line":291,"column":72}},{"start":{"line":291,"column":75},"end":{"line":291,"column":85}}]},"46":{"line":291,"type":"binary-expr","locations":[{"start":{"line":291,"column":19},"end":{"line":291,"column":32}},{"start":{"line":291,"column":36},"end":{"line":291,"column":55}}]},"47":{"line":293,"type":"cond-expr","locations":[{"start":{"line":293,"column":36},"end":{"line":293,"column":50}},{"start":{"line":293,"column":53},"end":{"line":293,"column":57}}]},"48":{"line":294,"type":"if","locations":[{"start":{"line":294,"column":12},"end":{"line":294,"column":12}},{"start":{"line":294,"column":12},"end":{"line":294,"column":12}}]},"49":{"line":294,"type":"binary-expr","locations":[{"start":{"line":294,"column":16},"end":{"line":294,"column":25}},{"start":{"line":294,"column":30},"end":{"line":294,"column":40}},{"start":{"line":294,"column":44},"end":{"line":294,"column":63}}]},"50":{"line":296,"type":"if","locations":[{"start":{"line":296,"column":16},"end":{"line":296,"column":16}},{"start":{"line":296,"column":16},"end":{"line":296,"column":16}}]},"51":{"line":319,"type":"if","locations":[{"start":{"line":319,"column":4},"end":{"line":319,"column":4}},{"start":{"line":319,"column":4},"end":{"line":319,"column":4}}]},"52":{"line":324,"type":"if","locations":[{"start":{"line":324,"column":11},"end":{"line":324,"column":11}},{"start":{"line":324,"column":11},"end":{"line":324,"column":11}}]},"53":{"line":343,"type":"if","locations":[{"start":{"line":343,"column":4},"end":{"line":343,"column":4}},{"start":{"line":343,"column":4},"end":{"line":343,"column":4}}]},"54":{"line":343,"type":"binary-expr","locations":[{"start":{"line":343,"column":8},"end":{"line":343,"column":20}},{"start":{"line":343,"column":24},"end":{"line":343,"column":46}}]},"55":{"line":345,"type":"if","locations":[{"start":{"line":345,"column":11},"end":{"line":345,"column":11}},{"start":{"line":345,"column":11},"end":{"line":345,"column":11}}]},"56":{"line":365,"type":"if","locations":[{"start":{"line":365,"column":8},"end":{"line":365,"column":8}},{"start":{"line":365,"column":8},"end":{"line":365,"column":8}}]},"57":{"line":367,"type":"cond-expr","locations":[{"start":{"line":367,"column":39},"end":{"line":367,"column":62}},{"start":{"line":367,"column":65},"end":{"line":367,"column":69}}]},"58":{"line":367,"type":"binary-expr","locations":[{"start":{"line":367,"column":18},"end":{"line":367,"column":23}},{"start":{"line":367,"column":27},"end":{"line":367,"column":35}}]},"59":{"line":368,"type":"cond-expr","locations":[{"start":{"line":368,"column":53},"end":{"line":368,"column":83}},{"start":{"line":368,"column":86},"end":{"line":368,"column":90}}]},"60":{"line":368,"type":"binary-expr","locations":[{"start":{"line":368,"column":25},"end":{"line":368,"column":30}},{"start":{"line":368,"column":34},"end":{"line":368,"column":49}}]},"61":{"line":371,"type":"if","locations":[{"start":{"line":371,"column":12},"end":{"line":371,"column":12}},{"start":{"line":371,"column":12},"end":{"line":371,"column":12}}]},"62":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":12},"end":{"line":375,"column":12}},{"start":{"line":375,"column":12},"end":{"line":375,"column":12}}]},"63":{"line":397,"type":"if","locations":[{"start":{"line":397,"column":8},"end":{"line":397,"column":8}},{"start":{"line":397,"column":8},"end":{"line":397,"column":8}}]},"64":{"line":403,"type":"if","locations":[{"start":{"line":403,"column":8},"end":{"line":403,"column":8}},{"start":{"line":403,"column":8},"end":{"line":403,"column":8}}]},"65":{"line":405,"type":"if","locations":[{"start":{"line":405,"column":15},"end":{"line":405,"column":15}},{"start":{"line":405,"column":15},"end":{"line":405,"column":15}}]},"66":{"line":422,"type":"if","locations":[{"start":{"line":422,"column":8},"end":{"line":422,"column":8}},{"start":{"line":422,"column":8},"end":{"line":422,"column":8}}]},"67":{"line":422,"type":"binary-expr","locations":[{"start":{"line":422,"column":12},"end":{"line":422,"column":22}},{"start":{"line":422,"column":26},"end":{"line":422,"column":43}}]},"68":{"line":424,"type":"if","locations":[{"start":{"line":424,"column":15},"end":{"line":424,"column":15}},{"start":{"line":424,"column":15},"end":{"line":424,"column":15}}]},"69":{"line":447,"type":"if","locations":[{"start":{"line":447,"column":8},"end":{"line":447,"column":8}},{"start":{"line":447,"column":8},"end":{"line":447,"column":8}}]},"70":{"line":450,"type":"if","locations":[{"start":{"line":450,"column":12},"end":{"line":450,"column":12}},{"start":{"line":450,"column":12},"end":{"line":450,"column":12}}]},"71":{"line":450,"type":"binary-expr","locations":[{"start":{"line":450,"column":16},"end":{"line":450,"column":26}},{"start":{"line":450,"column":30},"end":{"line":450,"column":47}}]},"72":{"line":452,"type":"if","locations":[{"start":{"line":452,"column":19},"end":{"line":452,"column":19}},{"start":{"line":452,"column":19},"end":{"line":452,"column":19}}]},"73":{"line":469,"type":"if","locations":[{"start":{"line":469,"column":8},"end":{"line":469,"column":8}},{"start":{"line":469,"column":8},"end":{"line":469,"column":8}}]},"74":{"line":488,"type":"if","locations":[{"start":{"line":488,"column":8},"end":{"line":488,"column":8}},{"start":{"line":488,"column":8},"end":{"line":488,"column":8}}]},"75":{"line":509,"type":"if","locations":[{"start":{"line":509,"column":8},"end":{"line":509,"column":8}},{"start":{"line":509,"column":8},"end":{"line":509,"column":8}}]},"76":{"line":509,"type":"binary-expr","locations":[{"start":{"line":509,"column":12},"end":{"line":509,"column":19}},{"start":{"line":509,"column":23},"end":{"line":509,"column":36}}]},"77":{"line":525,"type":"if","locations":[{"start":{"line":525,"column":8},"end":{"line":525,"column":8}},{"start":{"line":525,"column":8},"end":{"line":525,"column":8}}]},"78":{"line":526,"type":"cond-expr","locations":[{"start":{"line":526,"column":26},"end":{"line":526,"column":42}},{"start":{"line":526,"column":45},"end":{"line":526,"column":65}}]},"79":{"line":526,"type":"binary-expr","locations":[{"start":{"line":526,"column":26},"end":{"line":526,"column":35}},{"start":{"line":526,"column":39},"end":{"line":526,"column":42}}]},"80":{"line":527,"type":"if","locations":[{"start":{"line":527,"column":12},"end":{"line":527,"column":12}},{"start":{"line":527,"column":12},"end":{"line":527,"column":12}}]},"81":{"line":538,"type":"if","locations":[{"start":{"line":538,"column":8},"end":{"line":538,"column":8}},{"start":{"line":538,"column":8},"end":{"line":538,"column":8}}]},"82":{"line":538,"type":"binary-expr","locations":[{"start":{"line":538,"column":12},"end":{"line":538,"column":15}},{"start":{"line":538,"column":19},"end":{"line":538,"column":44}}]},"83":{"line":561,"type":"if","locations":[{"start":{"line":561,"column":8},"end":{"line":561,"column":8}},{"start":{"line":561,"column":8},"end":{"line":561,"column":8}}]},"84":{"line":561,"type":"binary-expr","locations":[{"start":{"line":561,"column":12},"end":{"line":561,"column":34}},{"start":{"line":562,"column":17},"end":{"line":562,"column":44}},{"start":{"line":562,"column":48},"end":{"line":562,"column":77}}]},"85":{"line":578,"type":"if","locations":[{"start":{"line":578,"column":8},"end":{"line":578,"column":8}},{"start":{"line":578,"column":8},"end":{"line":578,"column":8}}]},"86":{"line":578,"type":"binary-expr","locations":[{"start":{"line":578,"column":12},"end":{"line":578,"column":34}},{"start":{"line":579,"column":17},"end":{"line":579,"column":44}},{"start":{"line":579,"column":48},"end":{"line":579,"column":77}}]},"87":{"line":649,"type":"if","locations":[{"start":{"line":649,"column":8},"end":{"line":649,"column":8}},{"start":{"line":649,"column":8},"end":{"line":649,"column":8}}]},"88":{"line":655,"type":"binary-expr","locations":[{"start":{"line":655,"column":15},"end":{"line":655,"column":23}},{"start":{"line":655,"column":27},"end":{"line":655,"column":36}}]},"89":{"line":682,"type":"if","locations":[{"start":{"line":682,"column":8},"end":{"line":682,"column":8}},{"start":{"line":682,"column":8},"end":{"line":682,"column":8}}]},"90":{"line":682,"type":"binary-expr","locations":[{"start":{"line":682,"column":12},"end":{"line":682,"column":16}},{"start":{"line":682,"column":20},"end":{"line":682,"column":35}}]},"91":{"line":686,"type":"if","locations":[{"start":{"line":686,"column":8},"end":{"line":686,"column":8}},{"start":{"line":686,"column":8},"end":{"line":686,"column":8}}]},"92":{"line":704,"type":"if","locations":[{"start":{"line":704,"column":8},"end":{"line":704,"column":8}},{"start":{"line":704,"column":8},"end":{"line":704,"column":8}}]},"93":{"line":719,"type":"if","locations":[{"start":{"line":719,"column":8},"end":{"line":719,"column":8}},{"start":{"line":719,"column":8},"end":{"line":719,"column":8}}]},"94":{"line":736,"type":"cond-expr","locations":[{"start":{"line":736,"column":42},"end":{"line":736,"column":52}},{"start":{"line":736,"column":55},"end":{"line":736,"column":62}}]},"95":{"line":741,"type":"if","locations":[{"start":{"line":741,"column":8},"end":{"line":741,"column":8}},{"start":{"line":741,"column":8},"end":{"line":741,"column":8}}]},"96":{"line":747,"type":"if","locations":[{"start":{"line":747,"column":8},"end":{"line":747,"column":8}},{"start":{"line":747,"column":8},"end":{"line":747,"column":8}}]},"97":{"line":750,"type":"if","locations":[{"start":{"line":750,"column":16},"end":{"line":750,"column":16}},{"start":{"line":750,"column":16},"end":{"line":750,"column":16}}]},"98":{"line":778,"type":"if","locations":[{"start":{"line":778,"column":8},"end":{"line":778,"column":8}},{"start":{"line":778,"column":8},"end":{"line":778,"column":8}}]},"99":{"line":778,"type":"binary-expr","locations":[{"start":{"line":778,"column":12},"end":{"line":778,"column":13}},{"start":{"line":778,"column":17},"end":{"line":778,"column":24}}]},"100":{"line":782,"type":"if","locations":[{"start":{"line":782,"column":8},"end":{"line":782,"column":8}},{"start":{"line":782,"column":8},"end":{"line":782,"column":8}}]},"101":{"line":782,"type":"binary-expr","locations":[{"start":{"line":782,"column":12},"end":{"line":782,"column":13}},{"start":{"line":782,"column":17},"end":{"line":782,"column":24}}]},"102":{"line":797,"type":"cond-expr","locations":[{"start":{"line":798,"column":8},"end":{"line":800,"column":9}},{"start":{"line":801,"column":8},"end":{"line":816,"column":9}}]},"103":{"line":807,"type":"if","locations":[{"start":{"line":807,"column":12},"end":{"line":807,"column":12}},{"start":{"line":807,"column":12},"end":{"line":807,"column":12}}]},"104":{"line":809,"type":"if","locations":[{"start":{"line":809,"column":19},"end":{"line":809,"column":19}},{"start":{"line":809,"column":19},"end":{"line":809,"column":19}}]},"105":{"line":821,"type":"binary-expr","locations":[{"start":{"line":821,"column":18},"end":{"line":821,"column":22}},{"start":{"line":821,"column":26},"end":{"line":821,"column":40}},{"start":{"line":822,"column":16},"end":{"line":822,"column":48}},{"start":{"line":823,"column":13},"end":{"line":823,"column":46}},{"start":{"line":824,"column":16},"end":{"line":824,"column":62}}]},"106":{"line":872,"type":"if","locations":[{"start":{"line":872,"column":4},"end":{"line":872,"column":4}},{"start":{"line":872,"column":4},"end":{"line":872,"column":4}}]},"107":{"line":873,"type":"if","locations":[{"start":{"line":873,"column":8},"end":{"line":873,"column":8}},{"start":{"line":873,"column":8},"end":{"line":873,"column":8}}]},"108":{"line":876,"type":"if","locations":[{"start":{"line":876,"column":15},"end":{"line":876,"column":15}},{"start":{"line":876,"column":15},"end":{"line":876,"column":15}}]},"109":{"line":876,"type":"binary-expr","locations":[{"start":{"line":876,"column":19},"end":{"line":876,"column":33}},{"start":{"line":876,"column":37},"end":{"line":876,"column":58}}]},"110":{"line":878,"type":"if","locations":[{"start":{"line":878,"column":15},"end":{"line":878,"column":15}},{"start":{"line":878,"column":15},"end":{"line":878,"column":15}}]},"111":{"line":880,"type":"if","locations":[{"start":{"line":880,"column":15},"end":{"line":880,"column":15}},{"start":{"line":880,"column":15},"end":{"line":880,"column":15}}]},"112":{"line":880,"type":"binary-expr","locations":[{"start":{"line":880,"column":19},"end":{"line":880,"column":27}},{"start":{"line":880,"column":31},"end":{"line":880,"column":45}}]},"113":{"line":882,"type":"if","locations":[{"start":{"line":882,"column":16},"end":{"line":882,"column":16}},{"start":{"line":882,"column":16},"end":{"line":882,"column":16}}]},"114":{"line":897,"type":"binary-expr","locations":[{"start":{"line":897,"column":18},"end":{"line":897,"column":23}},{"start":{"line":897,"column":27},"end":{"line":897,"column":29}}]},"115":{"line":911,"type":"cond-expr","locations":[{"start":{"line":911,"column":43},"end":{"line":911,"column":58}},{"start":{"line":911,"column":61},"end":{"line":911,"column":69}}]},"116":{"line":911,"type":"binary-expr","locations":[{"start":{"line":911,"column":12},"end":{"line":911,"column":20}},{"start":{"line":911,"column":24},"end":{"line":911,"column":39}}]},"117":{"line":916,"type":"if","locations":[{"start":{"line":916,"column":4},"end":{"line":916,"column":4}},{"start":{"line":916,"column":4},"end":{"line":916,"column":4}}]},"118":{"line":916,"type":"binary-expr","locations":[{"start":{"line":916,"column":8},"end":{"line":916,"column":13}},{"start":{"line":916,"column":17},"end":{"line":916,"column":29}}]},"119":{"line":917,"type":"binary-expr","locations":[{"start":{"line":917,"column":32},"end":{"line":917,"column":39}},{"start":{"line":917,"column":43},"end":{"line":917,"column":51}}]},"120":{"line":923,"type":"if","locations":[{"start":{"line":923,"column":4},"end":{"line":923,"column":4}},{"start":{"line":923,"column":4},"end":{"line":923,"column":4}}]},"121":{"line":923,"type":"binary-expr","locations":[{"start":{"line":923,"column":8},"end":{"line":923,"column":12}},{"start":{"line":923,"column":16},"end":{"line":923,"column":18}}]},"122":{"line":929,"type":"cond-expr","locations":[{"start":{"line":929,"column":68},"end":{"line":929,"column":78}},{"start":{"line":929,"column":81},"end":{"line":929,"column":88}}]},"123":{"line":929,"type":"binary-expr","locations":[{"start":{"line":929,"column":27},"end":{"line":929,"column":40}},{"start":{"line":929,"column":44},"end":{"line":929,"column":63}}]},"124":{"line":934,"type":"if","locations":[{"start":{"line":934,"column":16},"end":{"line":934,"column":16}},{"start":{"line":934,"column":16},"end":{"line":934,"column":16}}]},"125":{"line":937,"type":"binary-expr","locations":[{"start":{"line":937,"column":22},"end":{"line":937,"column":29}},{"start":{"line":937,"column":33},"end":{"line":937,"column":41}}]},"126":{"line":939,"type":"if","locations":[{"start":{"line":939,"column":16},"end":{"line":939,"column":16}},{"start":{"line":939,"column":16},"end":{"line":939,"column":16}}]},"127":{"line":939,"type":"binary-expr","locations":[{"start":{"line":939,"column":20},"end":{"line":939,"column":40}},{"start":{"line":939,"column":44},"end":{"line":939,"column":63}}]},"128":{"line":945,"type":"cond-expr","locations":[{"start":{"line":945,"column":32},"end":{"line":945,"column":35}},{"start":{"line":945,"column":38},"end":{"line":945,"column":42}}]},"129":{"line":952,"type":"if","locations":[{"start":{"line":952,"column":4},"end":{"line":952,"column":4}},{"start":{"line":952,"column":4},"end":{"line":952,"column":4}}]},"130":{"line":953,"type":"binary-expr","locations":[{"start":{"line":953,"column":18},"end":{"line":953,"column":25}},{"start":{"line":953,"column":29},"end":{"line":953,"column":33}}]},"131":{"line":964,"type":"if","locations":[{"start":{"line":964,"column":4},"end":{"line":964,"column":4}},{"start":{"line":964,"column":4},"end":{"line":964,"column":4}}]},"132":{"line":976,"type":"cond-expr","locations":[{"start":{"line":976,"column":29},"end":{"line":976,"column":31}},{"start":{"line":976,"column":34},"end":{"line":976,"column":38}}]},"133":{"line":980,"type":"if","locations":[{"start":{"line":980,"column":12},"end":{"line":980,"column":12}},{"start":{"line":980,"column":12},"end":{"line":980,"column":12}}]},"134":{"line":996,"type":"binary-expr","locations":[{"start":{"line":996,"column":22},"end":{"line":996,"column":33}},{"start":{"line":996,"column":37},"end":{"line":996,"column":39}}]},"135":{"line":1012,"type":"binary-expr","locations":[{"start":{"line":1012,"column":27},"end":{"line":1012,"column":34}},{"start":{"line":1012,"column":38},"end":{"line":1012,"column":42}}]},"136":{"line":1022,"type":"if","locations":[{"start":{"line":1022,"column":12},"end":{"line":1022,"column":12}},{"start":{"line":1022,"column":12},"end":{"line":1022,"column":12}}]},"137":{"line":1026,"type":"binary-expr","locations":[{"start":{"line":1026,"column":27},"end":{"line":1026,"column":34}},{"start":{"line":1026,"column":38},"end":{"line":1026,"column":46}}]},"138":{"line":1044,"type":"binary-expr","locations":[{"start":{"line":1044,"column":22},"end":{"line":1044,"column":29}},{"start":{"line":1044,"column":33},"end":{"line":1044,"column":37}}]},"139":{"line":1091,"type":"binary-expr","locations":[{"start":{"line":1091,"column":12},"end":{"line":1091,"column":13}},{"start":{"line":1091,"column":17},"end":{"line":1091,"column":18}}]},"140":{"line":1094,"type":"if","locations":[{"start":{"line":1094,"column":12},"end":{"line":1094,"column":12}},{"start":{"line":1094,"column":12},"end":{"line":1094,"column":12}}]},"141":{"line":1136,"type":"if","locations":[{"start":{"line":1136,"column":8},"end":{"line":1136,"column":8}},{"start":{"line":1136,"column":8},"end":{"line":1136,"column":8}}]},"142":{"line":1137,"type":"if","locations":[{"start":{"line":1137,"column":12},"end":{"line":1137,"column":12}},{"start":{"line":1137,"column":12},"end":{"line":1137,"column":12}}]},"143":{"line":1138,"type":"if","locations":[{"start":{"line":1138,"column":16},"end":{"line":1138,"column":16}},{"start":{"line":1138,"column":16},"end":{"line":1138,"column":16}}]},"144":{"line":1138,"type":"binary-expr","locations":[{"start":{"line":1138,"column":20},"end":{"line":1138,"column":25}},{"start":{"line":1138,"column":29},"end":{"line":1138,"column":37}},{"start":{"line":1138,"column":41},"end":{"line":1138,"column":63}}]},"145":{"line":1173,"type":"if","locations":[{"start":{"line":1173,"column":8},"end":{"line":1173,"column":8}},{"start":{"line":1173,"column":8},"end":{"line":1173,"column":8}}]},"146":{"line":1173,"type":"binary-expr","locations":[{"start":{"line":1173,"column":12},"end":{"line":1173,"column":17}},{"start":{"line":1173,"column":21},"end":{"line":1173,"column":29}}]},"147":{"line":1176,"type":"if","locations":[{"start":{"line":1176,"column":12},"end":{"line":1176,"column":12}},{"start":{"line":1176,"column":12},"end":{"line":1176,"column":12}}]},"148":{"line":1180,"type":"if","locations":[{"start":{"line":1180,"column":12},"end":{"line":1180,"column":12}},{"start":{"line":1180,"column":12},"end":{"line":1180,"column":12}}]},"149":{"line":1184,"type":"if","locations":[{"start":{"line":1184,"column":12},"end":{"line":1184,"column":12}},{"start":{"line":1184,"column":12},"end":{"line":1184,"column":12}}]},"150":{"line":1188,"type":"binary-expr","locations":[{"start":{"line":1188,"column":15},"end":{"line":1188,"column":18}},{"start":{"line":1188,"column":22},"end":{"line":1188,"column":30}}]},"151":{"line":1262,"type":"if","locations":[{"start":{"line":1262,"column":4},"end":{"line":1262,"column":4}},{"start":{"line":1262,"column":4},"end":{"line":1262,"column":4}}]},"152":{"line":1263,"type":"binary-expr","locations":[{"start":{"line":1263,"column":19},"end":{"line":1263,"column":52}},{"start":{"line":1263,"column":56},"end":{"line":1263,"column":73}}]},"153":{"line":1265,"type":"if","locations":[{"start":{"line":1265,"column":8},"end":{"line":1265,"column":8}},{"start":{"line":1265,"column":8},"end":{"line":1265,"column":8}}]},"154":{"line":1265,"type":"binary-expr","locations":[{"start":{"line":1265,"column":12},"end":{"line":1265,"column":15}},{"start":{"line":1265,"column":19},"end":{"line":1265,"column":31}}]},"155":{"line":1273,"type":"if","locations":[{"start":{"line":1273,"column":8},"end":{"line":1273,"column":8}},{"start":{"line":1273,"column":8},"end":{"line":1273,"column":8}}]},"156":{"line":1278,"type":"if","locations":[{"start":{"line":1278,"column":8},"end":{"line":1278,"column":8}},{"start":{"line":1278,"column":8},"end":{"line":1278,"column":8}}]},"157":{"line":1285,"type":"cond-expr","locations":[{"start":{"line":1285,"column":26},"end":{"line":1285,"column":36}},{"start":{"line":1285,"column":39},"end":{"line":1285,"column":42}}]},"158":{"line":1368,"type":"binary-expr","locations":[{"start":{"line":1368,"column":22},"end":{"line":1368,"column":31}},{"start":{"line":1368,"column":35},"end":{"line":1368,"column":45}},{"start":{"line":1368,"column":49},"end":{"line":1368,"column":52}}]},"159":{"line":1373,"type":"if","locations":[{"start":{"line":1373,"column":8},"end":{"line":1373,"column":8}},{"start":{"line":1373,"column":8},"end":{"line":1373,"column":8}}]},"160":{"line":1497,"type":"if","locations":[{"start":{"line":1497,"column":4},"end":{"line":1497,"column":4}},{"start":{"line":1497,"column":4},"end":{"line":1497,"column":4}}]}},"code":["(function () { YUI.add('node-core', function (Y, NAME) {","","/**"," * The Node Utility provides a DOM-like interface for interacting with DOM nodes."," * @module node"," * @main node"," * @submodule node-core"," */","","/**"," * The Node class provides a wrapper for manipulating DOM Nodes."," * Node properties can be accessed via the set/get methods."," * Use `Y.one()` to retrieve Node instances."," *"," * <strong>NOTE:</strong> Node properties are accessed using"," * the <code>set</code> and <code>get</code> methods."," *"," * @class Node"," * @constructor"," * @param {HTMLElement} node the DOM node to be mapped to the Node instance."," * @uses EventTarget"," */","","// \"globals\"","var DOT = '.',"," NODE_NAME = 'nodeName',"," NODE_TYPE = 'nodeType',"," OWNER_DOCUMENT = 'ownerDocument',"," TAG_NAME = 'tagName',"," UID = '_yuid',"," EMPTY_OBJ = {},",""," _slice = Array.prototype.slice,",""," Y_DOM = Y.DOM,",""," Y_Node = function(node) {"," if (!this.getDOMNode) { // support optional \"new\""," return new Y_Node(node);"," }",""," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," }",""," var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID];",""," if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) {"," node[UID] = null; // unset existing uid to prevent collision (via clone or hack)"," }",""," uid = uid || Y.stamp(node);"," if (!uid) { // stamp failed; likely IE non-HTMLElement"," uid = Y.guid();"," }",""," this[UID] = uid;",""," /**"," * The underlying DOM node bound to the Y.Node instance"," * @property _node"," * @type HTMLElement"," * @private"," */"," this._node = node;",""," this._stateProxy = node; // when augmented with Attribute",""," if (this._initPlugins) { // when augmented with Plugin.Host"," this._initPlugins();"," }"," },",""," // used with previous/next/ancestor tests"," _wrapFn = function(fn) {"," var ret = null;"," if (fn) {"," ret = (typeof fn == 'string') ?"," function(n) {"," return Y.Selector.test(n, fn);"," } :"," function(n) {"," return fn(Y.one(n));"," };"," }",""," return ret;"," };","// end \"globals\"","","Y_Node.ATTRS = {};","Y_Node.DOM_EVENTS = {};","","Y_Node._fromString = function(node) {"," if (node) {"," if (node.indexOf('doc') === 0) { // doc OR document"," node = Y.config.doc;"," } else if (node.indexOf('win') === 0) { // win OR window"," node = Y.config.win;"," } else {"," node = Y.Selector.query(node, null, true);"," }"," }",""," return node || null;","};","","/**"," * The name of the component"," * @static"," * @type String"," * @property NAME"," */","Y_Node.NAME = 'node';","","/*"," * The pattern used to identify ARIA attributes"," */","Y_Node.re_aria = /^(?:role$|aria-)/;","","Y_Node.SHOW_TRANSITION = 'fadeIn';","Y_Node.HIDE_TRANSITION = 'fadeOut';","","/**"," * A list of Node instances that have been created"," * @private"," * @type Object"," * @property _instances"," * @static"," *"," */","Y_Node._instances = {};","","/**"," * Retrieves the DOM node bound to a Node instance"," * @method getDOMNode"," * @static"," *"," * @param {Node|HTMLElement} node The Node instance or an HTMLElement"," * @return {HTMLElement} The DOM node bound to the Node instance. If a DOM node is passed"," * as the node argument, it is simply returned."," */","Y_Node.getDOMNode = function(node) {"," if (node) {"," return (node.nodeType) ? node : node._node || null;"," }"," return null;","};","","/**"," * Checks Node return values and wraps DOM Nodes as Y.Node instances"," * and DOM Collections / Arrays as Y.NodeList instances."," * Other return values just pass thru. If undefined is returned (e.g. no return)"," * then the Node instance is returned for chainability."," * @method scrubVal"," * @static"," *"," * @param {HTMLElement|HTMLElement[]|Node} node The Node instance or an HTMLElement"," * @return {Node | NodeList | Any} Depends on what is returned from the DOM node."," */","Y_Node.scrubVal = function(val, node) {"," if (val) { // only truthy values are risky"," if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function"," if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window"," val = Y.one(val);"," } else if ((val.item && !val._nodes) || // dom collection or Node instance"," (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes"," val = Y.all(val);"," }"," }"," } else if (typeof val === 'undefined') {"," val = node; // for chaining"," } else if (val === null) {"," val = null; // IE: DOM null not the same as null"," }",""," return val;","};","","/**"," * Adds methods to the Y.Node prototype, routing through scrubVal."," * @method addMethod"," * @static"," *"," * @param {String} name The name of the method to add"," * @param {Function} fn The function that becomes the method"," * @param {Object} context An optional context to call the method with"," * (defaults to the Node instance)"," * @return {any} Depends on what is returned from the DOM node."," */","Y_Node.addMethod = function(name, fn, context) {"," if (name && fn && typeof fn == 'function') {"," Y_Node.prototype[name] = function() {"," var args = _slice.call(arguments),"," node = this,"," ret;",""," if (args[0] && args[0]._node) {"," args[0] = args[0]._node;"," }",""," if (args[1] && args[1]._node) {"," args[1] = args[1]._node;"," }"," args.unshift(node._node);",""," ret = fn.apply(context || node, args);",""," if (ret) { // scrub truthy"," ret = Y_Node.scrubVal(ret, node);"," }",""," (typeof ret != 'undefined') || (ret = node);"," return ret;"," };"," } else {"," }","};","","/**"," * Imports utility methods to be added as Y.Node methods."," * @method importMethod"," * @static"," *"," * @param {Object} host The object that contains the method to import."," * @param {String} name The name of the method to import"," * @param {String} altName An optional name to use in place of the host name"," * @param {Object} context An optional context to call the method with"," */","Y_Node.importMethod = function(host, name, altName) {"," if (typeof name == 'string') {"," altName = altName || name;"," Y_Node.addMethod(altName, host[name], host);"," } else {"," Y.Array.each(name, function(n) {"," Y_Node.importMethod(host, n);"," });"," }","};","","/**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for Node"," */","Y_Node.one = function(node) {"," var instance = null,"," cachedNode,"," uid;",""," if (node) {"," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," } else if (node.getDOMNode) {"," return node; // NOTE: return"," }",""," if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc)"," uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid;"," instance = Y_Node._instances[uid]; // reuse exising instances"," cachedNode = instance ? instance._node : null;"," if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match"," instance = new Y_Node(node);"," if (node.nodeType != 11) { // dont cache document fragment"," Y_Node._instances[instance[UID]] = instance; // cache node"," }"," }"," }"," }",""," return instance;","};","","/**"," * The default setter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_SETTER"," * @static"," * @param {String} name The attribute/property being set"," * @param {any} val The value to be set"," * @return {any} The value"," */","Y_Node.DEFAULT_SETTER = function(name, val) {"," var node = this._stateProxy,"," strPath;",""," if (name.indexOf(DOT) > -1) {"," strPath = name;"," name = name.split(DOT);"," // only allow when defined on node"," Y.Object.setValue(node, name, val);"," } else if (typeof node[name] != 'undefined') { // pass thru DOM properties"," node[name] = val;"," }",""," return val;","};","","/**"," * The default getter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_GETTER"," * @static"," * @param {String} name The attribute/property to look up"," * @return {any} The current value"," */","Y_Node.DEFAULT_GETTER = function(name) {"," var node = this._stateProxy,"," val;",""," if (name.indexOf && name.indexOf(DOT) > -1) {"," val = Y.Object.getValue(node, name.split(DOT));"," } else if (typeof node[name] != 'undefined') { // pass thru from DOM"," val = node[name];"," }",""," return val;","};","","Y.mix(Y_Node.prototype, {"," DATA_PREFIX: 'data-',",""," /**"," * The method called when outputting Node instances as strings"," * @method toString"," * @return {String} A string representation of the Node instance"," */"," toString: function() {"," var str = this[UID] + ': not bound to a node',"," node = this._node,"," attrs, id, className;",""," if (node) {"," attrs = node.attributes;"," id = (attrs && attrs.id) ? node.getAttribute('id') : null;"," className = (attrs && attrs.className) ? node.getAttribute('className') : null;"," str = node[NODE_NAME];",""," if (id) {"," str += '#' + id;"," }",""," if (className) {"," str += '.' + className.replace(' ', '.');"," }",""," // TODO: add yuid?"," str += ' ' + this[UID];"," }"," return str;"," },",""," /**"," * Returns an attribute value on the Node instance."," * Unless pre-configured (via `Node.ATTRS`), get hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be queried."," * @method get"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," get: function(attr) {"," var val;",""," if (this._getAttr) { // use Attribute imple"," val = this._getAttr(attr);"," } else {"," val = this._get(attr);"," }",""," if (val) {"," val = Y_Node.scrubVal(val, this);"," } else if (val === null) {"," val = null; // IE: DOM null is not true null (even though they ===)"," }"," return val;"," },",""," /**"," * Helper method for get."," * @method _get"," * @private"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," _get: function(attr) {"," var attrConfig = Y_Node.ATTRS[attr],"," val;",""," if (attrConfig && attrConfig.getter) {"," val = attrConfig.getter.call(this);"," } else if (Y_Node.re_aria.test(attr)) {"," val = this._node.getAttribute(attr, 2);"," } else {"," val = Y_Node.DEFAULT_GETTER.apply(this, arguments);"," }",""," return val;"," },",""," /**"," * Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," */"," set: function(attr, val) {"," var attrConfig = Y_Node.ATTRS[attr];",""," if (this._setAttr) { // use Attribute imple"," this._setAttr.apply(this, arguments);"," } else { // use setters inline"," if (attrConfig && attrConfig.setter) {"," attrConfig.setter.call(this, val, attr);"," } else if (Y_Node.re_aria.test(attr)) { // special case Aria"," this._node.setAttribute(attr, val);"," } else {"," Y_Node.DEFAULT_SETTER.apply(this, arguments);"," }"," }",""," return this;"," },",""," /**"," * Sets multiple attributes."," * @method setAttrs"," * @param {Object} attrMap an object of name/value pairs to set"," * @chainable"," */"," setAttrs: function(attrMap) {"," if (this._setAttrs) { // use Attribute imple"," this._setAttrs(attrMap);"," } else { // use setters inline"," Y.Object.each(attrMap, function(v, n) {"," this.set(n, v);"," }, this);"," }",""," return this;"," },",""," /**"," * Returns an object containing the values for the requested attributes."," * @method getAttrs"," * @param {Array} attrs an array of attributes to get values"," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs: function(attrs) {"," var ret = {};"," if (this._getAttrs) { // use Attribute imple"," this._getAttrs(attrs);"," } else { // use setters inline"," Y.Array.each(attrs, function(v, n) {"," ret[v] = this.get(v);"," }, this);"," }",""," return ret;"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this._node;",""," if (refNode && refNode._node) {"," refNode = refNode._node;"," }"," return node === refNode;"," },",""," /**"," * Determines whether the node is appended to the document."," * @method inDoc"," * @param {Node|HTMLElement} doc optional An optional document to check against."," * Defaults to current document."," * @return {Boolean} Whether or not this node is appended to the document."," */"," inDoc: function(doc) {"," var node = this._node;",""," if (node) {"," doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];"," if (doc.documentElement) {"," return Y_DOM.contains(doc.documentElement, node);"," }"," }",""," return false;"," },",""," getById: function(id) {"," var node = this._node,"," ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]);"," if (ret && Y_DOM.contains(node, ret)) {"," ret = Y.one(ret);"," } else {"," ret = null;"," }"," return ret;"," },",""," /**"," * Returns the nearest ancestor that passes the test applied by supplied boolean method."," * @method ancestor"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * If fn is not passed as an argument, the parent node will be returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * @param {String | Function} stopFn optional A selector string or boolean"," * method to indicate when the search should stop. The search bails when the function"," * returns true or the selector matches."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} The matching Node instance or null if not found"," */"," ancestor: function(fn, testSelf, stopFn) {"," // testSelf is optional, check for stopFn as 2nd arg"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }",""," return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the ancestors that pass the test applied by supplied boolean method."," * @method ancestors"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} A NodeList instance containing the matching elements"," */"," ancestors: function(fn, testSelf, stopFn) {"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }"," return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the previous matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method previous"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @param {Boolean} [all] Whether text nodes as well as element nodes should be returned, or"," * just element nodes will be returned(default)"," * @return {Node} Node instance or null if not found"," */"," previous: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns the next matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method next"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @param {Boolean} [all] Whether text nodes as well as element nodes should be returned, or"," * just element nodes will be returned(default)"," * @return {Node} Node instance or null if not found"," */"," next: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns all matching siblings."," * Returns all siblings if no method provided."," * @method siblings"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} NodeList instance bound to found siblings"," */"," siblings: function(fn) {"," return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn)));"," },",""," /**"," * Retrieves a single Node instance, the first element matching the given"," * CSS selector."," * Returns null if no match found."," * @method one"," *"," * @param {string} selector The CSS selector to test against."," * @return {Node | null} A Node instance for the matching HTMLElement or null"," * if no match found."," */"," one: function(selector) {"," return Y.one(Y.Selector.query(selector, this._node, true));"," },",""," /**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," */"," all: function(selector) {"," var nodelist;",""," if (this._node) {"," nodelist = Y.all(Y.Selector.query(selector, this._node));"," nodelist._query = selector;"," nodelist._queryRoot = this._node;"," }",""," return nodelist || Y.all([]);"," },",""," // TODO: allow fn test"," /**"," * Test if the supplied node matches the supplied selector."," * @method test"," *"," * @param {string} selector The CSS selector to test against."," * @return {boolean} Whether or not the node matches the selector."," */"," test: function(selector) {"," return Y.Selector.test(this._node, selector);"," },",""," /**"," * Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," *"," */"," remove: function(destroy) {"," var node = this._node;",""," if (node && node.parentNode) {"," node.parentNode.removeChild(node);"," }",""," if (destroy) {"," this.destroy();"," }",""," return this;"," },",""," /**"," * Replace the node with the other node. This is a DOM update only"," * and does not change the node bound to the Node instance."," * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode);"," * @method replace"," * @param {Node | HTMLElement} newNode Node to be inserted"," * @chainable"," *"," */"," replace: function(newNode) {"," var node = this._node;"," if (typeof newNode == 'string') {"," newNode = Y_Node.create(newNode);"," }"," node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node);"," return this;"," },",""," /**"," * @method replaceChild"," * @for Node"," * @param {String | HTMLElement | Node} node Node to be inserted"," * @param {HTMLElement | Node} refNode Node to be replaced"," * @return {Node} The replaced node"," */"," replaceChild: function(node, refNode) {"," if (typeof node == 'string') {"," node = Y_DOM.create(node);"," }",""," return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode)));"," },",""," /**"," * Nulls internal node references, removes any plugins and event listeners."," * Note that destroy() will not remove the node from its parent or from the DOM. For that"," * functionality, call remove(true)."," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the"," * node's subtree (default is false)"," *"," */"," destroy: function(recursive) {"," var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid',"," instance;",""," this.purge(); // TODO: only remove events add via this Node",""," if (this.unplug) { // may not be a PluginHost"," this.unplug();"," }",""," this.clearData();",""," if (recursive) {"," Y.NodeList.each(this.all('*'), function(node) {"," instance = Y_Node._instances[node[UID]];"," if (instance) {"," instance.destroy();"," } else { // purge in case added by other means"," Y.Event.purgeElement(node);"," }"," });"," }",""," this._node = null;"," this._stateProxy = null;",""," delete Y_Node._instances[this._yuid];"," },",""," /**"," * Invokes a method on the Node instance"," * @method invoke"," * @param {String} method The name of the method to invoke"," * @param {any} [args*] Arguments to invoke the method with."," * @return {any} Whatever the underly method returns."," * DOM Nodes and Collections return values"," * are converted to Node/NodeList instances."," *"," */"," invoke: function(method, a, b, c, d, e) {"," var node = this._node,"," ret;",""," if (a && a._node) {"," a = a._node;"," }",""," if (b && b._node) {"," b = b._node;"," }",""," ret = node[method](a, b, c, d, e);"," return Y_Node.scrubVal(ret, this);"," },",""," /**"," * @method swap"," * @description Swap DOM locations with the given node."," * This does not change which DOM node each Node instance refers to."," * @param {Node} otherNode The node to swap with"," * @chainable"," */"," swap: Y.config.doc.documentElement.swapNode ?"," function(otherNode) {"," this._node.swapNode(Y_Node.getDOMNode(otherNode));"," } :"," function(otherNode) {"," otherNode = Y_Node.getDOMNode(otherNode);"," var node = this._node,"," parent = otherNode.parentNode,"," nextSibling = otherNode.nextSibling;",""," if (nextSibling === node) {"," parent.insertBefore(node, otherNode);"," } else if (otherNode === node.nextSibling) {"," parent.insertBefore(otherNode, node);"," } else {"," node.parentNode.replaceChild(otherNode, node);"," Y_DOM.addHTML(parent, node, nextSibling);"," }"," return this;"," },","",""," hasMethod: function(method) {"," var node = this._node;"," return !!(node && method in node &&"," typeof node[method] != 'unknown' &&"," (typeof node[method] == 'function' ||"," String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space"," },",""," isFragment: function() {"," return (this.get('nodeType') === 11);"," },",""," /**"," * Removes and destroys all of the nodes within the node."," * @method empty"," * @chainable"," */"," empty: function() {"," this.get('childNodes').remove().destroy(true);"," return this;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNode"," * @return {HTMLElement}"," */"," getDOMNode: function() {"," return this._node;"," }","}, true);","","Y.Node = Y_Node;","Y.one = Y_Node.one;","/**"," * The NodeList module provides support for managing collections of Nodes."," * @module node"," * @submodule node-core"," */","","/**"," * The NodeList class provides a wrapper for manipulating DOM NodeLists."," * NodeList properties can be accessed via the set/get methods."," * Use Y.all() to retrieve NodeList instances."," *"," * @class NodeList"," * @constructor"," * @param nodes {String|element|Node|Array} A selector, DOM element, Node, list of DOM elements, or list of Nodes with which to populate this NodeList."," */","","var NodeList = function(nodes) {"," var tmp = [];",""," if (nodes) {"," if (typeof nodes === 'string') { // selector query"," this._query = nodes;"," nodes = Y.Selector.query(nodes);"," } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window"," nodes = [nodes];"," } else if (nodes._node) { // Y.Node"," nodes = [nodes._node];"," } else if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes"," Y.Array.each(nodes, function(node) {"," if (node._node) {"," tmp.push(node._node);"," }"," });"," nodes = tmp;"," } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes)"," nodes = Y.Array(nodes, 0, true);"," }"," }",""," /**"," * The underlying array of DOM nodes bound to the Y.NodeList instance"," * @property _nodes"," * @private"," */"," this._nodes = nodes || [];","};","","NodeList.NAME = 'NodeList';","","/**"," * Retrieves the DOM nodes bound to a NodeList instance"," * @method getDOMNodes"," * @static"," *"," * @param {NodeList} nodelist The NodeList instance"," * @return {Array} The array of DOM nodes bound to the NodeList"," */","NodeList.getDOMNodes = function(nodelist) {"," return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist;","};","","NodeList.each = function(instance, fn, context) {"," var nodes = instance._nodes;"," if (nodes && nodes.length) {"," Y.Array.each(nodes, fn, context || instance);"," } else {"," }","};","","NodeList.addMethod = function(name, fn, context) {"," if (name && fn) {"," NodeList.prototype[name] = function() {"," var ret = [],"," args = arguments;",""," Y.Array.each(this._nodes, function(node) {"," var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid',"," instance = Y.Node._instances[node[UID]],"," ctx,"," result;",""," if (!instance) {"," instance = NodeList._getTempNode(node);"," }"," ctx = context || instance;"," result = fn.apply(ctx, args);"," if (result !== undefined && result !== instance) {"," ret[ret.length] = result;"," }"," });",""," // TODO: remove tmp pointer"," return ret.length ? ret : this;"," };"," } else {"," }","};","","NodeList.importMethod = function(host, name, altName) {"," if (typeof name === 'string') {"," altName = altName || name;"," NodeList.addMethod(name, host[name]);"," } else {"," Y.Array.each(name, function(n) {"," NodeList.importMethod(host, n);"," });"," }","};","","NodeList._getTempNode = function(node) {"," var tmp = NodeList._tempNode;"," if (!tmp) {"," tmp = Y.Node.create('<div></div>');"," NodeList._tempNode = tmp;"," }",""," tmp._node = node;"," tmp._stateProxy = node;"," return tmp;","};","","Y.mix(NodeList.prototype, {"," _invoke: function(method, args, getter) {"," var ret = (getter) ? [] : this;",""," this.each(function(node) {"," var val = node[method].apply(node, args);"," if (getter) {"," ret.push(val);"," }"," });",""," return ret;"," },",""," /**"," * Retrieves the Node instance at the given index."," * @method item"," *"," * @param {Number} index The index of the target Node."," * @return {Node} The Node instance at the given index."," */"," item: function(index) {"," return Y.one((this._nodes || [])[index]);"," },",""," /**"," * Applies the given function to each Node in the NodeList."," * @method each"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to apply the function with"," * Default context is the current Node instance"," * @chainable"," */"," each: function(fn, context) {"," var instance = this;"," Y.Array.each(this._nodes, function(node, index) {"," node = Y.one(node);"," return fn.call(context || node, node, index, instance);"," });"," return instance;"," },",""," batch: function(fn, context) {"," var nodelist = this;",""," Y.Array.each(this._nodes, function(node, index) {"," var instance = Y.Node._instances[node[UID]];"," if (!instance) {"," instance = NodeList._getTempNode(node);"," }",""," return fn.call(context || instance, instance, index, nodelist);"," });"," return nodelist;"," },",""," /**"," * Executes the function once for each node until a true value is returned."," * @method some"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to execute the function from."," * Default context is the current Node instance"," * @return {Boolean} Whether or not the function returned true for any node."," */"," some: function(fn, context) {"," var instance = this;"," return Y.Array.some(this._nodes, function(node, index) {"," node = Y.one(node);"," context = context || node;"," return fn.call(context, node, index, instance);"," });"," },",""," /**"," * Creates a documenFragment from the nodes bound to the NodeList instance"," * @method toFrag"," * @return {Node} a Node instance bound to the documentFragment"," */"," toFrag: function() {"," return Y.one(Y.DOM._nl2frag(this._nodes));"," },",""," /**"," * Returns the index of the node in the NodeList instance"," * or -1 if the node isn't found."," * @method indexOf"," * @param {Node | HTMLElement} node the node to search for"," * @return {Number} the index of the node value or -1 if not found"," */"," indexOf: function(node) {"," return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node));"," },",""," /**"," * Filters the NodeList instance down to only nodes matching the given selector."," * @method filter"," * @param {String} selector The selector to filter against"," * @return {NodeList} NodeList containing the updated collection"," * @see Selector"," */"," filter: function(selector) {"," return Y.all(Y.Selector.filter(this._nodes, selector));"," },","",""," /**"," * Creates a new NodeList containing all nodes at every n indices, where"," * remainder n % index equals r."," * (zero-based index)."," * @method modulus"," * @param {Number} n The offset to use (return every nth node)"," * @param {Number} r An optional remainder to use with the modulus operation (defaults to zero)"," * @return {NodeList} NodeList containing the updated collection"," */"," modulus: function(n, r) {"," r = r || 0;"," var nodes = [];"," NodeList.each(this, function(node, i) {"," if (i % n === r) {"," nodes.push(node);"," }"," });",""," return Y.all(nodes);"," },",""," /**"," * Creates a new NodeList containing all nodes at odd indices"," * (zero-based index)."," * @method odd"," * @return {NodeList} NodeList containing the updated collection"," */"," odd: function() {"," return this.modulus(2, 1);"," },",""," /**"," * Creates a new NodeList containing all nodes at even indices"," * (zero-based index), including zero."," * @method even"," * @return {NodeList} NodeList containing the updated collection"," */"," even: function() {"," return this.modulus(2);"," },",""," destructor: function() {"," },",""," /**"," * Reruns the initial query, when created using a selector query"," * @method refresh"," * @chainable"," */"," refresh: function() {"," var doc,"," nodes = this._nodes,"," query = this._query,"," root = this._queryRoot;",""," if (query) {"," if (!root) {"," if (nodes && nodes[0] && nodes[0].ownerDocument) {"," root = nodes[0].ownerDocument;"," }"," }",""," this._nodes = Y.Selector.query(query, root);"," }",""," return this;"," },",""," /**"," * Returns the current number of items in the NodeList."," * @method size"," * @return {Number} The number of items in the NodeList."," */"," size: function() {"," return this._nodes.length;"," },",""," /**"," * Determines if the instance is bound to any nodes"," * @method isEmpty"," * @return {Boolean} Whether or not the NodeList is bound to any nodes"," */"," isEmpty: function() {"," return this._nodes.length < 1;"," },",""," toString: function() {"," var str = '',"," errorMsg = this[UID] + ': not bound to any nodes',"," nodes = this._nodes,"," node;",""," if (nodes && nodes[0]) {"," node = nodes[0];"," str += node[NODE_NAME];"," if (node.id) {"," str += '#' + node.id;"," }",""," if (node.className) {"," str += '.' + node.className.replace(' ', '.');"," }",""," if (nodes.length > 1) {"," str += '...[' + nodes.length + ' items]';"," }"," }"," return str || errorMsg;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNodes"," * @return {Array}"," */"," getDOMNodes: function() {"," return this._nodes;"," }","}, true);","","NodeList.importMethod(Y.Node.prototype, ["," /**"," * Called on each Node instance. Nulls internal node references,"," * removes any plugins and event listeners"," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to"," * remove listeners from the node's subtree (default is false)"," * @see Node.destroy"," */"," 'destroy',",""," /**"," * Called on each Node instance. Removes and destroys all of the nodes"," * within the node"," * @method empty"," * @chainable"," * @see Node.empty"," */"," 'empty',",""," /**"," * Called on each Node instance. Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," * @see Node.remove"," */"," 'remove',",""," /**"," * Called on each Node instance. Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," * @see Node.set"," */"," 'set'","]);","","// one-off implementation to convert array of Nodes to NodeList","// e.g. Y.all('input').get('parentNode');","","/** Called on each Node instance"," * @method get"," * @see Node"," */","NodeList.prototype.get = function(attr) {"," var ret = [],"," nodes = this._nodes,"," isNodeList = false,"," getTemp = NodeList._getTempNode,"," instance,"," val;",""," if (nodes[0]) {"," instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]);"," val = instance._get(attr);"," if (val && val.nodeType) {"," isNodeList = true;"," }"," }",""," Y.Array.each(nodes, function(node) {"," instance = Y.Node._instances[node._yuid];",""," if (!instance) {"," instance = getTemp(node);"," }",""," val = instance._get(attr);"," if (!isNodeList) { // convert array of Nodes to NodeList"," val = Y.Node.scrubVal(val, instance);"," }",""," ret.push(val);"," });",""," return (isNodeList) ? Y.all(ret) : ret;","};","","Y.NodeList = NodeList;","","Y.all = function(nodes) {"," return new NodeList(nodes);","};","","Y.Node.all = Y.all;","/**"," * @module node"," * @submodule node-core"," */","","var Y_NodeList = Y.NodeList,"," ArrayProto = Array.prototype,"," ArrayMethods = {"," /** Returns a new NodeList combining the given NodeList(s)"," * @for NodeList"," * @method concat"," * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to"," * concatenate to the resulting NodeList"," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'concat': 1,"," /** Removes the last from the NodeList and returns it."," * @for NodeList"," * @method pop"," * @return {Node | null} The last item in the NodeList, or null if the list is empty."," */"," 'pop': 0,"," /** Adds the given Node(s) to the end of the NodeList."," * @for NodeList"," * @method push"," * @param {Node | HTMLElement} nodes One or more nodes to add to the end of the NodeList."," */"," 'push': 0,"," /** Removes the first item from the NodeList and returns it."," * @for NodeList"," * @method shift"," * @return {Node | null} The first item in the NodeList, or null if the NodeList is empty."," */"," 'shift': 0,"," /** Returns a new NodeList comprising the Nodes in the given range."," * @for NodeList"," * @method slice"," * @param {Number} begin Zero-based index at which to begin extraction."," As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence."," * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end."," slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3)."," As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence."," If end is omitted, slice extracts to the end of the sequence."," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'slice': 1,"," /** Changes the content of the NodeList, adding new elements while removing old elements."," * @for NodeList"," * @method splice"," * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end."," * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed."," * {Node | HTMLElement| element1, ..., elementN"," The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array."," * @return {NodeList} The element(s) removed."," */"," 'splice': 1,"," /** Adds the given Node(s) to the beginning of the NodeList."," * @for NodeList"," * @method unshift"," * @param {Node | HTMLElement} nodes One or more nodes to add to the NodeList."," */"," 'unshift': 0"," };","","","Y.Object.each(ArrayMethods, function(returnNodeList, name) {"," Y_NodeList.prototype[name] = function() {"," var args = [],"," i = 0,"," arg,"," ret;",""," while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists"," args.push(arg._node || arg._nodes || arg);"," }",""," ret = ArrayProto[name].apply(this._nodes, args);",""," if (returnNodeList) {"," ret = Y.all(ret);"," } else {"," ret = Y.Node.scrubVal(ret);"," }",""," return ret;"," };","});","/**"," * @module node"," * @submodule node-core"," */","","Y.Array.each(["," /**"," * Passes through to DOM method."," * @for Node"," * @method removeChild"," * @param {HTMLElement | Node} node Node to be removed"," * @return {Node} The removed node"," */"," 'removeChild',",""," /**"," * Passes through to DOM method."," * @method hasChildNodes"," * @return {Boolean} Whether or not the node has any childNodes"," */"," 'hasChildNodes',",""," /**"," * Passes through to DOM method."," * @method cloneNode"," * @param {Boolean} deep Whether or not to perform a deep clone, which includes"," * subtree and attributes"," * @return {Node} The clone"," */"," 'cloneNode',",""," /**"," * Passes through to DOM method."," * @method hasAttribute"," * @param {String} attribute The attribute to test for"," * @return {Boolean} Whether or not the attribute is present"," */"," 'hasAttribute',",""," /**"," * Passes through to DOM method."," * @method scrollIntoView"," * @chainable"," */"," 'scrollIntoView',",""," /**"," * Passes through to DOM method."," * @method getElementsByTagName"," * @param {String} tagName The tagName to collect"," * @return {NodeList} A NodeList representing the HTMLCollection"," */"," 'getElementsByTagName',",""," /**"," * Passes through to DOM method."," * @method focus"," * @chainable"," */"," 'focus',",""," /**"," * Passes through to DOM method."," * @method blur"," * @chainable"," */"," 'blur',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method submit"," * @chainable"," */"," 'submit',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method reset"," * @chainable"," */"," 'reset',",""," /**"," * Passes through to DOM method."," * @method select"," * @chainable"," */"," 'select',",""," /**"," * Passes through to DOM method."," * Only valid on TABLE elements"," * @method createCaption"," * @chainable"," */"," 'createCaption'","","], function(method) {"," Y.Node.prototype[method] = function(arg1, arg2, arg3) {"," var ret = this.invoke(method, arg1, arg2, arg3);"," return ret;"," };","});","","/**"," * Passes through to DOM method."," * @method removeAttribute"," * @param {String} attribute The attribute to be removed"," * @chainable"," */"," // one-off implementation due to IE returning boolean, breaking chaining","Y.Node.prototype.removeAttribute = function(attr) {"," var node = this._node;"," if (node) {"," node.removeAttribute(attr, 0); // comma zero for IE < 8 to force case-insensitive"," }",""," return this;","};","","Y.Node.importMethod(Y.DOM, ["," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy."," * @method contains"," * @param {Node | HTMLElement} needle The possible node or descendent"," * @return {Boolean} Whether or not this node is the needle its ancestor"," */"," 'contains',"," /**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @for Node"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',"," /**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @for Node"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */"," 'getAttribute',",""," /**"," * Wraps the given HTML around the node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," * @for Node"," */"," 'wrap',",""," /**"," * Removes the node's parent node."," * @method unwrap"," * @chainable"," */"," 'unwrap',",""," /**"," * Applies a unique ID to the node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","Y.NodeList.importMethod(Y.Node.prototype, [","/**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */",""," 'getAttribute',","/**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @see Node"," * @for NodeList"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',","","/**"," * Allows for removing attributes on DOM nodes."," * This passes through to the DOM node, allowing for custom attributes."," * @method removeAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute to remove"," */"," 'removeAttribute',","/**"," * Removes the parent node from node in the list."," * @method unwrap"," * @chainable"," */"," 'unwrap',","/**"," * Wraps the given HTML around each node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," */"," 'wrap',","","/**"," * Applies a unique ID to each node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","","}, '3.17.1', {\"requires\": [\"dom-core\", \"selector\"]});","","}());"]}; } var __cov_LGqepiXuzGEZpz3IhlW0rQ = __coverage__['build/node-core/node-core.js']; __cov_LGqepiXuzGEZpz3IhlW0rQ.s['1']++;YUI.add('node-core',function(Y,NAME){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['1']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['2']++;var DOT='.',NODE_NAME='nodeName',NODE_TYPE='nodeType',OWNER_DOCUMENT='ownerDocument',TAG_NAME='tagName',UID='_yuid',EMPTY_OBJ={},_slice=Array.prototype.slice,Y_DOM=Y.DOM,Y_Node=function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['2']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['3']++;if(!this.getDOMNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['1'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['4']++;return new Y_Node(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['1'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['5']++;if(typeof node=='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['2'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['6']++;node=Y_Node._fromString(node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['7']++;if(!node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['3'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['8']++;return null;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['3'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['2'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['9']++;var uid=node.nodeType!==9?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['4'][0]++,node.uniqueID):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['4'][1]++,node[UID]);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['10']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['6'][0]++,uid)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['6'][1]++,Y_Node._instances[uid])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['6'][2]++,Y_Node._instances[uid]._node!==node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['5'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['11']++;node[UID]=null;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['5'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['12']++;uid=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['7'][0]++,uid)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['7'][1]++,Y.stamp(node));__cov_LGqepiXuzGEZpz3IhlW0rQ.s['13']++;if(!uid){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['8'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['14']++;uid=Y.guid();}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['8'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['15']++;this[UID]=uid;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['16']++;this._node=node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['17']++;this._stateProxy=node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['18']++;if(this._initPlugins){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['9'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['19']++;this._initPlugins();}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['9'][1]++;}},_wrapFn=function(fn){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['3']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['20']++;var ret=null;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['21']++;if(fn){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['10'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['22']++;ret=typeof fn=='string'?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['11'][0]++,function(n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['4']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['23']++;return Y.Selector.test(n,fn);}):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['11'][1]++,function(n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['5']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['24']++;return fn(Y.one(n));});}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['10'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['25']++;return ret;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['26']++;Y_Node.ATTRS={};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['27']++;Y_Node.DOM_EVENTS={};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['28']++;Y_Node._fromString=function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['6']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['29']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['12'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['30']++;if(node.indexOf('doc')===0){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['13'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['31']++;node=Y.config.doc;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['13'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['32']++;if(node.indexOf('win')===0){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['14'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['33']++;node=Y.config.win;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['14'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['34']++;node=Y.Selector.query(node,null,true);}}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['12'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['35']++;return(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['15'][0]++,node)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['15'][1]++,null);};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['36']++;Y_Node.NAME='node';__cov_LGqepiXuzGEZpz3IhlW0rQ.s['37']++;Y_Node.re_aria=/^(?:role$|aria-)/;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['38']++;Y_Node.SHOW_TRANSITION='fadeIn';__cov_LGqepiXuzGEZpz3IhlW0rQ.s['39']++;Y_Node.HIDE_TRANSITION='fadeOut';__cov_LGqepiXuzGEZpz3IhlW0rQ.s['40']++;Y_Node._instances={};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['41']++;Y_Node.getDOMNode=function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['7']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['42']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['16'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['43']++;return node.nodeType?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['17'][0]++,node):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['17'][1]++,(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['18'][0]++,node._node)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['18'][1]++,null));}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['16'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['44']++;return null;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['45']++;Y_Node.scrubVal=function(val,node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['8']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['46']++;if(val){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['19'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['47']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['21'][0]++,typeof val=='object')||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['21'][1]++,typeof val=='function')){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['20'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['48']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['23'][0]++,NODE_TYPE in val)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['23'][1]++,Y_DOM.isWindow(val))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['22'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['49']++;val=Y.one(val);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['22'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['50']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['25'][0]++,val.item)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['25'][1]++,!val._nodes)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['25'][2]++,val[0])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['25'][3]++,val[0][NODE_TYPE])){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['24'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['51']++;val=Y.all(val);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['24'][1]++;}}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['20'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['19'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['52']++;if(typeof val==='undefined'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['26'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['53']++;val=node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['26'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['54']++;if(val===null){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['27'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['55']++;val=null;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['27'][1]++;}}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['56']++;return val;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['57']++;Y_Node.addMethod=function(name,fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['9']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['58']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['29'][0]++,name)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['29'][1]++,fn)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['29'][2]++,typeof fn=='function')){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['28'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['59']++;Y_Node.prototype[name]=function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['10']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['60']++;var args=_slice.call(arguments),node=this,ret;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['61']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['31'][0]++,args[0])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['31'][1]++,args[0]._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['30'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['62']++;args[0]=args[0]._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['30'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['63']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['33'][0]++,args[1])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['33'][1]++,args[1]._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['32'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['64']++;args[1]=args[1]._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['32'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['65']++;args.unshift(node._node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['66']++;ret=fn.apply((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['34'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['34'][1]++,node),args);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['67']++;if(ret){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['35'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['68']++;ret=Y_Node.scrubVal(ret,node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['35'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['69']++;(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['36'][0]++,typeof ret!='undefined')||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['36'][1]++,ret=node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['70']++;return ret;};}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['28'][1]++;}};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['71']++;Y_Node.importMethod=function(host,name,altName){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['11']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['72']++;if(typeof name=='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['37'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['73']++;altName=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['38'][0]++,altName)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['38'][1]++,name);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['74']++;Y_Node.addMethod(altName,host[name],host);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['37'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['75']++;Y.Array.each(name,function(n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['12']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['76']++;Y_Node.importMethod(host,n);});}};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['77']++;Y_Node.one=function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['13']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['78']++;var instance=null,cachedNode,uid;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['79']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['39'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['80']++;if(typeof node=='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['40'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['81']++;node=Y_Node._fromString(node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['82']++;if(!node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['41'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['83']++;return null;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['41'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['40'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['84']++;if(node.getDOMNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['42'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['85']++;return node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['42'][1]++;}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['86']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['44'][0]++,node.nodeType)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['44'][1]++,Y.DOM.isWindow(node))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['43'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['87']++;uid=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['46'][0]++,node.uniqueID)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['46'][1]++,node.nodeType!==9)?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['45'][0]++,node.uniqueID):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['45'][1]++,node._yuid);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['88']++;instance=Y_Node._instances[uid];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['89']++;cachedNode=instance?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['47'][0]++,instance._node):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['47'][1]++,null);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['90']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['49'][0]++,!instance)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['49'][1]++,cachedNode)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['49'][2]++,node!==cachedNode)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['48'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['91']++;instance=new Y_Node(node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['92']++;if(node.nodeType!=11){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['50'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['93']++;Y_Node._instances[instance[UID]]=instance;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['50'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['48'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['43'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['39'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['94']++;return instance;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['95']++;Y_Node.DEFAULT_SETTER=function(name,val){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['14']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['96']++;var node=this._stateProxy,strPath;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['97']++;if(name.indexOf(DOT)>-1){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['51'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['98']++;strPath=name;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['99']++;name=name.split(DOT);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['100']++;Y.Object.setValue(node,name,val);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['51'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['101']++;if(typeof node[name]!='undefined'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['52'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['102']++;node[name]=val;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['52'][1]++;}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['103']++;return val;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['104']++;Y_Node.DEFAULT_GETTER=function(name){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['15']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['105']++;var node=this._stateProxy,val;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['106']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['54'][0]++,name.indexOf)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['54'][1]++,name.indexOf(DOT)>-1)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['53'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['107']++;val=Y.Object.getValue(node,name.split(DOT));}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['53'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['108']++;if(typeof node[name]!='undefined'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['55'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['109']++;val=node[name];}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['55'][1]++;}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['110']++;return val;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['111']++;Y.mix(Y_Node.prototype,{DATA_PREFIX:'data-',toString:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['16']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['112']++;var str=this[UID]+': not bound to a node',node=this._node,attrs,id,className;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['113']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['56'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['114']++;attrs=node.attributes;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['115']++;id=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['58'][0]++,attrs)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['58'][1]++,attrs.id)?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['57'][0]++,node.getAttribute('id')):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['57'][1]++,null);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['116']++;className=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['60'][0]++,attrs)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['60'][1]++,attrs.className)?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['59'][0]++,node.getAttribute('className')):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['59'][1]++,null);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['117']++;str=node[NODE_NAME];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['118']++;if(id){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['61'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['119']++;str+='#'+id;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['61'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['120']++;if(className){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['62'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['121']++;str+='.'+className.replace(' ','.');}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['62'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['122']++;str+=' '+this[UID];}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['56'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['123']++;return str;},get:function(attr){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['17']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['124']++;var val;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['125']++;if(this._getAttr){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['63'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['126']++;val=this._getAttr(attr);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['63'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['127']++;val=this._get(attr);}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['128']++;if(val){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['64'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['129']++;val=Y_Node.scrubVal(val,this);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['64'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['130']++;if(val===null){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['65'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['131']++;val=null;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['65'][1]++;}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['132']++;return val;},_get:function(attr){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['18']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['133']++;var attrConfig=Y_Node.ATTRS[attr],val;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['134']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['67'][0]++,attrConfig)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['67'][1]++,attrConfig.getter)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['66'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['135']++;val=attrConfig.getter.call(this);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['66'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['136']++;if(Y_Node.re_aria.test(attr)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['68'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['137']++;val=this._node.getAttribute(attr,2);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['68'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['138']++;val=Y_Node.DEFAULT_GETTER.apply(this,arguments);}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['139']++;return val;},set:function(attr,val){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['19']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['140']++;var attrConfig=Y_Node.ATTRS[attr];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['141']++;if(this._setAttr){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['69'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['142']++;this._setAttr.apply(this,arguments);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['69'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['143']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['71'][0]++,attrConfig)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['71'][1]++,attrConfig.setter)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['70'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['144']++;attrConfig.setter.call(this,val,attr);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['70'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['145']++;if(Y_Node.re_aria.test(attr)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['72'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['146']++;this._node.setAttribute(attr,val);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['72'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['147']++;Y_Node.DEFAULT_SETTER.apply(this,arguments);}}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['148']++;return this;},setAttrs:function(attrMap){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['20']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['149']++;if(this._setAttrs){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['73'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['150']++;this._setAttrs(attrMap);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['73'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['151']++;Y.Object.each(attrMap,function(v,n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['21']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['152']++;this.set(n,v);},this);}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['153']++;return this;},getAttrs:function(attrs){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['22']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['154']++;var ret={};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['155']++;if(this._getAttrs){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['74'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['156']++;this._getAttrs(attrs);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['74'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['157']++;Y.Array.each(attrs,function(v,n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['23']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['158']++;ret[v]=this.get(v);},this);}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['159']++;return ret;},compareTo:function(refNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['24']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['160']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['161']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['76'][0]++,refNode)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['76'][1]++,refNode._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['75'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['162']++;refNode=refNode._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['75'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['163']++;return node===refNode;},inDoc:function(doc){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['25']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['164']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['165']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['77'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['166']++;doc=doc?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['78'][0]++,(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['79'][0]++,doc._node)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['79'][1]++,doc)):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['78'][1]++,node[OWNER_DOCUMENT]);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['167']++;if(doc.documentElement){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['80'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['168']++;return Y_DOM.contains(doc.documentElement,node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['80'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['77'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['169']++;return false;},getById:function(id){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['26']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['170']++;var node=this._node,ret=Y_DOM.byId(id,node[OWNER_DOCUMENT]);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['171']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['82'][0]++,ret)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['82'][1]++,Y_DOM.contains(node,ret))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['81'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['172']++;ret=Y.one(ret);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['81'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['173']++;ret=null;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['174']++;return ret;},ancestor:function(fn,testSelf,stopFn){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['27']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['175']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['84'][0]++,arguments.length===2)&&((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['84'][1]++,typeof testSelf=='string')||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['84'][2]++,typeof testSelf=='function'))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['83'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['176']++;stopFn=testSelf;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['83'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['177']++;return Y.one(Y_DOM.ancestor(this._node,_wrapFn(fn),testSelf,_wrapFn(stopFn)));},ancestors:function(fn,testSelf,stopFn){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['28']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['178']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['86'][0]++,arguments.length===2)&&((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['86'][1]++,typeof testSelf=='string')||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['86'][2]++,typeof testSelf=='function'))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['85'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['179']++;stopFn=testSelf;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['85'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['180']++;return Y.all(Y_DOM.ancestors(this._node,_wrapFn(fn),testSelf,_wrapFn(stopFn)));},previous:function(fn,all){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['29']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['181']++;return Y.one(Y_DOM.elementByAxis(this._node,'previousSibling',_wrapFn(fn),all));},next:function(fn,all){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['30']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['182']++;return Y.one(Y_DOM.elementByAxis(this._node,'nextSibling',_wrapFn(fn),all));},siblings:function(fn){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['31']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['183']++;return Y.all(Y_DOM.siblings(this._node,_wrapFn(fn)));},one:function(selector){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['32']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['184']++;return Y.one(Y.Selector.query(selector,this._node,true));},all:function(selector){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['33']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['185']++;var nodelist;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['186']++;if(this._node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['87'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['187']++;nodelist=Y.all(Y.Selector.query(selector,this._node));__cov_LGqepiXuzGEZpz3IhlW0rQ.s['188']++;nodelist._query=selector;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['189']++;nodelist._queryRoot=this._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['87'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['190']++;return(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['88'][0]++,nodelist)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['88'][1]++,Y.all([]));},test:function(selector){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['34']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['191']++;return Y.Selector.test(this._node,selector);},remove:function(destroy){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['35']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['192']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['193']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['90'][0]++,node)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['90'][1]++,node.parentNode)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['89'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['194']++;node.parentNode.removeChild(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['89'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['195']++;if(destroy){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['91'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['196']++;this.destroy();}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['91'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['197']++;return this;},replace:function(newNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['36']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['198']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['199']++;if(typeof newNode=='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['92'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['200']++;newNode=Y_Node.create(newNode);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['92'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['201']++;node.parentNode.replaceChild(Y_Node.getDOMNode(newNode),node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['202']++;return this;},replaceChild:function(node,refNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['37']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['203']++;if(typeof node=='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['93'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['204']++;node=Y_DOM.create(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['93'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['205']++;return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node),Y_Node.getDOMNode(refNode)));},destroy:function(recursive){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['38']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['206']++;var UID=Y.config.doc.uniqueID?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['94'][0]++,'uniqueID'):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['94'][1]++,'_yuid'),instance;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['207']++;this.purge();__cov_LGqepiXuzGEZpz3IhlW0rQ.s['208']++;if(this.unplug){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['95'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['209']++;this.unplug();}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['95'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['210']++;this.clearData();__cov_LGqepiXuzGEZpz3IhlW0rQ.s['211']++;if(recursive){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['96'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['212']++;Y.NodeList.each(this.all('*'),function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['39']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['213']++;instance=Y_Node._instances[node[UID]];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['214']++;if(instance){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['97'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['215']++;instance.destroy();}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['97'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['216']++;Y.Event.purgeElement(node);}});}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['96'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['217']++;this._node=null;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['218']++;this._stateProxy=null;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['219']++;delete Y_Node._instances[this._yuid];},invoke:function(method,a,b,c,d,e){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['40']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['220']++;var node=this._node,ret;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['221']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['99'][0]++,a)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['99'][1]++,a._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['98'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['222']++;a=a._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['98'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['223']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['101'][0]++,b)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['101'][1]++,b._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['100'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['224']++;b=b._node;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['100'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['225']++;ret=node[method](a,b,c,d,e);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['226']++;return Y_Node.scrubVal(ret,this);},swap:Y.config.doc.documentElement.swapNode?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['102'][0]++,function(otherNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['41']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['227']++;this._node.swapNode(Y_Node.getDOMNode(otherNode));}):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['102'][1]++,function(otherNode){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['42']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['228']++;otherNode=Y_Node.getDOMNode(otherNode);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['229']++;var node=this._node,parent=otherNode.parentNode,nextSibling=otherNode.nextSibling;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['230']++;if(nextSibling===node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['103'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['231']++;parent.insertBefore(node,otherNode);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['103'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['232']++;if(otherNode===node.nextSibling){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['104'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['233']++;parent.insertBefore(otherNode,node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['104'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['234']++;node.parentNode.replaceChild(otherNode,node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['235']++;Y_DOM.addHTML(parent,node,nextSibling);}}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['236']++;return this;}),hasMethod:function(method){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['43']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['237']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['238']++;return!!((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['105'][0]++,node)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['105'][1]++,method in node)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['105'][2]++,typeof node[method]!='unknown')&&((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['105'][3]++,typeof node[method]=='function')||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['105'][4]++,String(node[method]).indexOf('function')===1)));},isFragment:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['44']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['239']++;return this.get('nodeType')===11;},empty:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['45']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['240']++;this.get('childNodes').remove().destroy(true);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['241']++;return this;},getDOMNode:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['46']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['242']++;return this._node;}},true);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['243']++;Y.Node=Y_Node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['244']++;Y.one=Y_Node.one;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['245']++;var NodeList=function(nodes){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['47']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['246']++;var tmp=[];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['247']++;if(nodes){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['106'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['248']++;if(typeof nodes==='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['107'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['249']++;this._query=nodes;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['250']++;nodes=Y.Selector.query(nodes);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['107'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['251']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['109'][0]++,nodes.nodeType)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['109'][1]++,Y_DOM.isWindow(nodes))){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['108'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['252']++;nodes=[nodes];}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['108'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['253']++;if(nodes._node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['110'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['254']++;nodes=[nodes._node];}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['110'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['255']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['112'][0]++,nodes[0])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['112'][1]++,nodes[0]._node)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['111'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['256']++;Y.Array.each(nodes,function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['48']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['257']++;if(node._node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['113'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['258']++;tmp.push(node._node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['113'][1]++;}});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['259']++;nodes=tmp;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['111'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['260']++;nodes=Y.Array(nodes,0,true);}}}}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['106'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['261']++;this._nodes=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['114'][0]++,nodes)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['114'][1]++,[]);};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['262']++;NodeList.NAME='NodeList';__cov_LGqepiXuzGEZpz3IhlW0rQ.s['263']++;NodeList.getDOMNodes=function(nodelist){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['49']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['264']++;return(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['116'][0]++,nodelist)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['116'][1]++,nodelist._nodes)?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['115'][0]++,nodelist._nodes):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['115'][1]++,nodelist);};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['265']++;NodeList.each=function(instance,fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['50']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['266']++;var nodes=instance._nodes;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['267']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['118'][0]++,nodes)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['118'][1]++,nodes.length)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['117'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['268']++;Y.Array.each(nodes,fn,(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['119'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['119'][1]++,instance));}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['117'][1]++;}};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['269']++;NodeList.addMethod=function(name,fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['51']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['270']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['121'][0]++,name)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['121'][1]++,fn)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['120'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['271']++;NodeList.prototype[name]=function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['52']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['272']++;var ret=[],args=arguments;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['273']++;Y.Array.each(this._nodes,function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['53']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['274']++;var UID=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['123'][0]++,node.uniqueID)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['123'][1]++,node.nodeType!==9)?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['122'][0]++,'uniqueID'):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['122'][1]++,'_yuid'),instance=Y.Node._instances[node[UID]],ctx,result;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['275']++;if(!instance){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['124'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['276']++;instance=NodeList._getTempNode(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['124'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['277']++;ctx=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['125'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['125'][1]++,instance);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['278']++;result=fn.apply(ctx,args);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['279']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['127'][0]++,result!==undefined)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['127'][1]++,result!==instance)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['126'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['280']++;ret[ret.length]=result;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['126'][1]++;}});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['281']++;return ret.length?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['128'][0]++,ret):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['128'][1]++,this);};}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['120'][1]++;}};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['282']++;NodeList.importMethod=function(host,name,altName){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['54']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['283']++;if(typeof name==='string'){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['129'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['284']++;altName=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['130'][0]++,altName)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['130'][1]++,name);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['285']++;NodeList.addMethod(name,host[name]);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['129'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['286']++;Y.Array.each(name,function(n){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['55']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['287']++;NodeList.importMethod(host,n);});}};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['288']++;NodeList._getTempNode=function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['56']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['289']++;var tmp=NodeList._tempNode;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['290']++;if(!tmp){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['131'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['291']++;tmp=Y.Node.create('<div></div>');__cov_LGqepiXuzGEZpz3IhlW0rQ.s['292']++;NodeList._tempNode=tmp;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['131'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['293']++;tmp._node=node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['294']++;tmp._stateProxy=node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['295']++;return tmp;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['296']++;Y.mix(NodeList.prototype,{_invoke:function(method,args,getter){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['57']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['297']++;var ret=getter?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['132'][0]++,[]):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['132'][1]++,this);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['298']++;this.each(function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['58']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['299']++;var val=node[method].apply(node,args);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['300']++;if(getter){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['133'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['301']++;ret.push(val);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['133'][1]++;}});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['302']++;return ret;},item:function(index){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['59']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['303']++;return Y.one(((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['134'][0]++,this._nodes)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['134'][1]++,[]))[index]);},each:function(fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['60']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['304']++;var instance=this;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['305']++;Y.Array.each(this._nodes,function(node,index){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['61']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['306']++;node=Y.one(node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['307']++;return fn.call((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['135'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['135'][1]++,node),node,index,instance);});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['308']++;return instance;},batch:function(fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['62']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['309']++;var nodelist=this;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['310']++;Y.Array.each(this._nodes,function(node,index){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['63']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['311']++;var instance=Y.Node._instances[node[UID]];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['312']++;if(!instance){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['136'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['313']++;instance=NodeList._getTempNode(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['136'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['314']++;return fn.call((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['137'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['137'][1]++,instance),instance,index,nodelist);});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['315']++;return nodelist;},some:function(fn,context){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['64']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['316']++;var instance=this;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['317']++;return Y.Array.some(this._nodes,function(node,index){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['65']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['318']++;node=Y.one(node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['319']++;context=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['138'][0]++,context)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['138'][1]++,node);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['320']++;return fn.call(context,node,index,instance);});},toFrag:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['66']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['321']++;return Y.one(Y.DOM._nl2frag(this._nodes));},indexOf:function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['67']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['322']++;return Y.Array.indexOf(this._nodes,Y.Node.getDOMNode(node));},filter:function(selector){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['68']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['323']++;return Y.all(Y.Selector.filter(this._nodes,selector));},modulus:function(n,r){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['69']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['324']++;r=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['139'][0]++,r)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['139'][1]++,0);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['325']++;var nodes=[];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['326']++;NodeList.each(this,function(node,i){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['70']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['327']++;if(i%n===r){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['140'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['328']++;nodes.push(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['140'][1]++;}});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['329']++;return Y.all(nodes);},odd:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['71']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['330']++;return this.modulus(2,1);},even:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['72']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['331']++;return this.modulus(2);},destructor:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['73']++;},refresh:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['74']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['332']++;var doc,nodes=this._nodes,query=this._query,root=this._queryRoot;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['333']++;if(query){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['141'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['334']++;if(!root){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['142'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['335']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['144'][0]++,nodes)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['144'][1]++,nodes[0])&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['144'][2]++,nodes[0].ownerDocument)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['143'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['336']++;root=nodes[0].ownerDocument;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['143'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['142'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['337']++;this._nodes=Y.Selector.query(query,root);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['141'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['338']++;return this;},size:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['75']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['339']++;return this._nodes.length;},isEmpty:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['76']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['340']++;return this._nodes.length<1;},toString:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['77']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['341']++;var str='',errorMsg=this[UID]+': not bound to any nodes',nodes=this._nodes,node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['342']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['146'][0]++,nodes)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['146'][1]++,nodes[0])){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['145'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['343']++;node=nodes[0];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['344']++;str+=node[NODE_NAME];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['345']++;if(node.id){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['147'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['346']++;str+='#'+node.id;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['147'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['347']++;if(node.className){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['148'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['348']++;str+='.'+node.className.replace(' ','.');}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['148'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['349']++;if(nodes.length>1){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['149'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['350']++;str+='...['+nodes.length+' items]';}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['149'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['145'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['351']++;return(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['150'][0]++,str)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['150'][1]++,errorMsg);},getDOMNodes:function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['78']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['352']++;return this._nodes;}},true);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['353']++;NodeList.importMethod(Y.Node.prototype,['destroy','empty','remove','set']);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['354']++;NodeList.prototype.get=function(attr){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['79']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['355']++;var ret=[],nodes=this._nodes,isNodeList=false,getTemp=NodeList._getTempNode,instance,val;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['356']++;if(nodes[0]){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['151'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['357']++;instance=(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['152'][0]++,Y.Node._instances[nodes[0]._yuid])||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['152'][1]++,getTemp(nodes[0]));__cov_LGqepiXuzGEZpz3IhlW0rQ.s['358']++;val=instance._get(attr);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['359']++;if((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['154'][0]++,val)&&(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['154'][1]++,val.nodeType)){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['153'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['360']++;isNodeList=true;}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['153'][1]++;}}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['151'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['361']++;Y.Array.each(nodes,function(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['80']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['362']++;instance=Y.Node._instances[node._yuid];__cov_LGqepiXuzGEZpz3IhlW0rQ.s['363']++;if(!instance){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['155'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['364']++;instance=getTemp(node);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['155'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['365']++;val=instance._get(attr);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['366']++;if(!isNodeList){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['156'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['367']++;val=Y.Node.scrubVal(val,instance);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['156'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['368']++;ret.push(val);});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['369']++;return isNodeList?(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['157'][0]++,Y.all(ret)):(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['157'][1]++,ret);};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['370']++;Y.NodeList=NodeList;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['371']++;Y.all=function(nodes){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['81']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['372']++;return new NodeList(nodes);};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['373']++;Y.Node.all=Y.all;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['374']++;var Y_NodeList=Y.NodeList,ArrayProto=Array.prototype,ArrayMethods={'concat':1,'pop':0,'push':0,'shift':0,'slice':1,'splice':1,'unshift':0};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['375']++;Y.Object.each(ArrayMethods,function(returnNodeList,name){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['82']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['376']++;Y_NodeList.prototype[name]=function(){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['83']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['377']++;var args=[],i=0,arg,ret;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['378']++;while(typeof(arg=arguments[i++])!='undefined'){__cov_LGqepiXuzGEZpz3IhlW0rQ.s['379']++;args.push((__cov_LGqepiXuzGEZpz3IhlW0rQ.b['158'][0]++,arg._node)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['158'][1]++,arg._nodes)||(__cov_LGqepiXuzGEZpz3IhlW0rQ.b['158'][2]++,arg));}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['380']++;ret=ArrayProto[name].apply(this._nodes,args);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['381']++;if(returnNodeList){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['159'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['382']++;ret=Y.all(ret);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['159'][1]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['383']++;ret=Y.Node.scrubVal(ret);}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['384']++;return ret;};});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['385']++;Y.Array.each(['removeChild','hasChildNodes','cloneNode','hasAttribute','scrollIntoView','getElementsByTagName','focus','blur','submit','reset','select','createCaption'],function(method){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['84']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['386']++;Y.Node.prototype[method]=function(arg1,arg2,arg3){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['85']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['387']++;var ret=this.invoke(method,arg1,arg2,arg3);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['388']++;return ret;};});__cov_LGqepiXuzGEZpz3IhlW0rQ.s['389']++;Y.Node.prototype.removeAttribute=function(attr){__cov_LGqepiXuzGEZpz3IhlW0rQ.f['86']++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['390']++;var node=this._node;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['391']++;if(node){__cov_LGqepiXuzGEZpz3IhlW0rQ.b['160'][0]++;__cov_LGqepiXuzGEZpz3IhlW0rQ.s['392']++;node.removeAttribute(attr,0);}else{__cov_LGqepiXuzGEZpz3IhlW0rQ.b['160'][1]++;}__cov_LGqepiXuzGEZpz3IhlW0rQ.s['393']++;return this;};__cov_LGqepiXuzGEZpz3IhlW0rQ.s['394']++;Y.Node.importMethod(Y.DOM,['contains','setAttribute','getAttribute','wrap','unwrap','generateID']);__cov_LGqepiXuzGEZpz3IhlW0rQ.s['395']++;Y.NodeList.importMethod(Y.Node.prototype,['getAttribute','setAttribute','removeAttribute','unwrap','wrap','generateID']);},'3.17.1',{'requires':['dom-core','selector']});
WebReflection/cdnjs
ajax/libs/yui/3.17.1/node-core/node-core-coverage.js
JavaScript
mit
172,385
"use strict";angular.module("ngLocale",[],["$provide",function(e){function r(e){e+="";var r=e.indexOf(".");return r==-1?0:e.length-r-1}function a(e,a){var n=a;void 0===n&&(n=Math.min(r(e),3));var M=Math.pow(10,n),u=(e*M|0)%M;return{v:n,f:u}}var n={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, dd MMMM y",longDate:"dd MMMM y",medium:"dd MMM y h:mm:ss a",mediumDate:"dd MMM y",mediumTime:"h:mm:ss a",short:"y/MM/dd h:mm a",shortDate:"y/MM/dd",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"R",DECIMAL_SEP:",",GROUP_SEP:" ",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-za",localeID:"en_ZA",pluralCat:function(e,r){var M=0|e,u=a(e,r);return 1==M&&0==u.v?n.ONE:n.OTHER}})}]); //# sourceMappingURL=angular-locale_en-za.min.js.map
redmunds/cdnjs
ajax/libs/angular-i18n/1.6.1/angular-locale_en-za.min.js
JavaScript
mit
1,533
"use strict";angular.module("ngLocale",[],["$provide",function(u){function a(u){u+="";var a=u.indexOf(".");return a==-1?0:u.length-a-1}function t(u,t){var e=t;void 0===e&&(e=Math.min(a(u),3));var i=Math.pow(10,e),n=(u*i|0)%i;return{v:e,f:n}}var e={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};u.value("$locale",{DATETIME_FORMATS:{AMPMS:["ap.","ip."],DAY:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ERANAMES:["ennen Kristuksen syntymää","jälkeen Kristuksen syntymän"],ERAS:["eKr.","jKr."],FIRSTDAYOFWEEK:0,MONTH:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],SHORTDAY:["su","ma","ti","ke","to","pe","la"],SHORTMONTH:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],STANDALONEMONTH:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],WEEKENDRANGE:[5,6],fullDate:"cccc d. MMMM y",longDate:"d. MMMM y",medium:"d.M.y H.mm.ss",mediumDate:"d.M.y",mediumTime:"H.mm.ss",short:"d.M.y H.mm",shortDate:"d.M.y",shortTime:"H.mm"},NUMBER_FORMATS:{CURRENCY_SYM:"€",DECIMAL_SEP:",",GROUP_SEP:" ",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:" ¤",posPre:"",posSuf:" ¤"}]},id:"fi",localeID:"fi",pluralCat:function(u,a){var i=0|u,n=t(u,a);return 1==i&&0==n.v?e.ONE:e.OTHER}})}]); //# sourceMappingURL=angular-locale_fi.min.js.map
pvnr0082t/cdnjs
ajax/libs/angular.js/1.4.14/i18n/angular-locale_fi.min.js
JavaScript
mit
1,715
"use strict";angular.module("ngLocale",[],["$provide",function(e){function i(e){e+="";var i=e.indexOf(".");return i==-1?0:e.length-i-1}function a(e,a){var r=a;void 0===r&&(r=Math.min(i(e),3));var n=Math.pow(10,r),t=(e*n|0)%n;return{v:r,f:t}}var r={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ERANAMES:["p.n.e.","n.e."],ERAS:["p.n.e.","n.e."],FIRSTDAYOFWEEK:0,MONTH:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],SHORTDAY:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],SHORTMONTH:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],STANDALONEMONTH:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],WEEKENDRANGE:[5,6],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"dd.MM.y HH:mm:ss",mediumDate:"dd.MM.y",mediumTime:"HH:mm:ss",short:"dd.MM.y HH:mm",shortDate:"dd.MM.y",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"zł",DECIMAL_SEP:",",GROUP_SEP:" ",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-",negSuf:" ¤",posPre:"",posSuf:" ¤"}]},id:"pl-pl",localeID:"pl_PL",pluralCat:function(e,i){var n=0|e,t=a(e,i);return 1==n&&0==t.v?r.ONE:0==t.v&&n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r.FEW:0==t.v&&1!=n&&n%10>=0&&n%10<=1||0==t.v&&n%10>=5&&n%10<=9||0==t.v&&n%100>=12&&n%100<=14?r.MANY:r.OTHER}})}]); //# sourceMappingURL=angular-locale_pl-pl.min.js.map
iwdmb/cdnjs
ajax/libs/angular-i18n/1.6.0-rc.1/angular-locale_pl-pl.min.js
JavaScript
mit
1,715
/* YUI 3.17.1 (build 0eb5a52) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('node-menunav', function (Y, NAME) { /** * <p>The MenuNav Node Plugin makes it easy to transform existing list-based * markup into traditional, drop down navigational menus that are both accessible * and easy to customize, and only require a small set of dependencies.</p> * * * <p>To use the MenuNav Node Plugin, simply pass a reference to the plugin to a * Node instance's <code>plug</code> method.</p> * * <p> * <code> * &#60;script type="text/javascript"&#62; <br> * <br> * // Call the "use" method, passing in "node-menunav". This will <br> * // load the script and CSS for the MenuNav Node Plugin and all of <br> * // the required dependencies. <br> * <br> * YUI().use("node-menunav", function(Y) { <br> * <br> * // Use the "contentready" event to initialize the menu when <br> * // the subtree of element representing the root menu <br> * // (&#60;div id="menu-1"&#62;) is ready to be scripted. <br> * <br> * Y.on("contentready", function () { <br> * <br> * // The scope of the callback will be a Node instance <br> * // representing the root menu (&#60;div id="menu-1"&#62;). <br> * // Therefore, since "this" represents a Node instance, it <br> * // is possible to just call "this.plug" passing in a <br> * // reference to the MenuNav Node Plugin. <br> * <br> * this.plug(Y.Plugin.NodeMenuNav); <br> * <br> * }, "#menu-1"); <br> * <br> * }); <br> * <br> * &#60;/script&#62; <br> * </code> * </p> * * <p>The MenuNav Node Plugin has several configuration properties that can be * set via an object literal that is passed as a second argument to a Node * instance's <code>plug</code> method. * </p> * * <p> * <code> * &#60;script type="text/javascript"&#62; <br> * <br> * // Call the "use" method, passing in "node-menunav". This will <br> * // load the script and CSS for the MenuNav Node Plugin and all of <br> * // the required dependencies. <br> * <br> * YUI().use("node-menunav", function(Y) { <br> * <br> * // Use the "contentready" event to initialize the menu when <br> * // the subtree of element representing the root menu <br> * // (&#60;div id="menu-1"&#62;) is ready to be scripted. <br> * <br> * Y.on("contentready", function () { <br> * <br> * // The scope of the callback will be a Node instance <br> * // representing the root menu (&#60;div id="menu-1"&#62;). <br> * // Therefore, since "this" represents a Node instance, it <br> * // is possible to just call "this.plug" passing in a <br> * // reference to the MenuNav Node Plugin. <br> * <br> * this.plug(Y.Plugin.NodeMenuNav, { mouseOutHideDelay: 1000 }); * <br><br> * }, "#menu-1"); <br> * <br> * }); <br> * <br> * &#60;/script&#62; <br> * </code> * </p> * DEPRECATED. The MenuNav Node Plugin has been deprecated as of YUI 3.9.0. This module will be removed from the library in a future version. If you require functionality similar to the one provided by this module, consider taking a look at the various modules in the YUI Gallery <http://yuilibrary.com/gallery/>. @module node-menunav @deprecated 3.9.0 */ // Util shortcuts var UA = Y.UA, later = Y.later, getClassName = Y.ClassNameManager.getClassName, // Frequently used strings MENU = "menu", MENUITEM = "menuitem", HIDDEN = "hidden", PARENT_NODE = "parentNode", CHILDREN = "children", OFFSET_HEIGHT = "offsetHeight", OFFSET_WIDTH = "offsetWidth", PX = "px", ID = "id", PERIOD = ".", HANDLED_MOUSEOUT = "handledMouseOut", HANDLED_MOUSEOVER = "handledMouseOver", ACTIVE = "active", LABEL = "label", LOWERCASE_A = "a", MOUSEDOWN = "mousedown", KEYDOWN = "keydown", CLICK = "click", EMPTY_STRING = "", FIRST_OF_TYPE = "first-of-type", ROLE = "role", PRESENTATION = "presentation", DESCENDANTS = "descendants", UI = "UI", ACTIVE_DESCENDANT = "activeDescendant", USE_ARIA = "useARIA", ARIA_HIDDEN = "aria-hidden", CONTENT = "content", HOST = "host", ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + "Change", // Attribute keys AUTO_SUBMENU_DISPLAY = "autoSubmenuDisplay", MOUSEOUT_HIDE_DELAY = "mouseOutHideDelay", // CSS class names CSS_MENU = getClassName(MENU), CSS_MENU_HIDDEN = getClassName(MENU, HIDDEN), CSS_MENU_HORIZONTAL = getClassName(MENU, "horizontal"), CSS_MENU_LABEL = getClassName(MENU, LABEL), CSS_MENU_LABEL_ACTIVE = getClassName(MENU, LABEL, ACTIVE), CSS_MENU_LABEL_MENUVISIBLE = getClassName(MENU, LABEL, (MENU + "visible")), CSS_MENUITEM = getClassName(MENUITEM), CSS_MENUITEM_ACTIVE = getClassName(MENUITEM, ACTIVE), // CSS selectors MENU_SELECTOR = PERIOD + CSS_MENU, MENU_TOGGLE_SELECTOR = (PERIOD + getClassName(MENU, "toggle")), MENU_CONTENT_SELECTOR = PERIOD + getClassName(MENU, CONTENT), MENU_LABEL_SELECTOR = PERIOD + CSS_MENU_LABEL, STANDARD_QUERY = ">" + MENU_CONTENT_SELECTOR + ">ul>li>a", EXTENDED_QUERY = ">" + MENU_CONTENT_SELECTOR + ">ul>li>" + MENU_LABEL_SELECTOR + ">a:first-child"; // Utility functions var getPreviousSibling = function (node) { var oPrevious = node.previous(), oChildren; if (!oPrevious) { oChildren = node.get(PARENT_NODE).get(CHILDREN); oPrevious = oChildren.item(oChildren.size() - 1); } return oPrevious; }; var getNextSibling = function (node) { var oNext = node.next(); if (!oNext) { oNext = node.get(PARENT_NODE).get(CHILDREN).item(0); } return oNext; }; var isAnchor = function (node) { var bReturnVal = false; if (node) { bReturnVal = node.get("nodeName").toLowerCase() === LOWERCASE_A; } return bReturnVal; }; var isMenuItem = function (node) { return node.hasClass(CSS_MENUITEM); }; var isMenuLabel = function (node) { return node.hasClass(CSS_MENU_LABEL); }; var isHorizontalMenu = function (menu) { return menu.hasClass(CSS_MENU_HORIZONTAL); }; var hasVisibleSubmenu = function (menuLabel) { return menuLabel.hasClass(CSS_MENU_LABEL_MENUVISIBLE); }; var getItemAnchor = function (node) { return isAnchor(node) ? node : node.one(LOWERCASE_A); }; var getNodeWithClass = function (node, className, searchAncestors) { var oItem; if (node) { if (node.hasClass(className)) { oItem = node; } if (!oItem && searchAncestors) { oItem = node.ancestor((PERIOD + className)); } } return oItem; }; var getParentMenu = function (node) { return node.ancestor(MENU_SELECTOR); }; var getMenu = function (node, searchAncestors) { return getNodeWithClass(node, CSS_MENU, searchAncestors); }; var getMenuItem = function (node, searchAncestors) { var oItem; if (node) { oItem = getNodeWithClass(node, CSS_MENUITEM, searchAncestors); } return oItem; }; var getMenuLabel = function (node, searchAncestors) { var oItem; if (node) { if (searchAncestors) { oItem = getNodeWithClass(node, CSS_MENU_LABEL, searchAncestors); } else { oItem = getNodeWithClass(node, CSS_MENU_LABEL) || node.one((PERIOD + CSS_MENU_LABEL)); } } return oItem; }; var getItem = function (node, searchAncestors) { var oItem; if (node) { oItem = getMenuItem(node, searchAncestors) || getMenuLabel(node, searchAncestors); } return oItem; }; var getFirstItem = function (menu) { return getItem(menu.one("li")); }; var getActiveClass = function (node) { return isMenuItem(node) ? CSS_MENUITEM_ACTIVE : CSS_MENU_LABEL_ACTIVE; }; var handleMouseOverForNode = function (node, target) { return node && !node[HANDLED_MOUSEOVER] && (node.compareTo(target) || node.contains(target)); }; var handleMouseOutForNode = function (node, relatedTarget) { return node && !node[HANDLED_MOUSEOUT] && (!node.compareTo(relatedTarget) && !node.contains(relatedTarget)); }; /** * The NodeMenuNav class is a plugin for a Node instance. The class is used via * the <a href="Node.html#method_plug"><code>plug</code></a> method of Node and * should not be instantiated directly. * @namespace plugin * @class NodeMenuNav */ var NodeMenuNav = function () { NodeMenuNav.superclass.constructor.apply(this, arguments); }; NodeMenuNav.NAME = "nodeMenuNav"; NodeMenuNav.NS = "menuNav"; /** * @property SHIM_TEMPLATE_TITLE * @description String representing the value for the <code>title</code> * attribute for the shim used to prevent <code>&#60;select&#62;</code> elements * from poking through menus in IE 6. * @default "Menu Stacking Shim" * @type String */ NodeMenuNav.SHIM_TEMPLATE_TITLE = "Menu Stacking Shim"; /** * @property SHIM_TEMPLATE * @description String representing the HTML used to create the * <code>&#60;iframe&#62;</code> shim used to prevent * <code>&#60;select&#62;</code> elements from poking through menus in IE 6. * @default &#34;&#60;iframe frameborder=&#34;0&#34; tabindex=&#34;-1&#34; * class=&#34;yui-shim&#34; title=&#34;Menu Stacking Shim&#34; * src=&#34;javascript:false;&#34;&#62;&#60;/iframe&#62;&#34; * @type String */ // <iframe> shim notes: // // 1) Need to set the "frameBorder" property to 0 to suppress the default // <iframe> border in IE. (Setting the CSS "border" property alone doesn't // suppress it.) // // 2) The "src" attribute of the <iframe> is set to "javascript:false;" so // that it won't load a page inside it, preventing the secure/nonsecure // warning in IE when using HTTPS. // // 3) Since the role of the <iframe> shim is completely presentational, its // "tabindex" attribute is set to "-1" and its title attribute is set to // "Menu Stacking Shim". Both strategies help users of screen readers to // avoid mistakenly interacting with the <iframe> shim. NodeMenuNav.SHIM_TEMPLATE = '<iframe frameborder="0" tabindex="-1" class="' + getClassName("shim") + '" title="' + NodeMenuNav.SHIM_TEMPLATE_TITLE + '" src="javascript:false;"></iframe>'; NodeMenuNav.ATTRS = { /** * Boolean indicating if use of the WAI-ARIA Roles and States should be * enabled for the menu. * * @attribute useARIA * @readOnly * @writeOnce * @default true * @type boolean */ useARIA: { value: true, writeOnce: true, lazyAdd: false, setter: function (value) { var oMenu = this.get(HOST), oMenuLabel, oMenuToggle, oSubmenu, sID; if (value) { oMenu.set(ROLE, MENU); oMenu.all("ul,li," + MENU_CONTENT_SELECTOR).set(ROLE, PRESENTATION); oMenu.all((PERIOD + getClassName(MENUITEM, CONTENT))).set(ROLE, MENUITEM); oMenu.all((PERIOD + CSS_MENU_LABEL)).each(function (node) { oMenuLabel = node; oMenuToggle = node.one(MENU_TOGGLE_SELECTOR); if (oMenuToggle) { oMenuToggle.set(ROLE, PRESENTATION); oMenuLabel = oMenuToggle.previous(); } oMenuLabel.set(ROLE, MENUITEM); oMenuLabel.set("aria-haspopup", true); oSubmenu = node.next(); if (oSubmenu) { oSubmenu.set(ROLE, MENU); oMenuLabel = oSubmenu.previous(); oMenuToggle = oMenuLabel.one(MENU_TOGGLE_SELECTOR); if (oMenuToggle) { oMenuLabel = oMenuToggle; } sID = Y.stamp(oMenuLabel); if (!oMenuLabel.get(ID)) { oMenuLabel.set(ID, sID); } oSubmenu.set("aria-labelledby", sID); oSubmenu.set(ARIA_HIDDEN, true); } }); } } }, /** * Boolean indicating if submenus are automatically made visible when the * user mouses over the menu's items. * * @attribute autoSubmenuDisplay * @readOnly * @writeOnce * @default true * @type boolean */ autoSubmenuDisplay: { value: true, writeOnce: true }, /** * Number indicating the time (in milliseconds) that should expire before a * submenu is made visible when the user mouses over the menu's label. * * @attribute submenuShowDelay * @readOnly * @writeOnce * @default 250 * @type Number */ submenuShowDelay: { value: 250, writeOnce: true }, /** * Number indicating the time (in milliseconds) that should expire before a * submenu is hidden when the user mouses out of a menu label heading in the * direction of a submenu. * * @attribute submenuHideDelay * @readOnly * @writeOnce * @default 250 * @type Number */ submenuHideDelay: { value: 250, writeOnce: true }, /** * Number indicating the time (in milliseconds) that should expire before a * submenu is hidden when the user mouses out of it. * * @attribute mouseOutHideDelay * @readOnly * @writeOnce * @default 750 * @type Number */ mouseOutHideDelay: { value: 750, writeOnce: true } }; Y.extend(NodeMenuNav, Y.Plugin.Base, { // Protected properties /** * @property _rootMenu * @description Node instance representing the root menu in the menu. * @default null * @protected * @type Node */ _rootMenu: null, /** * @property _activeItem * @description Node instance representing the menu's active descendent: * the menuitem or menu label the user is currently interacting with. * @default null * @protected * @type Node */ _activeItem: null, /** * @property _activeMenu * @description Node instance representing the menu that is the parent of * the menu's active descendent. * @default null * @protected * @type Node */ _activeMenu: null, /** * @property _hasFocus * @description Boolean indicating if the menu has focus. * @default false * @protected * @type Boolean */ _hasFocus: false, // In gecko-based browsers a mouseover and mouseout event will fire even // if a DOM element moves out from under the mouse without the user // actually moving the mouse. This bug affects NodeMenuNav because the // user can hit the Esc key to hide a menu, and if the mouse is over the // menu when the user presses Esc, the _onMenuMouseOut handler will be // called. To fix this bug the following flag (_blockMouseEvent) is used // to block the code in the _onMenuMouseOut handler from executing. /** * @property _blockMouseEvent * @description Boolean indicating whether or not to handle the * "mouseover" event. * @default false * @protected * @type Boolean */ _blockMouseEvent: false, /** * @property _currentMouseX * @description Number representing the current x coordinate of the mouse * inside the menu. * @default 0 * @protected * @type Number */ _currentMouseX: 0, /** * @property _movingToSubmenu * @description Boolean indicating if the mouse is moving from a menu * label to its corresponding submenu. * @default false * @protected * @type Boolean */ _movingToSubmenu: false, /** * @property _showSubmenuTimer * @description Timer used to show a submenu. * @default null * @protected * @type Object */ _showSubmenuTimer: null, /** * @property _hideSubmenuTimer * @description Timer used to hide a submenu. * @default null * @protected * @type Object */ _hideSubmenuTimer: null, /** * @property _hideAllSubmenusTimer * @description Timer used to hide a all submenus. * @default null * @protected * @type Object */ _hideAllSubmenusTimer: null, /** * @property _firstItem * @description Node instance representing the first item (menuitem or menu * label) in the root menu of a menu. * @default null * @protected * @type Node */ _firstItem: null, // Public methods initializer: function (config) { var menuNav = this, oRootMenu = this.get(HOST), aHandlers = [], oDoc; if (oRootMenu) { menuNav._rootMenu = oRootMenu; oRootMenu.all("ul:first-child").addClass(FIRST_OF_TYPE); // Hide all visible submenus oRootMenu.all(MENU_SELECTOR).addClass(CSS_MENU_HIDDEN); // Wire up all event handlers aHandlers.push(oRootMenu.on("mouseover", menuNav._onMouseOver, menuNav)); aHandlers.push(oRootMenu.on("mouseout", menuNav._onMouseOut, menuNav)); aHandlers.push(oRootMenu.on("mousemove", menuNav._onMouseMove, menuNav)); aHandlers.push(oRootMenu.on(MOUSEDOWN, menuNav._toggleSubmenuDisplay, menuNav)); aHandlers.push(Y.on("key", menuNav._toggleSubmenuDisplay, oRootMenu, "down:13", menuNav)); aHandlers.push(oRootMenu.on(CLICK, menuNav._toggleSubmenuDisplay, menuNav)); aHandlers.push(oRootMenu.on("keypress", menuNav._onKeyPress, menuNav)); aHandlers.push(oRootMenu.on(KEYDOWN, menuNav._onKeyDown, menuNav)); oDoc = oRootMenu.get("ownerDocument"); aHandlers.push(oDoc.on(MOUSEDOWN, menuNav._onDocMouseDown, menuNav)); aHandlers.push(oDoc.on("focus", menuNav._onDocFocus, menuNav)); this._eventHandlers = aHandlers; menuNav._initFocusManager(); } }, destructor: function () { var aHandlers = this._eventHandlers; if (aHandlers) { Y.Array.each(aHandlers, function (handle) { handle.detach(); }); this._eventHandlers = null; } this.get(HOST).unplug("focusManager"); }, // Protected methods /** * @method _isRoot * @description Returns a boolean indicating if the specified menu is the * root menu in the menu. * @protected * @param {Node} menu Node instance representing a menu. * @return {Boolean} Boolean indicating if the specified menu is the root * menu in the menu. */ _isRoot: function (menu) { return this._rootMenu.compareTo(menu); }, /** * @method _getTopmostSubmenu * @description Returns the topmost submenu of a submenu hierarchy. * @protected * @param {Node} menu Node instance representing a menu. * @return {Node} Node instance representing a menu. */ _getTopmostSubmenu: function (menu) { var menuNav = this, oMenu = getParentMenu(menu), returnVal; if (!oMenu) { returnVal = menu; } else if (menuNav._isRoot(oMenu)) { returnVal = menu; } else { returnVal = menuNav._getTopmostSubmenu(oMenu); } return returnVal; }, /** * @method _clearActiveItem * @description Clears the menu's active descendent. * @protected */ _clearActiveItem: function () { var menuNav = this, oActiveItem = menuNav._activeItem; if (oActiveItem) { oActiveItem.removeClass(getActiveClass(oActiveItem)); } menuNav._activeItem = null; }, /** * @method _setActiveItem * @description Sets the specified menuitem or menu label as the menu's * active descendent. * @protected * @param {Node} item Node instance representing a menuitem or menu label. */ _setActiveItem: function (item) { var menuNav = this; if (item) { menuNav._clearActiveItem(); item.addClass(getActiveClass(item)); menuNav._activeItem = item; } }, /** * @method _focusItem * @description Focuses the specified menuitem or menu label. * @protected * @param {Node} item Node instance representing a menuitem or menu label. */ _focusItem: function (item) { var menuNav = this, oMenu, oItem; if (item && menuNav._hasFocus) { oMenu = getParentMenu(item); oItem = getItemAnchor(item); if (oMenu && !oMenu.compareTo(menuNav._activeMenu)) { menuNav._activeMenu = oMenu; menuNav._initFocusManager(); } menuNav._focusManager.focus(oItem); } }, /** * @method _showMenu * @description Shows the specified menu. * @protected * @param {Node} menu Node instance representing a menu. */ _showMenu: function (menu) { var oParentMenu = getParentMenu(menu), oLI = menu.get(PARENT_NODE), aXY = oLI.getXY(); if (this.get(USE_ARIA)) { menu.set(ARIA_HIDDEN, false); } if (isHorizontalMenu(oParentMenu)) { aXY[1] = aXY[1] + oLI.get(OFFSET_HEIGHT); } else { aXY[0] = aXY[0] + oLI.get(OFFSET_WIDTH); } menu.setXY(aXY); if (UA.ie && UA.ie < 8) { if (UA.ie === 6 && !menu.hasIFrameShim) { menu.appendChild(Y.Node.create(NodeMenuNav.SHIM_TEMPLATE)); menu.hasIFrameShim = true; } // Clear previous values for height and width menu.setStyles({ height: EMPTY_STRING, width: EMPTY_STRING }); // Set the width and height of the menu's bounding box - this is // necessary for IE 6 so that the CSS for the <iframe> shim can // simply set the <iframe>'s width and height to 100% to ensure // that dimensions of an <iframe> shim are always sync'd to the // that of its parent menu. Specifying a width and height also // helps when positioning decorator elements (for creating effects // like rounded corners) inside a menu's bounding box in IE 7. menu.setStyles({ height: (menu.get(OFFSET_HEIGHT) + PX), width: (menu.get(OFFSET_WIDTH) + PX) }); } menu.previous().addClass(CSS_MENU_LABEL_MENUVISIBLE); menu.removeClass(CSS_MENU_HIDDEN); }, /** * @method _hideMenu * @description Hides the specified menu. * @protected * @param {Node} menu Node instance representing a menu. * @param {Boolean} activateAndFocusLabel Boolean indicating if the label * for the specified * menu should be focused and set as active. */ _hideMenu: function (menu, activateAndFocusLabel) { var menuNav = this, oLabel = menu.previous(), oActiveItem; oLabel.removeClass(CSS_MENU_LABEL_MENUVISIBLE); if (activateAndFocusLabel) { menuNav._focusItem(oLabel); menuNav._setActiveItem(oLabel); } oActiveItem = menu.one((PERIOD + CSS_MENUITEM_ACTIVE)); if (oActiveItem) { oActiveItem.removeClass(CSS_MENUITEM_ACTIVE); } // Clear the values for top and left that were set by the call to // "setXY" when the menu was shown so that the hidden position // specified in the core CSS file will take affect. menu.setStyles({ left: EMPTY_STRING, top: EMPTY_STRING }); menu.addClass(CSS_MENU_HIDDEN); if (menuNav.get(USE_ARIA)) { menu.set(ARIA_HIDDEN, true); } }, /** * @method _hideAllSubmenus * @description Hides all submenus of the specified menu. * @protected * @param {Node} menu Node instance representing a menu. */ _hideAllSubmenus: function (menu) { var menuNav = this; menu.all(MENU_SELECTOR).each(Y.bind(function (submenuNode) { menuNav._hideMenu(submenuNode); }, menuNav)); }, /** * @method _cancelShowSubmenuTimer * @description Cancels the timer used to show a submenu. * @protected */ _cancelShowSubmenuTimer: function () { var menuNav = this, oShowSubmenuTimer = menuNav._showSubmenuTimer; if (oShowSubmenuTimer) { oShowSubmenuTimer.cancel(); menuNav._showSubmenuTimer = null; } }, /** * @method _cancelHideSubmenuTimer * @description Cancels the timer used to hide a submenu. * @protected */ _cancelHideSubmenuTimer: function () { var menuNav = this, oHideSubmenuTimer = menuNav._hideSubmenuTimer; if (oHideSubmenuTimer) { oHideSubmenuTimer.cancel(); menuNav._hideSubmenuTimer = null; } }, /** * @method _initFocusManager * @description Initializes and updates the Focus Manager so that is is * always managing descendants of the active menu. * @protected */ _initFocusManager: function () { var menuNav = this, oRootMenu = menuNav._rootMenu, oMenu = menuNav._activeMenu || oRootMenu, sSelectorBase = menuNav._isRoot(oMenu) ? EMPTY_STRING : ("#" + oMenu.get("id")), oFocusManager = menuNav._focusManager, sKeysVal, sDescendantSelector, sQuery; if (isHorizontalMenu(oMenu)) { sDescendantSelector = sSelectorBase + STANDARD_QUERY + "," + sSelectorBase + EXTENDED_QUERY; sKeysVal = { next: "down:39", previous: "down:37" }; } else { sDescendantSelector = sSelectorBase + STANDARD_QUERY; sKeysVal = { next: "down:40", previous: "down:38" }; } if (!oFocusManager) { oRootMenu.plug(Y.Plugin.NodeFocusManager, { descendants: sDescendantSelector, keys: sKeysVal, circular: true }); oFocusManager = oRootMenu.focusManager; sQuery = "#" + oRootMenu.get("id") + MENU_SELECTOR + " a," + MENU_TOGGLE_SELECTOR; oRootMenu.all(sQuery).set("tabIndex", -1); oFocusManager.on(ACTIVE_DESCENDANT_CHANGE, this._onActiveDescendantChange, oFocusManager, this); oFocusManager.after(ACTIVE_DESCENDANT_CHANGE, this._afterActiveDescendantChange, oFocusManager, this); menuNav._focusManager = oFocusManager; } else { oFocusManager.set(ACTIVE_DESCENDANT, -1); oFocusManager.set(DESCENDANTS, sDescendantSelector); oFocusManager.set("keys", sKeysVal); } }, // Event handlers for discrete pieces of pieces of the menu /** * @method _onActiveDescendantChange * @description "activeDescendantChange" event handler for menu's * Focus Manager. * @protected * @param {Object} event Object representing the Attribute change event. * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance. */ _onActiveDescendantChange: function (event, menuNav) { if (event.src === UI && menuNav._activeMenu && !menuNav._movingToSubmenu) { menuNav._hideAllSubmenus(menuNav._activeMenu); } }, /** * @method _afterActiveDescendantChange * @description "activeDescendantChange" event handler for menu's * Focus Manager. * @protected * @param {Object} event Object representing the Attribute change event. * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance. */ _afterActiveDescendantChange: function (event, menuNav) { var oItem; if (event.src === UI) { oItem = getItem(this.get(DESCENDANTS).item(event.newVal), true); menuNav._setActiveItem(oItem); } }, /** * @method _onDocFocus * @description "focus" event handler for the owner document of the MenuNav. * @protected * @param {Object} event Object representing the DOM event. */ _onDocFocus: function (event) { var menuNav = this, oActiveItem = menuNav._activeItem, oTarget = event.target, oMenu; if (menuNav._rootMenu.contains(oTarget)) { // The menu has focus if (menuNav._hasFocus) { oMenu = getParentMenu(oTarget); // If the element that was focused is a descendant of the // root menu, but is in a submenu not currently being // managed by the Focus Manager, update the Focus Manager so // that it is now managing the submenu that is the parent of // the element that was focused. if (!menuNav._activeMenu.compareTo(oMenu)) { menuNav._activeMenu = oMenu; menuNav._initFocusManager(); menuNav._focusManager.set(ACTIVE_DESCENDANT, oTarget); menuNav._setActiveItem(getItem(oTarget, true)); } } else { // Initial focus // First time the menu has been focused, need to setup focused // state and established active active descendant menuNav._hasFocus = true; oActiveItem = getItem(oTarget, true); if (oActiveItem) { menuNav._setActiveItem(oActiveItem); } } } else { // The menu has lost focus menuNav._clearActiveItem(); menuNav._cancelShowSubmenuTimer(); menuNav._hideAllSubmenus(menuNav._rootMenu); menuNav._activeMenu = menuNav._rootMenu; menuNav._initFocusManager(); menuNav._focusManager.set(ACTIVE_DESCENDANT, 0); menuNav._hasFocus = false; } }, /** * @method _onMenuMouseOver * @description "mouseover" event handler for a menu. * @protected * @param {Node} menu Node instance representing a menu. * @param {Object} event Object representing the DOM event. */ _onMenuMouseOver: function (menu, event) { var menuNav = this, oHideAllSubmenusTimer = menuNav._hideAllSubmenusTimer; if (oHideAllSubmenusTimer) { oHideAllSubmenusTimer.cancel(); menuNav._hideAllSubmenusTimer = null; } menuNav._cancelHideSubmenuTimer(); // Need to update the FocusManager in advance of focus a new // Menu in order to avoid the FocusManager thinking that // it has lost focus if (menu && !menu.compareTo(menuNav._activeMenu)) { menuNav._activeMenu = menu; if (menuNav._hasFocus) { menuNav._initFocusManager(); } } if (menuNav._movingToSubmenu && isHorizontalMenu(menu)) { menuNav._movingToSubmenu = false; } }, /** * @method _hideAndFocusLabel * @description Hides all of the submenus of the root menu and focuses the * label of the topmost submenu * @protected */ _hideAndFocusLabel: function () { var menuNav = this, oActiveMenu = menuNav._activeMenu, oSubmenu; menuNav._hideAllSubmenus(menuNav._rootMenu); if (oActiveMenu) { // Focus the label element for the topmost submenu oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu); menuNav._focusItem(oSubmenu.previous()); } }, /** * @method _onMenuMouseOut * @description "mouseout" event handler for a menu. * @protected * @param {Node} menu Node instance representing a menu. * @param {Object} event Object representing the DOM event. */ _onMenuMouseOut: function (menu, event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, oRelatedTarget = event.relatedTarget, oActiveItem = menuNav._activeItem, oParentMenu, oMenu; if (oActiveMenu && !oActiveMenu.contains(oRelatedTarget)) { oParentMenu = getParentMenu(oActiveMenu); if (oParentMenu && !oParentMenu.contains(oRelatedTarget)) { if (menuNav.get(MOUSEOUT_HIDE_DELAY) > 0) { menuNav._cancelShowSubmenuTimer(); menuNav._hideAllSubmenusTimer = later(menuNav.get(MOUSEOUT_HIDE_DELAY), menuNav, menuNav._hideAndFocusLabel); } } else { if (oActiveItem) { oMenu = getParentMenu(oActiveItem); if (!menuNav._isRoot(oMenu)) { menuNav._focusItem(oMenu.previous()); } } } } }, /** * @method _onMenuLabelMouseOver * @description "mouseover" event handler for a menu label. * @protected * @param {Node} menuLabel Node instance representing a menu label. * @param {Object} event Object representing the DOM event. */ _onMenuLabelMouseOver: function (menuLabel, event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, bIsRoot = menuNav._isRoot(oActiveMenu), bUseAutoSubmenuDisplay = (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot), submenuShowDelay = menuNav.get("submenuShowDelay"), oSubmenu; var showSubmenu = function (delay) { menuNav._cancelHideSubmenuTimer(); menuNav._cancelShowSubmenuTimer(); if (!hasVisibleSubmenu(menuLabel)) { oSubmenu = menuLabel.next(); if (oSubmenu) { menuNav._hideAllSubmenus(oActiveMenu); menuNav._showSubmenuTimer = later(delay, menuNav, menuNav._showMenu, oSubmenu); } } }; menuNav._focusItem(menuLabel); menuNav._setActiveItem(menuLabel); if (bUseAutoSubmenuDisplay) { if (menuNav._movingToSubmenu) { // If the user is moving diagonally from a submenu to // another submenu and they then stop and pause on a // menu label for an amount of time equal to the amount of // time defined for the display of a submenu then show the // submenu immediately. // http://yuilibrary.com/projects/yui3/ticket/2528316 //Y.message("Pause path"); menuNav._hoverTimer = later(submenuShowDelay, menuNav, function () { showSubmenu(0); }); } else { showSubmenu(submenuShowDelay); } } }, /** * @method _onMenuLabelMouseOut * @description "mouseout" event handler for a menu label. * @protected * @param {Node} menuLabel Node instance representing a menu label. * @param {Object} event Object representing the DOM event. */ _onMenuLabelMouseOut: function (menuLabel, event) { var menuNav = this, bIsRoot = menuNav._isRoot(menuNav._activeMenu), bUseAutoSubmenuDisplay = (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot), oRelatedTarget = event.relatedTarget, oSubmenu = menuLabel.next(), hoverTimer = menuNav._hoverTimer; if (hoverTimer) { hoverTimer.cancel(); } menuNav._clearActiveItem(); if (bUseAutoSubmenuDisplay) { if (menuNav._movingToSubmenu && !menuNav._showSubmenuTimer && oSubmenu) { // If the mouse is moving diagonally toward the submenu and // another submenu isn't in the process of being displayed // (via a timer), then hide the submenu via a timer to give // the user some time to reach the submenu. menuNav._hideSubmenuTimer = later(menuNav.get("submenuHideDelay"), menuNav, menuNav._hideMenu, oSubmenu); } else if (!menuNav._movingToSubmenu && oSubmenu && (!oRelatedTarget || (oRelatedTarget && !oSubmenu.contains(oRelatedTarget) && !oRelatedTarget.compareTo(oSubmenu)))) { // If the mouse is not moving toward the submenu, cancel any // submenus that might be in the process of being displayed // (via a timer) and hide this submenu immediately. menuNav._cancelShowSubmenuTimer(); menuNav._hideMenu(oSubmenu); } } }, /** * @method _onMenuItemMouseOver * @description "mouseover" event handler for a menuitem. * @protected * @param {Node} menuItem Node instance representing a menuitem. * @param {Object} event Object representing the DOM event. */ _onMenuItemMouseOver: function (menuItem, event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, bIsRoot = menuNav._isRoot(oActiveMenu), bUseAutoSubmenuDisplay = (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot); menuNav._focusItem(menuItem); menuNav._setActiveItem(menuItem); if (bUseAutoSubmenuDisplay && !menuNav._movingToSubmenu) { menuNav._hideAllSubmenus(oActiveMenu); } }, /** * @method _onMenuItemMouseOut * @description "mouseout" event handler for a menuitem. * @protected * @param {Node} menuItem Node instance representing a menuitem. * @param {Object} event Object representing the DOM event. */ _onMenuItemMouseOut: function (menuItem, event) { this._clearActiveItem(); }, /** * @method _onVerticalMenuKeyDown * @description "keydown" event handler for vertical menus. * @protected * @param {Object} event Object representing the DOM event. */ _onVerticalMenuKeyDown: function (event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, oRootMenu = menuNav._rootMenu, oTarget = event.target, bPreventDefault = false, nKeyCode = event.keyCode, oSubmenu, oParentMenu, oLI, oItem; switch (nKeyCode) { case 37: // left arrow oParentMenu = getParentMenu(oActiveMenu); if (oParentMenu && isHorizontalMenu(oParentMenu)) { menuNav._hideMenu(oActiveMenu); oLI = getPreviousSibling(oActiveMenu.get(PARENT_NODE)); oItem = getItem(oLI); if (oItem) { if (isMenuLabel(oItem)) { // Menu label oSubmenu = oItem.next(); if (oSubmenu) { menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } else { menuNav._focusItem(oItem); menuNav._setActiveItem(oItem); } } else { // MenuItem menuNav._focusItem(oItem); menuNav._setActiveItem(oItem); } } } else if (!menuNav._isRoot(oActiveMenu)) { menuNav._hideMenu(oActiveMenu, true); } bPreventDefault = true; break; case 39: // right arrow if (isMenuLabel(oTarget)) { oSubmenu = oTarget.next(); if (oSubmenu) { menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } } else if (isHorizontalMenu(oRootMenu)) { oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu); oLI = getNextSibling(oSubmenu.get(PARENT_NODE)); oItem = getItem(oLI); menuNav._hideAllSubmenus(oRootMenu); if (oItem) { if (isMenuLabel(oItem)) { // Menu label oSubmenu = oItem.next(); if (oSubmenu) { menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } else { menuNav._focusItem(oItem); menuNav._setActiveItem(oItem); } } else { // MenuItem menuNav._focusItem(oItem); menuNav._setActiveItem(oItem); } } } bPreventDefault = true; break; } if (bPreventDefault) { // Prevent the browser from scrolling the window event.preventDefault(); } }, /** * @method _onHorizontalMenuKeyDown * @description "keydown" event handler for horizontal menus. * @protected * @param {Object} event Object representing the DOM event. */ _onHorizontalMenuKeyDown: function (event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, oTarget = event.target, oFocusedItem = getItem(oTarget, true), bPreventDefault = false, nKeyCode = event.keyCode, oSubmenu; if (nKeyCode === 40) { menuNav._hideAllSubmenus(oActiveMenu); if (isMenuLabel(oFocusedItem)) { oSubmenu = oFocusedItem.next(); if (oSubmenu) { menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } bPreventDefault = true; } } if (bPreventDefault) { // Prevent the browser from scrolling the window event.preventDefault(); } }, // Generic DOM Event handlers /** * @method _onMouseMove * @description "mousemove" event handler for the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onMouseMove: function (event) { var menuNav = this; // Using a timer to set the value of the "_currentMouseX" property // helps improve the reliability of the calculation used to set the // value of the "_movingToSubmenu" property - especially in Opera. later(10, menuNav, function () { menuNav._currentMouseX = event.pageX; }); }, /** * @method _onMouseOver * @description "mouseover" event handler for the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onMouseOver: function (event) { var menuNav = this, oTarget, oMenu, oMenuLabel, oParentMenu, oMenuItem; if (menuNav._blockMouseEvent) { menuNav._blockMouseEvent = false; } else { oTarget = event.target; oMenu = getMenu(oTarget, true); oMenuLabel = getMenuLabel(oTarget, true); oMenuItem = getMenuItem(oTarget, true); if (handleMouseOverForNode(oMenu, oTarget)) { menuNav._onMenuMouseOver(oMenu, event); oMenu[HANDLED_MOUSEOVER] = true; oMenu[HANDLED_MOUSEOUT] = false; oParentMenu = getParentMenu(oMenu); if (oParentMenu) { oParentMenu[HANDLED_MOUSEOUT] = true; oParentMenu[HANDLED_MOUSEOVER] = false; } } if (handleMouseOverForNode(oMenuLabel, oTarget)) { menuNav._onMenuLabelMouseOver(oMenuLabel, event); oMenuLabel[HANDLED_MOUSEOVER] = true; oMenuLabel[HANDLED_MOUSEOUT] = false; } if (handleMouseOverForNode(oMenuItem, oTarget)) { menuNav._onMenuItemMouseOver(oMenuItem, event); oMenuItem[HANDLED_MOUSEOVER] = true; oMenuItem[HANDLED_MOUSEOUT] = false; } } }, /** * @method _onMouseOut * @description "mouseout" event handler for the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onMouseOut: function (event) { var menuNav = this, oActiveMenu = menuNav._activeMenu, bMovingToSubmenu = false, oTarget, oRelatedTarget, oMenu, oMenuLabel, oSubmenu, oMenuItem; menuNav._movingToSubmenu = (oActiveMenu && !isHorizontalMenu(oActiveMenu) && ((event.pageX - 5) > menuNav._currentMouseX)); oTarget = event.target; oRelatedTarget = event.relatedTarget; oMenu = getMenu(oTarget, true); oMenuLabel = getMenuLabel(oTarget, true); oMenuItem = getMenuItem(oTarget, true); if (handleMouseOutForNode(oMenuLabel, oRelatedTarget)) { menuNav._onMenuLabelMouseOut(oMenuLabel, event); oMenuLabel[HANDLED_MOUSEOUT] = true; oMenuLabel[HANDLED_MOUSEOVER] = false; } if (handleMouseOutForNode(oMenuItem, oRelatedTarget)) { menuNav._onMenuItemMouseOut(oMenuItem, event); oMenuItem[HANDLED_MOUSEOUT] = true; oMenuItem[HANDLED_MOUSEOVER] = false; } if (oMenuLabel) { oSubmenu = oMenuLabel.next(); if (oSubmenu && oRelatedTarget && (oRelatedTarget.compareTo(oSubmenu) || oSubmenu.contains(oRelatedTarget))) { bMovingToSubmenu = true; } } if (handleMouseOutForNode(oMenu, oRelatedTarget) || bMovingToSubmenu) { menuNav._onMenuMouseOut(oMenu, event); oMenu[HANDLED_MOUSEOUT] = true; oMenu[HANDLED_MOUSEOVER] = false; } }, /** * @method _toggleSubmenuDisplay * @description "mousedown," "keydown," and "click" event handler for the * menu used to toggle the display of a submenu. * @protected * @param {Object} event Object representing the DOM event. */ _toggleSubmenuDisplay: function (event) { var menuNav = this, oTarget = event.target, oMenuLabel = getMenuLabel(oTarget, true), sType = event.type, oAnchor, oSubmenu, sHref, nHashPos, nLen, sId; if (oMenuLabel) { oAnchor = isAnchor(oTarget) ? oTarget : oTarget.ancestor(isAnchor); if (oAnchor) { // Need to pass "2" as a second argument to "getAttribute" for // IE otherwise IE will return a fully qualified URL for the // value of the "href" attribute. // http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx sHref = oAnchor.getAttribute("href", 2); nHashPos = sHref.indexOf("#"); nLen = sHref.length; if (nHashPos === 0 && nLen > 1) { sId = sHref.substr(1, nLen); oSubmenu = oMenuLabel.next(); if (oSubmenu && (oSubmenu.get(ID) === sId)) { if (sType === MOUSEDOWN || sType === KEYDOWN) { if ((UA.opera || UA.gecko || UA.ie) && sType === KEYDOWN && !menuNav._preventClickHandle) { // Prevent the browser from following the URL of // the anchor element menuNav._preventClickHandle = menuNav._rootMenu.on("click", function (event) { event.preventDefault(); menuNav._preventClickHandle.detach(); menuNav._preventClickHandle = null; }); } if (sType == MOUSEDOWN) { // Prevent the target from getting focused by // default, since the element to be focused will // be determined by weather or not the submenu // is visible. event.preventDefault(); // FocusManager will attempt to focus any // descendant that is the target of the mousedown // event. Since we want to explicitly control // where focus is going, we need to call // "stopImmediatePropagation" to stop the // FocusManager from doing its thing. event.stopImmediatePropagation(); // The "_focusItem" method relies on the // "_hasFocus" property being set to true. The // "_hasFocus" property is normally set via a // "focus" event listener, but since we've // blocked focus from happening, we need to set // this property manually. menuNav._hasFocus = true; } if (menuNav._isRoot(getParentMenu(oTarget))) { // Event target is a submenu label in the root menu // Menu label toggle functionality if (hasVisibleSubmenu(oMenuLabel)) { menuNav._hideMenu(oSubmenu); menuNav._focusItem(oMenuLabel); menuNav._setActiveItem(oMenuLabel); } else { menuNav._hideAllSubmenus(menuNav._rootMenu); menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } } else { // Event target is a submenu label within a submenu if (menuNav._activeItem == oMenuLabel) { menuNav._showMenu(oSubmenu); menuNav._focusItem(getFirstItem(oSubmenu)); menuNav._setActiveItem(getFirstItem(oSubmenu)); } else { if (!oMenuLabel._clickHandle) { oMenuLabel._clickHandle = oMenuLabel.on("click", function () { menuNav._hideAllSubmenus(menuNav._rootMenu); menuNav._hasFocus = false; menuNav._clearActiveItem(); oMenuLabel._clickHandle.detach(); oMenuLabel._clickHandle = null; }); } } } } if (sType === CLICK) { // Prevent the browser from following the URL of // the anchor element event.preventDefault(); } } } } } }, /** * @method _onKeyPress * @description "keypress" event handler for the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onKeyPress: function (event) { switch (event.keyCode) { case 37: // left arrow case 38: // up arrow case 39: // right arrow case 40: // down arrow // Prevent the browser from scrolling the window event.preventDefault(); break; } }, /** * @method _onKeyDown * @description "keydown" event handler for the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onKeyDown: function (event) { var menuNav = this, oActiveItem = menuNav._activeItem, oTarget = event.target, oActiveMenu = getParentMenu(oTarget), oSubmenu; if (oActiveMenu) { menuNav._activeMenu = oActiveMenu; if (isHorizontalMenu(oActiveMenu)) { menuNav._onHorizontalMenuKeyDown(event); } else { menuNav._onVerticalMenuKeyDown(event); } if (event.keyCode === 27) { if (!menuNav._isRoot(oActiveMenu)) { if (UA.opera) { later(0, menuNav, function () { menuNav._hideMenu(oActiveMenu, true); }); } else { menuNav._hideMenu(oActiveMenu, true); } event.stopPropagation(); menuNav._blockMouseEvent = UA.gecko ? true : false; } else if (oActiveItem) { if (isMenuLabel(oActiveItem) && hasVisibleSubmenu(oActiveItem)) { oSubmenu = oActiveItem.next(); if (oSubmenu) { menuNav._hideMenu(oSubmenu); } } else { menuNav._focusManager.blur(); // This is necessary for Webkit since blurring the // active menuitem won't result in the document // gaining focus, meaning the that _onDocFocus // listener won't clear the active menuitem. menuNav._clearActiveItem(); menuNav._hasFocus = false; } } } } }, /** * @method _onDocMouseDown * @description "mousedown" event handler for the owner document of * the menu. * @protected * @param {Object} event Object representing the DOM event. */ _onDocMouseDown: function (event) { var menuNav = this, oRoot = menuNav._rootMenu, oTarget = event.target; if (!(oRoot.compareTo(oTarget) || oRoot.contains(oTarget))) { menuNav._hideAllSubmenus(oRoot); // Document doesn't receive focus in Webkit when the user mouses // down on it, so the "_hasFocus" property won't get set to the // correct value. The following line corrects the problem. if (UA.webkit) { menuNav._hasFocus = false; menuNav._clearActiveItem(); } } } }); Y.namespace('Plugin'); Y.Plugin.NodeMenuNav = NodeMenuNav; }, '3.17.1', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});
sympmarc/cdnjs
ajax/libs/yui/3.17.1/node-menunav/node-menunav.js
JavaScript
mit
47,164
!function() { var d3 = { version: "3.4.3" }; if (!Date.now) Date.now = function() { return +new Date(); }; var d3_arraySlice = [].slice, d3_array = function(list) { return d3_arraySlice.call(list); }; var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window; try { d3_array(d3_documentElement.childNodes)[0].nodeType; } catch (e) { d3_array = function(list) { var i = list.length, array = new Array(i); while (i--) array[i] = list[i]; return array; }; } try { d3_document.createElement("div").style.setProperty("opacity", 0, ""); } catch (error) { var d3_element_prototype = d3_window.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty; d3_element_prototype.setAttribute = function(name, value) { d3_element_setAttribute.call(this, name, value + ""); }; d3_element_prototype.setAttributeNS = function(space, local, value) { d3_element_setAttributeNS.call(this, space, local, value + ""); }; d3_style_prototype.setProperty = function(name, value, priority) { d3_style_setProperty.call(this, name, value + "", priority); }; } d3.ascending = function(a, b) { return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; }; d3.descending = function(a, b) { return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; }; d3.min = function(array, f) { var i = -1, n = array.length, a, b; if (arguments.length === 1) { while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; while (++i < n) if ((b = array[i]) != null && a > b) a = b; } else { while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b; } return a; }; d3.max = function(array, f) { var i = -1, n = array.length, a, b; if (arguments.length === 1) { while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined; while (++i < n) if ((b = array[i]) != null && b > a) a = b; } else { while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined; while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b; } return a; }; d3.extent = function(array, f) { var i = -1, n = array.length, a, b, c; if (arguments.length === 1) { while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined; while (++i < n) if ((b = array[i]) != null) { if (a > b) a = b; if (c < b) c = b; } } else { while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined; while (++i < n) if ((b = f.call(array, array[i], i)) != null) { if (a > b) a = b; if (c < b) c = b; } } return [ a, c ]; }; d3.sum = function(array, f) { var s = 0, n = array.length, a, i = -1; if (arguments.length === 1) { while (++i < n) if (!isNaN(a = +array[i])) s += a; } else { while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a; } return s; }; function d3_number(x) { return x != null && !isNaN(x); } d3.mean = function(array, f) { var n = array.length, a, m = 0, i = -1, j = 0; if (arguments.length === 1) { while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j; } else { while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j; } return j ? m : undefined; }; d3.quantile = function(values, p) { var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h; return e ? v + e * (values[h] - v) : v; }; d3.median = function(array, f) { if (arguments.length > 1) array = array.map(f); array = array.filter(d3_number); return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined; }; d3.bisector = function(f) { return { left: function(a, x, lo, hi) { if (arguments.length < 3) lo = 0; if (arguments.length < 4) hi = a.length; while (lo < hi) { var mid = lo + hi >>> 1; if (f.call(a, a[mid], mid) < x) lo = mid + 1; else hi = mid; } return lo; }, right: function(a, x, lo, hi) { if (arguments.length < 3) lo = 0; if (arguments.length < 4) hi = a.length; while (lo < hi) { var mid = lo + hi >>> 1; if (x < f.call(a, a[mid], mid)) hi = mid; else lo = mid + 1; } return lo; } }; }; var d3_bisector = d3.bisector(function(d) { return d; }); d3.bisectLeft = d3_bisector.left; d3.bisect = d3.bisectRight = d3_bisector.right; d3.shuffle = function(array) { var m = array.length, t, i; while (m) { i = Math.random() * m-- | 0; t = array[m], array[m] = array[i], array[i] = t; } return array; }; d3.permute = function(array, indexes) { var i = indexes.length, permutes = new Array(i); while (i--) permutes[i] = array[indexes[i]]; return permutes; }; d3.pairs = function(array) { var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n); while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ]; return pairs; }; d3.zip = function() { if (!(n = arguments.length)) return []; for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) { for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) { zip[j] = arguments[j][i]; } } return zips; }; function d3_zipLength(d) { return d.length; } d3.transpose = function(matrix) { return d3.zip.apply(d3, matrix); }; d3.keys = function(map) { var keys = []; for (var key in map) keys.push(key); return keys; }; d3.values = function(map) { var values = []; for (var key in map) values.push(map[key]); return values; }; d3.entries = function(map) { var entries = []; for (var key in map) entries.push({ key: key, value: map[key] }); return entries; }; d3.merge = function(arrays) { var n = arrays.length, m, i = -1, j = 0, merged, array; while (++i < n) j += arrays[i].length; merged = new Array(j); while (--n >= 0) { array = arrays[n]; m = array.length; while (--m >= 0) { merged[--j] = array[m]; } } return merged; }; var abs = Math.abs; d3.range = function(start, stop, step) { if (arguments.length < 3) { step = 1; if (arguments.length < 2) { stop = start; start = 0; } } if ((stop - start) / step === Infinity) throw new Error("infinite range"); var range = [], k = d3_range_integerScale(abs(step)), i = -1, j; start *= k, stop *= k, step *= k; if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k); return range; }; function d3_range_integerScale(x) { var k = 1; while (x * k % 1) k *= 10; return k; } function d3_class(ctor, properties) { try { for (var key in properties) { Object.defineProperty(ctor.prototype, key, { value: properties[key], enumerable: false }); } } catch (e) { ctor.prototype = properties; } } d3.map = function(object) { var map = new d3_Map(); if (object instanceof d3_Map) object.forEach(function(key, value) { map.set(key, value); }); else for (var key in object) map.set(key, object[key]); return map; }; function d3_Map() {} d3_class(d3_Map, { has: d3_map_has, get: function(key) { return this[d3_map_prefix + key]; }, set: function(key, value) { return this[d3_map_prefix + key] = value; }, remove: d3_map_remove, keys: d3_map_keys, values: function() { var values = []; this.forEach(function(key, value) { values.push(value); }); return values; }, entries: function() { var entries = []; this.forEach(function(key, value) { entries.push({ key: key, value: value }); }); return entries; }, size: d3_map_size, empty: d3_map_empty, forEach: function(f) { for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) f.call(this, key.substring(1), this[key]); } }); var d3_map_prefix = "\x00", d3_map_prefixCode = d3_map_prefix.charCodeAt(0); function d3_map_has(key) { return d3_map_prefix + key in this; } function d3_map_remove(key) { key = d3_map_prefix + key; return key in this && delete this[key]; } function d3_map_keys() { var keys = []; this.forEach(function(key) { keys.push(key); }); return keys; } function d3_map_size() { var size = 0; for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) ++size; return size; } function d3_map_empty() { for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) return false; return true; } d3.nest = function() { var nest = {}, keys = [], sortKeys = [], sortValues, rollup; function map(mapType, array, depth) { if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array; var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values; while (++i < n) { if (values = valuesByKey.get(keyValue = key(object = array[i]))) { values.push(object); } else { valuesByKey.set(keyValue, [ object ]); } } if (mapType) { object = mapType(); setter = function(keyValue, values) { object.set(keyValue, map(mapType, values, depth)); }; } else { object = {}; setter = function(keyValue, values) { object[keyValue] = map(mapType, values, depth); }; } valuesByKey.forEach(setter); return object; } function entries(map, depth) { if (depth >= keys.length) return map; var array = [], sortKey = sortKeys[depth++]; map.forEach(function(key, keyMap) { array.push({ key: key, values: entries(keyMap, depth) }); }); return sortKey ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array; } nest.map = function(array, mapType) { return map(mapType, array, 0); }; nest.entries = function(array) { return entries(map(d3.map, array, 0), 0); }; nest.key = function(d) { keys.push(d); return nest; }; nest.sortKeys = function(order) { sortKeys[keys.length - 1] = order; return nest; }; nest.sortValues = function(order) { sortValues = order; return nest; }; nest.rollup = function(f) { rollup = f; return nest; }; return nest; }; d3.set = function(array) { var set = new d3_Set(); if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]); return set; }; function d3_Set() {} d3_class(d3_Set, { has: d3_map_has, add: function(value) { this[d3_map_prefix + value] = true; return value; }, remove: function(value) { value = d3_map_prefix + value; return value in this && delete this[value]; }, values: d3_map_keys, size: d3_map_size, empty: d3_map_empty, forEach: function(f) { for (var value in this) if (value.charCodeAt(0) === d3_map_prefixCode) f.call(this, value.substring(1)); } }); d3.behavior = {}; d3.rebind = function(target, source) { var i = 1, n = arguments.length, method; while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]); return target; }; function d3_rebind(target, source, method) { return function() { var value = method.apply(source, arguments); return value === source ? target : value; }; } function d3_vendorSymbol(object, name) { if (name in object) return name; name = name.charAt(0).toUpperCase() + name.substring(1); for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { var prefixName = d3_vendorPrefixes[i] + name; if (prefixName in object) return prefixName; } } var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ]; function d3_noop() {} d3.dispatch = function() { var dispatch = new d3_dispatch(), i = -1, n = arguments.length; while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); return dispatch; }; function d3_dispatch() {} d3_dispatch.prototype.on = function(type, listener) { var i = type.indexOf("."), name = ""; if (i >= 0) { name = type.substring(i + 1); type = type.substring(0, i); } if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); if (arguments.length === 2) { if (listener == null) for (type in this) { if (this.hasOwnProperty(type)) this[type].on(name, null); } return this; } }; function d3_dispatch_event(dispatch) { var listeners = [], listenerByName = new d3_Map(); function event() { var z = listeners, i = -1, n = z.length, l; while (++i < n) if (l = z[i].on) l.apply(this, arguments); return dispatch; } event.on = function(name, listener) { var l = listenerByName.get(name), i; if (arguments.length < 2) return l && l.on; if (l) { l.on = null; listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1)); listenerByName.remove(name); } if (listener) listeners.push(listenerByName.set(name, { on: listener })); return dispatch; }; return event; } d3.event = null; function d3_eventPreventDefault() { d3.event.preventDefault(); } function d3_eventSource() { var e = d3.event, s; while (s = e.sourceEvent) e = s; return e; } function d3_eventDispatch(target) { var dispatch = new d3_dispatch(), i = 0, n = arguments.length; while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch); dispatch.of = function(thiz, argumentz) { return function(e1) { try { var e0 = e1.sourceEvent = d3.event; e1.target = target; d3.event = e1; dispatch[e1.type].apply(thiz, argumentz); } finally { d3.event = e0; } }; }; return dispatch; } d3.requote = function(s) { return s.replace(d3_requote_re, "\\$&"); }; var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g; var d3_subclass = {}.__proto__ ? function(object, prototype) { object.__proto__ = prototype; } : function(object, prototype) { for (var property in prototype) object[property] = prototype[property]; }; function d3_selection(groups) { d3_subclass(groups, d3_selectionPrototype); return groups; } var d3_select = function(s, n) { return n.querySelector(s); }, d3_selectAll = function(s, n) { return n.querySelectorAll(s); }, d3_selectMatcher = d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) { return d3_selectMatcher.call(n, s); }; if (typeof Sizzle === "function") { d3_select = function(s, n) { return Sizzle(s, n)[0] || null; }; d3_selectAll = function(s, n) { return Sizzle.uniqueSort(Sizzle(s, n)); }; d3_selectMatches = Sizzle.matchesSelector; } d3.selection = function() { return d3_selectionRoot; }; var d3_selectionPrototype = d3.selection.prototype = []; d3_selectionPrototype.select = function(selector) { var subgroups = [], subgroup, subnode, group, node; selector = d3_selection_selector(selector); for (var j = -1, m = this.length; ++j < m; ) { subgroups.push(subgroup = []); subgroup.parentNode = (group = this[j]).parentNode; for (var i = -1, n = group.length; ++i < n; ) { if (node = group[i]) { subgroup.push(subnode = selector.call(node, node.__data__, i, j)); if (subnode && "__data__" in node) subnode.__data__ = node.__data__; } else { subgroup.push(null); } } } return d3_selection(subgroups); }; function d3_selection_selector(selector) { return typeof selector === "function" ? selector : function() { return d3_select(selector, this); }; } d3_selectionPrototype.selectAll = function(selector) { var subgroups = [], subgroup, node; selector = d3_selection_selectorAll(selector); for (var j = -1, m = this.length; ++j < m; ) { for (var group = this[j], i = -1, n = group.length; ++i < n; ) { if (node = group[i]) { subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j))); subgroup.parentNode = node; } } } return d3_selection(subgroups); }; function d3_selection_selectorAll(selector) { return typeof selector === "function" ? selector : function() { return d3_selectAll(selector, this); }; } var d3_nsPrefix = { svg: "http://www.w3.org/2000/svg", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; d3.ns = { prefix: d3_nsPrefix, qualify: function(name) { var i = name.indexOf(":"), prefix = name; if (i >= 0) { prefix = name.substring(0, i); name = name.substring(i + 1); } return d3_nsPrefix.hasOwnProperty(prefix) ? { space: d3_nsPrefix[prefix], local: name } : name; } }; d3_selectionPrototype.attr = function(name, value) { if (arguments.length < 2) { if (typeof name === "string") { var node = this.node(); name = d3.ns.qualify(name); return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name); } for (value in name) this.each(d3_selection_attr(value, name[value])); return this; } return this.each(d3_selection_attr(name, value)); }; function d3_selection_attr(name, value) { name = d3.ns.qualify(name); function attrNull() { this.removeAttribute(name); } function attrNullNS() { this.removeAttributeNS(name.space, name.local); } function attrConstant() { this.setAttribute(name, value); } function attrConstantNS() { this.setAttributeNS(name.space, name.local, value); } function attrFunction() { var x = value.apply(this, arguments); if (x == null) this.removeAttribute(name); else this.setAttribute(name, x); } function attrFunctionNS() { var x = value.apply(this, arguments); if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x); } return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant; } function d3_collapse(s) { return s.trim().replace(/\s+/g, " "); } d3_selectionPrototype.classed = function(name, value) { if (arguments.length < 2) { if (typeof name === "string") { var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1; if (value = node.classList) { while (++i < n) if (!value.contains(name[i])) return false; } else { value = node.getAttribute("class"); while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false; } return true; } for (value in name) this.each(d3_selection_classed(value, name[value])); return this; } return this.each(d3_selection_classed(name, value)); }; function d3_selection_classedRe(name) { return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g"); } function d3_selection_classes(name) { return name.trim().split(/^|\s+/); } function d3_selection_classed(name, value) { name = d3_selection_classes(name).map(d3_selection_classedName); var n = name.length; function classedConstant() { var i = -1; while (++i < n) name[i](this, value); } function classedFunction() { var i = -1, x = value.apply(this, arguments); while (++i < n) name[i](this, x); } return typeof value === "function" ? classedFunction : classedConstant; } function d3_selection_classedName(name) { var re = d3_selection_classedRe(name); return function(node, value) { if (c = node.classList) return value ? c.add(name) : c.remove(name); var c = node.getAttribute("class") || ""; if (value) { re.lastIndex = 0; if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name)); } else { node.setAttribute("class", d3_collapse(c.replace(re, " "))); } }; } d3_selectionPrototype.style = function(name, value, priority) { var n = arguments.length; if (n < 3) { if (typeof name !== "string") { if (n < 2) value = ""; for (priority in name) this.each(d3_selection_style(priority, name[priority], value)); return this; } if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name); priority = ""; } return this.each(d3_selection_style(name, value, priority)); }; function d3_selection_style(name, value, priority) { function styleNull() { this.style.removeProperty(name); } function styleConstant() { this.style.setProperty(name, value, priority); } function styleFunction() { var x = value.apply(this, arguments); if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority); } return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant; } d3_selectionPrototype.property = function(name, value) { if (arguments.length < 2) { if (typeof name === "string") return this.node()[name]; for (value in name) this.each(d3_selection_property(value, name[value])); return this; } return this.each(d3_selection_property(name, value)); }; function d3_selection_property(name, value) { function propertyNull() { delete this[name]; } function propertyConstant() { this[name] = value; } function propertyFunction() { var x = value.apply(this, arguments); if (x == null) delete this[name]; else this[name] = x; } return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant; } d3_selectionPrototype.text = function(value) { return arguments.length ? this.each(typeof value === "function" ? function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; } : value == null ? function() { this.textContent = ""; } : function() { this.textContent = value; }) : this.node().textContent; }; d3_selectionPrototype.html = function(value) { return arguments.length ? this.each(typeof value === "function" ? function() { var v = value.apply(this, arguments); this.innerHTML = v == null ? "" : v; } : value == null ? function() { this.innerHTML = ""; } : function() { this.innerHTML = value; }) : this.node().innerHTML; }; d3_selectionPrototype.append = function(name) { name = d3_selection_creator(name); return this.select(function() { return this.appendChild(name.apply(this, arguments)); }); }; function d3_selection_creator(name) { return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() { return this.ownerDocument.createElementNS(name.space, name.local); } : function() { return this.ownerDocument.createElementNS(this.namespaceURI, name); }; } d3_selectionPrototype.insert = function(name, before) { name = d3_selection_creator(name); before = d3_selection_selector(before); return this.select(function() { return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null); }); }; d3_selectionPrototype.remove = function() { return this.each(function() { var parent = this.parentNode; if (parent) parent.removeChild(this); }); }; d3_selectionPrototype.data = function(value, key) { var i = -1, n = this.length, group, node; if (!arguments.length) { value = new Array(n = (group = this[0]).length); while (++i < n) { if (node = group[i]) { value[i] = node.__data__; } } return value; } function bind(group, groupData) { var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData; if (key) { var nodeByKeyValue = new d3_Map(), dataByKeyValue = new d3_Map(), keyValues = [], keyValue; for (i = -1; ++i < n; ) { keyValue = key.call(node = group[i], node.__data__, i); if (nodeByKeyValue.has(keyValue)) { exitNodes[i] = node; } else { nodeByKeyValue.set(keyValue, node); } keyValues.push(keyValue); } for (i = -1; ++i < m; ) { keyValue = key.call(groupData, nodeData = groupData[i], i); if (node = nodeByKeyValue.get(keyValue)) { updateNodes[i] = node; node.__data__ = nodeData; } else if (!dataByKeyValue.has(keyValue)) { enterNodes[i] = d3_selection_dataNode(nodeData); } dataByKeyValue.set(keyValue, nodeData); nodeByKeyValue.remove(keyValue); } for (i = -1; ++i < n; ) { if (nodeByKeyValue.has(keyValues[i])) { exitNodes[i] = group[i]; } } } else { for (i = -1; ++i < n0; ) { node = group[i]; nodeData = groupData[i]; if (node) { node.__data__ = nodeData; updateNodes[i] = node; } else { enterNodes[i] = d3_selection_dataNode(nodeData); } } for (;i < m; ++i) { enterNodes[i] = d3_selection_dataNode(groupData[i]); } for (;i < n; ++i) { exitNodes[i] = group[i]; } } enterNodes.update = updateNodes; enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode; enter.push(enterNodes); update.push(updateNodes); exit.push(exitNodes); } var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]); if (typeof value === "function") { while (++i < n) { bind(group = this[i], value.call(group, group.parentNode.__data__, i)); } } else { while (++i < n) { bind(group = this[i], value); } } update.enter = function() { return enter; }; update.exit = function() { return exit; }; return update; }; function d3_selection_dataNode(data) { return { __data__: data }; } d3_selectionPrototype.datum = function(value) { return arguments.length ? this.property("__data__", value) : this.property("__data__"); }; d3_selectionPrototype.filter = function(filter) { var subgroups = [], subgroup, group, node; if (typeof filter !== "function") filter = d3_selection_filter(filter); for (var j = 0, m = this.length; j < m; j++) { subgroups.push(subgroup = []); subgroup.parentNode = (group = this[j]).parentNode; for (var i = 0, n = group.length; i < n; i++) { if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { subgroup.push(node); } } } return d3_selection(subgroups); }; function d3_selection_filter(selector) { return function() { return d3_selectMatches(this, selector); }; } d3_selectionPrototype.order = function() { for (var j = -1, m = this.length; ++j < m; ) { for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) { if (node = group[i]) { if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); next = node; } } } return this; }; d3_selectionPrototype.sort = function(comparator) { comparator = d3_selection_sortComparator.apply(this, arguments); for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator); return this.order(); }; function d3_selection_sortComparator(comparator) { if (!arguments.length) comparator = d3.ascending; return function(a, b) { return a && b ? comparator(a.__data__, b.__data__) : !a - !b; }; } d3_selectionPrototype.each = function(callback) { return d3_selection_each(this, function(node, i, j) { callback.call(node, node.__data__, i, j); }); }; function d3_selection_each(groups, callback) { for (var j = 0, m = groups.length; j < m; j++) { for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) { if (node = group[i]) callback(node, i, j); } } return groups; } d3_selectionPrototype.call = function(callback) { var args = d3_array(arguments); callback.apply(args[0] = this, args); return this; }; d3_selectionPrototype.empty = function() { return !this.node(); }; d3_selectionPrototype.node = function() { for (var j = 0, m = this.length; j < m; j++) { for (var group = this[j], i = 0, n = group.length; i < n; i++) { var node = group[i]; if (node) return node; } } return null; }; d3_selectionPrototype.size = function() { var n = 0; this.each(function() { ++n; }); return n; }; function d3_selection_enter(selection) { d3_subclass(selection, d3_selection_enterPrototype); return selection; } var d3_selection_enterPrototype = []; d3.selection.enter = d3_selection_enter; d3.selection.enter.prototype = d3_selection_enterPrototype; d3_selection_enterPrototype.append = d3_selectionPrototype.append; d3_selection_enterPrototype.empty = d3_selectionPrototype.empty; d3_selection_enterPrototype.node = d3_selectionPrototype.node; d3_selection_enterPrototype.call = d3_selectionPrototype.call; d3_selection_enterPrototype.size = d3_selectionPrototype.size; d3_selection_enterPrototype.select = function(selector) { var subgroups = [], subgroup, subnode, upgroup, group, node; for (var j = -1, m = this.length; ++j < m; ) { upgroup = (group = this[j]).update; subgroups.push(subgroup = []); subgroup.parentNode = group.parentNode; for (var i = -1, n = group.length; ++i < n; ) { if (node = group[i]) { subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j)); subnode.__data__ = node.__data__; } else { subgroup.push(null); } } } return d3_selection(subgroups); }; d3_selection_enterPrototype.insert = function(name, before) { if (arguments.length < 2) before = d3_selection_enterInsertBefore(this); return d3_selectionPrototype.insert.call(this, name, before); }; function d3_selection_enterInsertBefore(enter) { var i0, j0; return function(d, i, j) { var group = enter[j].update, n = group.length, node; if (j != j0) j0 = j, i0 = 0; if (i >= i0) i0 = i + 1; while (!(node = group[i0]) && ++i0 < n) ; return node; }; } d3_selectionPrototype.transition = function() { var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || { time: Date.now(), ease: d3_ease_cubicInOut, delay: 0, duration: 250 }; for (var j = -1, m = this.length; ++j < m; ) { subgroups.push(subgroup = []); for (var group = this[j], i = -1, n = group.length; ++i < n; ) { if (node = group[i]) d3_transitionNode(node, i, id, transition); subgroup.push(node); } } return d3_transition(subgroups, id); }; d3_selectionPrototype.interrupt = function() { return this.each(d3_selection_interrupt); }; function d3_selection_interrupt() { var lock = this.__transition__; if (lock) ++lock.active; } d3.select = function(node) { var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ]; group.parentNode = d3_documentElement; return d3_selection([ group ]); }; d3.selectAll = function(nodes) { var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes); group.parentNode = d3_documentElement; return d3_selection([ group ]); }; var d3_selectionRoot = d3.select(d3_documentElement); d3_selectionPrototype.on = function(type, listener, capture) { var n = arguments.length; if (n < 3) { if (typeof type !== "string") { if (n < 2) listener = false; for (capture in type) this.each(d3_selection_on(capture, type[capture], listener)); return this; } if (n < 2) return (n = this.node()["__on" + type]) && n._; capture = false; } return this.each(d3_selection_on(type, listener, capture)); }; function d3_selection_on(type, listener, capture) { var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; if (i > 0) type = type.substring(0, i); var filter = d3_selection_onFilters.get(type); if (filter) type = filter, wrap = d3_selection_onFilter; function onRemove() { var l = this[name]; if (l) { this.removeEventListener(type, l, l.$); delete this[name]; } } function onAdd() { var l = wrap(listener, d3_array(arguments)); onRemove.call(this); this.addEventListener(type, this[name] = l, l.$ = capture); l._ = listener; } function removeAll() { var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match; for (var name in this) { if (match = name.match(re)) { var l = this[name]; this.removeEventListener(match[1], l, l.$); delete this[name]; } } } return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll; } var d3_selection_onFilters = d3.map({ mouseenter: "mouseover", mouseleave: "mouseout" }); d3_selection_onFilters.forEach(function(k) { if ("on" + k in d3_document) d3_selection_onFilters.remove(k); }); function d3_selection_onListener(listener, argumentz) { return function(e) { var o = d3.event; d3.event = e; argumentz[0] = this.__data__; try { listener.apply(this, argumentz); } finally { d3.event = o; } }; } function d3_selection_onFilter(listener, argumentz) { var l = d3_selection_onListener(listener, argumentz); return function(e) { var target = this, related = e.relatedTarget; if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) { l.call(target, e); } }; } var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0; function d3_event_dragSuppress() { var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault); if (d3_event_dragSelect) { var style = d3_documentElement.style, select = style[d3_event_dragSelect]; style[d3_event_dragSelect] = "none"; } return function(suppressClick) { w.on(name, null); if (d3_event_dragSelect) style[d3_event_dragSelect] = select; if (suppressClick) { function off() { w.on(click, null); } w.on(click, function() { d3_eventPreventDefault(); off(); }, true); setTimeout(off, 0); } }; } d3.mouse = function(container) { return d3_mousePoint(container, d3_eventSource()); }; var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0; function d3_mousePoint(container, e) { if (e.changedTouches) e = e.changedTouches[0]; var svg = container.ownerSVGElement || container; if (svg.createSVGPoint) { var point = svg.createSVGPoint(); if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) { svg = d3.select("body").append("svg").style({ position: "absolute", top: 0, left: 0, margin: 0, padding: 0, border: "none" }, "important"); var ctm = svg[0][0].getScreenCTM(); d3_mouse_bug44083 = !(ctm.f || ctm.e); svg.remove(); } if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, point.y = e.clientY; point = point.matrixTransform(container.getScreenCTM().inverse()); return [ point.x, point.y ]; } var rect = container.getBoundingClientRect(); return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ]; } d3.touches = function(container, touches) { if (arguments.length < 2) touches = d3_eventSource().touches; return touches ? d3_array(touches).map(function(touch) { var point = d3_mousePoint(container, touch); point.identifier = touch.identifier; return point; }) : []; }; d3.behavior.drag = function() { var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, "mousemove", "mouseup"), touchstart = dragstart(touchid, touchposition, "touchmove", "touchend"); function drag() { this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart); } function touchid() { return d3.event.changedTouches[0].identifier; } function touchposition(parent, id) { return d3.touches(parent).filter(function(p) { return p.identifier === id; })[0]; } function dragstart(id, position, move, end) { return function() { var target = this, parent = target.parentNode, event_ = event.of(target, arguments), eventTarget = d3.event.target, eventId = id(), drag = eventId == null ? "drag" : "drag-" + eventId, origin_ = position(parent, eventId), dragged = 0, offset, w = d3.select(d3_window).on(move + "." + drag, moved).on(end + "." + drag, ended), dragRestore = d3_event_dragSuppress(); if (origin) { offset = origin.apply(target, arguments); offset = [ offset.x - origin_[0], offset.y - origin_[1] ]; } else { offset = [ 0, 0 ]; } event_({ type: "dragstart" }); function moved() { var p = position(parent, eventId), dx = p[0] - origin_[0], dy = p[1] - origin_[1]; dragged |= dx | dy; origin_ = p; event_({ type: "drag", x: p[0] + offset[0], y: p[1] + offset[1], dx: dx, dy: dy }); } function ended() { w.on(move + "." + drag, null).on(end + "." + drag, null); dragRestore(dragged && d3.event.target === eventTarget); event_({ type: "dragend" }); } }; } drag.origin = function(x) { if (!arguments.length) return origin; origin = x; return drag; }; return d3.rebind(drag, event, "on"); }; var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π; function d3_sgn(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; } function d3_cross2d(a, b, c) { return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]); } function d3_acos(x) { return x > 1 ? 0 : x < -1 ? π : Math.acos(x); } function d3_asin(x) { return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x); } function d3_sinh(x) { return ((x = Math.exp(x)) - 1 / x) / 2; } function d3_cosh(x) { return ((x = Math.exp(x)) + 1 / x) / 2; } function d3_tanh(x) { return ((x = Math.exp(2 * x)) - 1) / (x + 1); } function d3_haversin(x) { return (x = Math.sin(x / 2)) * x; } var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4; d3.interpolateZoom = function(p0, p1) { var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2]; var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ; function interpolate(t) { var s = t * S; if (dr) { var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0)); return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ]; } return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ]; } interpolate.duration = S * 1e3; return interpolate; }; d3.behavior.zoom = function() { var view = { x: 0, y: 0, k: 1 }, translate0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1; function zoom(g) { g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on(mousemove, mousewheelreset).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted); } zoom.event = function(g) { g.each(function() { var event_ = event.of(this, arguments), view1 = view; if (d3_transitionInheritId) { d3.select(this).transition().each("start.zoom", function() { view = this.__chart__ || { x: 0, y: 0, k: 1 }; zoomstarted(event_); }).tween("zoom:zoom", function() { var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]); return function(t) { var l = i(t), k = dx / l[2]; this.__chart__ = view = { x: cx - l[0] * k, y: cy - l[1] * k, k: k }; zoomed(event_); }; }).each("end.zoom", function() { zoomended(event_); }); } else { this.__chart__ = view; zoomstarted(event_); zoomed(event_); zoomended(event_); } }); }; zoom.translate = function(_) { if (!arguments.length) return [ view.x, view.y ]; view = { x: +_[0], y: +_[1], k: view.k }; rescale(); return zoom; }; zoom.scale = function(_) { if (!arguments.length) return view.k; view = { x: view.x, y: view.y, k: +_ }; rescale(); return zoom; }; zoom.scaleExtent = function(_) { if (!arguments.length) return scaleExtent; scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ]; return zoom; }; zoom.center = function(_) { if (!arguments.length) return center; center = _ && [ +_[0], +_[1] ]; return zoom; }; zoom.size = function(_) { if (!arguments.length) return size; size = _ && [ +_[0], +_[1] ]; return zoom; }; zoom.x = function(z) { if (!arguments.length) return x1; x1 = z; x0 = z.copy(); view = { x: 0, y: 0, k: 1 }; return zoom; }; zoom.y = function(z) { if (!arguments.length) return y1; y1 = z; y0 = z.copy(); view = { x: 0, y: 0, k: 1 }; return zoom; }; function location(p) { return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ]; } function point(l) { return [ l[0] * view.k + view.x, l[1] * view.k + view.y ]; } function scaleTo(s) { view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s)); } function translateTo(p, l) { l = point(l); view.x += p[0] - l[0]; view.y += p[1] - l[1]; } function rescale() { if (x1) x1.domain(x0.range().map(function(x) { return (x - view.x) / view.k; }).map(x0.invert)); if (y1) y1.domain(y0.range().map(function(y) { return (y - view.y) / view.k; }).map(y0.invert)); } function zoomstarted(event) { event({ type: "zoomstart" }); } function zoomed(event) { rescale(); event({ type: "zoom", scale: view.k, translate: [ view.x, view.y ] }); } function zoomended(event) { event({ type: "zoomend" }); } function mousedowned() { var target = this, event_ = event.of(target, arguments), eventTarget = d3.event.target, dragged = 0, w = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), l = location(d3.mouse(target)), dragRestore = d3_event_dragSuppress(); d3_selection_interrupt.call(target); zoomstarted(event_); function moved() { dragged = 1; translateTo(d3.mouse(target), l); zoomed(event_); } function ended() { w.on(mousemove, d3_window === target ? mousewheelreset : null).on(mouseup, null); dragRestore(dragged && d3.event.target === eventTarget); zoomended(event_); } } function touchstarted() { var target = this, event_ = event.of(target, arguments), locations0 = {}, distance0 = 0, scale0, eventId = d3.event.changedTouches[0].identifier, touchmove = "touchmove.zoom-" + eventId, touchend = "touchend.zoom-" + eventId, w = d3.select(d3_window).on(touchmove, moved).on(touchend, ended), t = d3.select(target).on(mousedown, null).on(touchstart, started), dragRestore = d3_event_dragSuppress(); d3_selection_interrupt.call(target); started(); zoomstarted(event_); function relocate() { var touches = d3.touches(target); scale0 = view.k; touches.forEach(function(t) { if (t.identifier in locations0) locations0[t.identifier] = location(t); }); return touches; } function started() { var changed = d3.event.changedTouches; for (var i = 0, n = changed.length; i < n; ++i) { locations0[changed[i].identifier] = null; } var touches = relocate(), now = Date.now(); if (touches.length === 1) { if (now - touchtime < 500) { var p = touches[0], l = locations0[p.identifier]; scaleTo(view.k * 2); translateTo(p, l); d3_eventPreventDefault(); zoomed(event_); } touchtime = now; } else if (touches.length > 1) { var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1]; distance0 = dx * dx + dy * dy; } } function moved() { var touches = d3.touches(target), p0, l0, p1, l1; for (var i = 0, n = touches.length; i < n; ++i, l1 = null) { p1 = touches[i]; if (l1 = locations0[p1.identifier]) { if (l0) break; p0 = p1, l0 = l1; } } if (l1) { var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0); p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ]; l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ]; scaleTo(scale1 * scale0); } touchtime = null; translateTo(p0, l0); zoomed(event_); } function ended() { if (d3.event.touches.length) { var changed = d3.event.changedTouches; for (var i = 0, n = changed.length; i < n; ++i) { delete locations0[changed[i].identifier]; } for (var identifier in locations0) { return void relocate(); } } w.on(touchmove, null).on(touchend, null); t.on(mousedown, mousedowned).on(touchstart, touchstarted); dragRestore(); zoomended(event_); } } function mousewheeled() { var event_ = event.of(this, arguments); if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), zoomstarted(event_); mousewheelTimer = setTimeout(function() { mousewheelTimer = null; zoomended(event_); }, 50); d3_eventPreventDefault(); var point = center || d3.mouse(this); if (!translate0) translate0 = location(point); scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k); translateTo(point, translate0); zoomed(event_); } function mousewheelreset() { translate0 = null; } function dblclicked() { var event_ = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2; zoomstarted(event_); scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1)); translateTo(p, l); zoomed(event_); zoomended(event_); } return d3.rebind(zoom, event, "on"); }; var d3_behavior_zoomInfinity = [ 0, Infinity ]; var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() { return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1); }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() { return d3.event.wheelDelta; }, "mousewheel") : (d3_behavior_zoomDelta = function() { return -d3.event.detail; }, "MozMousePixelScroll"); function d3_Color() {} d3_Color.prototype.toString = function() { return this.rgb() + ""; }; d3.hsl = function(h, s, l) { return arguments.length === 1 ? h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : d3_hsl(+h, +s, +l); }; function d3_hsl(h, s, l) { return new d3_Hsl(h, s, l); } function d3_Hsl(h, s, l) { this.h = h; this.s = s; this.l = l; } var d3_hslPrototype = d3_Hsl.prototype = new d3_Color(); d3_hslPrototype.brighter = function(k) { k = Math.pow(.7, arguments.length ? k : 1); return d3_hsl(this.h, this.s, this.l / k); }; d3_hslPrototype.darker = function(k) { k = Math.pow(.7, arguments.length ? k : 1); return d3_hsl(this.h, this.s, k * this.l); }; d3_hslPrototype.rgb = function() { return d3_hsl_rgb(this.h, this.s, this.l); }; function d3_hsl_rgb(h, s, l) { var m1, m2; h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h; s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s; l = l < 0 ? 0 : l > 1 ? 1 : l; m2 = l <= .5 ? l * (1 + s) : l + s - l * s; m1 = 2 * l - m2; function v(h) { if (h > 360) h -= 360; else if (h < 0) h += 360; if (h < 60) return m1 + (m2 - m1) * h / 60; if (h < 180) return m2; if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60; return m1; } function vv(h) { return Math.round(v(h) * 255); } return d3_rgb(vv(h + 120), vv(h), vv(h - 120)); } d3.hcl = function(h, c, l) { return arguments.length === 1 ? h instanceof d3_Hcl ? d3_hcl(h.h, h.c, h.l) : h instanceof d3_Lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : d3_hcl(+h, +c, +l); }; function d3_hcl(h, c, l) { return new d3_Hcl(h, c, l); } function d3_Hcl(h, c, l) { this.h = h; this.c = c; this.l = l; } var d3_hclPrototype = d3_Hcl.prototype = new d3_Color(); d3_hclPrototype.brighter = function(k) { return d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1))); }; d3_hclPrototype.darker = function(k) { return d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1))); }; d3_hclPrototype.rgb = function() { return d3_hcl_lab(this.h, this.c, this.l).rgb(); }; function d3_hcl_lab(h, c, l) { if (isNaN(h)) h = 0; if (isNaN(c)) c = 0; return d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c); } d3.lab = function(l, a, b) { return arguments.length === 1 ? l instanceof d3_Lab ? d3_lab(l.l, l.a, l.b) : l instanceof d3_Hcl ? d3_hcl_lab(l.l, l.c, l.h) : d3_rgb_lab((l = d3.rgb(l)).r, l.g, l.b) : d3_lab(+l, +a, +b); }; function d3_lab(l, a, b) { return new d3_Lab(l, a, b); } function d3_Lab(l, a, b) { this.l = l; this.a = a; this.b = b; } var d3_lab_K = 18; var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883; var d3_labPrototype = d3_Lab.prototype = new d3_Color(); d3_labPrototype.brighter = function(k) { return d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); }; d3_labPrototype.darker = function(k) { return d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b); }; d3_labPrototype.rgb = function() { return d3_lab_rgb(this.l, this.a, this.b); }; function d3_lab_rgb(l, a, b) { var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200; x = d3_lab_xyz(x) * d3_lab_X; y = d3_lab_xyz(y) * d3_lab_Y; z = d3_lab_xyz(z) * d3_lab_Z; return d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z)); } function d3_lab_hcl(l, a, b) { return l > 0 ? d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : d3_hcl(NaN, NaN, l); } function d3_lab_xyz(x) { return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037; } function d3_xyz_lab(x) { return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29; } function d3_xyz_rgb(r) { return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055)); } d3.rgb = function(r, g, b) { return arguments.length === 1 ? r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : d3_rgb(~~r, ~~g, ~~b); }; function d3_rgbNumber(value) { return d3_rgb(value >> 16, value >> 8 & 255, value & 255); } function d3_rgbString(value) { return d3_rgbNumber(value) + ""; } function d3_rgb(r, g, b) { return new d3_Rgb(r, g, b); } function d3_Rgb(r, g, b) { this.r = r; this.g = g; this.b = b; } var d3_rgbPrototype = d3_Rgb.prototype = new d3_Color(); d3_rgbPrototype.brighter = function(k) { k = Math.pow(.7, arguments.length ? k : 1); var r = this.r, g = this.g, b = this.b, i = 30; if (!r && !g && !b) return d3_rgb(i, i, i); if (r && r < i) r = i; if (g && g < i) g = i; if (b && b < i) b = i; return d3_rgb(Math.min(255, ~~(r / k)), Math.min(255, ~~(g / k)), Math.min(255, ~~(b / k))); }; d3_rgbPrototype.darker = function(k) { k = Math.pow(.7, arguments.length ? k : 1); return d3_rgb(~~(k * this.r), ~~(k * this.g), ~~(k * this.b)); }; d3_rgbPrototype.hsl = function() { return d3_rgb_hsl(this.r, this.g, this.b); }; d3_rgbPrototype.toString = function() { return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b); }; function d3_rgb_hex(v) { return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16); } function d3_rgb_parse(format, rgb, hsl) { var r = 0, g = 0, b = 0, m1, m2, name; m1 = /([a-z]+)\((.*)\)/i.exec(format); if (m1) { m2 = m1[2].split(","); switch (m1[1]) { case "hsl": { return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100); } case "rgb": { return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2])); } } } if (name = d3_rgb_names.get(format)) return rgb(name.r, name.g, name.b); if (format != null && format.charAt(0) === "#") { if (format.length === 4) { r = format.charAt(1); r += r; g = format.charAt(2); g += g; b = format.charAt(3); b += b; } else if (format.length === 7) { r = format.substring(1, 3); g = format.substring(3, 5); b = format.substring(5, 7); } r = parseInt(r, 16); g = parseInt(g, 16); b = parseInt(b, 16); } return rgb(r, g, b); } function d3_rgb_hsl(r, g, b) { var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2; if (d) { s = l < .5 ? d / (max + min) : d / (2 - max - min); if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4; h *= 60; } else { h = NaN; s = l > 0 && l < 1 ? 0 : h; } return d3_hsl(h, s, l); } function d3_rgb_lab(r, g, b) { r = d3_rgb_xyz(r); g = d3_rgb_xyz(g); b = d3_rgb_xyz(b); var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z); return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z)); } function d3_rgb_xyz(r) { return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); } function d3_rgb_parseNumber(c) { var f = parseFloat(c); return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f; } var d3_rgb_names = d3.map({ aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074 }); d3_rgb_names.forEach(function(key, value) { d3_rgb_names.set(key, d3_rgbNumber(value)); }); function d3_functor(v) { return typeof v === "function" ? v : function() { return v; }; } d3.functor = d3_functor; function d3_identity(d) { return d; } d3.xhr = d3_xhrType(d3_identity); function d3_xhrType(response) { return function(url, mimeType, callback) { if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, mimeType = null; return d3_xhr(url, mimeType, response, callback); }; } function d3_xhr(url, mimeType, response, callback) { var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null; if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest(); "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() { request.readyState > 3 && respond(); }; function respond() { var status = request.status, result; if (!status && request.responseText || status >= 200 && status < 300 || status === 304) { try { result = response.call(xhr, request); } catch (e) { dispatch.error.call(xhr, e); return; } dispatch.load.call(xhr, result); } else { dispatch.error.call(xhr, request); } } request.onprogress = function(event) { var o = d3.event; d3.event = event; try { dispatch.progress.call(xhr, request); } finally { d3.event = o; } }; xhr.header = function(name, value) { name = (name + "").toLowerCase(); if (arguments.length < 2) return headers[name]; if (value == null) delete headers[name]; else headers[name] = value + ""; return xhr; }; xhr.mimeType = function(value) { if (!arguments.length) return mimeType; mimeType = value == null ? null : value + ""; return xhr; }; xhr.responseType = function(value) { if (!arguments.length) return responseType; responseType = value; return xhr; }; xhr.response = function(value) { response = value; return xhr; }; [ "get", "post" ].forEach(function(method) { xhr[method] = function() { return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments))); }; }); xhr.send = function(method, data, callback) { if (arguments.length === 2 && typeof data === "function") callback = data, data = null; request.open(method, url, true); if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*"; if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]); if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType); if (responseType != null) request.responseType = responseType; if (callback != null) xhr.on("error", callback).on("load", function(request) { callback(null, request); }); dispatch.beforesend.call(xhr, request); request.send(data == null ? null : data); return xhr; }; xhr.abort = function() { request.abort(); return xhr; }; d3.rebind(xhr, dispatch, "on"); return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback)); } function d3_xhr_fixCallback(callback) { return callback.length === 1 ? function(error, request) { callback(error == null ? request : null); } : callback; } d3.dsv = function(delimiter, mimeType) { var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0); function dsv(url, row, callback) { if (arguments.length < 3) callback = row, row = null; var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback); xhr.row = function(_) { return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row; }; return xhr; } function response(request) { return dsv.parse(request.responseText); } function typedResponse(f) { return function(request) { return dsv.parse(request.responseText, f); }; } dsv.parse = function(text, f) { var o; return dsv.parseRows(text, function(row, i) { if (o) return o(row, i - 1); var a = new Function("d", "return {" + row.map(function(name, i) { return JSON.stringify(name) + ": d[" + i + "]"; }).join(",") + "}"); o = f ? function(row, i) { return f(a(row), i); } : a; }); }; dsv.parseRows = function(text, f) { var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; function token() { if (I >= N) return EOF; if (eol) return eol = false, EOL; var j = I; if (text.charCodeAt(j) === 34) { var i = j; while (i++ < N) { if (text.charCodeAt(i) === 34) { if (text.charCodeAt(i + 1) !== 34) break; ++i; } } I = i + 2; var c = text.charCodeAt(i + 1); if (c === 13) { eol = true; if (text.charCodeAt(i + 2) === 10) ++I; } else if (c === 10) { eol = true; } return text.substring(j + 1, i).replace(/""/g, '"'); } while (I < N) { var c = text.charCodeAt(I++), k = 1; if (c === 10) eol = true; else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } else if (c !== delimiterCode) continue; return text.substring(j, I - k); } return text.substring(j); } while ((t = token()) !== EOF) { var a = []; while (t !== EOL && t !== EOF) { a.push(t); t = token(); } if (f && !(a = f(a, n++))) continue; rows.push(a); } return rows; }; dsv.format = function(rows) { if (Array.isArray(rows[0])) return dsv.formatRows(rows); var fieldSet = new d3_Set(), fields = []; rows.forEach(function(row) { for (var field in row) { if (!fieldSet.has(field)) { fields.push(fieldSet.add(field)); } } }); return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) { return fields.map(function(field) { return formatValue(row[field]); }).join(delimiter); })).join("\n"); }; dsv.formatRows = function(rows) { return rows.map(formatRow).join("\n"); }; function formatRow(row) { return row.map(formatValue).join(delimiter); } function formatValue(text) { return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text; } return dsv; }; d3.csv = d3.dsv(",", "text/csv"); d3.tsv = d3.dsv(" ", "text/tab-separated-values"); var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) { setTimeout(callback, 17); }; d3.timer = function(callback, delay, then) { var n = arguments.length; if (n < 2) delay = 0; if (n < 3) then = Date.now(); var time = then + delay, timer = { c: callback, t: time, f: false, n: null }; if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer; d3_timer_queueTail = timer; if (!d3_timer_interval) { d3_timer_timeout = clearTimeout(d3_timer_timeout); d3_timer_interval = 1; d3_timer_frame(d3_timer_step); } }; function d3_timer_step() { var now = d3_timer_mark(), delay = d3_timer_sweep() - now; if (delay > 24) { if (isFinite(delay)) { clearTimeout(d3_timer_timeout); d3_timer_timeout = setTimeout(d3_timer_step, delay); } d3_timer_interval = 0; } else { d3_timer_interval = 1; d3_timer_frame(d3_timer_step); } } d3.timer.flush = function() { d3_timer_mark(); d3_timer_sweep(); }; function d3_timer_mark() { var now = Date.now(); d3_timer_active = d3_timer_queueHead; while (d3_timer_active) { if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t); d3_timer_active = d3_timer_active.n; } return now; } function d3_timer_sweep() { var t0, t1 = d3_timer_queueHead, time = Infinity; while (t1) { if (t1.f) { t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n; } else { if (t1.t < time) time = t1.t; t1 = (t0 = t1).n; } } d3_timer_queueTail = t0; return time; } function d3_format_precision(x, p) { return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1); } d3.round = function(x, n) { return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x); }; var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix); d3.formatPrefix = function(value, precision) { var i = 0; if (value) { if (value < 0) value *= -1; if (precision) value = d3.round(value, d3_format_precision(value, precision)); i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3)); } return d3_formatPrefixes[8 + i / 3]; }; function d3_formatPrefix(d, i) { var k = Math.pow(10, abs(8 - i) * 3); return { scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; }, symbol: d }; } function d3_locale_numberFormat(locale) { var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping ? function(value) { var i = value.length, t = [], j = 0, g = locale_grouping[0]; while (i > 0 && g > 0) { t.push(value.substring(i -= g, i + g)); g = locale_grouping[j = (j + 1) % locale_grouping.length]; } return t.reverse().join(locale_thousands); } : d3_identity; return function(specifier) { var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false; if (precision) precision = +precision.substring(1); if (zfill || fill === "0" && align === "=") { zfill = fill = "0"; align = "="; if (comma) width -= Math.floor((width - 1) / 4); } switch (type) { case "n": comma = true; type = "g"; break; case "%": scale = 100; suffix = "%"; type = "f"; break; case "p": scale = 100; suffix = "%"; type = "r"; break; case "b": case "o": case "x": case "X": if (symbol === "#") prefix = "0" + type.toLowerCase(); case "c": case "d": integer = true; precision = 0; break; case "s": scale = -1; type = "r"; break; } if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1]; if (type == "r" && !precision) type = "g"; if (precision != null) { if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision)); } type = d3_format_types.get(type) || d3_format_typeDefault; var zcomma = zfill && comma; return function(value) { var fullSuffix = suffix; if (integer && value % 1) return ""; var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign; if (scale < 0) { var unit = d3.formatPrefix(value, precision); value = unit.scale(value); fullSuffix = unit.symbol + suffix; } else { value *= scale; } value = type(value, precision); var i = value.lastIndexOf("."), before = i < 0 ? value : value.substring(0, i), after = i < 0 ? "" : locale_decimal + value.substring(i + 1); if (!zfill && comma) before = formatGroup(before); var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : ""; if (zcomma) before = formatGroup(padding + before); negative += prefix; value = before + after; return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix; }; }; } var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i; var d3_format_types = d3.map({ b: function(x) { return x.toString(2); }, c: function(x) { return String.fromCharCode(x); }, o: function(x) { return x.toString(8); }, x: function(x) { return x.toString(16); }, X: function(x) { return x.toString(16).toUpperCase(); }, g: function(x, p) { return x.toPrecision(p); }, e: function(x, p) { return x.toExponential(p); }, f: function(x, p) { return x.toFixed(p); }, r: function(x, p) { return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p)))); } }); function d3_format_typeDefault(x) { return x + ""; } var d3_time = d3.time = {}, d3_date = Date; function d3_date_utc() { this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]); } d3_date_utc.prototype = { getDate: function() { return this._.getUTCDate(); }, getDay: function() { return this._.getUTCDay(); }, getFullYear: function() { return this._.getUTCFullYear(); }, getHours: function() { return this._.getUTCHours(); }, getMilliseconds: function() { return this._.getUTCMilliseconds(); }, getMinutes: function() { return this._.getUTCMinutes(); }, getMonth: function() { return this._.getUTCMonth(); }, getSeconds: function() { return this._.getUTCSeconds(); }, getTime: function() { return this._.getTime(); }, getTimezoneOffset: function() { return 0; }, valueOf: function() { return this._.valueOf(); }, setDate: function() { d3_time_prototype.setUTCDate.apply(this._, arguments); }, setDay: function() { d3_time_prototype.setUTCDay.apply(this._, arguments); }, setFullYear: function() { d3_time_prototype.setUTCFullYear.apply(this._, arguments); }, setHours: function() { d3_time_prototype.setUTCHours.apply(this._, arguments); }, setMilliseconds: function() { d3_time_prototype.setUTCMilliseconds.apply(this._, arguments); }, setMinutes: function() { d3_time_prototype.setUTCMinutes.apply(this._, arguments); }, setMonth: function() { d3_time_prototype.setUTCMonth.apply(this._, arguments); }, setSeconds: function() { d3_time_prototype.setUTCSeconds.apply(this._, arguments); }, setTime: function() { d3_time_prototype.setTime.apply(this._, arguments); } }; var d3_time_prototype = Date.prototype; function d3_time_interval(local, step, number) { function round(date) { var d0 = local(date), d1 = offset(d0, 1); return date - d0 < d1 - date ? d0 : d1; } function ceil(date) { step(date = local(new d3_date(date - 1)), 1); return date; } function offset(date, k) { step(date = new d3_date(+date), k); return date; } function range(t0, t1, dt) { var time = ceil(t0), times = []; if (dt > 1) { while (time < t1) { if (!(number(time) % dt)) times.push(new Date(+time)); step(time, 1); } } else { while (time < t1) times.push(new Date(+time)), step(time, 1); } return times; } function range_utc(t0, t1, dt) { try { d3_date = d3_date_utc; var utc = new d3_date_utc(); utc._ = t0; return range(utc, t1, dt); } finally { d3_date = Date; } } local.floor = local; local.round = round; local.ceil = ceil; local.offset = offset; local.range = range; var utc = local.utc = d3_time_interval_utc(local); utc.floor = utc; utc.round = d3_time_interval_utc(round); utc.ceil = d3_time_interval_utc(ceil); utc.offset = d3_time_interval_utc(offset); utc.range = range_utc; return local; } function d3_time_interval_utc(method) { return function(date, k) { try { d3_date = d3_date_utc; var utc = new d3_date_utc(); utc._ = date; return method(utc, k)._; } finally { d3_date = Date; } }; } d3_time.year = d3_time_interval(function(date) { date = d3_time.day(date); date.setMonth(0, 1); return date; }, function(date, offset) { date.setFullYear(date.getFullYear() + offset); }, function(date) { return date.getFullYear(); }); d3_time.years = d3_time.year.range; d3_time.years.utc = d3_time.year.utc.range; d3_time.day = d3_time_interval(function(date) { var day = new d3_date(2e3, 0); day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); return day; }, function(date, offset) { date.setDate(date.getDate() + offset); }, function(date) { return date.getDate() - 1; }); d3_time.days = d3_time.day.range; d3_time.days.utc = d3_time.day.utc.range; d3_time.dayOfYear = function(date) { var year = d3_time.year(date); return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5); }; [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) { i = 7 - i; var interval = d3_time[day] = d3_time_interval(function(date) { (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7); return date; }, function(date, offset) { date.setDate(date.getDate() + Math.floor(offset) * 7); }, function(date) { var day = d3_time.year(date).getDay(); return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i); }); d3_time[day + "s"] = interval.range; d3_time[day + "s"].utc = interval.utc.range; d3_time[day + "OfYear"] = function(date) { var day = d3_time.year(date).getDay(); return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7); }; }); d3_time.week = d3_time.sunday; d3_time.weeks = d3_time.sunday.range; d3_time.weeks.utc = d3_time.sunday.utc.range; d3_time.weekOfYear = d3_time.sundayOfYear; function d3_locale_timeFormat(locale) { var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths; function d3_time_format(template) { var n = template.length; function format(date) { var string = [], i = -1, j = 0, c, p, f; while (++i < n) { if (template.charCodeAt(i) === 37) { string.push(template.substring(j, i)); if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); string.push(c); j = i + 1; } } string.push(template.substring(j, i)); return string.join(""); } format.parse = function(string) { var d = { y: 1900, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0, Z: null }, i = d3_time_parse(d, template, string, 0); if (i != string.length) return null; if ("p" in d) d.H = d.H % 12 + d.p * 12; var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)(); if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) { date.setFullYear(d.y, 0, 1); date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7); } else date.setFullYear(d.y, d.m, d.d); date.setHours(d.H + Math.floor(d.Z / 100), d.M + d.Z % 100, d.S, d.L); return localZ ? date._ : date; }; format.toString = function() { return template; }; return format; } function d3_time_parse(date, template, string, j) { var c, p, t, i = 0, n = template.length, m = string.length; while (i < n) { if (j >= m) return -1; c = template.charCodeAt(i++); if (c === 37) { t = template.charAt(i++); p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t]; if (!p || (j = p(date, string, j)) < 0) return -1; } else if (c != string.charCodeAt(j++)) { return -1; } } return j; } d3_time_format.utc = function(template) { var local = d3_time_format(template); function format(date) { try { d3_date = d3_date_utc; var utc = new d3_date(); utc._ = date; return local(utc); } finally { d3_date = Date; } } format.parse = function(string) { try { d3_date = d3_date_utc; var date = local.parse(string); return date && date._; } finally { d3_date = Date; } }; format.toString = local.toString; return format; }; d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti; var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths); locale_periods.forEach(function(p, i) { d3_time_periodLookup.set(p.toLowerCase(), i); }); var d3_time_formats = { a: function(d) { return locale_shortDays[d.getDay()]; }, A: function(d) { return locale_days[d.getDay()]; }, b: function(d) { return locale_shortMonths[d.getMonth()]; }, B: function(d) { return locale_months[d.getMonth()]; }, c: d3_time_format(locale_dateTime), d: function(d, p) { return d3_time_formatPad(d.getDate(), p, 2); }, e: function(d, p) { return d3_time_formatPad(d.getDate(), p, 2); }, H: function(d, p) { return d3_time_formatPad(d.getHours(), p, 2); }, I: function(d, p) { return d3_time_formatPad(d.getHours() % 12 || 12, p, 2); }, j: function(d, p) { return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3); }, L: function(d, p) { return d3_time_formatPad(d.getMilliseconds(), p, 3); }, m: function(d, p) { return d3_time_formatPad(d.getMonth() + 1, p, 2); }, M: function(d, p) { return d3_time_formatPad(d.getMinutes(), p, 2); }, p: function(d) { return locale_periods[+(d.getHours() >= 12)]; }, S: function(d, p) { return d3_time_formatPad(d.getSeconds(), p, 2); }, U: function(d, p) { return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2); }, w: function(d) { return d.getDay(); }, W: function(d, p) { return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2); }, x: d3_time_format(locale_date), X: d3_time_format(locale_time), y: function(d, p) { return d3_time_formatPad(d.getFullYear() % 100, p, 2); }, Y: function(d, p) { return d3_time_formatPad(d.getFullYear() % 1e4, p, 4); }, Z: d3_time_zone, "%": function() { return "%"; } }; var d3_time_parsers = { a: d3_time_parseWeekdayAbbrev, A: d3_time_parseWeekday, b: d3_time_parseMonthAbbrev, B: d3_time_parseMonth, c: d3_time_parseLocaleFull, d: d3_time_parseDay, e: d3_time_parseDay, H: d3_time_parseHour24, I: d3_time_parseHour24, j: d3_time_parseDayOfYear, L: d3_time_parseMilliseconds, m: d3_time_parseMonthNumber, M: d3_time_parseMinutes, p: d3_time_parseAmPm, S: d3_time_parseSeconds, U: d3_time_parseWeekNumberSunday, w: d3_time_parseWeekdayNumber, W: d3_time_parseWeekNumberMonday, x: d3_time_parseLocaleDate, X: d3_time_parseLocaleTime, y: d3_time_parseYear, Y: d3_time_parseFullYear, Z: d3_time_parseZone, "%": d3_time_parseLiteralPercent }; function d3_time_parseWeekdayAbbrev(date, string, i) { d3_time_dayAbbrevRe.lastIndex = 0; var n = d3_time_dayAbbrevRe.exec(string.substring(i)); return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function d3_time_parseWeekday(date, string, i) { d3_time_dayRe.lastIndex = 0; var n = d3_time_dayRe.exec(string.substring(i)); return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function d3_time_parseMonthAbbrev(date, string, i) { d3_time_monthAbbrevRe.lastIndex = 0; var n = d3_time_monthAbbrevRe.exec(string.substring(i)); return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function d3_time_parseMonth(date, string, i) { d3_time_monthRe.lastIndex = 0; var n = d3_time_monthRe.exec(string.substring(i)); return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; } function d3_time_parseLocaleFull(date, string, i) { return d3_time_parse(date, d3_time_formats.c.toString(), string, i); } function d3_time_parseLocaleDate(date, string, i) { return d3_time_parse(date, d3_time_formats.x.toString(), string, i); } function d3_time_parseLocaleTime(date, string, i) { return d3_time_parse(date, d3_time_formats.X.toString(), string, i); } function d3_time_parseAmPm(date, string, i) { var n = d3_time_periodLookup.get(string.substring(i, i += 2).toLowerCase()); return n == null ? -1 : (date.p = n, i); } return d3_time_format; } var d3_time_formatPads = { "-": "", _: " ", "0": "0" }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/; function d3_time_formatPad(value, fill, width) { var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length; return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string); } function d3_time_formatRe(names) { return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i"); } function d3_time_formatLookup(names) { var map = new d3_Map(), i = -1, n = names.length; while (++i < n) map.set(names[i].toLowerCase(), i); return map; } function d3_time_parseWeekdayNumber(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 1)); return n ? (date.w = +n[0], i + n[0].length) : -1; } function d3_time_parseWeekNumberSunday(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i)); return n ? (date.U = +n[0], i + n[0].length) : -1; } function d3_time_parseWeekNumberMonday(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i)); return n ? (date.W = +n[0], i + n[0].length) : -1; } function d3_time_parseFullYear(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 4)); return n ? (date.y = +n[0], i + n[0].length) : -1; } function d3_time_parseYear(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; } function d3_time_parseZone(date, string, i) { return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = +string, i + 5) : -1; } function d3_time_expandYear(d) { return d + (d > 68 ? 1900 : 2e3); } function d3_time_parseMonthNumber(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.m = n[0] - 1, i + n[0].length) : -1; } function d3_time_parseDay(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.d = +n[0], i + n[0].length) : -1; } function d3_time_parseDayOfYear(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 3)); return n ? (date.j = +n[0], i + n[0].length) : -1; } function d3_time_parseHour24(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.H = +n[0], i + n[0].length) : -1; } function d3_time_parseMinutes(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.M = +n[0], i + n[0].length) : -1; } function d3_time_parseSeconds(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 2)); return n ? (date.S = +n[0], i + n[0].length) : -1; } function d3_time_parseMilliseconds(date, string, i) { d3_time_numberRe.lastIndex = 0; var n = d3_time_numberRe.exec(string.substring(i, i + 3)); return n ? (date.L = +n[0], i + n[0].length) : -1; } function d3_time_zone(d) { var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = ~~(abs(z) / 60), zm = abs(z) % 60; return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2); } function d3_time_parseLiteralPercent(date, string, i) { d3_time_percentRe.lastIndex = 0; var n = d3_time_percentRe.exec(string.substring(i, i + 1)); return n ? i + n[0].length : -1; } function d3_time_formatMulti(formats) { var n = formats.length, i = -1; while (++i < n) formats[i][0] = this(formats[i][0]); return function(date) { var i = 0, f = formats[i]; while (!f[1](date)) f = formats[++i]; return f[0](date); }; } d3.locale = function(locale) { return { numberFormat: d3_locale_numberFormat(locale), timeFormat: d3_locale_timeFormat(locale) }; }; var d3_locale_enUS = d3.locale({ decimal: ".", thousands: ",", grouping: [ 3 ], currency: [ "$", "" ], dateTime: "%a %b %e %X %Y", date: "%m/%d/%Y", time: "%H:%M:%S", periods: [ "AM", "PM" ], days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] }); d3.format = d3_locale_enUS.numberFormat; d3.geo = {}; function d3_adder() {} d3_adder.prototype = { s: 0, t: 0, add: function(y) { d3_adderSum(y, this.t, d3_adderTemp); d3_adderSum(d3_adderTemp.s, this.s, this); if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t; }, reset: function() { this.s = this.t = 0; }, valueOf: function() { return this.s; } }; var d3_adderTemp = new d3_adder(); function d3_adderSum(a, b, o) { var x = o.s = a + b, bv = x - a, av = x - bv; o.t = a - av + (b - bv); } d3.geo.stream = function(object, listener) { if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) { d3_geo_streamObjectType[object.type](object, listener); } else { d3_geo_streamGeometry(object, listener); } }; function d3_geo_streamGeometry(geometry, listener) { if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) { d3_geo_streamGeometryType[geometry.type](geometry, listener); } } var d3_geo_streamObjectType = { Feature: function(feature, listener) { d3_geo_streamGeometry(feature.geometry, listener); }, FeatureCollection: function(object, listener) { var features = object.features, i = -1, n = features.length; while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener); } }; var d3_geo_streamGeometryType = { Sphere: function(object, listener) { listener.sphere(); }, Point: function(object, listener) { object = object.coordinates; listener.point(object[0], object[1], object[2]); }, MultiPoint: function(object, listener) { var coordinates = object.coordinates, i = -1, n = coordinates.length; while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]); }, LineString: function(object, listener) { d3_geo_streamLine(object.coordinates, listener, 0); }, MultiLineString: function(object, listener) { var coordinates = object.coordinates, i = -1, n = coordinates.length; while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0); }, Polygon: function(object, listener) { d3_geo_streamPolygon(object.coordinates, listener); }, MultiPolygon: function(object, listener) { var coordinates = object.coordinates, i = -1, n = coordinates.length; while (++i < n) d3_geo_streamPolygon(coordinates[i], listener); }, GeometryCollection: function(object, listener) { var geometries = object.geometries, i = -1, n = geometries.length; while (++i < n) d3_geo_streamGeometry(geometries[i], listener); } }; function d3_geo_streamLine(coordinates, listener, closed) { var i = -1, n = coordinates.length - closed, coordinate; listener.lineStart(); while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]); listener.lineEnd(); } function d3_geo_streamPolygon(coordinates, listener) { var i = -1, n = coordinates.length; listener.polygonStart(); while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1); listener.polygonEnd(); } d3.geo.area = function(object) { d3_geo_areaSum = 0; d3.geo.stream(object, d3_geo_area); return d3_geo_areaSum; }; var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder(); var d3_geo_area = { sphere: function() { d3_geo_areaSum += 4 * π; }, point: d3_noop, lineStart: d3_noop, lineEnd: d3_noop, polygonStart: function() { d3_geo_areaRingSum.reset(); d3_geo_area.lineStart = d3_geo_areaRingStart; }, polygonEnd: function() { var area = 2 * d3_geo_areaRingSum; d3_geo_areaSum += area < 0 ? 4 * π + area : area; d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop; } }; function d3_geo_areaRingStart() { var λ00, φ00, λ0, cosφ0, sinφ0; d3_geo_area.point = function(λ, φ) { d3_geo_area.point = nextPoint; λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), sinφ0 = Math.sin(φ); }; function nextPoint(λ, φ) { λ *= d3_radians; φ = φ * d3_radians / 2 + π / 4; var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ); d3_geo_areaRingSum.add(Math.atan2(v, u)); λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ; } d3_geo_area.lineEnd = function() { nextPoint(λ00, φ00); }; } function d3_geo_cartesian(spherical) { var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ); return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ]; } function d3_geo_cartesianDot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } function d3_geo_cartesianCross(a, b) { return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ]; } function d3_geo_cartesianAdd(a, b) { a[0] += b[0]; a[1] += b[1]; a[2] += b[2]; } function d3_geo_cartesianScale(vector, k) { return [ vector[0] * k, vector[1] * k, vector[2] * k ]; } function d3_geo_cartesianNormalize(d) { var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); d[0] /= l; d[1] /= l; d[2] /= l; } function d3_geo_spherical(cartesian) { return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ]; } function d3_geo_sphericalEqual(a, b) { return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε; } d3.geo.bounds = function() { var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range; var bound = { point: point, lineStart: lineStart, lineEnd: lineEnd, polygonStart: function() { bound.point = ringPoint; bound.lineStart = ringStart; bound.lineEnd = ringEnd; dλSum = 0; d3_geo_area.polygonStart(); }, polygonEnd: function() { d3_geo_area.polygonEnd(); bound.point = point; bound.lineStart = lineStart; bound.lineEnd = lineEnd; if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90; range[0] = λ0, range[1] = λ1; } }; function point(λ, φ) { ranges.push(range = [ λ0 = λ, λ1 = λ ]); if (φ < φ0) φ0 = φ; if (φ > φ1) φ1 = φ; } function linePoint(λ, φ) { var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]); if (p0) { var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal); d3_geo_cartesianNormalize(inflection); inflection = d3_geo_spherical(inflection); var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180; if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) { var φi = inflection[1] * d3_degrees; if (φi > φ1) φ1 = φi; } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) { var φi = -inflection[1] * d3_degrees; if (φi < φ0) φ0 = φi; } else { if (φ < φ0) φ0 = φ; if (φ > φ1) φ1 = φ; } if (antimeridian) { if (λ < λ_) { if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; } else { if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; } } else { if (λ1 >= λ0) { if (λ < λ0) λ0 = λ; if (λ > λ1) λ1 = λ; } else { if (λ > λ_) { if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ; } else { if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ; } } } } else { point(λ, φ); } p0 = p, λ_ = λ; } function lineStart() { bound.point = linePoint; } function lineEnd() { range[0] = λ0, range[1] = λ1; bound.point = point; p0 = null; } function ringPoint(λ, φ) { if (p0) { var dλ = λ - λ_; dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ; } else λ__ = λ, φ__ = φ; d3_geo_area.point(λ, φ); linePoint(λ, φ); } function ringStart() { d3_geo_area.lineStart(); } function ringEnd() { ringPoint(λ__, φ__); d3_geo_area.lineEnd(); if (abs(dλSum) > ε) λ0 = -(λ1 = 180); range[0] = λ0, range[1] = λ1; p0 = null; } function angle(λ0, λ1) { return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1; } function compareRanges(a, b) { return a[0] - b[0]; } function withinRange(x, range) { return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x; } return function(feature) { φ1 = λ1 = -(λ0 = φ0 = Infinity); ranges = []; d3.geo.stream(feature, bound); var n = ranges.length; if (n) { ranges.sort(compareRanges); for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) { b = ranges[i]; if (withinRange(b[0], a) || withinRange(b[1], a)) { if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1]; if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0]; } else { merged.push(a = b); } } var best = -Infinity, dλ; for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) { b = merged[i]; if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1]; } } ranges = range = null; return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ]; }; }(); d3.geo.centroid = function(object) { d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; d3.geo.stream(object, d3_geo_centroid); var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z; if (m < ε2) { x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1; if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0; m = x * x + y * y + z * z; if (m < ε2) return [ NaN, NaN ]; } return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ]; }; var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2; var d3_geo_centroid = { sphere: d3_noop, point: d3_geo_centroidPoint, lineStart: d3_geo_centroidLineStart, lineEnd: d3_geo_centroidLineEnd, polygonStart: function() { d3_geo_centroid.lineStart = d3_geo_centroidRingStart; }, polygonEnd: function() { d3_geo_centroid.lineStart = d3_geo_centroidLineStart; } }; function d3_geo_centroidPoint(λ, φ) { λ *= d3_radians; var cosφ = Math.cos(φ *= d3_radians); d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ)); } function d3_geo_centroidPointXYZ(x, y, z) { ++d3_geo_centroidW0; d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0; d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0; d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0; } function d3_geo_centroidLineStart() { var x0, y0, z0; d3_geo_centroid.point = function(λ, φ) { λ *= d3_radians; var cosφ = Math.cos(φ *= d3_radians); x0 = cosφ * Math.cos(λ); y0 = cosφ * Math.sin(λ); z0 = Math.sin(φ); d3_geo_centroid.point = nextPoint; d3_geo_centroidPointXYZ(x0, y0, z0); }; function nextPoint(λ, φ) { λ *= d3_radians; var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z); d3_geo_centroidW1 += w; d3_geo_centroidX1 += w * (x0 + (x0 = x)); d3_geo_centroidY1 += w * (y0 + (y0 = y)); d3_geo_centroidZ1 += w * (z0 + (z0 = z)); d3_geo_centroidPointXYZ(x0, y0, z0); } } function d3_geo_centroidLineEnd() { d3_geo_centroid.point = d3_geo_centroidPoint; } function d3_geo_centroidRingStart() { var λ00, φ00, x0, y0, z0; d3_geo_centroid.point = function(λ, φ) { λ00 = λ, φ00 = φ; d3_geo_centroid.point = nextPoint; λ *= d3_radians; var cosφ = Math.cos(φ *= d3_radians); x0 = cosφ * Math.cos(λ); y0 = cosφ * Math.sin(λ); z0 = Math.sin(φ); d3_geo_centroidPointXYZ(x0, y0, z0); }; d3_geo_centroid.lineEnd = function() { nextPoint(λ00, φ00); d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd; d3_geo_centroid.point = d3_geo_centroidPoint; }; function nextPoint(λ, φ) { λ *= d3_radians; var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u); d3_geo_centroidX2 += v * cx; d3_geo_centroidY2 += v * cy; d3_geo_centroidZ2 += v * cz; d3_geo_centroidW1 += w; d3_geo_centroidX1 += w * (x0 + (x0 = x)); d3_geo_centroidY1 += w * (y0 + (y0 = y)); d3_geo_centroidZ1 += w * (z0 + (z0 = z)); d3_geo_centroidPointXYZ(x0, y0, z0); } } function d3_true() { return true; } function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) { var subject = [], clip = []; segments.forEach(function(segment) { if ((n = segment.length - 1) <= 0) return; var n, p0 = segment[0], p1 = segment[n]; if (d3_geo_sphericalEqual(p0, p1)) { listener.lineStart(); for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]); listener.lineEnd(); return; } var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false); a.o = b; subject.push(a); clip.push(b); a = new d3_geo_clipPolygonIntersection(p1, segment, null, false); b = new d3_geo_clipPolygonIntersection(p1, null, a, true); a.o = b; subject.push(a); clip.push(b); }); clip.sort(compare); d3_geo_clipPolygonLinkCircular(subject); d3_geo_clipPolygonLinkCircular(clip); if (!subject.length) return; for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) { clip[i].e = entry = !entry; } var start = subject[0], points, point; while (1) { var current = start, isSubject = true; while (current.v) if ((current = current.n) === start) return; points = current.z; listener.lineStart(); do { current.v = current.o.v = true; if (current.e) { if (isSubject) { for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]); } else { interpolate(current.x, current.n.x, 1, listener); } current = current.n; } else { if (isSubject) { points = current.p.z; for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]); } else { interpolate(current.x, current.p.x, -1, listener); } current = current.p; } current = current.o; points = current.z; isSubject = !isSubject; } while (!current.v); listener.lineEnd(); } } function d3_geo_clipPolygonLinkCircular(array) { if (!(n = array.length)) return; var n, i = 0, a = array[0], b; while (++i < n) { a.n = b = array[i]; b.p = a; a = b; } a.n = b = array[0]; b.p = a; } function d3_geo_clipPolygonIntersection(point, points, other, entry) { this.x = point; this.z = points; this.o = other; this.e = entry; this.v = false; this.n = this.p = null; } function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) { return function(rotate, listener) { var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]); var clip = { point: point, lineStart: lineStart, lineEnd: lineEnd, polygonStart: function() { clip.point = pointRing; clip.lineStart = ringStart; clip.lineEnd = ringEnd; segments = []; polygon = []; listener.polygonStart(); }, polygonEnd: function() { clip.point = point; clip.lineStart = lineStart; clip.lineEnd = lineEnd; segments = d3.merge(segments); var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon); if (segments.length) { d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener); } else if (clipStartInside) { listener.lineStart(); interpolate(null, null, 1, listener); listener.lineEnd(); } listener.polygonEnd(); segments = polygon = null; }, sphere: function() { listener.polygonStart(); listener.lineStart(); interpolate(null, null, 1, listener); listener.lineEnd(); listener.polygonEnd(); } }; function point(λ, φ) { var point = rotate(λ, φ); if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ); } function pointLine(λ, φ) { var point = rotate(λ, φ); line.point(point[0], point[1]); } function lineStart() { clip.point = pointLine; line.lineStart(); } function lineEnd() { clip.point = point; line.lineEnd(); } var segments; var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygon, ring; function pointRing(λ, φ) { ring.push([ λ, φ ]); var point = rotate(λ, φ); ringListener.point(point[0], point[1]); } function ringStart() { ringListener.lineStart(); ring = []; } function ringEnd() { pointRing(ring[0][0], ring[0][1]); ringListener.lineEnd(); var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length; ring.pop(); polygon.push(ring); ring = null; if (!n) return; if (clean & 1) { segment = ringSegments[0]; var n = segment.length - 1, i = -1, point; listener.lineStart(); while (++i < n) listener.point((point = segment[i])[0], point[1]); listener.lineEnd(); return; } if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift())); segments.push(ringSegments.filter(d3_geo_clipSegmentLength1)); } return clip; }; } function d3_geo_clipSegmentLength1(segment) { return segment.length > 1; } function d3_geo_clipBufferListener() { var lines = [], line; return { lineStart: function() { lines.push(line = []); }, point: function(λ, φ) { line.push([ λ, φ ]); }, lineEnd: d3_noop, buffer: function() { var buffer = lines; lines = []; line = null; return buffer; }, rejoin: function() { if (lines.length > 1) lines.push(lines.pop().concat(lines.shift())); } }; } function d3_geo_clipSort(a, b) { return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]); } function d3_geo_pointInPolygon(point, polygon) { var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0; d3_geo_areaRingSum.reset(); for (var i = 0, n = polygon.length; i < n; ++i) { var ring = polygon[i], m = ring.length; if (!m) continue; var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1; while (true) { if (j === m) j = 0; point = ring[j]; var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ; d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ))); polarAngle += antimeridian ? dλ + sdλ * τ : dλ; if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) { var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point)); d3_geo_cartesianNormalize(arc); var intersection = d3_geo_cartesianCross(meridianNormal, arc); d3_geo_cartesianNormalize(intersection); var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]); if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) { winding += antimeridian ^ dλ >= 0 ? 1 : -1; } } if (!j++) break; λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point; } } return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1; } var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]); function d3_geo_clipAntimeridianLine(listener) { var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean; return { lineStart: function() { listener.lineStart(); clean = 1; }, point: function(λ1, φ1) { var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0); if (abs(dλ - π) < ε) { listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ); listener.point(sλ0, φ0); listener.lineEnd(); listener.lineStart(); listener.point(sλ1, φ0); listener.point(λ1, φ0); clean = 0; } else if (sλ0 !== sλ1 && dλ >= π) { if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε; if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε; φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1); listener.point(sλ0, φ0); listener.lineEnd(); listener.lineStart(); listener.point(sλ1, φ0); clean = 0; } listener.point(λ0 = λ1, φ0 = φ1); sλ0 = sλ1; }, lineEnd: function() { listener.lineEnd(); λ0 = φ0 = NaN; }, clean: function() { return 2 - clean; } }; } function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) { var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1); return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2; } function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) { var φ; if (from == null) { φ = direction * halfπ; listener.point(-π, φ); listener.point(0, φ); listener.point(π, φ); listener.point(π, 0); listener.point(π, -φ); listener.point(0, -φ); listener.point(-π, -φ); listener.point(-π, 0); listener.point(-π, φ); } else if (abs(from[0] - to[0]) > ε) { var s = from[0] < to[0] ? π : -π; φ = direction * s / 2; listener.point(-s, φ); listener.point(0, φ); listener.point(s, φ); } else { listener.point(to[0], to[1]); } } function d3_geo_clipCircle(radius) { var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians); return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]); function visible(λ, φ) { return Math.cos(λ) * Math.cos(φ) > cr; } function clipLine(listener) { var point0, c0, v0, v00, clean; return { lineStart: function() { v00 = v0 = false; clean = 1; }, point: function(λ, φ) { var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0; if (!point0 && (v00 = v0 = v)) listener.lineStart(); if (v !== v0) { point2 = intersect(point0, point1); if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) { point1[0] += ε; point1[1] += ε; v = visible(point1[0], point1[1]); } } if (v !== v0) { clean = 0; if (v) { listener.lineStart(); point2 = intersect(point1, point0); listener.point(point2[0], point2[1]); } else { point2 = intersect(point0, point1); listener.point(point2[0], point2[1]); listener.lineEnd(); } point0 = point2; } else if (notHemisphere && point0 && smallRadius ^ v) { var t; if (!(c & c0) && (t = intersect(point1, point0, true))) { clean = 0; if (smallRadius) { listener.lineStart(); listener.point(t[0][0], t[0][1]); listener.point(t[1][0], t[1][1]); listener.lineEnd(); } else { listener.point(t[1][0], t[1][1]); listener.lineEnd(); listener.lineStart(); listener.point(t[0][0], t[0][1]); } } } if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) { listener.point(point1[0], point1[1]); } point0 = point1, v0 = v, c0 = c; }, lineEnd: function() { if (v0) listener.lineEnd(); point0 = null; }, clean: function() { return clean | (v00 && v0) << 1; } }; } function intersect(a, b, two) { var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b); var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2; if (!determinant) return !two && a; var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2); d3_geo_cartesianAdd(A, B); var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1); if (t2 < 0) return; var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu); d3_geo_cartesianAdd(q, A); q = d3_geo_spherical(q); if (!two) return q; var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z; if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z; var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε; if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z; if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) { var q1 = d3_geo_cartesianScale(u, (-w + t) / uu); d3_geo_cartesianAdd(q1, A); return [ q, d3_geo_spherical(q1) ]; } } function code(λ, φ) { var r = smallRadius ? radius : π - radius, code = 0; if (λ < -r) code |= 1; else if (λ > r) code |= 2; if (φ < -r) code |= 4; else if (φ > r) code |= 8; return code; } } function d3_geom_clipLine(x0, y0, x1, y1) { return function(line) { var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r; r = x0 - ax; if (!dx && r > 0) return; r /= dx; if (dx < 0) { if (r < t0) return; if (r < t1) t1 = r; } else if (dx > 0) { if (r > t1) return; if (r > t0) t0 = r; } r = x1 - ax; if (!dx && r < 0) return; r /= dx; if (dx < 0) { if (r > t1) return; if (r > t0) t0 = r; } else if (dx > 0) { if (r < t0) return; if (r < t1) t1 = r; } r = y0 - ay; if (!dy && r > 0) return; r /= dy; if (dy < 0) { if (r < t0) return; if (r < t1) t1 = r; } else if (dy > 0) { if (r > t1) return; if (r > t0) t0 = r; } r = y1 - ay; if (!dy && r < 0) return; r /= dy; if (dy < 0) { if (r > t1) return; if (r > t0) t0 = r; } else if (dy > 0) { if (r < t0) return; if (r < t1) t1 = r; } if (t0 > 0) line.a = { x: ax + t0 * dx, y: ay + t0 * dy }; if (t1 < 1) line.b = { x: ax + t1 * dx, y: ay + t1 * dy }; return line; }; } var d3_geo_clipExtentMAX = 1e9; d3.geo.clipExtent = function() { var x0, y0, x1, y1, stream, clip, clipExtent = { stream: function(output) { if (stream) stream.valid = false; stream = clip(output); stream.valid = true; return stream; }, extent: function(_) { if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]); if (stream) stream.valid = false, stream = null; return clipExtent; } }; return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]); }; function d3_geo_clipExtent(x0, y0, x1, y1) { return function(listener) { var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring; var clip = { point: point, lineStart: lineStart, lineEnd: lineEnd, polygonStart: function() { listener = bufferListener; segments = []; polygon = []; clean = true; }, polygonEnd: function() { listener = listener_; segments = d3.merge(segments); var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length; if (inside || visible) { listener.polygonStart(); if (inside) { listener.lineStart(); interpolate(null, null, 1, listener); listener.lineEnd(); } if (visible) { d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener); } listener.polygonEnd(); } segments = polygon = ring = null; } }; function insidePolygon(p) { var wn = 0, n = polygon.length, y = p[1]; for (var i = 0; i < n; ++i) { for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) { b = v[j]; if (a[1] <= y) { if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn; } else { if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn; } a = b; } } return wn !== 0; } function interpolate(from, to, direction, listener) { var a = 0, a1 = 0; if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) { do { listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0); } while ((a = (a + direction + 4) % 4) !== a1); } else { listener.point(to[0], to[1]); } } function pointVisible(x, y) { return x0 <= x && x <= x1 && y0 <= y && y <= y1; } function point(x, y) { if (pointVisible(x, y)) listener.point(x, y); } var x__, y__, v__, x_, y_, v_, first, clean; function lineStart() { clip.point = linePoint; if (polygon) polygon.push(ring = []); first = true; v_ = false; x_ = y_ = NaN; } function lineEnd() { if (segments) { linePoint(x__, y__); if (v__ && v_) bufferListener.rejoin(); segments.push(bufferListener.buffer()); } clip.point = point; if (v_) listener.lineEnd(); } function linePoint(x, y) { x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x)); y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y)); var v = pointVisible(x, y); if (polygon) ring.push([ x, y ]); if (first) { x__ = x, y__ = y, v__ = v; first = false; if (v) { listener.lineStart(); listener.point(x, y); } } else { if (v && v_) listener.point(x, y); else { var l = { a: { x: x_, y: y_ }, b: { x: x, y: y } }; if (clipLine(l)) { if (!v_) { listener.lineStart(); listener.point(l.a.x, l.a.y); } listener.point(l.b.x, l.b.y); if (!v) listener.lineEnd(); clean = false; } else if (v) { listener.lineStart(); listener.point(x, y); clean = false; } } } x_ = x, y_ = y, v_ = v; } return clip; }; function corner(p, direction) { return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2; } function compare(a, b) { return comparePoints(a.x, b.x); } function comparePoints(a, b) { var ca = corner(a, 1), cb = corner(b, 1); return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0]; } } function d3_geo_compose(a, b) { function compose(x, y) { return x = a(x, y), b(x[0], x[1]); } if (a.invert && b.invert) compose.invert = function(x, y) { return x = b.invert(x, y), x && a.invert(x[0], x[1]); }; return compose; } function d3_geo_conic(projectAt) { var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1); p.parallels = function(_) { if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ]; return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180); }; return p; } function d3_geo_conicEqualArea(φ0, φ1) { var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n; function forward(λ, φ) { var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n; return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ]; } forward.invert = function(x, y) { var ρ0_y = ρ0 - y; return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ]; }; return forward; } (d3.geo.conicEqualArea = function() { return d3_geo_conic(d3_geo_conicEqualArea); }).raw = d3_geo_conicEqualArea; d3.geo.albers = function() { return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070); }; d3.geo.albersUsa = function() { var lower48 = d3.geo.albers(); var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]); var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]); var point, pointStream = { point: function(x, y) { point = [ x, y ]; } }, lower48Point, alaskaPoint, hawaiiPoint; function albersUsa(coordinates) { var x = coordinates[0], y = coordinates[1]; point = null; (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y); return point; } albersUsa.invert = function(coordinates) { var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k; return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates); }; albersUsa.stream = function(stream) { var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream); return { point: function(x, y) { lower48Stream.point(x, y); alaskaStream.point(x, y); hawaiiStream.point(x, y); }, sphere: function() { lower48Stream.sphere(); alaskaStream.sphere(); hawaiiStream.sphere(); }, lineStart: function() { lower48Stream.lineStart(); alaskaStream.lineStart(); hawaiiStream.lineStart(); }, lineEnd: function() { lower48Stream.lineEnd(); alaskaStream.lineEnd(); hawaiiStream.lineEnd(); }, polygonStart: function() { lower48Stream.polygonStart(); alaskaStream.polygonStart(); hawaiiStream.polygonStart(); }, polygonEnd: function() { lower48Stream.polygonEnd(); alaskaStream.polygonEnd(); hawaiiStream.polygonEnd(); } }; }; albersUsa.precision = function(_) { if (!arguments.length) return lower48.precision(); lower48.precision(_); alaska.precision(_); hawaii.precision(_); return albersUsa; }; albersUsa.scale = function(_) { if (!arguments.length) return lower48.scale(); lower48.scale(_); alaska.scale(_ * .35); hawaii.scale(_); return albersUsa.translate(lower48.translate()); }; albersUsa.translate = function(_) { if (!arguments.length) return lower48.translate(); var k = lower48.scale(), x = +_[0], y = +_[1]; lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point; alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point; return albersUsa; }; return albersUsa.scale(1070); }; var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = { point: d3_noop, lineStart: d3_noop, lineEnd: d3_noop, polygonStart: function() { d3_geo_pathAreaPolygon = 0; d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart; }, polygonEnd: function() { d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop; d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2); } }; function d3_geo_pathAreaRingStart() { var x00, y00, x0, y0; d3_geo_pathArea.point = function(x, y) { d3_geo_pathArea.point = nextPoint; x00 = x0 = x, y00 = y0 = y; }; function nextPoint(x, y) { d3_geo_pathAreaPolygon += y0 * x - x0 * y; x0 = x, y0 = y; } d3_geo_pathArea.lineEnd = function() { nextPoint(x00, y00); }; } var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1; var d3_geo_pathBounds = { point: d3_geo_pathBoundsPoint, lineStart: d3_noop, lineEnd: d3_noop, polygonStart: d3_noop, polygonEnd: d3_noop }; function d3_geo_pathBoundsPoint(x, y) { if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x; if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x; if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y; if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y; } function d3_geo_pathBuffer() { var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = []; var stream = { point: point, lineStart: function() { stream.point = pointLineStart; }, lineEnd: lineEnd, polygonStart: function() { stream.lineEnd = lineEndPolygon; }, polygonEnd: function() { stream.lineEnd = lineEnd; stream.point = point; }, pointRadius: function(_) { pointCircle = d3_geo_pathBufferCircle(_); return stream; }, result: function() { if (buffer.length) { var result = buffer.join(""); buffer = []; return result; } } }; function point(x, y) { buffer.push("M", x, ",", y, pointCircle); } function pointLineStart(x, y) { buffer.push("M", x, ",", y); stream.point = pointLine; } function pointLine(x, y) { buffer.push("L", x, ",", y); } function lineEnd() { stream.point = point; } function lineEndPolygon() { buffer.push("Z"); } return stream; } function d3_geo_pathBufferCircle(radius) { return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z"; } var d3_geo_pathCentroid = { point: d3_geo_pathCentroidPoint, lineStart: d3_geo_pathCentroidLineStart, lineEnd: d3_geo_pathCentroidLineEnd, polygonStart: function() { d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart; }, polygonEnd: function() { d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart; d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd; } }; function d3_geo_pathCentroidPoint(x, y) { d3_geo_centroidX0 += x; d3_geo_centroidY0 += y; ++d3_geo_centroidZ0; } function d3_geo_pathCentroidLineStart() { var x0, y0; d3_geo_pathCentroid.point = function(x, y) { d3_geo_pathCentroid.point = nextPoint; d3_geo_pathCentroidPoint(x0 = x, y0 = y); }; function nextPoint(x, y) { var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); d3_geo_centroidX1 += z * (x0 + x) / 2; d3_geo_centroidY1 += z * (y0 + y) / 2; d3_geo_centroidZ1 += z; d3_geo_pathCentroidPoint(x0 = x, y0 = y); } } function d3_geo_pathCentroidLineEnd() { d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint; } function d3_geo_pathCentroidRingStart() { var x00, y00, x0, y0; d3_geo_pathCentroid.point = function(x, y) { d3_geo_pathCentroid.point = nextPoint; d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y); }; function nextPoint(x, y) { var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy); d3_geo_centroidX1 += z * (x0 + x) / 2; d3_geo_centroidY1 += z * (y0 + y) / 2; d3_geo_centroidZ1 += z; z = y0 * x - x0 * y; d3_geo_centroidX2 += z * (x0 + x); d3_geo_centroidY2 += z * (y0 + y); d3_geo_centroidZ2 += z * 3; d3_geo_pathCentroidPoint(x0 = x, y0 = y); } d3_geo_pathCentroid.lineEnd = function() { nextPoint(x00, y00); }; } function d3_geo_pathContext(context) { var pointRadius = 4.5; var stream = { point: point, lineStart: function() { stream.point = pointLineStart; }, lineEnd: lineEnd, polygonStart: function() { stream.lineEnd = lineEndPolygon; }, polygonEnd: function() { stream.lineEnd = lineEnd; stream.point = point; }, pointRadius: function(_) { pointRadius = _; return stream; }, result: d3_noop }; function point(x, y) { context.moveTo(x, y); context.arc(x, y, pointRadius, 0, τ); } function pointLineStart(x, y) { context.moveTo(x, y); stream.point = pointLine; } function pointLine(x, y) { context.lineTo(x, y); } function lineEnd() { stream.point = point; } function lineEndPolygon() { context.closePath(); } return stream; } function d3_geo_resample(project) { var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16; function resample(stream) { return (maxDepth ? resampleRecursive : resampleNone)(stream); } function resampleNone(stream) { return d3_geo_transformPoint(stream, function(x, y) { x = project(x, y); stream.point(x[0], x[1]); }); } function resampleRecursive(stream) { var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0; var resample = { point: point, lineStart: lineStart, lineEnd: lineEnd, polygonStart: function() { stream.polygonStart(); resample.lineStart = ringStart; }, polygonEnd: function() { stream.polygonEnd(); resample.lineStart = lineStart; } }; function point(x, y) { x = project(x, y); stream.point(x[0], x[1]); } function lineStart() { x0 = NaN; resample.point = linePoint; stream.lineStart(); } function linePoint(λ, φ) { var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ); resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream); stream.point(x0, y0); } function lineEnd() { resample.point = point; stream.lineEnd(); } function ringStart() { lineStart(); resample.point = ringPoint; resample.lineEnd = ringEnd; } function ringPoint(λ, φ) { linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0; resample.point = linePoint; } function ringEnd() { resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream); resample.lineEnd = lineEnd; lineEnd(); } return resample; } function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) { var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy; if (d2 > 4 * δ2 && depth--) { var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2; if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream); stream.point(x2, y2); resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream); } } } resample.precision = function(_) { if (!arguments.length) return Math.sqrt(δ2); maxDepth = (δ2 = _ * _) > 0 && 16; return resample; }; return resample; } d3.geo.path = function() { var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream; function path(object) { if (object) { if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments)); if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream); d3.geo.stream(object, cacheStream); } return contextStream.result(); } path.area = function(object) { d3_geo_pathAreaSum = 0; d3.geo.stream(object, projectStream(d3_geo_pathArea)); return d3_geo_pathAreaSum; }; path.centroid = function(object) { d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0; d3.geo.stream(object, projectStream(d3_geo_pathCentroid)); return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ]; }; path.bounds = function(object) { d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity); d3.geo.stream(object, projectStream(d3_geo_pathBounds)); return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ]; }; path.projection = function(_) { if (!arguments.length) return projection; projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity; return reset(); }; path.context = function(_) { if (!arguments.length) return context; contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_); if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius); return reset(); }; path.pointRadius = function(_) { if (!arguments.length) return pointRadius; pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_); return path; }; function reset() { cacheStream = null; return path; } return path.projection(d3.geo.albersUsa()).context(null); }; function d3_geo_pathProjectStream(project) { var resample = d3_geo_resample(function(x, y) { return project([ x * d3_degrees, y * d3_degrees ]); }); return function(stream) { return d3_geo_projectionRadians(resample(stream)); }; } d3.geo.transform = function(methods) { return { stream: function(stream) { var transform = new d3_geo_transform(stream); for (var k in methods) transform[k] = methods[k]; return transform; } }; }; function d3_geo_transform(stream) { this.stream = stream; } d3_geo_transform.prototype = { point: function(x, y) { this.stream.point(x, y); }, sphere: function() { this.stream.sphere(); }, lineStart: function() { this.stream.lineStart(); }, lineEnd: function() { this.stream.lineEnd(); }, polygonStart: function() { this.stream.polygonStart(); }, polygonEnd: function() { this.stream.polygonEnd(); } }; function d3_geo_transformPoint(stream, point) { return { point: point, sphere: function() { stream.sphere(); }, lineStart: function() { stream.lineStart(); }, lineEnd: function() { stream.lineEnd(); }, polygonStart: function() { stream.polygonStart(); }, polygonEnd: function() { stream.polygonEnd(); } }; } d3.geo.projection = d3_geo_projection; d3.geo.projectionMutator = d3_geo_projectionMutator; function d3_geo_projection(project) { return d3_geo_projectionMutator(function() { return project; })(); } function d3_geo_projectionMutator(projectAt) { var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) { x = project(x, y); return [ x[0] * k + δx, δy - x[1] * k ]; }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream; function projection(point) { point = projectRotate(point[0] * d3_radians, point[1] * d3_radians); return [ point[0] * k + δx, δy - point[1] * k ]; } function invert(point) { point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k); return point && [ point[0] * d3_degrees, point[1] * d3_degrees ]; } projection.stream = function(output) { if (stream) stream.valid = false; stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output)))); stream.valid = true; return stream; }; projection.clipAngle = function(_) { if (!arguments.length) return clipAngle; preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians); return invalidate(); }; projection.clipExtent = function(_) { if (!arguments.length) return clipExtent; clipExtent = _; postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity; return invalidate(); }; projection.scale = function(_) { if (!arguments.length) return k; k = +_; return reset(); }; projection.translate = function(_) { if (!arguments.length) return [ x, y ]; x = +_[0]; y = +_[1]; return reset(); }; projection.center = function(_) { if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ]; λ = _[0] % 360 * d3_radians; φ = _[1] % 360 * d3_radians; return reset(); }; projection.rotate = function(_) { if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ]; δλ = _[0] % 360 * d3_radians; δφ = _[1] % 360 * d3_radians; δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0; return reset(); }; d3.rebind(projection, projectResample, "precision"); function reset() { projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project); var center = project(λ, φ); δx = x - center[0] * k; δy = y + center[1] * k; return invalidate(); } function invalidate() { if (stream) stream.valid = false, stream = null; return projection; } return function() { project = projectAt.apply(this, arguments); projection.invert = project.invert && invert; return reset(); }; } function d3_geo_projectionRadians(stream) { return d3_geo_transformPoint(stream, function(x, y) { stream.point(x * d3_radians, y * d3_radians); }); } function d3_geo_equirectangular(λ, φ) { return [ λ, φ ]; } (d3.geo.equirectangular = function() { return d3_geo_projection(d3_geo_equirectangular); }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular; d3.geo.rotation = function(rotate) { rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0); function forward(coordinates) { coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians); return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; } forward.invert = function(coordinates) { coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians); return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates; }; return forward; }; function d3_geo_identityRotation(λ, φ) { return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; } d3_geo_identityRotation.invert = d3_geo_equirectangular; function d3_geo_rotation(δλ, δφ, δγ) { return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation; } function d3_geo_forwardRotationλ(δλ) { return function(λ, φ) { return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ]; }; } function d3_geo_rotationλ(δλ) { var rotation = d3_geo_forwardRotationλ(δλ); rotation.invert = d3_geo_forwardRotationλ(-δλ); return rotation; } function d3_geo_rotationφγ(δφ, δγ) { var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ); function rotation(λ, φ) { var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ; return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ]; } rotation.invert = function(λ, φ) { var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ; return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ]; }; return rotation; } d3.geo.circle = function() { var origin = [ 0, 0 ], angle, precision = 6, interpolate; function circle() { var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = []; interpolate(null, null, 1, { point: function(x, y) { ring.push(x = rotate(x, y)); x[0] *= d3_degrees, x[1] *= d3_degrees; } }); return { type: "Polygon", coordinates: [ ring ] }; } circle.origin = function(x) { if (!arguments.length) return origin; origin = x; return circle; }; circle.angle = function(x) { if (!arguments.length) return angle; interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians); return circle; }; circle.precision = function(_) { if (!arguments.length) return precision; interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians); return circle; }; return circle.angle(90); }; function d3_geo_circleInterpolate(radius, precision) { var cr = Math.cos(radius), sr = Math.sin(radius); return function(from, to, direction, listener) { var step = direction * precision; if (from != null) { from = d3_geo_circleAngle(cr, from); to = d3_geo_circleAngle(cr, to); if (direction > 0 ? from < to : from > to) from += direction * τ; } else { from = radius + direction * τ; to = radius - .5 * step; } for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) { listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]); } }; } function d3_geo_circleAngle(cr, point) { var a = d3_geo_cartesian(point); a[0] -= cr; d3_geo_cartesianNormalize(a); var angle = d3_acos(-a[1]); return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI); } d3.geo.distance = function(a, b) { var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t; return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ); }; d3.geo.graticule = function() { var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5; function graticule() { return { type: "MultiLineString", coordinates: lines() }; } function lines() { return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > ε; }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > ε; }).map(y)); } graticule.lines = function() { return lines().map(function(coordinates) { return { type: "LineString", coordinates: coordinates }; }); }; graticule.outline = function() { return { type: "Polygon", coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ] }; }; graticule.extent = function(_) { if (!arguments.length) return graticule.minorExtent(); return graticule.majorExtent(_).minorExtent(_); }; graticule.majorExtent = function(_) { if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ]; X0 = +_[0][0], X1 = +_[1][0]; Y0 = +_[0][1], Y1 = +_[1][1]; if (X0 > X1) _ = X0, X0 = X1, X1 = _; if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _; return graticule.precision(precision); }; graticule.minorExtent = function(_) { if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ]; x0 = +_[0][0], x1 = +_[1][0]; y0 = +_[0][1], y1 = +_[1][1]; if (x0 > x1) _ = x0, x0 = x1, x1 = _; if (y0 > y1) _ = y0, y0 = y1, y1 = _; return graticule.precision(precision); }; graticule.step = function(_) { if (!arguments.length) return graticule.minorStep(); return graticule.majorStep(_).minorStep(_); }; graticule.majorStep = function(_) { if (!arguments.length) return [ DX, DY ]; DX = +_[0], DY = +_[1]; return graticule; }; graticule.minorStep = function(_) { if (!arguments.length) return [ dx, dy ]; dx = +_[0], dy = +_[1]; return graticule; }; graticule.precision = function(_) { if (!arguments.length) return precision; precision = +_; x = d3_geo_graticuleX(y0, y1, 90); y = d3_geo_graticuleY(x0, x1, precision); X = d3_geo_graticuleX(Y0, Y1, 90); Y = d3_geo_graticuleY(X0, X1, precision); return graticule; }; return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]); }; function d3_geo_graticuleX(y0, y1, dy) { var y = d3.range(y0, y1 - ε, dy).concat(y1); return function(x) { return y.map(function(y) { return [ x, y ]; }); }; } function d3_geo_graticuleY(x0, x1, dx) { var x = d3.range(x0, x1 - ε, dx).concat(x1); return function(y) { return x.map(function(x) { return [ x, y ]; }); }; } function d3_source(d) { return d.source; } function d3_target(d) { return d.target; } d3.geo.greatArc = function() { var source = d3_source, source_, target = d3_target, target_; function greatArc() { return { type: "LineString", coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ] }; } greatArc.distance = function() { return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments)); }; greatArc.source = function(_) { if (!arguments.length) return source; source = _, source_ = typeof _ === "function" ? null : _; return greatArc; }; greatArc.target = function(_) { if (!arguments.length) return target; target = _, target_ = typeof _ === "function" ? null : _; return greatArc; }; greatArc.precision = function() { return arguments.length ? greatArc : 0; }; return greatArc; }; d3.geo.interpolate = function(source, target) { return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians); }; function d3_geo_interpolate(x0, y0, x1, y1) { var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d); var interpolate = d ? function(t) { var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1; return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ]; } : function() { return [ x0 * d3_degrees, y0 * d3_degrees ]; }; interpolate.distance = d; return interpolate; } d3.geo.length = function(object) { d3_geo_lengthSum = 0; d3.geo.stream(object, d3_geo_length); return d3_geo_lengthSum; }; var d3_geo_lengthSum; var d3_geo_length = { sphere: d3_noop, point: d3_noop, lineStart: d3_geo_lengthLineStart, lineEnd: d3_noop, polygonStart: d3_noop, polygonEnd: d3_noop }; function d3_geo_lengthLineStart() { var λ0, sinφ0, cosφ0; d3_geo_length.point = function(λ, φ) { λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ); d3_geo_length.point = nextPoint; }; d3_geo_length.lineEnd = function() { d3_geo_length.point = d3_geo_length.lineEnd = d3_noop; }; function nextPoint(λ, φ) { var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t); d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ); λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ; } } function d3_geo_azimuthal(scale, angle) { function azimuthal(λ, φ) { var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ); return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ]; } azimuthal.invert = function(x, y) { var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c); return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ]; }; return azimuthal; } var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) { return Math.sqrt(2 / (1 + cosλcosφ)); }, function(ρ) { return 2 * Math.asin(ρ / 2); }); (d3.geo.azimuthalEqualArea = function() { return d3_geo_projection(d3_geo_azimuthalEqualArea); }).raw = d3_geo_azimuthalEqualArea; var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) { var c = Math.acos(cosλcosφ); return c && c / Math.sin(c); }, d3_identity); (d3.geo.azimuthalEquidistant = function() { return d3_geo_projection(d3_geo_azimuthalEquidistant); }).raw = d3_geo_azimuthalEquidistant; function d3_geo_conicConformal(φ0, φ1) { var cosφ0 = Math.cos(φ0), t = function(φ) { return Math.tan(π / 4 + φ / 2); }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n; if (!n) return d3_geo_mercator; function forward(λ, φ) { var ρ = abs(abs(φ) - halfπ) < ε ? 0 : F / Math.pow(t(φ), n); return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ]; } forward.invert = function(x, y) { var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y); return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ]; }; return forward; } (d3.geo.conicConformal = function() { return d3_geo_conic(d3_geo_conicConformal); }).raw = d3_geo_conicConformal; function d3_geo_conicEquidistant(φ0, φ1) { var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0; if (abs(n) < ε) return d3_geo_equirectangular; function forward(λ, φ) { var ρ = G - φ; return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ]; } forward.invert = function(x, y) { var ρ0_y = G - y; return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ]; }; return forward; } (d3.geo.conicEquidistant = function() { return d3_geo_conic(d3_geo_conicEquidistant); }).raw = d3_geo_conicEquidistant; var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) { return 1 / cosλcosφ; }, Math.atan); (d3.geo.gnomonic = function() { return d3_geo_projection(d3_geo_gnomonic); }).raw = d3_geo_gnomonic; function d3_geo_mercator(λ, φ) { return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ]; } d3_geo_mercator.invert = function(x, y) { return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ]; }; function d3_geo_mercatorProjection(project) { var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto; m.scale = function() { var v = scale.apply(m, arguments); return v === m ? clipAuto ? m.clipExtent(null) : m : v; }; m.translate = function() { var v = translate.apply(m, arguments); return v === m ? clipAuto ? m.clipExtent(null) : m : v; }; m.clipExtent = function(_) { var v = clipExtent.apply(m, arguments); if (v === m) { if (clipAuto = _ == null) { var k = π * scale(), t = translate(); clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]); } } else if (clipAuto) { v = null; } return v; }; return m.clipExtent(null); } (d3.geo.mercator = function() { return d3_geo_mercatorProjection(d3_geo_mercator); }).raw = d3_geo_mercator; var d3_geo_orthographic = d3_geo_azimuthal(function() { return 1; }, Math.asin); (d3.geo.orthographic = function() { return d3_geo_projection(d3_geo_orthographic); }).raw = d3_geo_orthographic; var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) { return 1 / (1 + cosλcosφ); }, function(ρ) { return 2 * Math.atan(ρ); }); (d3.geo.stereographic = function() { return d3_geo_projection(d3_geo_stereographic); }).raw = d3_geo_stereographic; function d3_geo_transverseMercator(λ, φ) { return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ]; } d3_geo_transverseMercator.invert = function(x, y) { return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ]; }; (d3.geo.transverseMercator = function() { var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate; projection.center = function(_) { return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ -_[1], _[0] ]); }; projection.rotate = function(_) { return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), [ _[0], _[1], _[2] - 90 ]); }; return projection.rotate([ 0, 0 ]); }).raw = d3_geo_transverseMercator; d3.geom = {}; function d3_geom_pointX(d) { return d[0]; } function d3_geom_pointY(d) { return d[1]; } d3.geom.hull = function(vertices) { var x = d3_geom_pointX, y = d3_geom_pointY; if (arguments.length) return hull(vertices); function hull(data) { if (data.length < 3) return []; var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = []; for (i = 0; i < n; i++) { points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]); } points.sort(d3_geom_hullOrder); for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]); var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints); var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = []; for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]); for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]); return polygon; } hull.x = function(_) { return arguments.length ? (x = _, hull) : x; }; hull.y = function(_) { return arguments.length ? (y = _, hull) : y; }; return hull; }; function d3_geom_hullUpper(points) { var n = points.length, hull = [ 0, 1 ], hs = 2; for (var i = 2; i < n; i++) { while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs; hull[hs++] = i; } return hull.slice(0, hs); } function d3_geom_hullOrder(a, b) { return a[0] - b[0] || a[1] - b[1]; } d3.geom.polygon = function(coordinates) { d3_subclass(coordinates, d3_geom_polygonPrototype); return coordinates; }; var d3_geom_polygonPrototype = d3.geom.polygon.prototype = []; d3_geom_polygonPrototype.area = function() { var i = -1, n = this.length, a, b = this[n - 1], area = 0; while (++i < n) { a = b; b = this[i]; area += a[1] * b[0] - a[0] * b[1]; } return area * .5; }; d3_geom_polygonPrototype.centroid = function(k) { var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c; if (!arguments.length) k = -1 / (6 * this.area()); while (++i < n) { a = b; b = this[i]; c = a[0] * b[1] - b[0] * a[1]; x += (a[0] + b[0]) * c; y += (a[1] + b[1]) * c; } return [ x * k, y * k ]; }; d3_geom_polygonPrototype.clip = function(subject) { var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d; while (++i < n) { input = subject.slice(); subject.length = 0; b = this[i]; c = input[(m = input.length - closed) - 1]; j = -1; while (++j < m) { d = input[j]; if (d3_geom_polygonInside(d, a, b)) { if (!d3_geom_polygonInside(c, a, b)) { subject.push(d3_geom_polygonIntersect(c, d, a, b)); } subject.push(d); } else if (d3_geom_polygonInside(c, a, b)) { subject.push(d3_geom_polygonIntersect(c, d, a, b)); } c = d; } if (closed) subject.push(subject[0]); a = b; } return subject; }; function d3_geom_polygonInside(p, a, b) { return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]); } function d3_geom_polygonIntersect(c, d, a, b) { var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21); return [ x1 + ua * x21, y1 + ua * y21 ]; } function d3_geom_polygonClosed(coordinates) { var a = coordinates[0], b = coordinates[coordinates.length - 1]; return !(a[0] - b[0] || a[1] - b[1]); } var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = []; function d3_geom_voronoiBeach() { d3_geom_voronoiRedBlackNode(this); this.edge = this.site = this.circle = null; } function d3_geom_voronoiCreateBeach(site) { var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach(); beach.site = site; return beach; } function d3_geom_voronoiDetachBeach(beach) { d3_geom_voronoiDetachCircle(beach); d3_geom_voronoiBeaches.remove(beach); d3_geom_voronoiBeachPool.push(beach); d3_geom_voronoiRedBlackNode(beach); } function d3_geom_voronoiRemoveBeach(beach) { var circle = beach.circle, x = circle.x, y = circle.cy, vertex = { x: x, y: y }, previous = beach.P, next = beach.N, disappearing = [ beach ]; d3_geom_voronoiDetachBeach(beach); var lArc = previous; while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) { previous = lArc.P; disappearing.unshift(lArc); d3_geom_voronoiDetachBeach(lArc); lArc = previous; } disappearing.unshift(lArc); d3_geom_voronoiDetachCircle(lArc); var rArc = next; while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) { next = rArc.N; disappearing.push(rArc); d3_geom_voronoiDetachBeach(rArc); rArc = next; } disappearing.push(rArc); d3_geom_voronoiDetachCircle(rArc); var nArcs = disappearing.length, iArc; for (iArc = 1; iArc < nArcs; ++iArc) { rArc = disappearing[iArc]; lArc = disappearing[iArc - 1]; d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); } lArc = disappearing[0]; rArc = disappearing[nArcs - 1]; rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex); d3_geom_voronoiAttachCircle(lArc); d3_geom_voronoiAttachCircle(rArc); } function d3_geom_voronoiAddBeach(site) { var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._; while (node) { dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x; if (dxl > ε) node = node.L; else { dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix); if (dxr > ε) { if (!node.R) { lArc = node; break; } node = node.R; } else { if (dxl > -ε) { lArc = node.P; rArc = node; } else if (dxr > -ε) { lArc = node; rArc = node.N; } else { lArc = rArc = node; } break; } } } var newArc = d3_geom_voronoiCreateBeach(site); d3_geom_voronoiBeaches.insert(lArc, newArc); if (!lArc && !rArc) return; if (lArc === rArc) { d3_geom_voronoiDetachCircle(lArc); rArc = d3_geom_voronoiCreateBeach(lArc.site); d3_geom_voronoiBeaches.insert(newArc, rArc); newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); d3_geom_voronoiAttachCircle(lArc); d3_geom_voronoiAttachCircle(rArc); return; } if (!rArc) { newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site); return; } d3_geom_voronoiDetachCircle(lArc); d3_geom_voronoiDetachCircle(rArc); var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = { x: (cy * hb - by * hc) / d + ax, y: (bx * hc - cx * hb) / d + ay }; d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex); newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex); rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex); d3_geom_voronoiAttachCircle(lArc); d3_geom_voronoiAttachCircle(rArc); } function d3_geom_voronoiLeftBreakPoint(arc, directrix) { var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix; if (!pby2) return rfocx; var lArc = arc.P; if (!lArc) return -Infinity; site = lArc.site; var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix; if (!plby2) return lfocx; var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2; if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; return (rfocx + lfocx) / 2; } function d3_geom_voronoiRightBreakPoint(arc, directrix) { var rArc = arc.N; if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix); var site = arc.site; return site.y === directrix ? site.x : Infinity; } function d3_geom_voronoiCell(site) { this.site = site; this.edges = []; } d3_geom_voronoiCell.prototype.prepare = function() { var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge; while (iHalfEdge--) { edge = halfEdges[iHalfEdge].edge; if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1); } halfEdges.sort(d3_geom_voronoiHalfEdgeOrder); return halfEdges.length; }; function d3_geom_voronoiCloseCells(extent) { var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end; while (iCell--) { cell = cells[iCell]; if (!cell || !cell.prepare()) continue; halfEdges = cell.edges; nHalfEdges = halfEdges.length; iHalfEdge = 0; while (iHalfEdge < nHalfEdges) { end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y; start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y; if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) { halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? { x: x0, y: abs(x2 - x0) < ε ? y2 : y1 } : abs(y3 - y1) < ε && x1 - x3 > ε ? { x: abs(y2 - y1) < ε ? x2 : x1, y: y1 } : abs(x3 - x1) < ε && y3 - y0 > ε ? { x: x1, y: abs(x2 - x1) < ε ? y2 : y0 } : abs(y3 - y0) < ε && x3 - x0 > ε ? { x: abs(y2 - y0) < ε ? x2 : x0, y: y0 } : null), cell.site, null)); ++nHalfEdges; } } } } function d3_geom_voronoiHalfEdgeOrder(a, b) { return b.angle - a.angle; } function d3_geom_voronoiCircle() { d3_geom_voronoiRedBlackNode(this); this.x = this.y = this.arc = this.site = this.cy = null; } function d3_geom_voronoiAttachCircle(arc) { var lArc = arc.P, rArc = arc.N; if (!lArc || !rArc) return; var lSite = lArc.site, cSite = arc.site, rSite = rArc.site; if (lSite === rSite) return; var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by; var d = 2 * (ax * cy - ay * cx); if (d >= -ε2) return; var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by; var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle(); circle.arc = arc; circle.site = cSite; circle.x = x + bx; circle.y = cy + Math.sqrt(x * x + y * y); circle.cy = cy; arc.circle = circle; var before = null, node = d3_geom_voronoiCircles._; while (node) { if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) { if (node.L) node = node.L; else { before = node.P; break; } } else { if (node.R) node = node.R; else { before = node; break; } } } d3_geom_voronoiCircles.insert(before, circle); if (!before) d3_geom_voronoiFirstCircle = circle; } function d3_geom_voronoiDetachCircle(arc) { var circle = arc.circle; if (circle) { if (!circle.P) d3_geom_voronoiFirstCircle = circle.N; d3_geom_voronoiCircles.remove(circle); d3_geom_voronoiCirclePool.push(circle); d3_geom_voronoiRedBlackNode(circle); arc.circle = null; } } function d3_geom_voronoiClipEdges(extent) { var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e; while (i--) { e = edges[i]; if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) { e.a = e.b = null; edges.splice(i, 1); } } } function d3_geom_voronoiConnectEdge(edge, extent) { var vb = edge.b; if (vb) return true; var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb; if (ry === ly) { if (fx < x0 || fx >= x1) return; if (lx > rx) { if (!va) va = { x: fx, y: y0 }; else if (va.y >= y1) return; vb = { x: fx, y: y1 }; } else { if (!va) va = { x: fx, y: y1 }; else if (va.y < y0) return; vb = { x: fx, y: y0 }; } } else { fm = (lx - rx) / (ry - ly); fb = fy - fm * fx; if (fm < -1 || fm > 1) { if (lx > rx) { if (!va) va = { x: (y0 - fb) / fm, y: y0 }; else if (va.y >= y1) return; vb = { x: (y1 - fb) / fm, y: y1 }; } else { if (!va) va = { x: (y1 - fb) / fm, y: y1 }; else if (va.y < y0) return; vb = { x: (y0 - fb) / fm, y: y0 }; } } else { if (ly < ry) { if (!va) va = { x: x0, y: fm * x0 + fb }; else if (va.x >= x1) return; vb = { x: x1, y: fm * x1 + fb }; } else { if (!va) va = { x: x1, y: fm * x1 + fb }; else if (va.x < x0) return; vb = { x: x0, y: fm * x0 + fb }; } } } edge.a = va; edge.b = vb; return true; } function d3_geom_voronoiEdge(lSite, rSite) { this.l = lSite; this.r = rSite; this.a = this.b = null; } function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) { var edge = new d3_geom_voronoiEdge(lSite, rSite); d3_geom_voronoiEdges.push(edge); if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va); if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb); d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite)); d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite)); return edge; } function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) { var edge = new d3_geom_voronoiEdge(lSite, null); edge.a = va; edge.b = vb; d3_geom_voronoiEdges.push(edge); return edge; } function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) { if (!edge.a && !edge.b) { edge.a = vertex; edge.l = lSite; edge.r = rSite; } else if (edge.l === rSite) { edge.b = vertex; } else { edge.a = vertex; } } function d3_geom_voronoiHalfEdge(edge, lSite, rSite) { var va = edge.a, vb = edge.b; this.edge = edge; this.site = lSite; this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y); } d3_geom_voronoiHalfEdge.prototype = { start: function() { return this.edge.l === this.site ? this.edge.a : this.edge.b; }, end: function() { return this.edge.l === this.site ? this.edge.b : this.edge.a; } }; function d3_geom_voronoiRedBlackTree() { this._ = null; } function d3_geom_voronoiRedBlackNode(node) { node.U = node.C = node.L = node.R = node.P = node.N = null; } d3_geom_voronoiRedBlackTree.prototype = { insert: function(after, node) { var parent, grandpa, uncle; if (after) { node.P = after; node.N = after.N; if (after.N) after.N.P = node; after.N = node; if (after.R) { after = after.R; while (after.L) after = after.L; after.L = node; } else { after.R = node; } parent = after; } else if (this._) { after = d3_geom_voronoiRedBlackFirst(this._); node.P = null; node.N = after; after.P = after.L = node; parent = after; } else { node.P = node.N = null; this._ = node; parent = null; } node.L = node.R = null; node.U = parent; node.C = true; after = node; while (parent && parent.C) { grandpa = parent.U; if (parent === grandpa.L) { uncle = grandpa.R; if (uncle && uncle.C) { parent.C = uncle.C = false; grandpa.C = true; after = grandpa; } else { if (after === parent.R) { d3_geom_voronoiRedBlackRotateLeft(this, parent); after = parent; parent = after.U; } parent.C = false; grandpa.C = true; d3_geom_voronoiRedBlackRotateRight(this, grandpa); } } else { uncle = grandpa.L; if (uncle && uncle.C) { parent.C = uncle.C = false; grandpa.C = true; after = grandpa; } else { if (after === parent.L) { d3_geom_voronoiRedBlackRotateRight(this, parent); after = parent; parent = after.U; } parent.C = false; grandpa.C = true; d3_geom_voronoiRedBlackRotateLeft(this, grandpa); } } parent = after.U; } this._.C = false; }, remove: function(node) { if (node.N) node.N.P = node.P; if (node.P) node.P.N = node.N; node.N = node.P = null; var parent = node.U, sibling, left = node.L, right = node.R, next, red; if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right); if (parent) { if (parent.L === node) parent.L = next; else parent.R = next; } else { this._ = next; } if (left && right) { red = next.C; next.C = node.C; next.L = left; left.U = next; if (next !== right) { parent = next.U; next.U = node.U; node = next.R; parent.L = node; next.R = right; right.U = next; } else { next.U = parent; parent = next; node = next.R; } } else { red = node.C; node = next; } if (node) node.U = parent; if (red) return; if (node && node.C) { node.C = false; return; } do { if (node === this._) break; if (node === parent.L) { sibling = parent.R; if (sibling.C) { sibling.C = false; parent.C = true; d3_geom_voronoiRedBlackRotateLeft(this, parent); sibling = parent.R; } if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { if (!sibling.R || !sibling.R.C) { sibling.L.C = false; sibling.C = true; d3_geom_voronoiRedBlackRotateRight(this, sibling); sibling = parent.R; } sibling.C = parent.C; parent.C = sibling.R.C = false; d3_geom_voronoiRedBlackRotateLeft(this, parent); node = this._; break; } } else { sibling = parent.L; if (sibling.C) { sibling.C = false; parent.C = true; d3_geom_voronoiRedBlackRotateRight(this, parent); sibling = parent.L; } if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) { if (!sibling.L || !sibling.L.C) { sibling.R.C = false; sibling.C = true; d3_geom_voronoiRedBlackRotateLeft(this, sibling); sibling = parent.L; } sibling.C = parent.C; parent.C = sibling.L.C = false; d3_geom_voronoiRedBlackRotateRight(this, parent); node = this._; break; } } sibling.C = true; node = parent; parent = parent.U; } while (!node.C); if (node) node.C = false; } }; function d3_geom_voronoiRedBlackRotateLeft(tree, node) { var p = node, q = node.R, parent = p.U; if (parent) { if (parent.L === p) parent.L = q; else parent.R = q; } else { tree._ = q; } q.U = parent; p.U = q; p.R = q.L; if (p.R) p.R.U = p; q.L = p; } function d3_geom_voronoiRedBlackRotateRight(tree, node) { var p = node, q = node.L, parent = p.U; if (parent) { if (parent.L === p) parent.L = q; else parent.R = q; } else { tree._ = q; } q.U = parent; p.U = q; p.L = q.R; if (p.L) p.L.U = p; q.R = p; } function d3_geom_voronoiRedBlackFirst(node) { while (node.L) node = node.L; return node; } function d3_geom_voronoi(sites, bbox) { var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle; d3_geom_voronoiEdges = []; d3_geom_voronoiCells = new Array(sites.length); d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree(); d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree(); while (true) { circle = d3_geom_voronoiFirstCircle; if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) { if (site.x !== x0 || site.y !== y0) { d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site); d3_geom_voronoiAddBeach(site); x0 = site.x, y0 = site.y; } site = sites.pop(); } else if (circle) { d3_geom_voronoiRemoveBeach(circle.arc); } else { break; } } if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox); var diagram = { cells: d3_geom_voronoiCells, edges: d3_geom_voronoiEdges }; d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null; return diagram; } function d3_geom_voronoiVertexOrder(a, b) { return b.y - a.y || b.x - a.x; } d3.geom.voronoi = function(points) { var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent; if (points) return voronoi(points); function voronoi(data) { var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1]; d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) { var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) { var s = e.start(); return [ s.x, s.y ]; }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : []; polygon.point = data[i]; }); return polygons; } function sites(data) { return data.map(function(d, i) { return { x: Math.round(fx(d, i) / ε) * ε, y: Math.round(fy(d, i) / ε) * ε, i: i }; }); } voronoi.links = function(data) { return d3_geom_voronoi(sites(data)).edges.filter(function(edge) { return edge.l && edge.r; }).map(function(edge) { return { source: data[edge.l.i], target: data[edge.r.i] }; }); }; voronoi.triangles = function(data) { var triangles = []; d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) { var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l; while (++j < m) { e0 = e1; s0 = s1; e1 = edges[j].edge; s1 = e1.l === site ? e1.r : e1.l; if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) { triangles.push([ data[i], data[s0.i], data[s1.i] ]); } } }); return triangles; }; voronoi.x = function(_) { return arguments.length ? (fx = d3_functor(x = _), voronoi) : x; }; voronoi.y = function(_) { return arguments.length ? (fy = d3_functor(y = _), voronoi) : y; }; voronoi.clipExtent = function(_) { if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent; clipExtent = _ == null ? d3_geom_voronoiClipExtent : _; return voronoi; }; voronoi.size = function(_) { if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1]; return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]); }; return voronoi; }; var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ]; function d3_geom_voronoiTriangleArea(a, b, c) { return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y); } d3.geom.delaunay = function(vertices) { return d3.geom.voronoi().triangles(vertices); }; d3.geom.quadtree = function(points, x1, y1, x2, y2) { var x = d3_geom_pointX, y = d3_geom_pointY, compat; if (compat = arguments.length) { x = d3_geom_quadtreeCompatX; y = d3_geom_quadtreeCompatY; if (compat === 3) { y2 = y1; x2 = x1; y1 = x1 = 0; } return quadtree(points); } function quadtree(data) { var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_; if (x1 != null) { x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2; } else { x2_ = y2_ = -(x1_ = y1_ = Infinity); xs = [], ys = []; n = data.length; if (compat) for (i = 0; i < n; ++i) { d = data[i]; if (d.x < x1_) x1_ = d.x; if (d.y < y1_) y1_ = d.y; if (d.x > x2_) x2_ = d.x; if (d.y > y2_) y2_ = d.y; xs.push(d.x); ys.push(d.y); } else for (i = 0; i < n; ++i) { var x_ = +fx(d = data[i], i), y_ = +fy(d, i); if (x_ < x1_) x1_ = x_; if (y_ < y1_) y1_ = y_; if (x_ > x2_) x2_ = x_; if (y_ > y2_) y2_ = y_; xs.push(x_); ys.push(y_); } } var dx = x2_ - x1_, dy = y2_ - y1_; if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy; function insert(n, d, x, y, x1, y1, x2, y2) { if (isNaN(x) || isNaN(y)) return; if (n.leaf) { var nx = n.x, ny = n.y; if (nx != null) { if (abs(nx - x) + abs(ny - y) < .01) { insertChild(n, d, x, y, x1, y1, x2, y2); } else { var nPoint = n.point; n.x = n.y = n.point = null; insertChild(n, nPoint, nx, ny, x1, y1, x2, y2); insertChild(n, d, x, y, x1, y1, x2, y2); } } else { n.x = x, n.y = y, n.point = d; } } else { insertChild(n, d, x, y, x1, y1, x2, y2); } } function insertChild(n, d, x, y, x1, y1, x2, y2) { var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right; n.leaf = false; n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode()); if (right) x1 = sx; else x2 = sx; if (bottom) y1 = sy; else y2 = sy; insert(n, d, x, y, x1, y1, x2, y2); } var root = d3_geom_quadtreeNode(); root.add = function(d) { insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_); }; root.visit = function(f) { d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_); }; i = -1; if (x1 == null) { while (++i < n) { insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_); } --i; } else data.forEach(root.add); xs = ys = data = d = null; return root; } quadtree.x = function(_) { return arguments.length ? (x = _, quadtree) : x; }; quadtree.y = function(_) { return arguments.length ? (y = _, quadtree) : y; }; quadtree.extent = function(_) { if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], y2 = +_[1][1]; return quadtree; }; quadtree.size = function(_) { if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ]; if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1]; return quadtree; }; return quadtree; }; function d3_geom_quadtreeCompatX(d) { return d.x; } function d3_geom_quadtreeCompatY(d) { return d.y; } function d3_geom_quadtreeNode() { return { leaf: true, nodes: [], point: null, x: null, y: null }; } function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) { if (!f(node, x1, y1, x2, y2)) { var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes; if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy); if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy); if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2); if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2); } } d3.interpolateRgb = d3_interpolateRgb; function d3_interpolateRgb(a, b) { a = d3.rgb(a); b = d3.rgb(b); var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab; return function(t) { return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t)); }; } d3.interpolateObject = d3_interpolateObject; function d3_interpolateObject(a, b) { var i = {}, c = {}, k; for (k in a) { if (k in b) { i[k] = d3_interpolate(a[k], b[k]); } else { c[k] = a[k]; } } for (k in b) { if (!(k in a)) { c[k] = b[k]; } } return function(t) { for (k in i) c[k] = i[k](t); return c; }; } d3.interpolateNumber = d3_interpolateNumber; function d3_interpolateNumber(a, b) { b -= a = +a; return function(t) { return a + b * t; }; } d3.interpolateString = d3_interpolateString; function d3_interpolateString(a, b) { var m, i, j, s0 = 0, s1 = 0, s = [], q = [], n, o; a = a + "", b = b + ""; d3_interpolate_number.lastIndex = 0; for (i = 0; m = d3_interpolate_number.exec(b); ++i) { if (m.index) s.push(b.substring(s0, s1 = m.index)); q.push({ i: s.length, x: m[0] }); s.push(null); s0 = d3_interpolate_number.lastIndex; } if (s0 < b.length) s.push(b.substring(s0)); for (i = 0, n = q.length; (m = d3_interpolate_number.exec(a)) && i < n; ++i) { o = q[i]; if (o.x == m[0]) { if (o.i) { if (s[o.i + 1] == null) { s[o.i - 1] += o.x; s.splice(o.i, 1); for (j = i + 1; j < n; ++j) q[j].i--; } else { s[o.i - 1] += o.x + s[o.i + 1]; s.splice(o.i, 2); for (j = i + 1; j < n; ++j) q[j].i -= 2; } } else { if (s[o.i + 1] == null) { s[o.i] = o.x; } else { s[o.i] = o.x + s[o.i + 1]; s.splice(o.i + 1, 1); for (j = i + 1; j < n; ++j) q[j].i--; } } q.splice(i, 1); n--; i--; } else { o.x = d3_interpolateNumber(parseFloat(m[0]), parseFloat(o.x)); } } while (i < n) { o = q.pop(); if (s[o.i + 1] == null) { s[o.i] = o.x; } else { s[o.i] = o.x + s[o.i + 1]; s.splice(o.i + 1, 1); } n--; } if (s.length === 1) { return s[0] == null ? (o = q[0].x, function(t) { return o(t) + ""; }) : function() { return b; }; } return function(t) { for (i = 0; i < n; ++i) s[(o = q[i]).i] = o.x(t); return s.join(""); }; } var d3_interpolate_number = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; d3.interpolate = d3_interpolate; function d3_interpolate(a, b) { var i = d3.interpolators.length, f; while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ; return f; } d3.interpolators = [ function(a, b) { var t = typeof b; return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_Color ? d3_interpolateRgb : t === "object" ? Array.isArray(b) ? d3_interpolateArray : d3_interpolateObject : d3_interpolateNumber)(a, b); } ]; d3.interpolateArray = d3_interpolateArray; function d3_interpolateArray(a, b) { var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i; for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i])); for (;i < na; ++i) c[i] = a[i]; for (;i < nb; ++i) c[i] = b[i]; return function(t) { for (i = 0; i < n0; ++i) c[i] = x[i](t); return c; }; } var d3_ease_default = function() { return d3_identity; }; var d3_ease = d3.map({ linear: d3_ease_default, poly: d3_ease_poly, quad: function() { return d3_ease_quad; }, cubic: function() { return d3_ease_cubic; }, sin: function() { return d3_ease_sin; }, exp: function() { return d3_ease_exp; }, circle: function() { return d3_ease_circle; }, elastic: d3_ease_elastic, back: d3_ease_back, bounce: function() { return d3_ease_bounce; } }); var d3_ease_mode = d3.map({ "in": d3_identity, out: d3_ease_reverse, "in-out": d3_ease_reflect, "out-in": function(f) { return d3_ease_reflect(d3_ease_reverse(f)); } }); d3.ease = function(name) { var i = name.indexOf("-"), t = i >= 0 ? name.substring(0, i) : name, m = i >= 0 ? name.substring(i + 1) : "in"; t = d3_ease.get(t) || d3_ease_default; m = d3_ease_mode.get(m) || d3_identity; return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); }; function d3_ease_clamp(f) { return function(t) { return t <= 0 ? 0 : t >= 1 ? 1 : f(t); }; } function d3_ease_reverse(f) { return function(t) { return 1 - f(1 - t); }; } function d3_ease_reflect(f) { return function(t) { return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t)); }; } function d3_ease_quad(t) { return t * t; } function d3_ease_cubic(t) { return t * t * t; } function d3_ease_cubicInOut(t) { if (t <= 0) return 0; if (t >= 1) return 1; var t2 = t * t, t3 = t2 * t; return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75); } function d3_ease_poly(e) { return function(t) { return Math.pow(t, e); }; } function d3_ease_sin(t) { return 1 - Math.cos(t * halfπ); } function d3_ease_exp(t) { return Math.pow(2, 10 * (t - 1)); } function d3_ease_circle(t) { return 1 - Math.sqrt(1 - t * t); } function d3_ease_elastic(a, p) { var s; if (arguments.length < 2) p = .45; if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4; return function(t) { return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p); }; } function d3_ease_back(s) { if (!s) s = 1.70158; return function(t) { return t * t * ((s + 1) * t - s); }; } function d3_ease_bounce(t) { return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375; } d3.interpolateHcl = d3_interpolateHcl; function d3_interpolateHcl(a, b) { a = d3.hcl(a); b = d3.hcl(b); var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al; if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac; if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; return function(t) { return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + ""; }; } d3.interpolateHsl = d3_interpolateHsl; function d3_interpolateHsl(a, b) { a = d3.hsl(a); b = d3.hsl(b); var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al; if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as; if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; return function(t) { return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + ""; }; } d3.interpolateLab = d3_interpolateLab; function d3_interpolateLab(a, b) { a = d3.lab(a); b = d3.lab(b); var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab; return function(t) { return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + ""; }; } d3.interpolateRound = d3_interpolateRound; function d3_interpolateRound(a, b) { b -= a; return function(t) { return Math.round(a + b * t); }; } d3.transform = function(string) { var g = d3_document.createElementNS(d3.ns.prefix.svg, "g"); return (d3.transform = function(string) { if (string != null) { g.setAttribute("transform", string); var t = g.transform.baseVal.consolidate(); } return new d3_transform(t ? t.matrix : d3_transformIdentity); })(string); }; function d3_transform(m) { var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0; if (r0[0] * r1[1] < r1[0] * r0[1]) { r0[0] *= -1; r0[1] *= -1; kx *= -1; kz *= -1; } this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees; this.translate = [ m.e, m.f ]; this.scale = [ kx, ky ]; this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0; } d3_transform.prototype.toString = function() { return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"; }; function d3_transformDot(a, b) { return a[0] * b[0] + a[1] * b[1]; } function d3_transformNormalize(a) { var k = Math.sqrt(d3_transformDot(a, a)); if (k) { a[0] /= k; a[1] /= k; } return k; } function d3_transformCombine(a, b, k) { a[0] += k * b[0]; a[1] += k * b[1]; return a; } var d3_transformIdentity = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0 }; d3.interpolateTransform = d3_interpolateTransform; function d3_interpolateTransform(a, b) { var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale; if (ta[0] != tb[0] || ta[1] != tb[1]) { s.push("translate(", null, ",", null, ")"); q.push({ i: 1, x: d3_interpolateNumber(ta[0], tb[0]) }, { i: 3, x: d3_interpolateNumber(ta[1], tb[1]) }); } else if (tb[0] || tb[1]) { s.push("translate(" + tb + ")"); } else { s.push(""); } if (ra != rb) { if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360; q.push({ i: s.push(s.pop() + "rotate(", null, ")") - 2, x: d3_interpolateNumber(ra, rb) }); } else if (rb) { s.push(s.pop() + "rotate(" + rb + ")"); } if (wa != wb) { q.push({ i: s.push(s.pop() + "skewX(", null, ")") - 2, x: d3_interpolateNumber(wa, wb) }); } else if (wb) { s.push(s.pop() + "skewX(" + wb + ")"); } if (ka[0] != kb[0] || ka[1] != kb[1]) { n = s.push(s.pop() + "scale(", null, ",", null, ")"); q.push({ i: n - 4, x: d3_interpolateNumber(ka[0], kb[0]) }, { i: n - 2, x: d3_interpolateNumber(ka[1], kb[1]) }); } else if (kb[0] != 1 || kb[1] != 1) { s.push(s.pop() + "scale(" + kb + ")"); } n = q.length; return function(t) { var i = -1, o; while (++i < n) s[(o = q[i]).i] = o.x(t); return s.join(""); }; } function d3_uninterpolateNumber(a, b) { b = b - (a = +a) ? 1 / (b - a) : 0; return function(x) { return (x - a) * b; }; } function d3_uninterpolateClamp(a, b) { b = b - (a = +a) ? 1 / (b - a) : 0; return function(x) { return Math.max(0, Math.min(1, (x - a) * b)); }; } d3.layout = {}; d3.layout.bundle = function() { return function(links) { var paths = [], i = -1, n = links.length; while (++i < n) paths.push(d3_layout_bundlePath(links[i])); return paths; }; }; function d3_layout_bundlePath(link) { var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ]; while (start !== lca) { start = start.parent; points.push(start); } var k = points.length; while (end !== lca) { points.splice(k, 0, end); end = end.parent; } return points; } function d3_layout_bundleAncestors(node) { var ancestors = [], parent = node.parent; while (parent != null) { ancestors.push(node); node = parent; parent = parent.parent; } ancestors.push(node); return ancestors; } function d3_layout_bundleLeastCommonAncestor(a, b) { if (a === b) return a; var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null; while (aNode === bNode) { sharedNode = aNode; aNode = aNodes.pop(); bNode = bNodes.pop(); } return sharedNode; } d3.layout.chord = function() { var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords; function relayout() { var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j; chords = []; groups = []; k = 0, i = -1; while (++i < n) { x = 0, j = -1; while (++j < n) { x += matrix[i][j]; } groupSums.push(x); subgroupIndex.push(d3.range(n)); k += x; } if (sortGroups) { groupIndex.sort(function(a, b) { return sortGroups(groupSums[a], groupSums[b]); }); } if (sortSubgroups) { subgroupIndex.forEach(function(d, i) { d.sort(function(a, b) { return sortSubgroups(matrix[i][a], matrix[i][b]); }); }); } k = (τ - padding * n) / k; x = 0, i = -1; while (++i < n) { x0 = x, j = -1; while (++j < n) { var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k; subgroups[di + "-" + dj] = { index: di, subindex: dj, startAngle: a0, endAngle: a1, value: v }; } groups[di] = { index: di, startAngle: x0, endAngle: x, value: (x - x0) / k }; x += padding; } i = -1; while (++i < n) { j = i - 1; while (++j < n) { var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i]; if (source.value || target.value) { chords.push(source.value < target.value ? { source: target, target: source } : { source: source, target: target }); } } } if (sortChords) resort(); } function resort() { chords.sort(function(a, b) { return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2); }); } chord.matrix = function(x) { if (!arguments.length) return matrix; n = (matrix = x) && matrix.length; chords = groups = null; return chord; }; chord.padding = function(x) { if (!arguments.length) return padding; padding = x; chords = groups = null; return chord; }; chord.sortGroups = function(x) { if (!arguments.length) return sortGroups; sortGroups = x; chords = groups = null; return chord; }; chord.sortSubgroups = function(x) { if (!arguments.length) return sortSubgroups; sortSubgroups = x; chords = null; return chord; }; chord.sortChords = function(x) { if (!arguments.length) return sortChords; sortChords = x; if (chords) resort(); return chord; }; chord.chords = function() { if (!chords) relayout(); return chords; }; chord.groups = function() { if (!groups) relayout(); return groups; }; return chord; }; d3.layout.force = function() { var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges; function repulse(node) { return function(quad, x1, _, x2) { if (quad.point !== node) { var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy; if (dw * dw / theta2 < dn) { if (dn < chargeDistance2) { var k = quad.charge / dn; node.px -= dx * k; node.py -= dy * k; } return true; } if (quad.point && dn && dn < chargeDistance2) { var k = quad.pointCharge / dn; node.px -= dx * k; node.py -= dy * k; } } return !quad.charge; }; } force.tick = function() { if ((alpha *= .99) < .005) { event.end({ type: "end", alpha: alpha = 0 }); return true; } var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y; for (i = 0; i < m; ++i) { o = links[i]; s = o.source; t = o.target; x = t.x - s.x; y = t.y - s.y; if (l = x * x + y * y) { l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l; x *= l; y *= l; t.x -= x * (k = s.weight / (t.weight + s.weight)); t.y -= y * k; s.x += x * (k = 1 - k); s.y += y * k; } } if (k = alpha * gravity) { x = size[0] / 2; y = size[1] / 2; i = -1; if (k) while (++i < n) { o = nodes[i]; o.x += (x - o.x) * k; o.y += (y - o.y) * k; } } if (charge) { d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges); i = -1; while (++i < n) { if (!(o = nodes[i]).fixed) { q.visit(repulse(o)); } } } i = -1; while (++i < n) { o = nodes[i]; if (o.fixed) { o.x = o.px; o.y = o.py; } else { o.x -= (o.px - (o.px = o.x)) * friction; o.y -= (o.py - (o.py = o.y)) * friction; } } event.tick({ type: "tick", alpha: alpha }); }; force.nodes = function(x) { if (!arguments.length) return nodes; nodes = x; return force; }; force.links = function(x) { if (!arguments.length) return links; links = x; return force; }; force.size = function(x) { if (!arguments.length) return size; size = x; return force; }; force.linkDistance = function(x) { if (!arguments.length) return linkDistance; linkDistance = typeof x === "function" ? x : +x; return force; }; force.distance = force.linkDistance; force.linkStrength = function(x) { if (!arguments.length) return linkStrength; linkStrength = typeof x === "function" ? x : +x; return force; }; force.friction = function(x) { if (!arguments.length) return friction; friction = +x; return force; }; force.charge = function(x) { if (!arguments.length) return charge; charge = typeof x === "function" ? x : +x; return force; }; force.chargeDistance = function(x) { if (!arguments.length) return Math.sqrt(chargeDistance2); chargeDistance2 = x * x; return force; }; force.gravity = function(x) { if (!arguments.length) return gravity; gravity = +x; return force; }; force.theta = function(x) { if (!arguments.length) return Math.sqrt(theta2); theta2 = x * x; return force; }; force.alpha = function(x) { if (!arguments.length) return alpha; x = +x; if (alpha) { if (x > 0) alpha = x; else alpha = 0; } else if (x > 0) { event.start({ type: "start", alpha: alpha = x }); d3.timer(force.tick); } return force; }; force.start = function() { var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o; for (i = 0; i < n; ++i) { (o = nodes[i]).index = i; o.weight = 0; } for (i = 0; i < m; ++i) { o = links[i]; if (typeof o.source == "number") o.source = nodes[o.source]; if (typeof o.target == "number") o.target = nodes[o.target]; ++o.source.weight; ++o.target.weight; } for (i = 0; i < n; ++i) { o = nodes[i]; if (isNaN(o.x)) o.x = position("x", w); if (isNaN(o.y)) o.y = position("y", h); if (isNaN(o.px)) o.px = o.x; if (isNaN(o.py)) o.py = o.y; } distances = []; if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance; strengths = []; if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength; charges = []; if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge; function position(dimension, size) { if (!neighbors) { neighbors = new Array(n); for (j = 0; j < n; ++j) { neighbors[j] = []; } for (j = 0; j < m; ++j) { var o = links[j]; neighbors[o.source.index].push(o.target); neighbors[o.target.index].push(o.source); } } var candidates = neighbors[i], j = -1, m = candidates.length, x; while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x; return Math.random() * size; } return force.resume(); }; force.resume = function() { return force.alpha(.1); }; force.stop = function() { return force.alpha(0); }; force.drag = function() { if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend); if (!arguments.length) return drag; this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag); }; function dragmove(d) { d.px = d3.event.x, d.py = d3.event.y; force.resume(); } return d3.rebind(force, event, "on"); }; function d3_layout_forceDragstart(d) { d.fixed |= 2; } function d3_layout_forceDragend(d) { d.fixed &= ~6; } function d3_layout_forceMouseover(d) { d.fixed |= 4; d.px = d.x, d.py = d.y; } function d3_layout_forceMouseout(d) { d.fixed &= ~4; } function d3_layout_forceAccumulate(quad, alpha, charges) { var cx = 0, cy = 0; quad.charge = 0; if (!quad.leaf) { var nodes = quad.nodes, n = nodes.length, i = -1, c; while (++i < n) { c = nodes[i]; if (c == null) continue; d3_layout_forceAccumulate(c, alpha, charges); quad.charge += c.charge; cx += c.charge * c.cx; cy += c.charge * c.cy; } } if (quad.point) { if (!quad.leaf) { quad.point.x += Math.random() - .5; quad.point.y += Math.random() - .5; } var k = alpha * charges[quad.point.index]; quad.charge += quad.pointCharge = k; cx += k * quad.point.x; cy += k * quad.point.y; } quad.cx = cx / quad.charge; quad.cy = cy / quad.charge; } var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity; d3.layout.hierarchy = function() { var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; function recurse(node, depth, nodes) { var childs = children.call(hierarchy, node, depth); node.depth = depth; nodes.push(node); if (childs && (n = childs.length)) { var i = -1, n, c = node.children = new Array(n), v = 0, j = depth + 1, d; while (++i < n) { d = c[i] = recurse(childs[i], j, nodes); d.parent = node; v += d.value; } if (sort) c.sort(sort); if (value) node.value = v; } else { delete node.children; if (value) { node.value = +value.call(hierarchy, node, depth) || 0; } } return node; } function revalue(node, depth) { var children = node.children, v = 0; if (children && (n = children.length)) { var i = -1, n, j = depth + 1; while (++i < n) v += revalue(children[i], j); } else if (value) { v = +value.call(hierarchy, node, depth) || 0; } if (value) node.value = v; return v; } function hierarchy(d) { var nodes = []; recurse(d, 0, nodes); return nodes; } hierarchy.sort = function(x) { if (!arguments.length) return sort; sort = x; return hierarchy; }; hierarchy.children = function(x) { if (!arguments.length) return children; children = x; return hierarchy; }; hierarchy.value = function(x) { if (!arguments.length) return value; value = x; return hierarchy; }; hierarchy.revalue = function(root) { revalue(root, 0); return root; }; return hierarchy; }; function d3_layout_hierarchyRebind(object, hierarchy) { d3.rebind(object, hierarchy, "sort", "children", "value"); object.nodes = object; object.links = d3_layout_hierarchyLinks; return object; } function d3_layout_hierarchyChildren(d) { return d.children; } function d3_layout_hierarchyValue(d) { return d.value; } function d3_layout_hierarchySort(a, b) { return b.value - a.value; } function d3_layout_hierarchyLinks(nodes) { return d3.merge(nodes.map(function(parent) { return (parent.children || []).map(function(child) { return { source: parent, target: child }; }); })); } d3.layout.partition = function() { var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ]; function position(node, x, dx, dy) { var children = node.children; node.x = x; node.y = node.depth * dy; node.dx = dx; node.dy = dy; if (children && (n = children.length)) { var i = -1, n, c, d; dx = node.value ? dx / node.value : 0; while (++i < n) { position(c = children[i], x, d = c.value * dx, dy); x += d; } } } function depth(node) { var children = node.children, d = 0; if (children && (n = children.length)) { var i = -1, n; while (++i < n) d = Math.max(d, depth(children[i])); } return 1 + d; } function partition(d, i) { var nodes = hierarchy.call(this, d, i); position(nodes[0], 0, size[0], size[1] / depth(nodes[0])); return nodes; } partition.size = function(x) { if (!arguments.length) return size; size = x; return partition; }; return d3_layout_hierarchyRebind(partition, hierarchy); }; d3.layout.pie = function() { var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ; function pie(data) { var values = data.map(function(d, i) { return +value.call(pie, d, i); }); var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle); var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values); var index = d3.range(data.length); if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) { return values[j] - values[i]; } : function(i, j) { return sort(data[i], data[j]); }); var arcs = []; index.forEach(function(i) { var d; arcs[i] = { data: data[i], value: d = values[i], startAngle: a, endAngle: a += d * k }; }); return arcs; } pie.value = function(x) { if (!arguments.length) return value; value = x; return pie; }; pie.sort = function(x) { if (!arguments.length) return sort; sort = x; return pie; }; pie.startAngle = function(x) { if (!arguments.length) return startAngle; startAngle = x; return pie; }; pie.endAngle = function(x) { if (!arguments.length) return endAngle; endAngle = x; return pie; }; return pie; }; var d3_layout_pieSortByValue = {}; d3.layout.stack = function() { var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY; function stack(data, index) { var series = data.map(function(d, i) { return values.call(stack, d, i); }); var points = series.map(function(d) { return d.map(function(v, i) { return [ x.call(stack, v, i), y.call(stack, v, i) ]; }); }); var orders = order.call(stack, points, index); series = d3.permute(series, orders); points = d3.permute(points, orders); var offsets = offset.call(stack, points, index); var n = series.length, m = series[0].length, i, j, o; for (j = 0; j < m; ++j) { out.call(stack, series[0][j], o = offsets[j], points[0][j][1]); for (i = 1; i < n; ++i) { out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]); } } return data; } stack.values = function(x) { if (!arguments.length) return values; values = x; return stack; }; stack.order = function(x) { if (!arguments.length) return order; order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault; return stack; }; stack.offset = function(x) { if (!arguments.length) return offset; offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero; return stack; }; stack.x = function(z) { if (!arguments.length) return x; x = z; return stack; }; stack.y = function(z) { if (!arguments.length) return y; y = z; return stack; }; stack.out = function(z) { if (!arguments.length) return out; out = z; return stack; }; return stack; }; function d3_layout_stackX(d) { return d.x; } function d3_layout_stackY(d) { return d.y; } function d3_layout_stackOut(d, y0, y) { d.y0 = y0; d.y = y; } var d3_layout_stackOrders = d3.map({ "inside-out": function(data) { var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) { return max[a] - max[b]; }), top = 0, bottom = 0, tops = [], bottoms = []; for (i = 0; i < n; ++i) { j = index[i]; if (top < bottom) { top += sums[j]; tops.push(j); } else { bottom += sums[j]; bottoms.push(j); } } return bottoms.reverse().concat(tops); }, reverse: function(data) { return d3.range(data.length).reverse(); }, "default": d3_layout_stackOrderDefault }); var d3_layout_stackOffsets = d3.map({ silhouette: function(data) { var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = []; for (j = 0; j < m; ++j) { for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; if (o > max) max = o; sums.push(o); } for (j = 0; j < m; ++j) { y0[j] = (max - sums[j]) / 2; } return y0; }, wiggle: function(data) { var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = []; y0[0] = o = o0 = 0; for (j = 1; j < m; ++j) { for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1]; for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) { for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) { s3 += (data[k][j][1] - data[k][j - 1][1]) / dx; } s2 += s3 * data[i][j][1]; } y0[j] = o -= s1 ? s2 / s1 * dx : 0; if (o < o0) o0 = o; } for (j = 0; j < m; ++j) y0[j] -= o0; return y0; }, expand: function(data) { var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = []; for (j = 0; j < m; ++j) { for (i = 0, o = 0; i < n; i++) o += data[i][j][1]; if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k; } for (j = 0; j < m; ++j) y0[j] = 0; return y0; }, zero: d3_layout_stackOffsetZero }); function d3_layout_stackOrderDefault(data) { return d3.range(data.length); } function d3_layout_stackOffsetZero(data) { var j = -1, m = data[0].length, y0 = []; while (++j < m) y0[j] = 0; return y0; } function d3_layout_stackMaxIndex(array) { var i = 1, j = 0, v = array[0][1], k, n = array.length; for (;i < n; ++i) { if ((k = array[i][1]) > v) { j = i; v = k; } } return j; } function d3_layout_stackReduceSum(d) { return d.reduce(d3_layout_stackSum, 0); } function d3_layout_stackSum(p, d) { return p + d[1]; } d3.layout.histogram = function() { var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges; function histogram(data, i) { var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x; while (++i < m) { bin = bins[i] = []; bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]); bin.y = 0; } if (m > 0) { i = -1; while (++i < n) { x = values[i]; if (x >= range[0] && x <= range[1]) { bin = bins[d3.bisect(thresholds, x, 1, m) - 1]; bin.y += k; bin.push(data[i]); } } } return bins; } histogram.value = function(x) { if (!arguments.length) return valuer; valuer = x; return histogram; }; histogram.range = function(x) { if (!arguments.length) return ranger; ranger = d3_functor(x); return histogram; }; histogram.bins = function(x) { if (!arguments.length) return binner; binner = typeof x === "number" ? function(range) { return d3_layout_histogramBinFixed(range, x); } : d3_functor(x); return histogram; }; histogram.frequency = function(x) { if (!arguments.length) return frequency; frequency = !!x; return histogram; }; return histogram; }; function d3_layout_histogramBinSturges(range, values) { return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1)); } function d3_layout_histogramBinFixed(range, n) { var x = -1, b = +range[0], m = (range[1] - b) / n, f = []; while (++x <= n) f[x] = m * x + b; return f; } function d3_layout_histogramRange(values) { return [ d3.min(values), d3.max(values) ]; } d3.layout.tree = function() { var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; function tree(d, i) { var nodes = hierarchy.call(this, d, i), root = nodes[0]; function firstWalk(node, previousSibling) { var children = node.children, layout = node._tree; if (children && (n = children.length)) { var n, firstChild = children[0], previousChild, ancestor = firstChild, child, i = -1; while (++i < n) { child = children[i]; firstWalk(child, previousChild); ancestor = apportion(child, previousChild, ancestor); previousChild = child; } d3_layout_treeShift(node); var midpoint = .5 * (firstChild._tree.prelim + child._tree.prelim); if (previousSibling) { layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling); layout.mod = layout.prelim - midpoint; } else { layout.prelim = midpoint; } } else { if (previousSibling) { layout.prelim = previousSibling._tree.prelim + separation(node, previousSibling); } } } function secondWalk(node, x) { node.x = node._tree.prelim + x; var children = node.children; if (children && (n = children.length)) { var i = -1, n; x += node._tree.mod; while (++i < n) { secondWalk(children[i], x); } } } function apportion(node, previousSibling, ancestor) { if (previousSibling) { var vip = node, vop = node, vim = previousSibling, vom = node.parent.children[0], sip = vip._tree.mod, sop = vop._tree.mod, sim = vim._tree.mod, som = vom._tree.mod, shift; while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) { vom = d3_layout_treeLeft(vom); vop = d3_layout_treeRight(vop); vop._tree.ancestor = node; shift = vim._tree.prelim + sim - vip._tree.prelim - sip + separation(vim, vip); if (shift > 0) { d3_layout_treeMove(d3_layout_treeAncestor(vim, node, ancestor), node, shift); sip += shift; sop += shift; } sim += vim._tree.mod; sip += vip._tree.mod; som += vom._tree.mod; sop += vop._tree.mod; } if (vim && !d3_layout_treeRight(vop)) { vop._tree.thread = vim; vop._tree.mod += sim - sop; } if (vip && !d3_layout_treeLeft(vom)) { vom._tree.thread = vip; vom._tree.mod += sip - som; ancestor = node; } } return ancestor; } d3_layout_treeVisitAfter(root, function(node, previousSibling) { node._tree = { ancestor: node, prelim: 0, mod: 0, change: 0, shift: 0, number: previousSibling ? previousSibling._tree.number + 1 : 0 }; }); firstWalk(root); secondWalk(root, -root._tree.prelim); var left = d3_layout_treeSearch(root, d3_layout_treeLeftmost), right = d3_layout_treeSearch(root, d3_layout_treeRightmost), deep = d3_layout_treeSearch(root, d3_layout_treeDeepest), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2, y1 = deep.depth || 1; d3_layout_treeVisitAfter(root, nodeSize ? function(node) { node.x *= size[0]; node.y = node.depth * size[1]; delete node._tree; } : function(node) { node.x = (node.x - x0) / (x1 - x0) * size[0]; node.y = node.depth / y1 * size[1]; delete node._tree; }); return nodes; } tree.separation = function(x) { if (!arguments.length) return separation; separation = x; return tree; }; tree.size = function(x) { if (!arguments.length) return nodeSize ? null : size; nodeSize = (size = x) == null; return tree; }; tree.nodeSize = function(x) { if (!arguments.length) return nodeSize ? size : null; nodeSize = (size = x) != null; return tree; }; return d3_layout_hierarchyRebind(tree, hierarchy); }; function d3_layout_treeSeparation(a, b) { return a.parent == b.parent ? 1 : 2; } function d3_layout_treeLeft(node) { var children = node.children; return children && children.length ? children[0] : node._tree.thread; } function d3_layout_treeRight(node) { var children = node.children, n; return children && (n = children.length) ? children[n - 1] : node._tree.thread; } function d3_layout_treeSearch(node, compare) { var children = node.children; if (children && (n = children.length)) { var child, n, i = -1; while (++i < n) { if (compare(child = d3_layout_treeSearch(children[i], compare), node) > 0) { node = child; } } } return node; } function d3_layout_treeRightmost(a, b) { return a.x - b.x; } function d3_layout_treeLeftmost(a, b) { return b.x - a.x; } function d3_layout_treeDeepest(a, b) { return a.depth - b.depth; } function d3_layout_treeVisitAfter(node, callback) { function visit(node, previousSibling) { var children = node.children; if (children && (n = children.length)) { var child, previousChild = null, i = -1, n; while (++i < n) { child = children[i]; visit(child, previousChild); previousChild = child; } } callback(node, previousSibling); } visit(node, null); } function d3_layout_treeShift(node) { var shift = 0, change = 0, children = node.children, i = children.length, child; while (--i >= 0) { child = children[i]._tree; child.prelim += shift; child.mod += shift; shift += child.shift + (change += child.change); } } function d3_layout_treeMove(ancestor, node, shift) { ancestor = ancestor._tree; node = node._tree; var change = shift / (node.number - ancestor.number); ancestor.change += change; node.change -= change; node.shift += shift; node.prelim += shift; node.mod += shift; } function d3_layout_treeAncestor(vim, node, ancestor) { return vim._tree.ancestor.parent == node.parent ? vim._tree.ancestor : ancestor; } d3.layout.pack = function() { var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius; function pack(d, i) { var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() { return radius; }; root.x = root.y = 0; d3_layout_treeVisitAfter(root, function(d) { d.r = +r(d.value); }); d3_layout_treeVisitAfter(root, d3_layout_packSiblings); if (padding) { var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2; d3_layout_treeVisitAfter(root, function(d) { d.r += dr; }); d3_layout_treeVisitAfter(root, d3_layout_packSiblings); d3_layout_treeVisitAfter(root, function(d) { d.r -= dr; }); } d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h)); return nodes; } pack.size = function(_) { if (!arguments.length) return size; size = _; return pack; }; pack.radius = function(_) { if (!arguments.length) return radius; radius = _ == null || typeof _ === "function" ? _ : +_; return pack; }; pack.padding = function(_) { if (!arguments.length) return padding; padding = +_; return pack; }; return d3_layout_hierarchyRebind(pack, hierarchy); }; function d3_layout_packSort(a, b) { return a.value - b.value; } function d3_layout_packInsert(a, b) { var c = a._pack_next; a._pack_next = b; b._pack_prev = a; b._pack_next = c; c._pack_prev = b; } function d3_layout_packSplice(a, b) { a._pack_next = b; b._pack_prev = a; } function d3_layout_packIntersects(a, b) { var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r; return .999 * dr * dr > dx * dx + dy * dy; } function d3_layout_packSiblings(node) { if (!(nodes = node.children) || !(n = nodes.length)) return; var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n; function bound(node) { xMin = Math.min(node.x - node.r, xMin); xMax = Math.max(node.x + node.r, xMax); yMin = Math.min(node.y - node.r, yMin); yMax = Math.max(node.y + node.r, yMax); } nodes.forEach(d3_layout_packLink); a = nodes[0]; a.x = -a.r; a.y = 0; bound(a); if (n > 1) { b = nodes[1]; b.x = b.r; b.y = 0; bound(b); if (n > 2) { c = nodes[2]; d3_layout_packPlace(a, b, c); bound(c); d3_layout_packInsert(a, c); a._pack_prev = c; d3_layout_packInsert(c, b); b = a._pack_next; for (i = 3; i < n; i++) { d3_layout_packPlace(a, b, c = nodes[i]); var isect = 0, s1 = 1, s2 = 1; for (j = b._pack_next; j !== b; j = j._pack_next, s1++) { if (d3_layout_packIntersects(j, c)) { isect = 1; break; } } if (isect == 1) { for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) { if (d3_layout_packIntersects(k, c)) { break; } } } if (isect) { if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b); i--; } else { d3_layout_packInsert(a, c); b = c; bound(c); } } } } var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0; for (i = 0; i < n; i++) { c = nodes[i]; c.x -= cx; c.y -= cy; cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y)); } node.r = cr; nodes.forEach(d3_layout_packUnlink); } function d3_layout_packLink(node) { node._pack_next = node._pack_prev = node; } function d3_layout_packUnlink(node) { delete node._pack_next; delete node._pack_prev; } function d3_layout_packTransform(node, x, y, k) { var children = node.children; node.x = x += k * node.x; node.y = y += k * node.y; node.r *= k; if (children) { var i = -1, n = children.length; while (++i < n) d3_layout_packTransform(children[i], x, y, k); } } function d3_layout_packPlace(a, b, c) { var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y; if (db && (dx || dy)) { var da = b.r + c.r, dc = dx * dx + dy * dy; da *= da; db *= db; var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc); c.x = a.x + x * dx + y * dy; c.y = a.y + x * dy - y * dx; } else { c.x = a.x + db; c.y = a.y; } } d3.layout.cluster = function() { var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false; function cluster(d, i) { var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0; d3_layout_treeVisitAfter(root, function(node) { var children = node.children; if (children && children.length) { node.x = d3_layout_clusterX(children); node.y = d3_layout_clusterY(children); } else { node.x = previousNode ? x += separation(node, previousNode) : 0; node.y = 0; previousNode = node; } }); var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2; d3_layout_treeVisitAfter(root, nodeSize ? function(node) { node.x = (node.x - root.x) * size[0]; node.y = (root.y - node.y) * size[1]; } : function(node) { node.x = (node.x - x0) / (x1 - x0) * size[0]; node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1]; }); return nodes; } cluster.separation = function(x) { if (!arguments.length) return separation; separation = x; return cluster; }; cluster.size = function(x) { if (!arguments.length) return nodeSize ? null : size; nodeSize = (size = x) == null; return cluster; }; cluster.nodeSize = function(x) { if (!arguments.length) return nodeSize ? size : null; nodeSize = (size = x) != null; return cluster; }; return d3_layout_hierarchyRebind(cluster, hierarchy); }; function d3_layout_clusterY(children) { return 1 + d3.max(children, function(child) { return child.y; }); } function d3_layout_clusterX(children) { return children.reduce(function(x, child) { return x + child.x; }, 0) / children.length; } function d3_layout_clusterLeft(node) { var children = node.children; return children && children.length ? d3_layout_clusterLeft(children[0]) : node; } function d3_layout_clusterRight(node) { var children = node.children, n; return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node; } d3.layout.treemap = function() { var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5)); function scale(children, k) { var i = -1, n = children.length, child, area; while (++i < n) { area = (child = children[i]).value * (k < 0 ? 0 : k); child.area = isNaN(area) || area <= 0 ? 0 : area; } } function squarify(node) { var children = node.children; if (children && children.length) { var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n; scale(remaining, rect.dx * rect.dy / node.value); row.area = 0; while ((n = remaining.length) > 0) { row.push(child = remaining[n - 1]); row.area += child.area; if (mode !== "squarify" || (score = worst(row, u)) <= best) { remaining.pop(); best = score; } else { row.area -= row.pop().area; position(row, u, rect, false); u = Math.min(rect.dx, rect.dy); row.length = row.area = 0; best = Infinity; } } if (row.length) { position(row, u, rect, true); row.length = row.area = 0; } children.forEach(squarify); } } function stickify(node) { var children = node.children; if (children && children.length) { var rect = pad(node), remaining = children.slice(), child, row = []; scale(remaining, rect.dx * rect.dy / node.value); row.area = 0; while (child = remaining.pop()) { row.push(child); row.area += child.area; if (child.z != null) { position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); row.length = row.area = 0; } } children.forEach(stickify); } } function worst(row, u) { var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length; while (++i < n) { if (!(r = row[i].area)) continue; if (r < rmin) rmin = r; if (r > rmax) rmax = r; } s *= s; u *= u; return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity; } function position(row, u, rect, flush) { var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o; if (u == rect.dx) { if (flush || v > rect.dy) v = rect.dy; while (++i < n) { o = row[i]; o.x = x; o.y = y; o.dy = v; x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0); } o.z = true; o.dx += rect.x + rect.dx - x; rect.y += v; rect.dy -= v; } else { if (flush || v > rect.dx) v = rect.dx; while (++i < n) { o = row[i]; o.x = x; o.y = y; o.dx = v; y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0); } o.z = false; o.dy += rect.y + rect.dy - y; rect.x += v; rect.dx -= v; } } function treemap(d) { var nodes = stickies || hierarchy(d), root = nodes[0]; root.x = 0; root.y = 0; root.dx = size[0]; root.dy = size[1]; if (stickies) hierarchy.revalue(root); scale([ root ], root.dx * root.dy / root.value); (stickies ? stickify : squarify)(root); if (sticky) stickies = nodes; return nodes; } treemap.size = function(x) { if (!arguments.length) return size; size = x; return treemap; }; treemap.padding = function(x) { if (!arguments.length) return padding; function padFunction(node) { var p = x.call(treemap, node, node.depth); return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p); } function padConstant(node) { return d3_layout_treemapPad(node, x); } var type; pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], padConstant) : padConstant; return treemap; }; treemap.round = function(x) { if (!arguments.length) return round != Number; round = x ? Math.round : Number; return treemap; }; treemap.sticky = function(x) { if (!arguments.length) return sticky; sticky = x; stickies = null; return treemap; }; treemap.ratio = function(x) { if (!arguments.length) return ratio; ratio = x; return treemap; }; treemap.mode = function(x) { if (!arguments.length) return mode; mode = x + ""; return treemap; }; return d3_layout_hierarchyRebind(treemap, hierarchy); }; function d3_layout_treemapPadNull(node) { return { x: node.x, y: node.y, dx: node.dx, dy: node.dy }; } function d3_layout_treemapPad(node, padding) { var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2]; if (dx < 0) { x += dx / 2; dx = 0; } if (dy < 0) { y += dy / 2; dy = 0; } return { x: x, y: y, dx: dx, dy: dy }; } d3.random = { normal: function(µ, σ) { var n = arguments.length; if (n < 2) σ = 1; if (n < 1) µ = 0; return function() { var x, y, r; do { x = Math.random() * 2 - 1; y = Math.random() * 2 - 1; r = x * x + y * y; } while (!r || r > 1); return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r); }; }, logNormal: function() { var random = d3.random.normal.apply(d3, arguments); return function() { return Math.exp(random()); }; }, bates: function(m) { var random = d3.random.irwinHall(m); return function() { return random() / m; }; }, irwinHall: function(m) { return function() { for (var s = 0, j = 0; j < m; j++) s += Math.random(); return s; }; } }; d3.scale = {}; function d3_scaleExtent(domain) { var start = domain[0], stop = domain[domain.length - 1]; return start < stop ? [ start, stop ] : [ stop, start ]; } function d3_scaleRange(scale) { return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range()); } function d3_scale_bilinear(domain, range, uninterpolate, interpolate) { var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]); return function(x) { return i(u(x)); }; } function d3_scale_nice(domain, nice) { var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx; if (x1 < x0) { dx = i0, i0 = i1, i1 = dx; dx = x0, x0 = x1, x1 = dx; } domain[i0] = nice.floor(x0); domain[i1] = nice.ceil(x1); return domain; } function d3_scale_niceStep(step) { return step ? { floor: function(x) { return Math.floor(x / step) * step; }, ceil: function(x) { return Math.ceil(x / step) * step; } } : d3_scale_niceIdentity; } var d3_scale_niceIdentity = { floor: d3_identity, ceil: d3_identity }; function d3_scale_polylinear(domain, range, uninterpolate, interpolate) { var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1; if (domain[k] < domain[0]) { domain = domain.slice().reverse(); range = range.slice().reverse(); } while (++j <= k) { u.push(uninterpolate(domain[j - 1], domain[j])); i.push(interpolate(range[j - 1], range[j])); } return function(x) { var j = d3.bisect(domain, x, 1, k) - 1; return i[j](u[j](x)); }; } d3.scale.linear = function() { return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false); }; function d3_scale_linear(domain, range, interpolate, clamp) { var output, input; function rescale() { var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber; output = linear(domain, range, uninterpolate, interpolate); input = linear(range, domain, uninterpolate, d3_interpolate); return scale; } function scale(x) { return output(x); } scale.invert = function(y) { return input(y); }; scale.domain = function(x) { if (!arguments.length) return domain; domain = x.map(Number); return rescale(); }; scale.range = function(x) { if (!arguments.length) return range; range = x; return rescale(); }; scale.rangeRound = function(x) { return scale.range(x).interpolate(d3_interpolateRound); }; scale.clamp = function(x) { if (!arguments.length) return clamp; clamp = x; return rescale(); }; scale.interpolate = function(x) { if (!arguments.length) return interpolate; interpolate = x; return rescale(); }; scale.ticks = function(m) { return d3_scale_linearTicks(domain, m); }; scale.tickFormat = function(m, format) { return d3_scale_linearTickFormat(domain, m, format); }; scale.nice = function(m) { d3_scale_linearNice(domain, m); return rescale(); }; scale.copy = function() { return d3_scale_linear(domain, range, interpolate, clamp); }; return rescale(); } function d3_scale_linearRebind(scale, linear) { return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp"); } function d3_scale_linearNice(domain, m) { return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2])); } function d3_scale_linearTickRange(domain, m) { if (m == null) m = 10; var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step; if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2; extent[0] = Math.ceil(extent[0] / step) * step; extent[1] = Math.floor(extent[1] / step) * step + step * .5; extent[2] = step; return extent; } function d3_scale_linearTicks(domain, m) { return d3.range.apply(d3, d3_scale_linearTickRange(domain, m)); } function d3_scale_linearTickFormat(domain, m, format) { var range = d3_scale_linearTickRange(domain, m); return d3.format(format ? format.replace(d3_format_re, function(a, b, c, d, e, f, g, h, i, j) { return [ b, c, d, e, f, g, h, i || "." + d3_scale_linearFormatPrecision(j, range), j ].join(""); }) : ",." + d3_scale_linearPrecision(range[2]) + "f"); } var d3_scale_linearFormatSignificant = { s: 1, g: 1, p: 1, r: 1, e: 1 }; function d3_scale_linearPrecision(value) { return -Math.floor(Math.log(value) / Math.LN10 + .01); } function d3_scale_linearFormatPrecision(type, range) { var p = d3_scale_linearPrecision(range[2]); return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(Math.abs(range[0]), Math.abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2; } d3.scale.log = function() { return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]); }; function d3_scale_log(linear, base, positive, domain) { function log(x) { return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base); } function pow(x) { return positive ? Math.pow(base, x) : -Math.pow(base, -x); } function scale(x) { return linear(log(x)); } scale.invert = function(x) { return pow(linear.invert(x)); }; scale.domain = function(x) { if (!arguments.length) return domain; positive = x[0] >= 0; linear.domain((domain = x.map(Number)).map(log)); return scale; }; scale.base = function(_) { if (!arguments.length) return base; base = +_; linear.domain(domain.map(log)); return scale; }; scale.nice = function() { var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative); linear.domain(niced); domain = niced.map(pow); return scale; }; scale.ticks = function() { var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base; if (isFinite(j - i)) { if (positive) { for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k); ticks.push(pow(i)); } else { ticks.push(pow(i)); for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k); } for (i = 0; ticks[i] < u; i++) {} for (j = ticks.length; ticks[j - 1] > v; j--) {} ticks = ticks.slice(i, j); } return ticks; }; scale.tickFormat = function(n, format) { if (!arguments.length) return d3_scale_logFormat; if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format); var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12, Math.floor), e; return function(d) { return d / pow(f(log(d) + e)) <= k ? format(d) : ""; }; }; scale.copy = function() { return d3_scale_log(linear.copy(), base, positive, domain); }; return d3_scale_linearRebind(scale, linear); } var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = { floor: function(x) { return -Math.ceil(-x); }, ceil: function(x) { return -Math.floor(-x); } }; d3.scale.pow = function() { return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]); }; function d3_scale_pow(linear, exponent, domain) { var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent); function scale(x) { return linear(powp(x)); } scale.invert = function(x) { return powb(linear.invert(x)); }; scale.domain = function(x) { if (!arguments.length) return domain; linear.domain((domain = x.map(Number)).map(powp)); return scale; }; scale.ticks = function(m) { return d3_scale_linearTicks(domain, m); }; scale.tickFormat = function(m, format) { return d3_scale_linearTickFormat(domain, m, format); }; scale.nice = function(m) { return scale.domain(d3_scale_linearNice(domain, m)); }; scale.exponent = function(x) { if (!arguments.length) return exponent; powp = d3_scale_powPow(exponent = x); powb = d3_scale_powPow(1 / exponent); linear.domain(domain.map(powp)); return scale; }; scale.copy = function() { return d3_scale_pow(linear.copy(), exponent, domain); }; return d3_scale_linearRebind(scale, linear); } function d3_scale_powPow(e) { return function(x) { return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); }; } d3.scale.sqrt = function() { return d3.scale.pow().exponent(.5); }; d3.scale.ordinal = function() { return d3_scale_ordinal([], { t: "range", a: [ [] ] }); }; function d3_scale_ordinal(domain, ranger) { var index, range, rangeBand; function scale(x) { return range[((index.get(x) || ranger.t === "range" && index.set(x, domain.push(x))) - 1) % range.length]; } function steps(start, step) { return d3.range(domain.length).map(function(i) { return start + step * i; }); } scale.domain = function(x) { if (!arguments.length) return domain; domain = []; index = new d3_Map(); var i = -1, n = x.length, xi; while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi)); return scale[ranger.t].apply(scale, ranger.a); }; scale.range = function(x) { if (!arguments.length) return range; range = x; rangeBand = 0; ranger = { t: "range", a: arguments }; return scale; }; scale.rangePoints = function(x, padding) { if (arguments.length < 2) padding = 0; var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding); range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step); rangeBand = 0; ranger = { t: "rangePoints", a: arguments }; return scale; }; scale.rangeBands = function(x, padding, outerPadding) { if (arguments.length < 2) padding = 0; if (arguments.length < 3) outerPadding = padding; var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding); range = steps(start + step * outerPadding, step); if (reverse) range.reverse(); rangeBand = step * (1 - padding); ranger = { t: "rangeBands", a: arguments }; return scale; }; scale.rangeRoundBands = function(x, padding, outerPadding) { if (arguments.length < 2) padding = 0; if (arguments.length < 3) outerPadding = padding; var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step; range = steps(start + Math.round(error / 2), step); if (reverse) range.reverse(); rangeBand = Math.round(step * (1 - padding)); ranger = { t: "rangeRoundBands", a: arguments }; return scale; }; scale.rangeBand = function() { return rangeBand; }; scale.rangeExtent = function() { return d3_scaleExtent(ranger.a[0]); }; scale.copy = function() { return d3_scale_ordinal(domain, ranger); }; return scale.domain(domain); } d3.scale.category10 = function() { return d3.scale.ordinal().range(d3_category10); }; d3.scale.category20 = function() { return d3.scale.ordinal().range(d3_category20); }; d3.scale.category20b = function() { return d3.scale.ordinal().range(d3_category20b); }; d3.scale.category20c = function() { return d3.scale.ordinal().range(d3_category20c); }; var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString); var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString); var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString); var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString); d3.scale.quantile = function() { return d3_scale_quantile([], []); }; function d3_scale_quantile(domain, range) { var thresholds; function rescale() { var k = 0, q = range.length; thresholds = []; while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q); return scale; } function scale(x) { if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)]; } scale.domain = function(x) { if (!arguments.length) return domain; domain = x.filter(function(d) { return !isNaN(d); }).sort(d3.ascending); return rescale(); }; scale.range = function(x) { if (!arguments.length) return range; range = x; return rescale(); }; scale.quantiles = function() { return thresholds; }; scale.invertExtent = function(y) { y = range.indexOf(y); return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ]; }; scale.copy = function() { return d3_scale_quantile(domain, range); }; return rescale(); } d3.scale.quantize = function() { return d3_scale_quantize(0, 1, [ 0, 1 ]); }; function d3_scale_quantize(x0, x1, range) { var kx, i; function scale(x) { return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))]; } function rescale() { kx = range.length / (x1 - x0); i = range.length - 1; return scale; } scale.domain = function(x) { if (!arguments.length) return [ x0, x1 ]; x0 = +x[0]; x1 = +x[x.length - 1]; return rescale(); }; scale.range = function(x) { if (!arguments.length) return range; range = x; return rescale(); }; scale.invertExtent = function(y) { y = range.indexOf(y); y = y < 0 ? NaN : y / kx + x0; return [ y, y + 1 / kx ]; }; scale.copy = function() { return d3_scale_quantize(x0, x1, range); }; return rescale(); } d3.scale.threshold = function() { return d3_scale_threshold([ .5 ], [ 0, 1 ]); }; function d3_scale_threshold(domain, range) { function scale(x) { if (x <= x) return range[d3.bisect(domain, x)]; } scale.domain = function(_) { if (!arguments.length) return domain; domain = _; return scale; }; scale.range = function(_) { if (!arguments.length) return range; range = _; return scale; }; scale.invertExtent = function(y) { y = range.indexOf(y); return [ domain[y - 1], domain[y] ]; }; scale.copy = function() { return d3_scale_threshold(domain, range); }; return scale; } d3.scale.identity = function() { return d3_scale_identity([ 0, 1 ]); }; function d3_scale_identity(domain) { function identity(x) { return +x; } identity.invert = identity; identity.domain = identity.range = function(x) { if (!arguments.length) return domain; domain = x.map(identity); return identity; }; identity.ticks = function(m) { return d3_scale_linearTicks(domain, m); }; identity.tickFormat = function(m, format) { return d3_scale_linearTickFormat(domain, m, format); }; identity.copy = function() { return d3_scale_identity(domain); }; return identity; } d3.svg = {}; d3.svg.arc = function() { var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; function arc() { var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0, a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1); return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z"; } arc.innerRadius = function(v) { if (!arguments.length) return innerRadius; innerRadius = d3_functor(v); return arc; }; arc.outerRadius = function(v) { if (!arguments.length) return outerRadius; outerRadius = d3_functor(v); return arc; }; arc.startAngle = function(v) { if (!arguments.length) return startAngle; startAngle = d3_functor(v); return arc; }; arc.endAngle = function(v) { if (!arguments.length) return endAngle; endAngle = d3_functor(v); return arc; }; arc.centroid = function() { var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset; return [ Math.cos(a) * r, Math.sin(a) * r ]; }; return arc; }; var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε; function d3_svg_arcInnerRadius(d) { return d.innerRadius; } function d3_svg_arcOuterRadius(d) { return d.outerRadius; } function d3_svg_arcStartAngle(d) { return d.startAngle; } function d3_svg_arcEndAngle(d) { return d.endAngle; } function d3_svg_line(projection) { var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7; function line(data) { var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y); function segment() { segments.push("M", interpolate(projection(points), tension)); } while (++i < n) { if (defined.call(this, d = data[i], i)) { points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]); } else if (points.length) { segment(); points = []; } } if (points.length) segment(); return segments.length ? segments.join("") : null; } line.x = function(_) { if (!arguments.length) return x; x = _; return line; }; line.y = function(_) { if (!arguments.length) return y; y = _; return line; }; line.defined = function(_) { if (!arguments.length) return defined; defined = _; return line; }; line.interpolate = function(_) { if (!arguments.length) return interpolateKey; if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; return line; }; line.tension = function(_) { if (!arguments.length) return tension; tension = _; return line; }; return line; } d3.svg.line = function() { return d3_svg_line(d3_identity); }; var d3_svg_lineInterpolators = d3.map({ linear: d3_svg_lineLinear, "linear-closed": d3_svg_lineLinearClosed, step: d3_svg_lineStep, "step-before": d3_svg_lineStepBefore, "step-after": d3_svg_lineStepAfter, basis: d3_svg_lineBasis, "basis-open": d3_svg_lineBasisOpen, "basis-closed": d3_svg_lineBasisClosed, bundle: d3_svg_lineBundle, cardinal: d3_svg_lineCardinal, "cardinal-open": d3_svg_lineCardinalOpen, "cardinal-closed": d3_svg_lineCardinalClosed, monotone: d3_svg_lineMonotone }); d3_svg_lineInterpolators.forEach(function(key, value) { value.key = key; value.closed = /-closed$/.test(key); }); function d3_svg_lineLinear(points) { return points.join("L"); } function d3_svg_lineLinearClosed(points) { return d3_svg_lineLinear(points) + "Z"; } function d3_svg_lineStep(points) { var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]); if (n > 1) path.push("H", p[0]); return path.join(""); } function d3_svg_lineStepBefore(points) { var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]); return path.join(""); } function d3_svg_lineStepAfter(points) { var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ]; while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]); return path.join(""); } function d3_svg_lineCardinalOpen(points, tension) { return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension)); } function d3_svg_lineCardinalClosed(points, tension) { return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); } function d3_svg_lineCardinal(points, tension) { return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension)); } function d3_svg_lineHermite(points, tangents) { if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) { return d3_svg_lineLinear(points); } var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1; if (quad) { path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1]; p0 = points[1]; pi = 2; } if (tangents.length > 1) { t = tangents[1]; p = points[pi]; pi++; path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; for (var i = 2; i < tangents.length; i++, pi++) { p = points[pi]; t = tangents[i]; path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1]; } } if (quad) { var lp = points[pi]; path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1]; } return path; } function d3_svg_lineCardinalTangents(points, tension) { var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length; while (++i < n) { p0 = p1; p1 = p2; p2 = points[i]; tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]); } return tangents; } function d3_svg_lineBasis(points) { if (points.length < 3) return d3_svg_lineLinear(points); var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; points.push(points[n - 1]); while (++i <= n) { pi = points[i]; px.shift(); px.push(pi[0]); py.shift(); py.push(pi[1]); d3_svg_lineBasisBezier(path, px, py); } points.pop(); path.push("L", pi); return path.join(""); } function d3_svg_lineBasisOpen(points) { if (points.length < 4) return d3_svg_lineLinear(points); var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ]; while (++i < 3) { pi = points[i]; px.push(pi[0]); py.push(pi[1]); } path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)); --i; while (++i < n) { pi = points[i]; px.shift(); px.push(pi[0]); py.shift(); py.push(pi[1]); d3_svg_lineBasisBezier(path, px, py); } return path.join(""); } function d3_svg_lineBasisClosed(points) { var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = []; while (++i < 4) { pi = points[i % n]; px.push(pi[0]); py.push(pi[1]); } path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ]; --i; while (++i < m) { pi = points[i % n]; px.shift(); px.push(pi[0]); py.shift(); py.push(pi[1]); d3_svg_lineBasisBezier(path, px, py); } return path.join(""); } function d3_svg_lineBundle(points, tension) { var n = points.length - 1; if (n) { var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t; while (++i <= n) { p = points[i]; t = i / n; p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx); p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy); } } return d3_svg_lineBasis(points); } function d3_svg_lineDot4(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; } var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ]; function d3_svg_lineBasisBezier(path, x, y) { path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y)); } function d3_svg_lineSlope(p0, p1) { return (p1[1] - p0[1]) / (p1[0] - p0[0]); } function d3_svg_lineFiniteDifferences(points) { var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1); while (++i < j) { m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2; } m[i] = d; return m; } function d3_svg_lineMonotoneTangents(points) { var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1; while (++i < j) { d = d3_svg_lineSlope(points[i], points[i + 1]); if (abs(d) < ε) { m[i] = m[i + 1] = 0; } else { a = m[i] / d; b = m[i + 1] / d; s = a * a + b * b; if (s > 9) { s = d * 3 / Math.sqrt(s); m[i] = s * a; m[i + 1] = s * b; } } } i = -1; while (++i <= j) { s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i])); tangents.push([ s || 0, m[i] * s || 0 ]); } return tangents; } function d3_svg_lineMonotone(points) { return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points)); } d3.svg.line.radial = function() { var line = d3_svg_line(d3_svg_lineRadial); line.radius = line.x, delete line.x; line.angle = line.y, delete line.y; return line; }; function d3_svg_lineRadial(points) { var point, i = -1, n = points.length, r, a; while (++i < n) { point = points[i]; r = point[0]; a = point[1] + d3_svg_arcOffset; point[0] = r * Math.cos(a); point[1] = r * Math.sin(a); } return points; } function d3_svg_area(projection) { var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7; function area(data) { var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() { return x; } : d3_functor(x1), fy1 = y0 === y1 ? function() { return y; } : d3_functor(y1), x, y; function segment() { segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z"); } while (++i < n) { if (defined.call(this, d = data[i], i)) { points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]); points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]); } else if (points0.length) { segment(); points0 = []; points1 = []; } } if (points0.length) segment(); return segments.length ? segments.join("") : null; } area.x = function(_) { if (!arguments.length) return x1; x0 = x1 = _; return area; }; area.x0 = function(_) { if (!arguments.length) return x0; x0 = _; return area; }; area.x1 = function(_) { if (!arguments.length) return x1; x1 = _; return area; }; area.y = function(_) { if (!arguments.length) return y1; y0 = y1 = _; return area; }; area.y0 = function(_) { if (!arguments.length) return y0; y0 = _; return area; }; area.y1 = function(_) { if (!arguments.length) return y1; y1 = _; return area; }; area.defined = function(_) { if (!arguments.length) return defined; defined = _; return area; }; area.interpolate = function(_) { if (!arguments.length) return interpolateKey; if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key; interpolateReverse = interpolate.reverse || interpolate; L = interpolate.closed ? "M" : "L"; return area; }; area.tension = function(_) { if (!arguments.length) return tension; tension = _; return area; }; return area; } d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; d3.svg.area = function() { return d3_svg_area(d3_identity); }; d3.svg.area.radial = function() { var area = d3_svg_area(d3_svg_lineRadial); area.radius = area.x, delete area.x; area.innerRadius = area.x0, delete area.x0; area.outerRadius = area.x1, delete area.x1; area.angle = area.y, delete area.y; area.startAngle = area.y0, delete area.y0; area.endAngle = area.y1, delete area.y1; return area; }; d3.svg.chord = function() { var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle; function chord(d, i) { var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i); return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z"; } function subgroup(self, f, d, i) { var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset; return { r: r, a0: a0, a1: a1, p0: [ r * Math.cos(a0), r * Math.sin(a0) ], p1: [ r * Math.cos(a1), r * Math.sin(a1) ] }; } function equals(a, b) { return a.a0 == b.a0 && a.a1 == b.a1; } function arc(r, p, a) { return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p; } function curve(r0, p0, r1, p1) { return "Q 0,0 " + p1; } chord.radius = function(v) { if (!arguments.length) return radius; radius = d3_functor(v); return chord; }; chord.source = function(v) { if (!arguments.length) return source; source = d3_functor(v); return chord; }; chord.target = function(v) { if (!arguments.length) return target; target = d3_functor(v); return chord; }; chord.startAngle = function(v) { if (!arguments.length) return startAngle; startAngle = d3_functor(v); return chord; }; chord.endAngle = function(v) { if (!arguments.length) return endAngle; endAngle = d3_functor(v); return chord; }; return chord; }; function d3_svg_chordRadius(d) { return d.radius; } d3.svg.diagonal = function() { var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection; function diagonal(d, i) { var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, { x: p0.x, y: m }, { x: p3.x, y: m }, p3 ]; p = p.map(projection); return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3]; } diagonal.source = function(x) { if (!arguments.length) return source; source = d3_functor(x); return diagonal; }; diagonal.target = function(x) { if (!arguments.length) return target; target = d3_functor(x); return diagonal; }; diagonal.projection = function(x) { if (!arguments.length) return projection; projection = x; return diagonal; }; return diagonal; }; function d3_svg_diagonalProjection(d) { return [ d.x, d.y ]; } d3.svg.diagonal.radial = function() { var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection; diagonal.projection = function(x) { return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection; }; return diagonal; }; function d3_svg_diagonalRadialProjection(projection) { return function() { var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset; return [ r * Math.cos(a), r * Math.sin(a) ]; }; } d3.svg.symbol = function() { var type = d3_svg_symbolType, size = d3_svg_symbolSize; function symbol(d, i) { return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i)); } symbol.type = function(x) { if (!arguments.length) return type; type = d3_functor(x); return symbol; }; symbol.size = function(x) { if (!arguments.length) return size; size = d3_functor(x); return symbol; }; return symbol; }; function d3_svg_symbolSize() { return 64; } function d3_svg_symbolType() { return "circle"; } function d3_svg_symbolCircle(size) { var r = Math.sqrt(size / π); return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z"; } var d3_svg_symbols = d3.map({ circle: d3_svg_symbolCircle, cross: function(size) { var r = Math.sqrt(size / 5) / 2; return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z"; }, diamond: function(size) { var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30; return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z"; }, square: function(size) { var r = Math.sqrt(size) / 2; return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z"; }, "triangle-down": function(size) { var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z"; }, "triangle-up": function(size) { var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2; return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z"; } }); d3.svg.symbolTypes = d3_svg_symbols.keys(); var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians); function d3_transition(groups, id) { d3_subclass(groups, d3_transitionPrototype); groups.id = id; return groups; } var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit; d3_transitionPrototype.call = d3_selectionPrototype.call; d3_transitionPrototype.empty = d3_selectionPrototype.empty; d3_transitionPrototype.node = d3_selectionPrototype.node; d3_transitionPrototype.size = d3_selectionPrototype.size; d3.transition = function(selection) { return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition(); }; d3.transition.prototype = d3_transitionPrototype; d3_transitionPrototype.select = function(selector) { var id = this.id, subgroups = [], subgroup, subnode, node; selector = d3_selection_selector(selector); for (var j = -1, m = this.length; ++j < m; ) { subgroups.push(subgroup = []); for (var group = this[j], i = -1, n = group.length; ++i < n; ) { if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) { if ("__data__" in node) subnode.__data__ = node.__data__; d3_transitionNode(subnode, i, id, node.__transition__[id]); subgroup.push(subnode); } else { subgroup.push(null); } } } return d3_transition(subgroups, id); }; d3_transitionPrototype.selectAll = function(selector) { var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition; selector = d3_selection_selectorAll(selector); for (var j = -1, m = this.length; ++j < m; ) { for (var group = this[j], i = -1, n = group.length; ++i < n; ) { if (node = group[i]) { transition = node.__transition__[id]; subnodes = selector.call(node, node.__data__, i, j); subgroups.push(subgroup = []); for (var k = -1, o = subnodes.length; ++k < o; ) { if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition); subgroup.push(subnode); } } } } return d3_transition(subgroups, id); }; d3_transitionPrototype.filter = function(filter) { var subgroups = [], subgroup, group, node; if (typeof filter !== "function") filter = d3_selection_filter(filter); for (var j = 0, m = this.length; j < m; j++) { subgroups.push(subgroup = []); for (var group = this[j], i = 0, n = group.length; i < n; i++) { if ((node = group[i]) && filter.call(node, node.__data__, i, j)) { subgroup.push(node); } } } return d3_transition(subgroups, this.id); }; d3_transitionPrototype.tween = function(name, tween) { var id = this.id; if (arguments.length < 2) return this.node().__transition__[id].tween.get(name); return d3_selection_each(this, tween == null ? function(node) { node.__transition__[id].tween.remove(name); } : function(node) { node.__transition__[id].tween.set(name, tween); }); }; function d3_transition_tween(groups, name, value, tween) { var id = groups.id; return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) { node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j))); } : (value = tween(value), function(node) { node.__transition__[id].tween.set(name, value); })); } d3_transitionPrototype.attr = function(nameNS, value) { if (arguments.length < 2) { for (value in nameNS) this.attr(value, nameNS[value]); return this; } var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS); function attrNull() { this.removeAttribute(name); } function attrNullNS() { this.removeAttributeNS(name.space, name.local); } function attrTween(b) { return b == null ? attrNull : (b += "", function() { var a = this.getAttribute(name), i; return a !== b && (i = interpolate(a, b), function(t) { this.setAttribute(name, i(t)); }); }); } function attrTweenNS(b) { return b == null ? attrNullNS : (b += "", function() { var a = this.getAttributeNS(name.space, name.local), i; return a !== b && (i = interpolate(a, b), function(t) { this.setAttributeNS(name.space, name.local, i(t)); }); }); } return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween); }; d3_transitionPrototype.attrTween = function(nameNS, tween) { var name = d3.ns.qualify(nameNS); function attrTween(d, i) { var f = tween.call(this, d, i, this.getAttribute(name)); return f && function(t) { this.setAttribute(name, f(t)); }; } function attrTweenNS(d, i) { var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); return f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); }; } return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); }; d3_transitionPrototype.style = function(name, value, priority) { var n = arguments.length; if (n < 3) { if (typeof name !== "string") { if (n < 2) value = ""; for (priority in name) this.style(priority, name[priority], value); return this; } priority = ""; } function styleNull() { this.style.removeProperty(name); } function styleString(b) { return b == null ? styleNull : (b += "", function() { var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i; return a !== b && (i = d3_interpolate(a, b), function(t) { this.style.setProperty(name, i(t), priority); }); }); } return d3_transition_tween(this, "style." + name, value, styleString); }; d3_transitionPrototype.styleTween = function(name, tween, priority) { if (arguments.length < 3) priority = ""; function styleTween(d, i) { var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name)); return f && function(t) { this.style.setProperty(name, f(t), priority); }; } return this.tween("style." + name, styleTween); }; d3_transitionPrototype.text = function(value) { return d3_transition_tween(this, "text", value, d3_transition_text); }; function d3_transition_text(b) { if (b == null) b = ""; return function() { this.textContent = b; }; } d3_transitionPrototype.remove = function() { return this.each("end.transition", function() { var p; if (this.__transition__.count < 2 && (p = this.parentNode)) p.removeChild(this); }); }; d3_transitionPrototype.ease = function(value) { var id = this.id; if (arguments.length < 1) return this.node().__transition__[id].ease; if (typeof value !== "function") value = d3.ease.apply(d3, arguments); return d3_selection_each(this, function(node) { node.__transition__[id].ease = value; }); }; d3_transitionPrototype.delay = function(value) { var id = this.id; return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { node.__transition__[id].delay = +value.call(node, node.__data__, i, j); } : (value = +value, function(node) { node.__transition__[id].delay = value; })); }; d3_transitionPrototype.duration = function(value) { var id = this.id; return d3_selection_each(this, typeof value === "function" ? function(node, i, j) { node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j)); } : (value = Math.max(1, value), function(node) { node.__transition__[id].duration = value; })); }; d3_transitionPrototype.each = function(type, listener) { var id = this.id; if (arguments.length < 2) { var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId; d3_transitionInheritId = id; d3_selection_each(this, function(node, i, j) { d3_transitionInherit = node.__transition__[id]; type.call(node, node.__data__, i, j); }); d3_transitionInherit = inherit; d3_transitionInheritId = inheritId; } else { d3_selection_each(this, function(node) { var transition = node.__transition__[id]; (transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener); }); } return this; }; d3_transitionPrototype.transition = function() { var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition; for (var j = 0, m = this.length; j < m; j++) { subgroups.push(subgroup = []); for (var group = this[j], i = 0, n = group.length; i < n; i++) { if (node = group[i]) { transition = Object.create(node.__transition__[id0]); transition.delay += transition.duration; d3_transitionNode(node, i, id1, transition); } subgroup.push(node); } } return d3_transition(subgroups, id1); }; function d3_transitionNode(node, i, id, inherit) { var lock = node.__transition__ || (node.__transition__ = { active: 0, count: 0 }), transition = lock[id]; if (!transition) { var time = inherit.time; transition = lock[id] = { tween: new d3_Map(), time: time, ease: inherit.ease, delay: inherit.delay, duration: inherit.duration }; ++lock.count; d3.timer(function(elapsed) { var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = []; timer.t = delay + time; if (delay <= elapsed) return start(elapsed - delay); timer.c = start; function start(elapsed) { if (lock.active > id) return stop(); lock.active = id; transition.event && transition.event.start.call(node, d, i); transition.tween.forEach(function(key, value) { if (value = value.call(node, d, i)) { tweened.push(value); } }); d3.timer(function() { timer.c = tick(elapsed || 1) ? d3_true : tick; return 1; }, 0, time); } function tick(elapsed) { if (lock.active !== id) return stop(); var t = elapsed / duration, e = ease(t), n = tweened.length; while (n > 0) { tweened[--n].call(node, e); } if (t >= 1) { transition.event && transition.event.end.call(node, d, i); return stop(); } } function stop() { if (--lock.count) delete lock[id]; else delete node.__transition__; return 1; } }, 0, time); } } d3.svg.axis = function() { var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_; function axis(g) { g.each(function() { var g = d3.select(this); var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform; var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), d3.transition(path)); tickEnter.append("line"); tickEnter.append("text"); var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"); switch (orient) { case "bottom": { tickTransform = d3_svg_axisX; lineEnter.attr("y2", innerTickSize); textEnter.attr("y", Math.max(innerTickSize, 0) + tickPadding); lineUpdate.attr("x2", 0).attr("y2", innerTickSize); textUpdate.attr("x", 0).attr("y", Math.max(innerTickSize, 0) + tickPadding); text.attr("dy", ".71em").style("text-anchor", "middle"); pathUpdate.attr("d", "M" + range[0] + "," + outerTickSize + "V0H" + range[1] + "V" + outerTickSize); break; } case "top": { tickTransform = d3_svg_axisX; lineEnter.attr("y2", -innerTickSize); textEnter.attr("y", -(Math.max(innerTickSize, 0) + tickPadding)); lineUpdate.attr("x2", 0).attr("y2", -innerTickSize); textUpdate.attr("x", 0).attr("y", -(Math.max(innerTickSize, 0) + tickPadding)); text.attr("dy", "0em").style("text-anchor", "middle"); pathUpdate.attr("d", "M" + range[0] + "," + -outerTickSize + "V0H" + range[1] + "V" + -outerTickSize); break; } case "left": { tickTransform = d3_svg_axisY; lineEnter.attr("x2", -innerTickSize); textEnter.attr("x", -(Math.max(innerTickSize, 0) + tickPadding)); lineUpdate.attr("x2", -innerTickSize).attr("y2", 0); textUpdate.attr("x", -(Math.max(innerTickSize, 0) + tickPadding)).attr("y", 0); text.attr("dy", ".32em").style("text-anchor", "end"); pathUpdate.attr("d", "M" + -outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + -outerTickSize); break; } case "right": { tickTransform = d3_svg_axisY; lineEnter.attr("x2", innerTickSize); textEnter.attr("x", Math.max(innerTickSize, 0) + tickPadding); lineUpdate.attr("x2", innerTickSize).attr("y2", 0); textUpdate.attr("x", Math.max(innerTickSize, 0) + tickPadding).attr("y", 0); text.attr("dy", ".32em").style("text-anchor", "start"); pathUpdate.attr("d", "M" + outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + outerTickSize); break; } } if (scale1.rangeBand) { var x = scale1, dx = x.rangeBand() / 2; scale0 = scale1 = function(d) { return x(d) + dx; }; } else if (scale0.rangeBand) { scale0 = scale1; } else { tickExit.call(tickTransform, scale1); } tickEnter.call(tickTransform, scale0); tickUpdate.call(tickTransform, scale1); }); } axis.scale = function(x) { if (!arguments.length) return scale; scale = x; return axis; }; axis.orient = function(x) { if (!arguments.length) return orient; orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient; return axis; }; axis.ticks = function() { if (!arguments.length) return tickArguments_; tickArguments_ = arguments; return axis; }; axis.tickValues = function(x) { if (!arguments.length) return tickValues; tickValues = x; return axis; }; axis.tickFormat = function(x) { if (!arguments.length) return tickFormat_; tickFormat_ = x; return axis; }; axis.tickSize = function(x) { var n = arguments.length; if (!n) return innerTickSize; innerTickSize = +x; outerTickSize = +arguments[n - 1]; return axis; }; axis.innerTickSize = function(x) { if (!arguments.length) return innerTickSize; innerTickSize = +x; return axis; }; axis.outerTickSize = function(x) { if (!arguments.length) return outerTickSize; outerTickSize = +x; return axis; }; axis.tickPadding = function(x) { if (!arguments.length) return tickPadding; tickPadding = +x; return axis; }; axis.tickSubdivide = function() { return arguments.length && axis; }; return axis; }; var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = { top: 1, right: 1, bottom: 1, left: 1 }; function d3_svg_axisX(selection, x) { selection.attr("transform", function(d) { return "translate(" + x(d) + ",0)"; }); } function d3_svg_axisY(selection, y) { selection.attr("transform", function(d) { return "translate(0," + y(d) + ")"; }); } d3.svg.brush = function() { var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0]; function brush(g) { g.each(function() { var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart); var background = g.selectAll(".background").data([ 0 ]); background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"); g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move"); var resize = g.selectAll(".resize").data(resizes, d3_identity); resize.exit().remove(); resize.enter().append("g").attr("class", function(d) { return "resize " + d; }).style("cursor", function(d) { return d3_svg_brushCursor[d]; }).append("rect").attr("x", function(d) { return /[ew]$/.test(d) ? -3 : null; }).attr("y", function(d) { return /^[ns]/.test(d) ? -3 : null; }).attr("width", 6).attr("height", 6).style("visibility", "hidden"); resize.style("display", brush.empty() ? "none" : null); var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range; if (x) { range = d3_scaleRange(x); backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]); redrawX(gUpdate); } if (y) { range = d3_scaleRange(y); backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]); redrawY(gUpdate); } redraw(gUpdate); }); } brush.event = function(g) { g.each(function() { var event_ = event.of(this, arguments), extent1 = { x: xExtent, y: yExtent, i: xExtentDomain, j: yExtentDomain }, extent0 = this.__chart__ || extent1; this.__chart__ = extent1; if (d3_transitionInheritId) { d3.select(this).transition().each("start.brush", function() { xExtentDomain = extent0.i; yExtentDomain = extent0.j; xExtent = extent0.x; yExtent = extent0.y; event_({ type: "brushstart" }); }).tween("brush:brush", function() { var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y); xExtentDomain = yExtentDomain = null; return function(t) { xExtent = extent1.x = xi(t); yExtent = extent1.y = yi(t); event_({ type: "brush", mode: "resize" }); }; }).each("end.brush", function() { xExtentDomain = extent1.i; yExtentDomain = extent1.j; event_({ type: "brush", mode: "resize" }); event_({ type: "brushend" }); }); } else { event_({ type: "brushstart" }); event_({ type: "brush", mode: "resize" }); event_({ type: "brushend" }); } }); }; function redraw(g) { g.selectAll(".resize").attr("transform", function(d) { return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")"; }); } function redrawX(g) { g.select(".extent").attr("x", xExtent[0]); g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]); } function redrawY(g) { g.select(".extent").attr("y", yExtent[0]); g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]); } function brushstart() { var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset; var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup); if (d3.event.changedTouches) { w.on("touchmove.brush", brushmove).on("touchend.brush", brushend); } else { w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend); } g.interrupt().selectAll("*").interrupt(); if (dragging) { origin[0] = xExtent[0] - origin[0]; origin[1] = yExtent[0] - origin[1]; } else if (resizing) { var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing); offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ]; origin[0] = xExtent[ex]; origin[1] = yExtent[ey]; } else if (d3.event.altKey) center = origin.slice(); g.style("pointer-events", "none").selectAll(".resize").style("display", null); d3.select("body").style("cursor", eventTarget.style("cursor")); event_({ type: "brushstart" }); brushmove(); function keydown() { if (d3.event.keyCode == 32) { if (!dragging) { center = null; origin[0] -= xExtent[1]; origin[1] -= yExtent[1]; dragging = 2; } d3_eventPreventDefault(); } } function keyup() { if (d3.event.keyCode == 32 && dragging == 2) { origin[0] += xExtent[1]; origin[1] += yExtent[1]; dragging = 0; d3_eventPreventDefault(); } } function brushmove() { var point = d3.mouse(target), moved = false; if (offset) { point[0] += offset[0]; point[1] += offset[1]; } if (!dragging) { if (d3.event.altKey) { if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ]; origin[0] = xExtent[+(point[0] < center[0])]; origin[1] = yExtent[+(point[1] < center[1])]; } else center = null; } if (resizingX && move1(point, x, 0)) { redrawX(g); moved = true; } if (resizingY && move1(point, y, 1)) { redrawY(g); moved = true; } if (moved) { redraw(g); event_({ type: "brush", mode: dragging ? "move" : "resize" }); } } function move1(point, scale, i) { var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max; if (dragging) { r0 -= position; r1 -= size + position; } min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i]; if (dragging) { max = (min += position) + size; } else { if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min)); if (position < min) { max = min; min = position; } else { max = position; } } if (extent[0] != min || extent[1] != max) { if (i) yExtentDomain = null; else xExtentDomain = null; extent[0] = min; extent[1] = max; return true; } } function brushend() { brushmove(); g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null); d3.select("body").style("cursor", null); w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null); dragRestore(); event_({ type: "brushend" }); } } brush.x = function(z) { if (!arguments.length) return x; x = z; resizes = d3_svg_brushResizes[!x << 1 | !y]; return brush; }; brush.y = function(z) { if (!arguments.length) return y; y = z; resizes = d3_svg_brushResizes[!x << 1 | !y]; return brush; }; brush.clamp = function(z) { if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null; if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z; return brush; }; brush.extent = function(z) { var x0, x1, y0, y1, t; if (!arguments.length) { if (x) { if (xExtentDomain) { x0 = xExtentDomain[0], x1 = xExtentDomain[1]; } else { x0 = xExtent[0], x1 = xExtent[1]; if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1); if (x1 < x0) t = x0, x0 = x1, x1 = t; } } if (y) { if (yExtentDomain) { y0 = yExtentDomain[0], y1 = yExtentDomain[1]; } else { y0 = yExtent[0], y1 = yExtent[1]; if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1); if (y1 < y0) t = y0, y0 = y1, y1 = t; } } return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ]; } if (x) { x0 = z[0], x1 = z[1]; if (y) x0 = x0[0], x1 = x1[0]; xExtentDomain = [ x0, x1 ]; if (x.invert) x0 = x(x0), x1 = x(x1); if (x1 < x0) t = x0, x0 = x1, x1 = t; if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ]; } if (y) { y0 = z[0], y1 = z[1]; if (x) y0 = y0[1], y1 = y1[1]; yExtentDomain = [ y0, y1 ]; if (y.invert) y0 = y(y0), y1 = y(y1); if (y1 < y0) t = y0, y0 = y1, y1 = t; if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ]; } return brush; }; brush.clear = function() { if (!brush.empty()) { xExtent = [ 0, 0 ], yExtent = [ 0, 0 ]; xExtentDomain = yExtentDomain = null; } return brush; }; brush.empty = function() { return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1]; }; return d3.rebind(brush, event, "on"); }; var d3_svg_brushCursor = { n: "ns-resize", e: "ew-resize", s: "ns-resize", w: "ew-resize", nw: "nwse-resize", ne: "nesw-resize", se: "nwse-resize", sw: "nesw-resize" }; var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ]; var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat; var d3_time_formatUtc = d3_time_format.utc; var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ"); d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso; function d3_time_formatIsoNative(date) { return date.toISOString(); } d3_time_formatIsoNative.parse = function(string) { var date = new Date(string); return isNaN(date) ? null : date; }; d3_time_formatIsoNative.toString = d3_time_formatIso.toString; d3_time.second = d3_time_interval(function(date) { return new d3_date(Math.floor(date / 1e3) * 1e3); }, function(date, offset) { date.setTime(date.getTime() + Math.floor(offset) * 1e3); }, function(date) { return date.getSeconds(); }); d3_time.seconds = d3_time.second.range; d3_time.seconds.utc = d3_time.second.utc.range; d3_time.minute = d3_time_interval(function(date) { return new d3_date(Math.floor(date / 6e4) * 6e4); }, function(date, offset) { date.setTime(date.getTime() + Math.floor(offset) * 6e4); }, function(date) { return date.getMinutes(); }); d3_time.minutes = d3_time.minute.range; d3_time.minutes.utc = d3_time.minute.utc.range; d3_time.hour = d3_time_interval(function(date) { var timezone = date.getTimezoneOffset() / 60; return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5); }, function(date, offset) { date.setTime(date.getTime() + Math.floor(offset) * 36e5); }, function(date) { return date.getHours(); }); d3_time.hours = d3_time.hour.range; d3_time.hours.utc = d3_time.hour.utc.range; d3_time.month = d3_time_interval(function(date) { date = d3_time.day(date); date.setDate(1); return date; }, function(date, offset) { date.setMonth(date.getMonth() + offset); }, function(date) { return date.getMonth(); }); d3_time.months = d3_time.month.range; d3_time.months.utc = d3_time.month.utc.range; function d3_time_scale(linear, methods, format) { function scale(x) { return linear(x); } scale.invert = function(x) { return d3_time_scaleDate(linear.invert(x)); }; scale.domain = function(x) { if (!arguments.length) return linear.domain().map(d3_time_scaleDate); linear.domain(x); return scale; }; function tickMethod(extent, count) { var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target); return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) { return d / 31536e6; }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i]; } scale.nice = function(interval, skip) { var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval); if (method) interval = method[0], skip = method[1]; function skipped(date) { return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length; } return scale.domain(d3_scale_nice(domain, skip > 1 ? { floor: function(date) { while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1); return date; }, ceil: function(date) { while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1); return date; } } : interval)); }; scale.ticks = function(interval, skip) { var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ { range: interval }, skip ]; if (method) interval = method[0], skip = method[1]; return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip); }; scale.tickFormat = function() { return format; }; scale.copy = function() { return d3_time_scale(linear.copy(), methods, format); }; return d3_scale_linearRebind(scale, linear); } function d3_time_scaleDate(t) { return new Date(t); } var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ]; var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ]; var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) { return d.getMilliseconds(); } ], [ ":%S", function(d) { return d.getSeconds(); } ], [ "%I:%M", function(d) { return d.getMinutes(); } ], [ "%I %p", function(d) { return d.getHours(); } ], [ "%a %d", function(d) { return d.getDay() && d.getDate() != 1; } ], [ "%b %d", function(d) { return d.getDate() != 1; } ], [ "%B", function(d) { return d.getMonth(); } ], [ "%Y", d3_true ] ]); var d3_time_scaleMilliseconds = { range: function(start, stop, step) { return d3.range(+start, +stop, step).map(d3_time_scaleDate); }, floor: d3_identity, ceil: d3_identity }; d3_time_scaleLocalMethods.year = d3_time.year; d3_time.scale = function() { return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat); }; var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) { return [ m[0].utc, m[1] ]; }); var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) { return d.getUTCMilliseconds(); } ], [ ":%S", function(d) { return d.getUTCSeconds(); } ], [ "%I:%M", function(d) { return d.getUTCMinutes(); } ], [ "%I %p", function(d) { return d.getUTCHours(); } ], [ "%a %d", function(d) { return d.getUTCDay() && d.getUTCDate() != 1; } ], [ "%b %d", function(d) { return d.getUTCDate() != 1; } ], [ "%B", function(d) { return d.getUTCMonth(); } ], [ "%Y", d3_true ] ]); d3_time_scaleUtcMethods.year = d3_time.year.utc; d3_time.scale.utc = function() { return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat); }; d3.text = d3_xhrType(function(request) { return request.responseText; }); d3.json = function(url, callback) { return d3_xhr(url, "application/json", d3_json, callback); }; function d3_json(request) { return JSON.parse(request.responseText); } d3.html = function(url, callback) { return d3_xhr(url, "text/html", d3_html, callback); }; function d3_html(request) { var range = d3_document.createRange(); range.selectNode(d3_document.body); return range.createContextualFragment(request.responseText); } d3.xml = d3_xhrType(function(request) { return request.responseXML; }); if (typeof define === "function" && define.amd) { define(d3); } else if (typeof module === "object" && module.exports) { module.exports = d3; } else { this.d3 = d3; } }();
binki/cdnjs
ajax/libs/d3/3.4.3/d3.js
JavaScript
mit
326,255
'use strict'; /* Initial code from https://github.com/gulpjs/gulp-util/blob/v3.0.6/lib/log.js */ var chalk = require('chalk'); var timestamp = require('time-stamp'); function getTimestamp(){ return '['+chalk.grey(timestamp('HH:mm:ss'))+']'; } function log(){ var time = getTimestamp(); process.stdout.write(time + ' '); console.log.apply(console, arguments); return this; } function info(){ var time = getTimestamp(); process.stdout.write(time + ' '); console.info.apply(console, arguments); return this; } function dir(){ var time = getTimestamp(); process.stdout.write(time + ' '); console.dir.apply(console, arguments); return this; } function warn(){ var time = getTimestamp(); process.stderr.write(time + ' '); console.warn.apply(console, arguments); return this; } function error(){ var time = getTimestamp(); process.stderr.write(time + ' '); console.error.apply(console, arguments); return this; } module.exports = log; module.exports.info = info; module.exports.dir = dir; module.exports.warn = warn; module.exports.error = error;
gyyu/cmu-debate
node_modules/fancy-log/index.js
JavaScript
mit
1,092
/** * @license * Lo-Dash 1.1.0 (Custom Build) lodash.com/license * Build: `lodash -o ./dist/lodash.compat.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ ;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!fe(n)&&Vt.call(n,"__wrapped__")?n:new K(n)}function q(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=qt(n[e]);(Vt.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=qt(e);return Vt.call(a,r)&&-1<yt(a[r],e)}return-1<yt(n,e,t)}}function B(n){return n.charCodeAt(0)}function F(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1 }return e<r?-1:1}function R(n,t,e,r){function u(){var r=arguments,c=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=V(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(M.prototype=n.prototype,c=new M,M.prototype=null,r=n.apply(c,r),Z(r)?r:c):n.apply(c,r)}var a=Y(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Bt;t=n}return u}function T(){for(var n,t={g:_,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!le},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=At,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ie.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ie.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ie.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ie.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ie.enumPrototypes&&(r+="}"),r+="}"; else if(r+="for(i in m){",(ie.enumPrototypes||t.i)&&(r+="if(",ie.enumPrototypes&&(r+="!(v&&i=='prototype')"),ie.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ie.enumPrototypes||t.i)&&(r+="}"),r+="}",ie.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ie.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Vt,H,fe,tt,le,a,P) }function D(n){return"\\"+N[n]}function z(n){return se[n]}function L(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function K(n){this.__wrapped__=n}function M(){}function U(n){var t=!1;if(!n||Qt.call(n)!=E||!ie.argsClass&&H(n))return t;var e=n.constructor;return(Y(e)?e instanceof e:ie.nodeClass||!L(n))?ie.ownLast?(ye(n,function(n,e,r){return t=Vt.call(r,e),!1}),!0===t):(ye(n,function(n,e){t=e}),!1===t||Vt.call(n,t)):t}function V(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0); var r=-1;e=e-t||0;for(var u=Ot(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function G(n){return ve[n]}function H(n){return Qt.call(n)==C}function J(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=Z(f)){var c=Qt.call(f);if(!I[c]||!ie.nodeClass&&L(f))return f;var l=fe(f)}if(!u||!t)return u?l?V(f):ge({},f):f;switch(u=oe[c],c){case j:case k:return new u(+f);case O:case A:return new u(f); case S:return u(f.source,v.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(Vt.call(n,"index")&&(f.index=n.index),Vt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?ft:me)(n,function(n,u){f[u]=J(n,t,r,e,o,i)}),f}function Q(n){var t=[];return ye(n,function(n,e){Y(n)&&t.push(e)}),t.sort()}function W(n){for(var t=-1,e=le(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function X(n,t,e,r,u,o){var f=e===i;if(e&&!f){e=typeof r=="undefined"?e:a.createCallback(e,r,2); var c=e(n,t);if(typeof c!="undefined")return!!c}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Qt.call(n),l=Qt.call(t),p==C&&(p=E),l==C&&(l=E),p!=l)return!1;switch(p){case j:case k:return+n==+t;case O:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case S:case A:return n==qt(t)}if(l=p==w,!l){if(Vt.call(n,"__wrapped__")||Vt.call(t,"__wrapped__"))return X(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o); if(p!=E||!ie.nodeClass&&(L(n)||L(t)))return!1;var p=!ie.argsObject&&H(n)?Nt:n.constructor,s=!ie.argsObject&&H(t)?Nt:t.constructor;if(p!=s&&(!Y(p)||!(p instanceof p&&Y(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,c=!0;if(u.push(n),o.push(t),l){if(p=n.length,v=t.length,c=v==n.length,!c&&!f)return c;for(;v--;)if(l=p,s=t[v],f)for(;l--&&!(c=X(n[l],s,e,r,u,o)););else if(!(c=X(n[v],s,e,r,u,o)))break;return c}return ye(t,function(t,a,i){return Vt.call(i,a)?(v++,c=Vt.call(n,a)&&X(n[a],t,e,r,u,o)):void 0 }),c&&!f&&ye(n,function(n,t,e){return Vt.call(e,t)?c=-1<--v:void 0}),c}function Y(n){return typeof n=="function"}function Z(n){return n?P[typeof n]:!1}function nt(n){return typeof n=="number"||Qt.call(n)==O}function tt(n){return typeof n=="string"||Qt.call(n)==A}function et(n,t,e){var r=arguments,u=0,o=2;if(!Z(n))return n;if(e===i)var f=r[3],c=r[4],l=r[5];else c=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]); for(;++u<o;)(fe(r[u])?ft:me)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=fe(t))||de(t))){for(a=c.length;a--;)if(r=c[a]==t){o=l[a];break}r||(o=u?fe(o)?o:[]:de(o)?o:{},f&&(a=f(o,t),typeof a!="undefined"&&(o=a)),c.push(t),l.push(o),f||(o=et(o,t,i,f,c,l)))}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function rt(n){for(var t=-1,e=le(n),r=e.length,u=Ot(r);++t<r;)u[t]=n[e[t]];return u}function ut(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?te(0,u+e):e)||0,typeof u=="number"?a=-1<(tt(n)?n.indexOf(t,e):yt(n,t,e)):pe(n,function(n){return++r<e?void 0:!(a=n===t) }),a}function at(n,t,e){var r=!0;if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else pe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function ot(n,t,e){var r=[];if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else pe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function it(n,t,e){if(t=a.createCallback(t,e),!fe(n)){var r;return pe(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e]; if(t(o,e,n))return o}}function ft(n,t,e){if(t&&typeof e=="undefined"&&fe(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else pe(n,t,e);return n}function ct(n,t,e){var r=-1,u=n?n.length:0,o=Ot(typeof u=="number"?u:0);if(t=a.createCallback(t,e),fe(n))for(;++r<u;)o[r]=t(n[r],r,n);else pe(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function lt(n,t,e){var r=-1/0,u=r;if(!t&&fe(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&tt(n)?B:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n) });return u}function pt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),fe(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else pe(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function st(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=le(n),o=f.length;else ie.unindexedChars&&tt(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),ft(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function vt(n,t,e){var r; if(t=a.createCallback(t,e),fe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else pe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function gt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return V(n,0,ee(te(0,r),u))}}function ht(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),fe(r)?Gt.apply(i,t?r:ht(r)):i.push(r); return i}function yt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?te(0,u+e):e||0)-1;else if(e)return r=dt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function mt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:te(0,t);return V(n,r)}function dt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):jt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],f=i; typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(null!=e&&(f=[],e=a.createCallback(e,r));++u<o;){r=n[u];var p=e?e(r,u,n):r;if(c)var s=qt(p),s=Vt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>yt(f,p))&&((e||c)&&f.push(p),i.push(r))}return i}function _t(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function Ct(n,t){return ie.fastBind||Wt&&2<arguments.length?Wt.call.apply(Wt,arguments):R(n,t,V(arguments,2))}function wt(n){var t=V(arguments,1); return Jt(function(){n.apply(e,t)},1)}function jt(n){return n}function kt(n){ft(Q(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Gt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new K(t)}})}function xt(){return this.__wrapped__}r=r?$.defaults(n.Object(),r,$.pick(n,b)):n;var Ot=r.Array,Et=r.Boolean,St=r.Date,At=r.Function,It=r.Math,Pt=r.Number,Nt=r.Object,$t=r.RegExp,qt=r.String,Bt=r.TypeError,Ft=Ot(),Rt=Nt(),Tt=r._,Dt=$t("^"+qt(Rt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),zt=It.ceil,Lt=r.clearTimeout,Kt=Ft.concat,Mt=It.floor,Ut=Dt.test(Ut=Nt.getPrototypeOf)&&Ut,Vt=Rt.hasOwnProperty,Gt=Ft.push,Ht=r.setImmediate,Jt=r.setTimeout,Qt=Rt.toString,Wt=Dt.test(Wt=V.bind)&&Wt,Xt=Dt.test(Xt=Ot.isArray)&&Xt,Yt=r.isFinite,Zt=r.isNaN,ne=Dt.test(ne=Nt.keys)&&ne,te=It.max,ee=It.min,re=r.parseInt,ue=It.random,It=Dt.test(r.attachEvent),ae=Wt&&!/\n|true/.test(Wt+It),oe={}; oe[w]=Ot,oe[j]=Et,oe[k]=St,oe[E]=Nt,oe[O]=Pt,oe[S]=$t,oe[A]=qt;var ie=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ie.argsObject=arguments.constructor==Nt,ie.argsClass=H(arguments),ie.enumPrototypes=n.propertyIsEnumerable("prototype"),ie.fastBind=Wt&&!ae,ie.ownLast="x"!=e[0],ie.nonEnumArgs=0!=r,ie.nonEnumShadows=!/valueOf/.test(e),ie.spliceObjects=(Ft.splice.call(t,0,1),!t[0]),ie.unindexedChars="xx"!="x"[0]+Nt("x")[0]; try{ie.nodeClass=!(Qt.call(document)==E&&!({toString:0}+""))}catch(u){ie.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}},Et={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},Pt={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},It={h:"if(!r[typeof m])return u;"+Pt.h,b:!1},K.prototype=a.prototype,ie.argsClass||(H=function(n){return n?Vt.call(n,"callee"):!1 });var fe=Xt||function(n){return ie.argsObject&&n instanceof Ot||Qt.call(n)==w},ce=T({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),le=ne?function(n){return Z(n)?ie.enumPrototypes&&typeof n=="function"||ie.nonEnumArgs&&n.length&&H(n)?ce(n):ne(n):[]}:ce,pe=T(Pt),se={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ve=W(se),ge=T(Et,{h:Et.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),he=T(Et),ye=T(Pt,It,{i:!1}),me=T(Pt,It); Y(/x/)&&(Y=function(n){return n instanceof At||Qt.call(n)==x});var de=Ut?function(n){if(!n||Qt.call(n)!=E||!ie.argsClass&&H(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Ut(t))&&Ut(e);return e?n==e||Ut(n)==e:U(n)}:U;return ae&&u&&typeof Ht=="function"&&(wt=Ct(Ht,r)),Ht=8==re("08")?re:function(n,t){return re(tt(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=ge,a.at=function(n){var t=-1,e=Kt.apply(Ft,V(arguments,1)),r=e.length,u=Ot(r); for(ie.unindexedChars&&tt(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=Ct,a.bindAll=function(n){for(var t=Kt.apply(Ft,arguments),e=1<t.length?0:(t=Q(n),-1),r=t.length;++e<r;){var u=t[e];n[u]=Ct(n[u],n)}return n},a.bindKey=function(n,t){return R(n,t,V(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0] }},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),ft(n,function(n,e,u){e=qt(t(n,e,u)),Vt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return jt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=le(n);return function(t){for(var e=u.length,r=!1;e--&&(r=X(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a) }:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=e&&!i;return u=arguments,o=this,Lt(i),i=Jt(r,t),f&&(a=n.apply(o,u)),a}},a.defaults=he,a.defer=wt,a.delay=function(n,t){var r=V(arguments,2);return Jt(function(){n.apply(e,r)},t)},a.difference=function(n){for(var t=-1,e=n?n.length:0,r=Kt.apply(Ft,arguments),r=q(r,e,100),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.filter=ot,a.flatten=ht,a.forEach=ft,a.forIn=ye,a.forOwn=me,a.functions=Q,a.groupBy=function(n,t,e){var r={}; return t=a.createCallback(t,e),ft(n,function(n,e,u){e=qt(t(n,e,u)),(Vt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return V(n,0,ee(te(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=100<=a,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=qt(c),l=Vt.call(r[0],l)?!(f=r[0][l]):f=r[0][l]=[]; if(l||0>yt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=q(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=W,a.invoke=function(n,t){var e=V(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Ot(typeof a=="number"?a:0);return ft(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=le,a.map=ct,a.max=lt,a.memoize=function(n,t){var e={};return function(){var r=qt(t?t.apply(this,arguments):arguments[0]);return Vt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=et,a.min=function(n,t,e){var r=1/0,u=r; if(!t&&fe(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&tt(n)?B:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Kt.apply(Ft,arguments);return ye(n,function(n,e,a){(r?!t(n,e,a):0>yt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=le(n),r=e.length,u=Ot(r);++t<r;){var a=e[t]; u[t]=[a,n[a]]}return u},a.partial=function(n){return R(n,V(arguments,1))},a.partialRight=function(n){return R(n,V(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=0,o=Kt.apply(Ft,arguments),i=Z(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),ye(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=ct,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=te(0,zt((t-n)/e));for(var u=Ot(t);++r<t;)u[r]=n,n+=e; return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),ot(n,function(n,e,r){return!t(n,e,r)})},a.rest=mt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=Ot(typeof e=="number"?e:0);return ft(n,function(n){var e=Mt(ue()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Ot(typeof u=="number"?u:0);for(t=a.createCallback(t,e),ft(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(F);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t){function e(){i=new St,o=null,u=n.apply(a,r) }var r,u,a,o,i=0;return function(){var f=new St,c=t-(f-i);return r=arguments,a=this,0<c?o||(o=Jt(e,c)):(Lt(o),o=null,i=f,u=n.apply(a,r)),u}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Ot(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ie.unindexedChars&&tt(n)?n.split(""):V(n):rt(n)},a.union=function(){return bt(Kt.apply(Ft,arguments))},a.uniq=bt,a.values=rt,a.where=ot,a.without=function(n){for(var t=-1,e=n?n.length:0,r=q(arguments,1,30),u=[];++t<e;){var a=n[t]; r(a)||u.push(a)}return u},a.wrap=function(n,t){return function(){var e=[n];return Gt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?lt(ct(arguments,"length")):0,r=Ot(e);++t<e;)r[t]=ct(arguments,t);return r},a.zipObject=_t,a.collect=ct,a.drop=mt,a.each=ft,a.extend=ge,a.methods=Q,a.object=_t,a.select=ot,a.tail=mt,a.unique=bt,kt(a),a.clone=J,a.cloneDeep=function(n,t,e){return J(n,!0,t,e)},a.contains=ut,a.escape=function(n){return null==n?"":qt(n).replace(m,z)},a.every=at,a.find=it,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0; for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),me(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Vt.call(n,t):!1},a.identity=jt,a.indexOf=yt,a.isArguments=H,a.isArray=fe,a.isBoolean=function(n){return!0===n||!1===n||Qt.call(n)==j},a.isDate=function(n){return n instanceof St||Qt.call(n)==k},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t; var e=Qt.call(n),r=n.length;return e==w||e==A||(ie.argsClass?e==C:H(n))||e==E&&typeof r=="number"&&Y(n.splice)?!r:(me(n,function(){return t=!1}),t)},a.isEqual=X,a.isFinite=function(n){return Yt(n)&&!Zt(parseFloat(n))},a.isFunction=Y,a.isNaN=function(n){return nt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=nt,a.isObject=Z,a.isPlainObject=de,a.isRegExp=function(n){return n instanceof $t||Qt.call(n)==S},a.isString=tt,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0; for(typeof e=="number"&&(r=(0>e?te(0,r+e):ee(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=kt,a.noConflict=function(){return r._=Tt,this},a.parseInt=Ht,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Mt(ue()*((+t||0)-n+1))},a.reduce=pt,a.reduceRight=st,a.result=function(n,t){var r=n?n[t]:e;return Y(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:le(n).length},a.some=vt,a.sortedIndex=dt,a.template=function(n,t,r){var u=a.templateSettings; n||(n=""),r=he({},r,u);var o,i=he({},r.imports,u.imports),u=le(i),i=rt(i),p=0,v=r.interpolate||y,h="__p+='",v=$t((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(d,D),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}"; try{var m=At(u,"return "+h).apply(e,i)}catch(b){throw b.source=h,b}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":qt(n).replace(p,G)},a.uniqueId=function(n){var t=++o;return qt(null==n?"":n)+t},a.all=at,a.any=vt,a.detect=it,a.foldl=pt,a.foldr=st,a.include=ut,a.inject=pt,me(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Gt.apply(t,arguments),n.apply(a,t)})}),a.first=gt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u; for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return V(n,te(0,u-r))}},a.take=gt,a.head=gt,me(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new K(r)})}),a.VERSION="1.1.0",a.prototype.toString=function(){return qt(this.__wrapped__)},a.prototype.value=xt,a.prototype.valueOf=xt,pe(["join","pop","shift"],function(n){var t=Ft[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) }}),pe(["push","reverse","sort","unshift"],function(n){var t=Ft[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),pe(["concat","slice","splice"],function(n){var t=Ft[n];a.prototype[n]=function(){return new K(t.apply(this.__wrapped__,arguments))}}),ie.spliceObjects||pe(["pop","shift","splice"],function(n){var t=Ft[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new K(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global; a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,d=/['\n\r\t\u2028\u2029\\]/g,b="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),C="[object Arguments]",w="[object Array]",j="[object Boolean]",k="[object Date]",x="[object Function]",O="[object Number]",E="[object Object]",S="[object RegExp]",A="[object String]",I={}; I[x]=!1,I[C]=I[w]=I[j]=I[k]=I[O]=I[E]=I[S]=I[A]=!0;var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},N={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=$,define(function(){return $})):r&&!r.nodeType?u?(u.exports=$)._=$:r._=$:n._=$})(this);
AlexisArce/cdnjs
ajax/libs/lodash.js/1.1.0/lodash.compat.min.js
JavaScript
mit
22,809
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>iframe</title> <style> html,body{ margin: 0; height: 100%; font: 13px/1.555 "Trebuchet MS", sans-serif; } a{ color: #888; font-weight: bold; text-decoration: none; border-bottom: 1px solid #888; } .main-box { color:#252525; padding: 3px 5px; text-align: justify; } .main-box p{margin: 0 0 14px;} .main-box .cerr{ color: #f00000; border-bottom-color: #f00000; } </style> </head> <body> <div id="content" class="main-box"></div> <iframe src="" frameborder="0" id="spelltext" name="spelltext" style="display:none; width: 100%" ></iframe> <iframe src="" frameborder="0" id="loadsuggestfirst" name="loadsuggestfirst" style="display:none; width: 100%" ></iframe> <iframe src="" frameborder="0" id="loadspellsuggestall" name="loadspellsuggestall" style="display:none; width: 100%" ></iframe> <iframe src="" frameborder="0" id="loadOptionsForm" name="loadOptionsForm" style="display:none; width: 100%" ></iframe> <script> (function(window) { // Constructor Manager PostMessage var ManagerPostMessage = function() { var _init = function(handler) { if (document.addEventListener) { window.addEventListener('message', handler, false); } else { window.attachEvent("onmessage", handler); }; }; var _sendCmd = function(o) { var str, type = Object.prototype.toString, fn = o.fn || null, id = o.id || '', target = o.target || window, message = o.message || { 'id': id }; if (type.call(o.message) == "[object Object]") { (o.message['id']) ? o.message['id'] : o.message['id'] = id; message = o.message; }; str = JSON.stringify(message, fn); target.postMessage(str, '*'); }; return { init: _init, send: _sendCmd }; }; var manageMessageTmp = new ManagerPostMessage; var appString = (function(){ var spell = parent.CKEDITOR.config.wsc.DefaultParams.scriptPath; var serverUrl = parent.CKEDITOR.config.wsc.DefaultParams.serviceHost; return serverUrl + spell; })(); function loadScript(src, callback) { var scriptTag = document.createElement("script"); scriptTag.type = "text/javascript"; callback ? callback : callback = function() {}; if(scriptTag.readyState) { //IE scriptTag.onreadystatechange = function() { if (scriptTag.readyState == "loaded" || scriptTag.readyState == "complete") { scriptTag.onreadystatechange = null; setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1) callback(); } }; }else{ //Others scriptTag.onload = function() { setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1); callback(); }; }; scriptTag.src = src; document.getElementsByTagName("head")[0].appendChild(scriptTag); }; window.onload = function(){ loadScript(appString, function(){ manageMessageTmp.send({ 'id': 'iframeOnload', 'target': window.parent }); }); } })(this); </script> </body> </html>
bergie/cdnjs
ajax/libs/ckeditor/4.3.2/plugins/wsc/dialogs/tmp.html
HTML
mit
3,499
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/yql/yql.js']) { __coverage__['build/yql/yql.js'] = {"path":"build/yql/yql.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":34}}},"2":{"name":"(anonymous_2)","line":16,"loc":{"start":{"line":16,"column":17},"end":{"line":16,"column":56}}},"3":{"name":"(anonymous_3)","line":84,"loc":{"start":{"line":84,"column":15},"end":{"line":84,"column":27}}},"4":{"name":"(anonymous_4)","line":93,"loc":{"start":{"line":93,"column":10},"end":{"line":93,"column":22}}},"5":{"name":"(anonymous_5)","line":96,"loc":{"start":{"line":96,"column":36},"end":{"line":96,"column":52}}},"6":{"name":"(anonymous_6)","line":121,"loc":{"start":{"line":121,"column":11},"end":{"line":121,"column":22}}},"7":{"name":"(anonymous_7)","line":162,"loc":{"start":{"line":162,"column":8},"end":{"line":162,"column":47}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":167,"column":39}},"2":{"start":{"line":16,"column":0},"end":{"line":46,"column":2}},"3":{"start":{"line":18,"column":4},"end":{"line":20,"column":5}},"4":{"start":{"line":19,"column":8},"end":{"line":19,"column":20}},"5":{"start":{"line":21,"column":4},"end":{"line":21,"column":19}},"6":{"start":{"line":23,"column":4},"end":{"line":25,"column":5}},"7":{"start":{"line":24,"column":8},"end":{"line":24,"column":44}},"8":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"9":{"start":{"line":27,"column":8},"end":{"line":27,"column":38}},"10":{"start":{"line":30,"column":4},"end":{"line":30,"column":25}},"11":{"start":{"line":32,"column":4},"end":{"line":35,"column":5}},"12":{"start":{"line":33,"column":8},"end":{"line":33,"column":37}},"13":{"start":{"line":34,"column":8},"end":{"line":34,"column":28}},"14":{"start":{"line":37,"column":4},"end":{"line":40,"column":5}},"15":{"start":{"line":38,"column":8},"end":{"line":38,"column":39}},"16":{"start":{"line":39,"column":8},"end":{"line":39,"column":30}},"17":{"start":{"line":42,"column":4},"end":{"line":42,"column":26}},"18":{"start":{"line":43,"column":4},"end":{"line":43,"column":22}},"19":{"start":{"line":44,"column":4},"end":{"line":44,"column":30}},"20":{"start":{"line":48,"column":0},"end":{"line":124,"column":2}},"21":{"start":{"line":85,"column":8},"end":{"line":85,"column":55}},"22":{"start":{"line":94,"column":8},"end":{"line":94,"column":105}},"23":{"start":{"line":96,"column":8},"end":{"line":98,"column":11}},"24":{"start":{"line":97,"column":12},"end":{"line":97,"column":53}},"25":{"start":{"line":100,"column":8},"end":{"line":100,"column":26}},"26":{"start":{"line":102,"column":8},"end":{"line":102,"column":96}},"27":{"start":{"line":104,"column":8},"end":{"line":104,"column":104}},"28":{"start":{"line":106,"column":8},"end":{"line":106,"column":26}},"29":{"start":{"line":107,"column":8},"end":{"line":107,"column":38}},"30":{"start":{"line":109,"column":8},"end":{"line":109,"column":52}},"31":{"start":{"line":111,"column":8},"end":{"line":111,"column":27}},"32":{"start":{"line":112,"column":8},"end":{"line":112,"column":20}},"33":{"start":{"line":131,"column":0},"end":{"line":131,"column":27}},"34":{"start":{"line":137,"column":0},"end":{"line":137,"column":26}},"35":{"start":{"line":143,"column":0},"end":{"line":143,"column":67}},"36":{"start":{"line":149,"column":0},"end":{"line":149,"column":60}},"37":{"start":{"line":151,"column":0},"end":{"line":151,"column":26}},"38":{"start":{"line":162,"column":0},"end":{"line":164,"column":2}},"39":{"start":{"line":163,"column":4},"end":{"line":163,"column":64}}},"branchMap":{"1":{"line":18,"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":18,"column":4}},{"start":{"line":18,"column":4},"end":{"line":18,"column":4}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":4},"end":{"line":23,"column":4}},{"start":{"line":23,"column":4},"end":{"line":23,"column":4}}]},"3":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"4":{"line":32,"type":"if","locations":[{"start":{"line":32,"column":4},"end":{"line":32,"column":4}},{"start":{"line":32,"column":4},"end":{"line":32,"column":4}}]},"5":{"line":32,"type":"binary-expr","locations":[{"start":{"line":32,"column":8},"end":{"line":32,"column":12}},{"start":{"line":32,"column":16},"end":{"line":32,"column":28}}]},"6":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":37,"column":4}},{"start":{"line":37,"column":4},"end":{"line":37,"column":4}}]},"7":{"line":37,"type":"binary-expr","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":14}},{"start":{"line":37,"column":18},"end":{"line":37,"column":32}}]},"8":{"line":94,"type":"cond-expr","locations":[{"start":{"line":94,"column":63},"end":{"line":94,"column":79}},{"start":{"line":94,"column":82},"end":{"line":94,"column":100}}]},"9":{"line":94,"type":"binary-expr","locations":[{"start":{"line":94,"column":29},"end":{"line":94,"column":39}},{"start":{"line":94,"column":43},"end":{"line":94,"column":59}}]},"10":{"line":102,"type":"cond-expr","locations":[{"start":{"line":102,"column":50},"end":{"line":102,"column":65}},{"start":{"line":102,"column":68},"end":{"line":102,"column":89}}]},"11":{"line":102,"type":"binary-expr","locations":[{"start":{"line":102,"column":17},"end":{"line":102,"column":27}},{"start":{"line":102,"column":31},"end":{"line":102,"column":46}}]},"12":{"line":104,"type":"cond-expr","locations":[{"start":{"line":104,"column":51},"end":{"line":104,"column":65}},{"start":{"line":104,"column":68},"end":{"line":104,"column":103}}]},"13":{"line":106,"type":"binary-expr","locations":[{"start":{"line":106,"column":15},"end":{"line":106,"column":19}},{"start":{"line":106,"column":23},"end":{"line":106,"column":25}}]}},"code":["(function () { YUI.add('yql', function (Y, NAME) {","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @module yql"," */","/**"," * Utility Class used under the hood by the YQL class"," * @class YQLRequest"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function/Object} callback The callback to execute after the query (Falls through to JSONP)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","var YQLRequest = function (sql, callback, params, opts) {",""," if (!params) {"," params = {};"," }"," params.q = sql;"," //Allow format override.. JSON-P-X"," if (!params.format) {"," params.format = Y.YQLRequest.FORMAT;"," }"," if (!params.env) {"," params.env = Y.YQLRequest.ENV;"," }",""," this._context = this;",""," if (opts && opts.context) {"," this._context = opts.context;"," delete opts.context;"," }",""," if (params && params.context) {"," this._context = params.context;"," delete params.context;"," }",""," this._params = params;"," this._opts = opts;"," this._callback = callback;","","};","","YQLRequest.prototype = {"," /**"," * @private"," * @property _jsonp"," * @description Reference to the JSONP instance used to make the queries"," */"," _jsonp: null,"," /**"," * @private"," * @property _opts"," * @description Holder for the opts argument"," */"," _opts: null,"," /**"," * @private"," * @property _callback"," * @description Holder for the callback argument"," */"," _callback: null,"," /**"," * @private"," * @property _params"," * @description Holder for the params argument"," */"," _params: null,"," /**"," * @private"," * @property _context"," * @description The context to execute the callback in"," */"," _context: null,"," /**"," * @private"," * @method _internal"," * @description Internal Callback Handler"," */"," _internal: function () {"," this._callback.apply(this._context, arguments);"," },"," /**"," * @method send"," * @description The method that executes the YQL Request."," * @chainable"," * @return {YQLRequest}"," */"," send: function () {"," var qs = [], url = ((this._opts && this._opts.proto) ? this._opts.proto : Y.YQLRequest.PROTO), o;",""," Y.Object.each(this._params, function (v, k) {"," qs.push(k + '=' + encodeURIComponent(v));"," });",""," qs = qs.join('&');",""," url += ((this._opts && this._opts.base) ? this._opts.base : Y.YQLRequest.BASE_URL) + qs;",""," o = (!Y.Lang.isFunction(this._callback)) ? this._callback : { on: { success: this._callback } };",""," o.on = o.on || {};"," this._callback = o.on.success;",""," o.on.success = Y.bind(this._internal, this);",""," this._send(url, o);"," return this;"," },"," /**"," * Private method to send the request, overwritten in plugins"," * @method _send"," * @private"," * @param {String} url The URL to request"," * @param {Object} o The config object"," */"," _send: function() {"," //Overwritten in plugins"," }","};","","/**","* @static","* @property FORMAT","* @description Default format to use: json","*/","YQLRequest.FORMAT = 'json';","/**","* @static","* @property PROTO","* @description Default protocol to use: http","*/","YQLRequest.PROTO = 'http';","/**","* @static","* @property BASE_URL","* @description The base URL to query: query.yahooapis.com/v1/public/yql?","*/","YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?';","/**","* @static","* @property ENV","* @description The environment file to load: http://datatables.org/alltables.env","*/","YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env';","","Y.YQLRequest = YQLRequest;","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @class YQL"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function} callback The callback to execute after the query (optional)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","Y.YQL = function (sql, callback, params, opts) {"," return new Y.YQLRequest(sql, callback, params, opts).send();","};","","","}, '@VERSION@', {\"requires\": [\"oop\"]});","","}());"]}; } var __cov_BdMVl3Nvn7mJmfLt43OYWQ = __coverage__['build/yql/yql.js']; __cov_BdMVl3Nvn7mJmfLt43OYWQ.s['1']++;YUI.add('yql',function(Y,NAME){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['1']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['2']++;var YQLRequest=function(sql,callback,params,opts){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['2']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['3']++;if(!params){__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['1'][0]++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['4']++;params={};}else{__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['1'][1]++;}__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['5']++;params.q=sql;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['6']++;if(!params.format){__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['2'][0]++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['7']++;params.format=Y.YQLRequest.FORMAT;}else{__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['2'][1]++;}__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['8']++;if(!params.env){__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['3'][0]++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['9']++;params.env=Y.YQLRequest.ENV;}else{__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['3'][1]++;}__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['10']++;this._context=this;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['11']++;if((__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['5'][0]++,opts)&&(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['5'][1]++,opts.context)){__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['4'][0]++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['12']++;this._context=opts.context;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['13']++;delete opts.context;}else{__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['4'][1]++;}__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['14']++;if((__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['7'][0]++,params)&&(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['7'][1]++,params.context)){__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['6'][0]++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['15']++;this._context=params.context;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['16']++;delete params.context;}else{__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['6'][1]++;}__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['17']++;this._params=params;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['18']++;this._opts=opts;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['19']++;this._callback=callback;};__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['20']++;YQLRequest.prototype={_jsonp:null,_opts:null,_callback:null,_params:null,_context:null,_internal:function(){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['3']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['21']++;this._callback.apply(this._context,arguments);},send:function(){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['4']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['22']++;var qs=[],url=(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['9'][0]++,this._opts)&&(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['9'][1]++,this._opts.proto)?(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['8'][0]++,this._opts.proto):(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['8'][1]++,Y.YQLRequest.PROTO),o;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['23']++;Y.Object.each(this._params,function(v,k){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['5']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['24']++;qs.push(k+'='+encodeURIComponent(v));});__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['25']++;qs=qs.join('&');__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['26']++;url+=((__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['11'][0]++,this._opts)&&(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['11'][1]++,this._opts.base)?(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['10'][0]++,this._opts.base):(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['10'][1]++,Y.YQLRequest.BASE_URL))+qs;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['27']++;o=!Y.Lang.isFunction(this._callback)?(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['12'][0]++,this._callback):(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['12'][1]++,{on:{success:this._callback}});__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['28']++;o.on=(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['13'][0]++,o.on)||(__cov_BdMVl3Nvn7mJmfLt43OYWQ.b['13'][1]++,{});__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['29']++;this._callback=o.on.success;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['30']++;o.on.success=Y.bind(this._internal,this);__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['31']++;this._send(url,o);__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['32']++;return this;},_send:function(){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['6']++;}};__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['33']++;YQLRequest.FORMAT='json';__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['34']++;YQLRequest.PROTO='http';__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['35']++;YQLRequest.BASE_URL=':/'+'/query.yahooapis.com/v1/public/yql?';__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['36']++;YQLRequest.ENV='http:/'+'/datatables.org/alltables.env';__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['37']++;Y.YQLRequest=YQLRequest;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['38']++;Y.YQL=function(sql,callback,params,opts){__cov_BdMVl3Nvn7mJmfLt43OYWQ.f['7']++;__cov_BdMVl3Nvn7mJmfLt43OYWQ.s['39']++;return new Y.YQLRequest(sql,callback,params,opts).send();};},'@VERSION@',{'requires':['oop']});
Eruant/cdnjs
ajax/libs/yui/3.14.0/yql/yql-coverage.js
JavaScript
mit
15,563
YUI.add('dd-drop-plugin', function(Y) { /** * Simple Drop plugin that can be attached to a Node via the plug method. * @module dd * @submodule dd-drop-plugin */ /** * Simple Drop plugin that can be attached to a Node via the plug method. * @class Drop * @extends DD.Drop * @constructor * @namespace Plugin */ var Drop = function(config) { config.node = config.host; Drop.superclass.constructor.apply(this, arguments); }; /** * @property NAME * @description dd-drop-plugin * @type {String} */ Drop.NAME = "dd-drop-plugin"; /** * @property NS * @description The Drop instance will be placed on the Node instance under the drop namespace. It can be accessed via Node.drop; * @type {String} */ Drop.NS = "drop"; Y.extend(Drop, Y.DD.Drop); Y.namespace('Plugin'); Y.Plugin.Drop = Drop; }, '@VERSION@' ,{requires:['dd-drop'], skinnable:false});
masimakopoulos/cdnjs
ajax/libs/yui/3.1.1/dd/dd-drop-plugin.js
JavaScript
mit
1,112
define("dojo/store/DataStore", [ "../_base/lang", "../_base/declare", "../Deferred", "../_base/array", "./util/QueryResults", "./util/SimpleQueryEngine" /*=====, "./api/Store" =====*/ ], function(lang, declare, Deferred, array, QueryResults, SimpleQueryEngine /*=====, Store =====*/){ // module: // dojo/store/DataStore // No base class, but for purposes of documentation, the base class is dojo/store/api/Store var base = null; /*===== base = Store; =====*/ return declare("dojo.store.DataStore", base, { // summary: // This is an adapter for using Dojo Data stores with an object store consumer. // You can provide a Dojo data store and use this adapter to interact with it through // the Dojo object store API target: "", constructor: function(options){ // options: Object? // This provides any configuration information that will be mixed into the store, // including a reference to the Dojo data store under the property "store". lang.mixin(this, options); if(!("idProperty" in options)){ var idAttribute; try{ idAttribute = this.store.getIdentityAttributes(); }catch(e){ // some store are not requiring an item instance to give us the ID attributes // but some other do and throw errors in that case. } // if no idAttribute we have implicit id this.idProperty = (lang.isArray(idAttribute) ? idAttribute[0] : idAttribute) || this.idProperty; } var features = this.store.getFeatures(); // check the feature set and null out any methods that shouldn't be available if(!features["dojo.data.api.Read"]){ this.get = null; } if(!features["dojo.data.api.Identity"]){ this.getIdentity = null; } if(!features["dojo.data.api.Write"]){ this.put = this.add = null; } }, // idProperty: String // The object property to use to store the identity of the store items. idProperty: "id", // store: // The object store to convert to a data store store: null, // queryEngine: Function // Defines the query engine to use for querying the data store queryEngine: SimpleQueryEngine, _objectConverter: function(callback){ var store = this.store; var idProperty = this.idProperty; function convert(item){ var object = {}; var attributes = store.getAttributes(item); for(var i = 0; i < attributes.length; i++){ var attribute = attributes[i]; var values = store.getValues(item, attribute); if(values.length > 1){ for(var j = 0; j < values.length; j++){ var value = values[j]; if(typeof value == 'object' && store.isItem(value)){ values[j] = convert(value); } } value = values; }else{ var value = store.getValue(item, attribute); if(typeof value == 'object' && store.isItem(value)){ value = convert(value); } } object[attributes[i]] = value; } if(!(idProperty in object) && store.getIdentity){ object[idProperty] = store.getIdentity(item); } return object; } return function(item){ return callback(item && convert(item)); }; }, get: function(id, options){ // summary: // Retrieves an object by it's identity. This will trigger a fetchItemByIdentity // id: Object? // The identity to use to lookup the object var returnedObject, returnedError; var deferred = new Deferred(); this.store.fetchItemByIdentity({ identity: id, onItem: this._objectConverter(function(object){ deferred.resolve(returnedObject = object); }), onError: function(error){ deferred.reject(returnedError = error); } }); if(returnedObject !== undefined){ // if it was returned synchronously return returnedObject == null ? undefined : returnedObject; } if(returnedError){ throw returnedError; } return deferred.promise; }, put: function(object, options){ // summary: // Stores an object by its identity. // object: Object // The object to store. // options: Object? // Additional metadata for storing the data. Includes a reference to an id // that the object may be stored with (i.e. { id: "foo" }). options = options || {}; var id = typeof options.id != "undefined" ? options.id : this.getIdentity(object); var store = this.store; var idProperty = this.idProperty; var deferred = new Deferred(); if(typeof id == "undefined"){ var item = store.newItem(object); store.save({ onComplete: function(){ deferred.resolve(item); }, onError: function(error){ deferred.reject(error); } }); }else{ store.fetchItemByIdentity({ identity: id, onItem: function(item){ if(item){ if(options.overwrite === false){ return deferred.reject(new Error("Overwriting existing object not allowed")); } for(var i in object){ if(i != idProperty && // don't copy id properties since they are immutable and should be omitted for implicit ids object.hasOwnProperty(i) && // don't want to copy methods and inherited properties store.getValue(item, i) != object[i]){ store.setValue(item, i, object[i]); } } }else{ if(options.overwrite === true){ return deferred.reject(new Error("Creating new object not allowed")); } var item = store.newItem(object); } store.save({ onComplete: function(){ deferred.resolve(item); }, onError: function(error){ deferred.reject(error); } }); }, onError: function(error){ deferred.reject(error); } }); } return deferred.promise; }, add: function(object, options){ // summary: // Creates an object, throws an error if the object already exists // object: Object // The object to store. // options: dojo/store/api/Store.PutDirectives? // Additional metadata for storing the data. Includes an "id" // property if a specific id is to be used. // returns: Number (options = options || {}).overwrite = false; // call put with overwrite being false return this.put(object, options); }, remove: function(id){ // summary: // Deletes an object by its identity. // id: Object // The identity to use to delete the object var store = this.store; var deferred = new Deferred(); this.store.fetchItemByIdentity({ identity: id, onItem: function(item){ try{ if(item == null){ // no item found, return false deferred.resolve(false); }else{ // delete and save the change store.deleteItem(item); store.save(); deferred.resolve(true); } }catch(error){ deferred.reject(error); } }, onError: function(error){ deferred.reject(error); } }); return deferred.promise; }, query: function(query, options){ // summary: // Queries the store for objects. // query: Object // The query to use for retrieving objects from the store // options: Object? // Optional options object as used by the underlying dojo.data Store. // returns: dojo/store/api/Store.QueryResults // A query results object that can be used to iterate over results. var fetchHandle; var deferred = new Deferred(function(){ fetchHandle.abort && fetchHandle.abort(); }); deferred.total = new Deferred(); var converter = this._objectConverter(function(object){return object;}); fetchHandle = this.store.fetch(lang.mixin({ query: query, onBegin: function(count){ deferred.total.resolve(count); }, onComplete: function(results){ deferred.resolve(array.map(results, converter)); }, onError: function(error){ deferred.reject(error); } }, options)); return QueryResults(deferred); }, getIdentity: function(object){ // summary: // Fetch the identity for the given object. // object: Object // The data object to get the identity from. // returns: Number // The id of the given object. return object[this.idProperty]; } }); });
CyrusSUEN/cdnjs
ajax/libs/dojo/1.11.0-rc3/store/DataStore.js.uncompressed.js
JavaScript
mit
7,878
(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I=[].slice,q={}.hasOwnProperty,R=function(e,t){function r(){this.constructor=e}for(var n in t)q.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},U=function(e,t){return function(){return e.apply(t,arguments)}};typeof module!="undefined"&&module!==null?(module.exports=e={},e.Bacon=e):this.Bacon=e={},e.fromBinder=function(t,n){return n==null&&(n=j.id),new o(function(r){var i,o;return i=function(){return typeof o!="undefined"&&o!==null?o():setTimeout(function(){return o()},0)},o=t(function(){var t,o,u,a,f,l,c;t=1<=arguments.length?I.call(arguments,0):[],a=n.apply(null,t),a instanceof Array&&j.last(a)instanceof s||(a=[a]);try{c=[];for(f=0,l=a.length;f<l;f++)o=a[f],u=r(o=_(o)),u===e.noMore||o.isEnd()?c.push(i()):c.push(void 0);return c}catch(h){throw j.last(a).isEnd()&&i(),h}})})},e.$={asEventStream:function(t,n,r){var i,s=this;return E(n)&&(i=[n,null],r=i[0],n=i[1]),e.fromBinder(function(e){return s.on(t,n,e),function(){return s.off(t,n,e)}},r)}},(F=typeof jQuery!=="undefined"&&jQuery!==null?jQuery:typeof Zepto!=="undefined"&&Zepto!==null?Zepto:null)!=null&&(F.fn.asEventStream=e.$.asEventStream),e.fromEventTarget=function(t,n,r){var i,s,o,u,a,f;return i=(o=t.addEventListener)!=null?o:(u=t.addListener)!=null?u:t.bind,s=(a=t.removeEventListener)!=null?a:(f=t.removeListener)!=null?f:t.unbind,e.fromBinder(function(e){return i.call(t,n,e),function(){return s.call(t,n,e)}},r)},e.fromPromise=function(t){return e.fromBinder(function(e){return t.then(e,function(t){return e(new i(t))}),function(){return typeof t.abort=="function"?t.abort():void 0}},function(e){return[e,m()]})},e.noMore=["<no-more>"],e.more=["<more>"],e.later=function(t,n){return e.sequentially(t,[n])},e.sequentially=function(t,n){var r;return r=0,e.fromPoll(t,function(){var e;return e=n[r++],r<n.length?e:[e,m()]})},e.repeatedly=function(t,n){var r;return r=0,e.fromPoll(t,function(){return n[r++%n.length]})},e.fromCallback=function(){var t,n;return n=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],e.fromBinder(function(e){return x(n,t)(e),k},function(e){return[e,m()]})},e.fromNodeCallback=function(){var t,n;return n=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],e.fromBinder(function(e){return x(n,t)(e),k},function(e,t){return e?[new i(e),m()]:[t,m()]})},e.fromPoll=function(t,n){return e.fromBinder(function(e){var n;return n=setInterval(e,t),function(){return clearInterval(n)}},n)},e.interval=function(t,n){return n==null&&(n={}),e.fromPoll(t,function(){return C(n)})},e.constant=function(e){return new c(O([e],b))},e.never=function(){return e.fromArray([])},e.once=function(t){return e.fromArray([t])},e.fromArray=function(e){return new o(O(e,C))},O=function(e,t){return function(n){var r,i,s;for(i=0,s=e.length;i<s;i++)r=e[i],n(t(r));return n(m()),k}},e.combineAll=function(e,t){var n,r,i,s,o;r=j.head(e),o=j.tail(e);for(i=0,s=o.length;i<s;i++)n=o[i],r=t(r,n);return r},e.mergeAll=function(t){return e.combineAll(t,function(e,t){return e.merge(t)})},e.combineAsArray=function(){var t,n,r,i,s=this;return r=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],r instanceof Array||(r=[r].concat(t)),r.length?(i=function(){var e,t,i;i=[];for(e=0,t=r.length;e<t;e++)n=r[e],i.push(f);return i}(),new c(function(t){var s,o,u,a,f,l,c,h,d,v,g,y;v=!1,d=function(){var e,t,i;i=[];for(e=0,t=r.length;e<t;e++)n=r[e],i.push(k);return i}(),h=function(){var e,t,n;for(t=0,n=d.length;t<n;t++)e=d[t],e();return v=!0},u=function(){var e,t,i;i=[];for(e=0,t=r.length;e<t;e++)n=r[e],i.push(!1);return i}(),s=function(){var n;if(j.all(u))return n=t(m()),n===e.noMore&&h(),n},f=!1,o=function(n,r){return function(o){var u,a;return o.isEnd()?(n(),s(),e.noMore):o.isError()?(u=t(o),u===e.noMore&&h(),u):(r(o.value),j.all(j.map(function(e){return e.isDefined},i))?f&&o.isInitial()?e.more:(f=!0,a=function(){var e,t,n,r;r=[];for(t=0,n=i.length;t<n;t++)e=i[t],r.push(e.get()());return r},u=t(o.apply(a)),u===e.noMore&&h(),u):e.more)}},l=function(e){return o(function(){return u[e]=!0},function(t){return i[e]=new p(t)})};for(a=g=0,y=r.length;g<y;a=++g)c=r[a],v||(d[a]=c.subscribe(l(a)));return h})):e.constant([])},e.combineWith=function(t,n){return e.combineAll(t,function(e,t){return e.toProperty().combine(t,n)})},e.combineTemplate=function(t){var n,r,i,s,o,u,a,f,c,h;return a=[],h=[],u=function(e){return e[e.length-1]},c=function(e,t,n){return u(e)[t]=n},n=function(e,t){return function(n,r){return c(n,e,r[t])}},o=function(e,t){return function(n,r){return c(n,e,t)}},f=function(e){return e instanceof Array?[]:{}},i=function(e,t){var r,i;return t instanceof l?(h.push(t),a.push(n(e,h.length-1))):typeof t=="object"?(i=function(e){return function(n,r){var i;return i=f(t),c(n,e,i),n.push(i)}},r=function(e,t){return e.pop()},a.push(i(e)),s(t),a.push(r)):a.push(o(e,t))},s=function(e){return j.each(e,i)},s(t),r=function(e){var n,r,i,s,o;i=f(t),n=[i];for(s=0,o=a.length;s<o;s++)r=a[s],r(n,e);return i},e.combineAsArray(h).map(r)},s=function(){function e(){}return e.prototype.isEvent=function(){return!0},e.prototype.isEnd=function(){return!1},e.prototype.isInitial=function(){return!1},e.prototype.isNext=function(){return!1},e.prototype.isError=function(){return!1},e.prototype.hasValue=function(){return!1},e.prototype.filter=function(e){return!0},e.prototype.onDone=function(e){return e()},e}(),a=function(e){function t(e,t){var n=this;E(e)?this.value=function(){var t;return t=e(),n.value=j.always(t),t}:this.value=j.always(e)}return R(t,e),t.prototype.isNext=function(){return!0},t.prototype.hasValue=function(){return!0},t.prototype.fmap=function(e){var t=this;return this.apply(function(){return e(t.value())})},t.prototype.apply=function(e){return new t(e)},t.prototype.filter=function(e){return e(this.value())},t.prototype.describe=function(){return this.value()},t}(s),u=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return R(t,e),t.prototype.isInitial=function(){return!0},t.prototype.isNext=function(){return!1},t.prototype.apply=function(e){return new t(e)},t.prototype.toNext=function(){return new a(this.value)},t}(a),r=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return R(t,e),t.prototype.isEnd=function(){return!0},t.prototype.fmap=function(){return this},t.prototype.apply=function(){return this},t.prototype.describe=function(){return"<end>"},t}(s),i=function(e){function t(e){this.error=e}return R(t,e),t.prototype.isError=function(){return!0},t.prototype.fmap=function(){return this},t.prototype.apply=function(){return this},t.prototype.describe=function(){return"<error> "+this.error},t}(s),l=function(){function t(){this.flatMapLatest=U(this.flatMapLatest,this),this.scan=U(this.scan,this),this.takeUntil=U(this.takeUntil,this),this.assign=this.onValue}return t.prototype.onValue=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.subscribe(function(e){if(e.hasValue())return t(e.value())})},t.prototype.onValues=function(e){return this.onValue(function(t){return e.apply(null,t)})},t.prototype.onError=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.subscribe(function(e){if(e.isError())return t(e.error)})},t.prototype.onEnd=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.subscribe(function(e){if(e.isEnd())return t()})},t.prototype.errors=function(){return this.filter(function(){return!1})},t.prototype.filter=function(){var t,n;return n=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],n instanceof c?n.sampledBy(this,function(e,t){return[e,t]}).filter(function(e){var t,n;return t=e[0],n=e[1],t}).map(function(e){var t,n;return t=e[0],n=e[1],n}):(n=x(n,t),this.withHandler(function(t){return t.filter(n)?this.push(t):e.more}))},t.prototype.takeWhile=function(){var t,n;return n=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],n=x(n,t),this.withHandler(function(t){return t.filter(n)?this.push(t):(this.push(m()),e.noMore)})},t.prototype.endOnError=function(){return this.withHandler(function(e){return e.isError()?(this.push(e),this.push(m())):this.push(e)})},t.prototype.take=function(t){return this.withHandler(function(n){return n.hasValue()?(t--,t>0?this.push(n):(this.push(n),this.push(m()),e.noMore)):this.push(n)})},t.prototype.map=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.withHandler(function(e){return this.push(e.fmap(t))})},t.prototype.mapError=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.withHandler(function(e){return e.isError()?this.push(C(t(e.error))):this.push(e)})},t.prototype.mapEnd=function(){var t,n;return n=arguments[0],t=2<=arguments.length?I.call(arguments,1):[],n=x(n,t),this.withHandler(function(t){return t.isEnd()?(this.push(C(n(t))),this.push(m()),e.noMore):this.push(t)})},t.prototype.doAction=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t=x(t,e),this.withHandler(function(e){return e.hasValue()&&t(e.value()),this.push(e)})},t.prototype.takeUntil=function(t){var n;return n=this,this.withSubscribe(function(r){var i,s,o,u,a,f;return f=!1,u=k,a=k,o=function(){return u(),a(),f=!0},i=function(t){return t.isEnd()?(a(),r(t),e.noMore):(t.onDone(function(){var n;if(!f){n=r(t);if(n===e.noMore)return o()}}),e.more)},s=function(t){return t.isError()?e.more:t.isEnd()?e.noMore:(u(),r(m()),e.noMore)},u=n.subscribe(i),f||(a=t.subscribe(s)),o})},t.prototype.skip=function(t){return this.withHandler(function(n){return n.hasValue()?t>0?(t--,e.more):this.push(n):this.push(n)})},t.prototype.skipDuplicates=function(e){return e==null&&(e=function(e,t){return e===t}),this.withStateMachine(f,function(t,n){return n.hasValue()?t===f||!e(t.get(),n.value())?[new p(n.value()),[n]]:[t,[]]:[t,[n]]})},t.prototype.withStateMachine=function(t,n){var r;return r=t,this.withHandler(function(t){var i,s,o,u,a,f,l;i=n(r,t),s=i[0],u=i[1],r=s,a=e.more;for(f=0,l=u.length;f<l;f++){o=u[f],a=this.push(o);if(a===e.noMore)return a}return a})},t.prototype.scan=function(t,n){var r,i,s=this;return n=M(n),r=H(t),i=function(t){var i,o;return i=!1,o=s.subscribe(function(s){return s.hasValue()?i&&s.isInitial()?e.more:(i=!0,r=new p(n(r.getOrElse(void 0),s.value())),t(s.apply(j.always(r.get())))):(s.isEnd()&&(i=!0),t(s))}),i||r.forEach(function(n){var r;r=t(b(n));if(r===e.noMore)return o(),o=k}),o},new c((new h(i)).subscribe)},t.prototype.diff=function(e,t){return t=M(t),this.scan([e],function(e,n){return[n,t(e[0],n)]}).filter(function(e){return e.length===2}).map(function(e){return e[1]})},t.prototype.flatMap=function(t){var n;return t=T(t),n=this,new o(function(r){var i,s,o,a,f,l;return s=[],o=!1,l=function(){},f=function(){var e,t,n;l();for(t=0,n=s.length;t<n;t++)e=s[t],e();return s=[]},i=function(){if(o&&s.length===0)return r(m())},a=function(n){var a,l,c,h,p;if(n.isEnd())return o=!0,i();if(n.isError())return r(n);a=t(n.value()),p=void 0,l=!1,h=function(){return p!=null&&A(p,s),i()},c=function(t){var n;return t.isEnd()?(h(),l=!0,e.noMore):(t instanceof u&&(t=t.toNext()),n=r(t),n===e.noMore&&f(),n)},p=a.subscribe(c);if(!l)return s.push(p)},l=n.subscribe(a),f})},t.prototype.flatMapLatest=function(e){var t,n=this;return e=T(e),t=this.toEventStream(),t.flatMap(function(n){return e(n).takeUntil(t)})},t.prototype.not=function(){return this.map(function(e){return!e})},t.prototype.log=function(){var e;return e=1<=arguments.length?I.call(arguments,0):[],this.subscribe(function(t){return console.log.apply(console,I.call(e).concat([t.describe()]))}),this},t.prototype.slidingWindow=function(e){return this.scan([],function(t,n){return t.concat([n]).slice(-e)})},t}(),o=function(t){function r(e){var t;r.__super__.constructor.call(this),t=new n(e),this.subscribe=t.subscribe,this.hasSubscribers=t.hasSubscribers}return R(r,t),r.prototype.map=function(){var e,t;return t=arguments[0],e=2<=arguments.length?I.call(arguments,1):[],t instanceof c?t.sampledBy(this,g):r.__super__.map.apply(this,[t].concat(I.call(e)))},r.prototype.delay=function(t){return this.flatMap(function(n){return e.later(t,n)})},r.prototype.debounce=function(t){return this.flatMapLatest(function(n){return e.later(t,n)})},r.prototype.throttle=function(e){return this.bufferWithTime(e).map(function(e){return e[e.length-1]})},r.prototype.bufferWithTime=function(e){var t,n=this;return t=function(e){return e.schedule()},this.buffer(e,t,t)},r.prototype.bufferWithCount=function(e){var t;return t=function(t){if(t.values.length===e)return t.flush()},this.buffer(0,t)},r.prototype.buffer=function(t,n,r){var i,s,o;return n==null&&(n=function(){}),r==null&&(r=function(){}),i={scheduled:!1,end:null,values:[],flush:function(){var t;this.scheduled=!1;if(this.values.length>0){t=this.push(C(this.values)),this.values=[];if(this.end!=null)return this.push(this.end);if(t!==e.noMore)return r(this)}else if(this.end!=null)return this.push(this.end)},schedule:function(){var e=this;if(!this.scheduled)return this.scheduled=!0,t(function(){return e.flush()})}},o=e.more,E(t)||(s=t,t=function(e){return setTimeout(e,s)}),this.withHandler(function(e){return i.push=this.push,e.isError()?o=this.push(e):e.isEnd()?(i.end=e,i.scheduled||i.flush()):(i.values.push(e.value()),n(i)),o})},r.prototype.merge=function(t){var n;return n=this,new r(function(r){var i,s,o,u,a,f;return u=k,a=k,f=!1,o=function(){return u(),a(),f=!0},i=0,s=function(t){var n;return t.isEnd()?(i++,i===2?r(m()):e.more):(n=r(t),n===e.noMore&&o(),n)},u=n.subscribe(s),f||(a=t.subscribe(s)),o})},r.prototype.toProperty=function(e){return arguments.length===0&&(e=f),this.scan(e,S)},r.prototype.toEventStream=function(){return this},r.prototype.concat=function(e){var t;return t=this,new r(function(n){var r;return r=t.subscribe(function(t){return t.isEnd()?r=e.subscribe(n):n(t)}),function(){return r()}})},r.prototype.awaiting=function(e){return this.map(!0).merge(e.map(!1)).toProperty(!1)},r.prototype.startWith=function(t){return e.once(t).concat(this)},r.prototype.withHandler=function(e){var t;return t=new n(this.subscribe,e),new r(t.subscribe)},r.prototype.withSubscribe=function(e){return new r(e)},r}(l),c=function(t){function n(t){var r,i=this;this.subscribe=t,this.toEventStream=U(this.toEventStream,this),this.toProperty=U(this.toProperty,this),this.changes=U(this.changes,this),this.sample=U(this.sample,this),n.__super__.constructor.call(this),r=function(t,r,s){var o,u;return o=f,u=f,new n(function(n){var a,f,l,c,h,d,v,g,y,b,w;return w=!1,y=k,b=k,g=function(){return y(),b(),w=!0},c=!1,d=!1,a=function(){var t;if(c&&d)return t=n(m()),t===e.noMore&&g(),t},l=!1,f=function(t,r,i){return function(s){var f;return s.isEnd()?(t(),a(),e.noMore):s.isError()?(f=n(s),f===e.noMore&&g(),f):(r(new p(s.value)),o.isDefined&&u.isDefined?l&&s.isInitial()?e.more:(l=!0,f=i(n,s,o.value,u.value),f===e.noMore&&g(),f):e.more)}},h=f(function(){return c=!0},function(e){return o=e},r),v=f(function(){return d=!0},function(e){return u=e},s),y=i.subscribe(h),w||(b=t.subscribe(v)),g})},this.combine=function(t,n){var r;return r=M(n),e.combineAsArray(i,t).map(function(e){return r(e[0],e[1])})},this.sampledBy=function(e,t){var n,i;return t==null&&(t=g),t=M(t),n=function(e,n,r,i){return e(n.apply(function(){return t(r(),i())}))},i=r(e,k,n),e instanceof o&&(i=i.changes()),i.takeUntil(e.filter(!1).mapEnd())}}return R(n,t),n.prototype.sample=function(t){return this.sampledBy(e.interval(t,{}))},n.prototype.changes=function(){var e=this;return new o(function(t){return e.subscribe(function(e){if(!e.isInitial())return t(e)})})},n.prototype.withHandler=function(e){return new n((new h(this.subscribe,e)).subscribe)},n.prototype.withSubscribe=function(e){return new n((new h(e)).subscribe)},n.prototype.toProperty=function(){return this},n.prototype.toEventStream=function(){var e=this;return new o(function(t){return e.subscribe(function(e){return e.isInitial()&&(e=e.toNext()),t(e)})})},n.prototype.and=function(e){return this.combine(e,function(e,t){return e&&t})},n.prototype.or=function(e){return this.combine(e,function(e,t){return e||t})},n.prototype.decode=function(t){return this.combine(e.combineTemplate(t),function(e,t){return t[e]})},n.prototype.delay=function(e){return this.delayChanges(function(t){return t.delay(e)})},n.prototype.debounce=function(e){return this.delayChanges(function(t){return t.debounce(e)})},n.prototype.throttle=function(e){return this.delayChanges(function(t){return t.throttle(e)})},n.prototype.delayChanges=function(e){return d(this,e(this.changes()))},n}(l),d=function(t,n){var r;return r=function(t){var n;return n=f,t.subscribe(function(t){return t.isInitial()&&(n=new p(t.value())),e.noMore}),n},n.toProperty(r(t))},n=function(){function t(t,n){var r,i,o,u,a,f,l,c,h,p=this;t==null&&(t=function(){return k}),l=[],a=null,u=!1,o=!1,this.hasSubscribers=function(){return l.length>0},c=k,f=function(e){return l=j.without(e,l)},h=null,i=function(e){var t,n,r,i;if(h!=null){n=h,h=null;for(r=0,i=n.length;r<i;r++)t=n[r],t()}return e.onDone=s.prototype.onDone},r=function(e){return h=(h||[]).concat([e])},this.push=function(t){var n,s,o,c,h;if(!u){try{u=!0,t.onDone=r,o=l;for(c=0,h=o.length;c<h;c++)s=o[c],n=s(t),(n===e.noMore||t.isEnd())&&f(s)}catch(d){throw a=null,d}finally{u=!1}while(a!=null?a.length:void 0)t=j.head(a),a=j.tail(a),p.push(t);return i(t),p.hasSubscribers()?e.more:e.noMore}return a=(a||[]).concat([t]),e.more},n==null&&(n=function(e){return this.push(e)}),this.handleEvent=function(e){return e.isEnd()&&(o=!0),n.apply(p,[e])},this.subscribe=function(e){return o?(e(m()),k):(l=l.concat(e),l.length===1&&(c=t(p.handleEvent)),function(){f(e);if(!p.hasSubscribers())return c()})}}return t}(),h=function(t){function n(t,r){var i,s,o,u=this;n.__super__.constructor.call(this,t,r),i=f,o=this.push,t=this.subscribe,s=!1,this.push=function(e){return e.isEnd()&&(s=!0),e.hasValue()&&(i=new p(e.value())),o.apply(u,[e])},this.subscribe=function(n){var r,o,a;return r=!1,a=function(){return u.hasSubscribers()||s},o=i.filter(a).map(function(e){return n(b(e))}),o.getOrElse(e.more)===e.noMore?k:s?(n(m()),k):t.apply(u,[n])}}return R(n,t),n}(n),t=function(t){function n(){var t,r,s,o,u,a,f,l,c=this;s=void 0,a=[],t=!1,r=function(t){return function(n){return n.isEnd()?(l(t),e.noMore):s(n)}},f=function(){var e,t,n,r;r=[];for(t=0,n=a.length;t<n;t++)e=a[t],r.push(typeof e.unsub=="function"?e.unsub():void 0);return r},u=function(e){return e.unsub=e.input.subscribe(r(e.input))},l=function(e){var t,n,r,i;for(t=r=0,i=a.length;r<i;t=++r){n=a[t];if(n.input===e){typeof n.unsub=="function"&&n.unsub(),a.splice(t,1);return}}},o=function(e){var t,n,r,i,o;s=e,n=[],o=v(a);for(r=0,i=o.length;r<i;r++)t=o[r],u(t);return f},n.__super__.constructor.call(this,o),this.plug=function(e){var n;if(t)return;return n={input:e},a.push(n),s!=null&&u(n),function(){return l(e)}},this.push=function(e){return typeof s=="function"?s(C(e)):void 0},this.error=function(e){return typeof s=="function"?s(new i(e)):void 0},this.end=function(){return t=!0,f(),typeof s=="function"?s(m()):void 0}}return R(n,t),n}(o),p=function(){function e(e){this.value=e}return e.prototype.getOrElse=function(){return this.value},e.prototype.get=function(){return this.value},e.prototype.filter=function(t){return t(this.value)?new e(this.value):f},e.prototype.map=function(t){return new e(t(this.value))},e.prototype.forEach=function(e){return e(this.value)},e.prototype.isDefined=!0,e.prototype.toArray=function(){return[this.value]},e}(),f={getOrElse:function(e){return e},filter:function(){return f},map:function(){return f},forEach:function(){},isDefined:!1,toArray:function(){return[]}},e.EventStream=o,e.Property=c,e.Observable=l,e.Bus=t,e.Initial=u,e.Next=a,e.End=r,e.Error=i,k=function(){},S=function(e,t){return t},g=function(e,t){return e},b=function(e){return new u(j.always(e))},C=function(e){return new a(j.always(e))},m=function(){return new r},_=function(e){return e instanceof s?e:C(e)},v=function(e){return e.slice(0)},y=Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){var n,r,i,s;for(n=i=0,s=e.length;i<s;n=++i){r=e[n];if(t===r)return n}return-1},A=function(e,t){var n;n=y(t,e);if(n>=0)return t.splice(n,1)},E=function(e){return typeof e=="function"},N=function(e,t,n){return n===void 0&&(n=[]),function(r){return e[t].apply(e,n.concat([r]))}},L=function(e,t){return function(){var n;return n=1<=arguments.length?I.call(arguments,0):[],e.apply(null,t.concat(n))}},T=function(e){return e instanceof l&&(e=j.always(e)),e},x=function(e,t){return E(e)?t.length?L(e,t):e:w(e)?D(e,t):typeof e=="object"&&t.length?N(e,j.head(t),j.tail(t)):j.always(e)},w=function(e){return typeof e=="string"&&e.length>1&&e.charAt(0)==="."},e.isFieldKey=w,D=function(e,t){var n,r;return r=e.slice(1).split("."),n=j.map(B(t),r),function(t){var r,i;for(r=0,i=n.length;r<i;r++)e=n[r],t=e(t);return t}},B=function(e){return function(t){return function(n){var r;return r=n[t],E(r)?r.apply(n,e):r}}},P=function(e){return e.slice(1)},M=function(e){var t;if(E(e))return e;if(w(e))return t=P(e),function(e,n){return e[t](n)}},H=function(e){return e instanceof p||e===f?e:new p(e)},typeof define!="undefined"&&define!==null&&define.amd!=null&&typeof define=="function"&&define(function(){return e}),j={head:function(e){return e[0]},always:function(e){return function(){return e}},empty:function(e){return e.length===0},tail:function(e){return e.slice(1,e.length)},filter:function(e,t){var n,r,i,s;n=[];for(i=0,s=t.length;i<s;i++)r=t[i],e(r)&&n.push(r);return n},map:function(e,t){var n,r,i,s;s=[];for(r=0,i=t.length;r<i;r++)n=t[r],s.push(e(n));return s},each:function(e,t){var n,r,i;i=[];for(n in e)r=e[n],i.push(t(n,r));return i},toArray:function(e){return e instanceof Array?e:[e]},contains:function(e,t){return y(e,t)!==-1},id:function(e){return e},last:function(e){return e[e.length-1]},all:function(e){var t,n,r;for(n=0,r=e.length;n<r;n++){t=e[n];if(!t)return!1}return!0},without:function(e,t){return j.filter(function(t){return t!==e},t)}},e._=j}).call(this);
kevinburke/cdnjs
ajax/libs/bacon.js/0.2.4/Bacon.min.js
JavaScript
mit
22,174
import re from django.conf import settings from django.http import HttpResponsePermanentRedirect class SecurityMiddleware(object): def __init__(self): self.sts_seconds = settings.SECURE_HSTS_SECONDS self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS self.content_type_nosniff = settings.SECURE_CONTENT_TYPE_NOSNIFF self.xss_filter = settings.SECURE_BROWSER_XSS_FILTER self.redirect = settings.SECURE_SSL_REDIRECT self.redirect_host = settings.SECURE_SSL_HOST self.redirect_exempt = [re.compile(r) for r in settings.SECURE_REDIRECT_EXEMPT] def process_request(self, request): path = request.path.lstrip("/") if (self.redirect and not request.is_secure() and not any(pattern.search(path) for pattern in self.redirect_exempt)): host = self.redirect_host or request.get_host() return HttpResponsePermanentRedirect( "https://%s%s" % (host, request.get_full_path()) ) def process_response(self, request, response): if (self.sts_seconds and request.is_secure() and 'strict-transport-security' not in response): sts_header = "max-age=%s" % self.sts_seconds if self.sts_include_subdomains: sts_header = sts_header + "; includeSubDomains" response["strict-transport-security"] = sts_header if self.content_type_nosniff and 'x-content-type-options' not in response: response["x-content-type-options"] = "nosniff" if self.xss_filter and 'x-xss-protection' not in response: response["x-xss-protection"] = "1; mode=block" return response
kronicz/ecommerce-2
lib/python2.7/site-packages/django/middleware/security.py
Python
mit
1,753
ace.define("ace/mode/praat_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="if|then|else|elsif|elif|endif|fi|endfor|endproc|while|endwhile|repeat|until|select|plus|minus|assert",t="macintosh|windows|unix|praatVersion|praatVersion\\$pi|undefined|newline\\$|tab\\$|shellDirectory\\$|homeDirectory\\$|preferencesDirectory\\$|temporaryDirectory\\$|defaultDirectory\\$",n="clearinfo|endSendPraat",r="writeInfo|writeInfoLine|appendInfo|appendInfoLine|writeFile|writeFileLine|appendFile|appendFileLine|abs|round|floor|ceiling|min|max|imin|imax|sqrt|sin|cos|tan|arcsin|arccos|arctan|arctan2|sinc|sincpi|exp|ln|log10|log2|sinh|cosh|tanh|arcsinh|arccosh|actanh|sigmoid|invSigmoid|erf|erfc|randomUniform|randomInteger|randomGauss|randomPoisson|lnGamma|gaussP|gaussQ|invGaussQ|chiSquareP|chiSquareQ|invChiSquareQ|studentP|studentQ|invStudentQ|fisherP|fisherQ|invFisherQ|binomialP|binomialQ|invBinomialP|invBinomialQ|hertzToBark|barkToHerz|hertzToMel|melToHertz|hertzToSemitones|semitonesToHerz|erb|hertzToErb|erbToHertz|phonToDifferenceLimens|differenceLimensToPhon|beta|besselI|besselK|selected|selected\\$|numberOfSelected|variableExists|index|rindex|startsWith|endsWith|index_regex|rindex_regex|replace_regex\\$|length|extractWord\\$|extractLine\\$|extractNumber|left\\$|right\\$|mid\\$|replace\\$|beginPause|endPause|demoShow|demoWindowTitle|demoInput|demoWaitForInput|demoClicked|demoClickedIn|demoX|demoY|demoKeyPressed|demoKey\\$|demoExtraControlKeyPressed|demoShiftKeyPressed|demoCommandKeyPressed|demoOptionKeyPressed|environment\\$|chooseReadFile\\$|chooseDirectory\\$|createDirectory|fileReadable|deleteFile|selectObject|removeObject|plusObject|minusObject|runScript|exitScript|beginSendPraat|endSendPraat",i="Activation|AffineTransform|AmplitudeTier|Art|Artword|Autosegment|BarkFilter|CCA|Categories|Cepstrum|Cepstrumc|ChebyshevSeries|ClassificationTable|Cochleagram|Collection|Configuration|Confusion|ContingencyTable|Corpus|Correlation|Covariance|CrossCorrelationTable|CrossCorrelationTables|DTW|Diagonalizer|Discriminant|Dissimilarity|Distance|Distributions|DurationTier|EEG|ERP|ERPTier|Eigen|Excitation|Excitations|ExperimentMFC|FFNet|FeatureWeights|Formant|FormantFilter|FormantGrid|FormantPoint|FormantTier|GaussianMixture|HMM|HMM_Observation|HMM_ObservationSequence|HMM_State|HMM_StateSequence|Harmonicity|ISpline|Index|Intensity|IntensityTier|IntervalTier|KNN|KlattGrid|KlattTable|LFCC|LPC|Label|LegendreSeries|LinearRegression|LogisticRegression|LongSound|Ltas|MFCC|MSpline|ManPages|Manipulation|Matrix|MelFilter|MixingMatrix|Movie|Network|OTGrammar|OTHistory|OTMulti|PCA|PairDistribution|ParamCurve|Pattern|Permutation|Pitch|PitchTier|PointProcess|Polygon|Polynomial|Procrustes|RealPoint|RealTier|ResultsMFC|Roots|SPINET|SSCP|SVD|Salience|ScalarProduct|Similarity|SimpleString|SortedSetOfString|Sound|Speaker|Spectrogram|Spectrum|SpectrumTier|SpeechSynthesizer|SpellingChecker|Strings|StringsIndex|Table|TableOfReal|TextGrid|TextInterval|TextPoint|TextTier|Tier|Transition|VocalTract|Weight|WordList";this.$rules={start:[{token:"string.interpolated",regex:/'((?:[a-z][a-zA-Z0-9_]*)(?:\$|#|:[0-9]+)?)'/},{token:["text","text","keyword.operator","text","keyword"],regex:/(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(stopwatch)/},{token:["text","keyword","text","string"],regex:/(^\s*)(print(?:line)?|echo|exit|pause|sendpraat|include|execute)(\s+)(.*)/},{token:["text","keyword"],regex:"(^\\s*)("+n+")$"},{token:["text","keyword.operator","text"],regex:/(\s+)((?:\+|-|\/|\*|<|>)=?|==?|!=|%|\^|\||and|or|not)(\s+)/},{token:["text","text","keyword.operator","text","keyword","text","keyword"],regex:/(^\s*)(?:([a-z][a-zA-Z0-9_]*\$?\s+)(=)(\s+))?(?:((?:no)?warn|nocheck|noprogress)(\s+))?((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/},{token:["text","keyword","text","keyword"],regex:/(^\s*)(?:(demo)?(\s+))((?:[A-Z][^.:"]+)(?:$|(?:\.{3}|:)))/},{token:["text","keyword","text","keyword"],regex:/^(\s*)(?:(demo)(\s+))?(10|12|14|16|24)$/},{token:["text","support.function","text"],regex:/(\s*)(do\$?)(\s*:\s*|\s*\(\s*)/},{token:"entity.name.type",regex:"("+i+")"},{token:"variable.language",regex:"("+t+")"},{token:["support.function","text"],regex:"((?:"+r+")\\$?)(\\s*(?::|\\())"},{token:"keyword",regex:/(\bfor\b)/,next:"for"},{token:"keyword",regex:"(\\b(?:"+e+")\\b)"},{token:"string",regex:/"[^"]*"/},{token:"string",regex:/"[^"]*$/,next:"brokenstring"},{token:["text","keyword","text","entity.name.section"],regex:/(^\s*)(\bform\b)(\s+)(.*)/,next:"form"},{token:"constant.numeric",regex:/\b[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["keyword","text","entity.name.function"],regex:/(procedure)(\s+)(\S+)/},{token:["entity.name.function","text"],regex:/(@\S+)(:|\s*\()/},{token:["text","keyword","text","entity.name.function"],regex:/(^\s*)(call)(\s+)(\S+)/},{token:"comment",regex:/(^\s*#|;).*$/},{token:"text",regex:/\s+/}],form:[{token:["keyword","text","constant.numeric"],regex:/((?:optionmenu|choice)\s+)(\S+:\s+)([0-9]+)/},{token:["keyword","constant.numeric"],regex:/((?:option|button)\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/},{token:["keyword","string"],regex:/((?:option|button)\s+)(.*)/},{token:["keyword","text","string"],regex:/((?:sentence|text)\s+)(\S+\s*)(.*)/},{token:["keyword","text","string","invalid.illegal"],regex:/(word\s+)(\S+\s*)(\S+)?(\s.*)?/},{token:["keyword","text","constant.language"],regex:/(boolean\s+)(\S+\s*)(0|1|"?(?:yes|no)"?)/},{token:["keyword","text","constant.numeric"],regex:/((?:real|natural|positive|integer)\s+)(\S+\s*)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b)/},{token:["keyword","string"],regex:/(comment\s+)(.*)/},{token:"keyword",regex:"endform",next:"start"}],"for":[{token:["keyword","text","constant.numeric","text"],regex:/(from|to)(\s+)([+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?)(\s*)/},{token:["keyword","text"],regex:/(from|to)(\s+\S+\s*)/},{token:"text",regex:/$/,next:"start"}],brokenstring:[{token:["text","string"],regex:/(\s*\.{3})([^"]*)/},{token:"string",regex:/"/,next:"start"}]}};r.inherits(s,i),t.PraatHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),ace.define("ace/mode/praat",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/praat_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./praat_highlight_rules").PraatHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("./folding/cstyle").FoldMode,f=function(){this.HighlightRules=s,this.$outdent=new o};r.inherits(f,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[\:]\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/praat"}.call(f.prototype),t.Mode=f})
Third9/jsdelivr
files/ace/1.1.6/noconflict/mode-praat.js
JavaScript
mit
9,179
/** * @license jqGrid Icelandic Translation * jtm@hi.is Univercity of Iceland * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html **/ /*jslint white: true */ /*global jQuery */ (function (factory) { "use strict"; if (typeof define === "function" && define.amd) { // AMD. Register as an anonymous module. define(["jquery"], factory); } else if (typeof exports === "object") { // Node/CommonJS factory(require("jquery")); } else { // Browser globals factory(jQuery); } }(function ($) { "use strict"; var locInfo = { isRTL: false, defaults: { recordtext: "Skoða {0} - {1} af {2}", emptyrecords: "Engar færslur", loadtext: "Hleður...", pgtext: "Síða {0} af {1}", pgfirst: "First Page", pglast: "Last Page", pgnext: "Next Page", pgprev: "Previous Page", pgrecs: "Records per Page", showhide: "Toggle Expand Collapse Grid", savetext: "Vistar..." }, search: { caption: "Leita...", Find: "Leita", Reset: "Endursetja", odata: [ { oper: "eq", text: "sama og" }, { oper: "ne", text: "ekki sama og" }, { oper: "lt", text: "minna en" }, { oper: "le", text: "minna eða jafnt og" }, { oper: "gt", text: "stærra en" }, { oper: "ge", text: "stærra eða jafnt og" }, { oper: "bw", text: "byrjar á" }, { oper: "bn", text: "byrjar ekki á" }, { oper: "in", text: "er í" }, { oper: "ni", text: "er ekki í" }, { oper: "ew", text: "endar á" }, { oper: "en", text: "endar ekki á" }, { oper: "cn", text: "inniheldur" }, { oper: "nc", text: "inniheldur ekki" }, { oper: "nu", text: "is null" }, { oper: "nn", text: "is not null" } ], groupOps: [ { op: "AND", text: "allt" }, { op: "OR", text: "eða" } ], addGroupTitle: "Add subgroup", deleteGroupTitle: "Delete group", addRuleTitle: "Add rule", deleteRuleTitle: "Delete rule", operandTitle: "Click to select search operation.", resetTitle: "Reset Search Value" }, edit: { addCaption: "Bæta við færslu", editCaption: "Breyta færslu", bSubmit: "Vista", bCancel: "Hætta við", bClose: "Loka", saveData: "Gögn hafa breyst! Vista breytingar?", bYes: "Já", bNo: "Nei", bExit: "Hætta við", msg: { required: "Reitur er nauðsynlegur", number: "Vinsamlega settu inn tölu", minValue: "gildi verður að vera meira en eða jafnt og ", maxValue: "gildi verður að vera minna en eða jafnt og ", email: "er ekki löglegt email", integer: "Vinsamlega settu inn tölu", date: "Vinsamlega setti inn dagsetningu", url: "er ekki löglegt URL. Vantar ('http://' eða 'https://')", nodefined: " er ekki skilgreint!", novalue: " skilagildi nauðsynlegt!", customarray: "Fall skal skila fylki!", customfcheck: "Fall skal vera skilgreint!" } }, view: { caption: "Skoða færslu", bClose: "Loka" }, del: { caption: "Eyða", msg: "Eyða völdum færslum ?", bSubmit: "Eyða", bCancel: "Hætta við" }, nav: { edittext: "", edittitle: "Breyta færslu", addtext: "", addtitle: "Ný færsla", deltext: "", deltitle: "Eyða færslu", searchtext: "", searchtitle: "Leita", refreshtext: "", refreshtitle: "Endurhlaða", alertcap: "Viðvörun", alerttext: "Vinsamlega veldu færslu", viewtext: "", viewtitle: "Skoða valda færslu", savetext: "", savetitle: "Save row", canceltext: "", canceltitle: "Cancel row editing" }, col: { caption: "Sýna / fela dálka", bSubmit: "Vista", bCancel: "Hætta við" }, errors: { errcap: "Villa", nourl: "Vantar slóð", norecords: "Engar færslur valdar", model: "Lengd colNames <> colModel!" }, formatter: { integer: { thousandsSeparator: " ", defaultValue: "0" }, number: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: "0.00" }, currency: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix: "", defaultValue: "0.00" }, date: { dayNames: [ "Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur" ], monthNames: [ "Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Oct", "Nóv", "Des", "Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júný", "Júlý", "Ágúst", "September", "Október", "Nóvember", "Desember" ], AmPm: ["am", "pm", "AM", "PM"], S: function (j) { return j < 11 || j > 13 ? ["st", "nd", "rd", "th"][Math.min((j - 1) % 10, 3)] : "th"; }, srcformat: "Y-m-d", newformat: "d/m/Y", masks: { ShortDate: "n/j/Y", LongDate: "l, F d, Y", FullDateTime: "l, F d, Y g:i:s A", MonthDay: "F d", ShortTime: "g:i A", LongTime: "g:i:s A", YearMonth: "F, Y" } } } }; $.jgrid = $.jgrid || {}; $.extend(true, $.jgrid, { defaults: { locale: "is" }, locales: { // In general the property name is free, but it's recommended to use the names based on // http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry // http://rishida.net/utils/subtags/ and RFC 5646. See Appendix A of RFC 5646 for examples. // One can use the lang attribute to specify language tags in HTML, and the xml:lang attribute for XML // if it exists. See http://www.w3.org/International/articles/language-tags/#extlang is: $.extend({}, locInfo, { name: "íslenska", nameEnglish: "Icelandic" }), "is-IS": $.extend({}, locInfo, { name: "íslenska (Ísland)", nameEnglish: "Icelandic (Iceland)" }) } }); }));
jonobr1/cdnjs
ajax/libs/free-jqgrid/4.12.0/js/i18n/grid.locale-is.js
JavaScript
mit
5,796
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>SB Admin 2 - Bootstrap Admin Theme</title> <!-- Bootstrap Core CSS --> <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <!-- MetisMenu CSS --> <link href="../bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="../dist/css/sb-admin-2.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">SB Admin v2.0</a> </div> <!-- /.navbar-header --> <ul class="nav navbar-top-links navbar-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-messages"> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <strong>John Smith</strong> <span class="pull-right text-muted"> <em>Yesterday</em> </span> </div> <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>Read All Messages</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-messages --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-tasks"> <li> <a href="#"> <div> <p> <strong>Task 1</strong> <span class="pull-right text-muted">40% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"> <span class="sr-only">40% Complete (success)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 2</strong> <span class="pull-right text-muted">20% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"> <span class="sr-only">20% Complete</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 3</strong> <span class="pull-right text-muted">60% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"> <span class="sr-only">60% Complete (warning)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <p> <strong>Task 4</strong> <span class="pull-right text-muted">80% Complete</span> </p> <div class="progress progress-striped active"> <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"> <span class="sr-only">80% Complete (danger)</span> </div> </div> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>See All Tasks</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-tasks --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-alerts"> <li> <a href="#"> <div> <i class="fa fa-comment fa-fw"></i> New Comment <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-twitter fa-fw"></i> 3 New Followers <span class="pull-right text-muted small">12 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-envelope fa-fw"></i> Message Sent <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-tasks fa-fw"></i> New Task <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a href="#"> <div> <i class="fa fa-upload fa-fw"></i> Server Rebooted <span class="pull-right text-muted small">4 minutes ago</span> </div> </a> </li> <li class="divider"></li> <li> <a class="text-center" href="#"> <strong>See All Alerts</strong> <i class="fa fa-angle-right"></i> </a> </li> </ul> <!-- /.dropdown-alerts --> </li> <!-- /.dropdown --> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i> </a> <ul class="dropdown-menu dropdown-user"> <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a> </li> <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a> </li> <li class="divider"></li> <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a> </li> </ul> <!-- /.dropdown-user --> </li> <!-- /.dropdown --> </ul> <!-- /.navbar-top-links --> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse"> <ul class="nav" id="side-menu"> <li class="sidebar-search"> <div class="input-group custom-search-form"> <input type="text" class="form-control" placeholder="Search..."> <span class="input-group-btn"> <button class="btn btn-default" type="button"> <i class="fa fa-search"></i> </button> </span> </div> <!-- /input-group --> </li> <li> <a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a> </li> <li> <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="flot.html">Flot Charts</a> </li> <li> <a href="morris.html">Morris.js Charts</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a> </li> <li> <a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a> </li> <li> <a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="panels-wells.html">Panels and Wells</a> </li> <li> <a href="buttons.html">Buttons</a> </li> <li> <a href="notifications.html">Notifications</a> </li> <li> <a href="typography.html">Typography</a> </li> <li> <a href="icons.html"> Icons</a> </li> <li> <a href="grid.html">Grid</a> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-sitemap fa-fw"></i> Multi-Level Dropdown<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="#">Second Level Item</a> </li> <li> <a href="#">Second Level Item</a> </li> <li> <a href="#">Third Level <span class="fa arrow"></span></a> <ul class="nav nav-third-level"> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> <li> <a href="#">Third Level Item</a> </li> </ul> <!-- /.nav-third-level --> </li> </ul> <!-- /.nav-second-level --> </li> <li> <a href="#"><i class="fa fa-files-o fa-fw"></i> Sample Pages<span class="fa arrow"></span></a> <ul class="nav nav-second-level"> <li> <a href="blank.html">Blank Page</a> </li> <li> <a href="login.html">Login Page</a> </li> </ul> <!-- /.nav-second-level --> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Grid</h1> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3>Grid options</h3> <p>See how aspects of the Bootstrap grid system work across multiple devices with a handy table.</p> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead> <tr> <th></th> <th> Extra small devices <small>Phones (&lt;768px)</small> </th> <th> Small devices <small>Tablets (&ge;768px)</small> </th> <th> Medium devices <small>Desktops (&ge;992px)</small> </th> <th> Large devices <small>Desktops (&ge;1200px)</small> </th> </tr> </thead> <tbody> <tr> <th>Grid behavior</th> <td>Horizontal at all times</td> <td colspan="3">Collapsed to start, horizontal above breakpoints</td> </tr> <tr> <th>Max container width</th> <td>None (auto)</td> <td>750px</td> <td>970px</td> <td>1170px</td> </tr> <tr> <th>Class prefix</th> <td> <code>.col-xs-</code> </td> <td> <code>.col-sm-</code> </td> <td> <code>.col-md-</code> </td> <td> <code>.col-lg-</code> </td> </tr> <tr> <th># of columns</th> <td colspan="4">12</td> </tr> <tr> <th>Max column width</th> <td class="text-muted">Auto</td> <td>60px</td> <td>78px</td> <td>95px</td> </tr> <tr> <th>Gutter width</th> <td colspan="4">30px (15px on each side of a column)</td> </tr> <tr> <th>Nestable</th> <td colspan="4">Yes</td> </tr> <tr> <th>Offsets</th> <td colspan="4">Yes</td> </tr> <tr> <th>Column ordering</th> <td colspan="4">Yes</td> </tr> </tbody> </table> </div> <p>Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any <code>.col-md-</code> class to an element will not only affect its styling on medium devices but also on large devices if a <code>.col-lg-</code> class is not present.</p> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3>Example: Stacked-to-horizontal</h3> <p>Using a single set of <code>.col-md-*</code> grid classes, you can create a default grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any <code>.row</code>.</p> <div class="row show-grid"> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> </div> <div class="row show-grid"> <div class="col-md-8">.col-md-8</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row show-grid"> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> <div class="col-md-4">.col-md-4</div> </div> <div class="row show-grid"> <div class="col-md-6">.col-md-6</div> <div class="col-md-6">.col-md-6</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3>Example: Mobile and desktop</h3> <p>Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding <code>.col-xs-*</code> <code>.col-md-*</code> to your columns. See the example below for a better idea of how it all works.</p> <div class="row show-grid"> <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6">.col-xs-6</div> <div class="col-xs-6">.col-xs-6</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3>Example: Mobile, tablet, desktops</h3> <p>Build on the previous example by creating even more dynamic and powerful layouts with tablet <code>.col-sm-*</code> classes.</p> <div class="row show-grid"> <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <div class="row show-grid"> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> <!-- Optional: clear the XS cols if their content doesn't match in height --> <div class="clearfix visible-xs"></div> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="grid-responsive-resets">Responsive column resets</h3> <p>With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a <code>.clearfix</code> and our <a href="#responsive-utilities">responsive utility classes</a>.</p> <div class="row show-grid"> <div class="col-xs-6 col-sm-3"> .col-xs-6 .col-sm-3 <br>Resize your viewport or check it out on your phone for an example. </div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> <!-- Add the extra clearfix for only the required viewport --> <div class="clearfix visible-xs"></div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="grid-offsetting">Offsetting columns</h3> <p>Move columns to the right using <code>.col-md-offset-*</code> classes. These classes increase the left margin of a column by <code>*</code> columns. For example, <code>.col-md-offset-4</code> moves <code>.col-md-4</code> over four columns.</p> <div class="row show-grid"> <div class="col-md-4">.col-md-4</div> <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div> </div> <div class="row show-grid"> <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div> <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div> </div> <div class="row show-grid"> <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="grid-nesting">Nesting columns</h3> <p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-md-*</code> columns within an existing <code>.col-md-*</code> column. Nested rows should include a set of columns that add up to 12.</p> <div class="row show-grid"> <div class="col-md-9"> Level 1: .col-md-9 <div class="row show-grid"> <div class="col-md-6"> Level 2: .col-md-6 </div> <div class="col-md-6"> Level 2: .col-md-6 </div> </div> </div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="grid-column-ordering">Column ordering</h3> <p>Easily change the order of our built-in grid columns with <code>.col-md-push-*</code> and <code>.col-md-pull-*</code> modifier classes.</p> <div class="row show-grid"> <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div> <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div> </div> </div> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> </div> <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="../bower_components/jquery/dist/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="../dist/js/sb-admin-2.js"></script> </body> </html>
rostojic/Lekarska
src/client/pages/grid.html
HTML
mit
35,985
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.barman=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ 'use strict'; var extend = _dereq_('./extend'), mix = _dereq_('./mix'), util = _dereq_('./util'), defineSpecialProperty = util.defineSpecialProperty, has = util.has, isFunction = util.isFunction, isArray = util.isArray, toArray = util.toArray; function Nil() {} defineSpecialProperty(Nil, '__super__', Nil.prototype); function ensureConstructor( parent, proto ) { if ( !has( proto, 'constructor' ) ) { proto.constructor = function() { parent.apply( this, arguments ); }; } else if ( !isFunction( proto.constructor ) ) { throw new TypeError( 'The constructor property must be a function' ); } return proto; } function _newclass( parent, traits, spec, classMethods ) { var proto = ensureConstructor(parent, mix( parent.prototype, traits, spec )), ctor = extend( proto.constructor, classMethods ); defineSpecialProperty( ctor, '__super__', parent.prototype ); defineSpecialProperty( ctor, 'super_', parent ); ctor.prototype = proto; ctor.extend = Nil.extend; return ctor; } function newclass() { var args = toArray( arguments ), parent = Nil, traits = []; if ( isFunction( args[ 0 ] ) ) { parent = args.shift(); } if ( isArray( args[ 0 ] ) ) { traits = args.shift(); } return _newclass( parent, traits, args[ 0 ], args[ 1 ] ); } Nil.extend = function() { var args = toArray( arguments ); args.unshift( this ); return newclass.apply( null, args ); }; module.exports = { newclass: newclass, Nil: Nil }; },{"./extend":3,"./mix":6,"./util":7}],2:[function(_dereq_,module,exports){ 'use strict'; var util = _dereq_('./util'), has = util.has, isUndefined = util.isUndefined; function cloneUsingObjectCreate( obj ) { if ( isUndefined( obj ) ) { return obj; } return Object.create( obj ); } function cloneUsingNew( obj ) { if ( isUndefined( obj ) ) { return obj; } function Empty() {} Empty.prototype = obj; return new Empty(); } var clone = has( Object, 'create' ) ? cloneUsingObjectCreate : cloneUsingNew; module.exports = clone; },{"./util":7}],3:[function(_dereq_,module,exports){ 'use strict'; var util = _dereq_('./util'), each = util.each, tail = util.tail; function extend( obj ) { each( tail( arguments ), function( source ) { if ( source ) { each( source, function( value, prop ) { obj[ prop ] = value; }); } }); return obj; } module.exports = extend; },{"./util":7}],4:[function(_dereq_,module,exports){ 'use strict'; var classes = _dereq_( './classes' ), merge = _dereq_( './merge' ); module.exports = { Nil: classes.Nil, newclass: classes.newclass, merge: merge, conflict: merge.conflict, required: merge.required, clone: _dereq_( './clone' ), extend: _dereq_( './extend' ), mix: _dereq_( './mix' ) }; },{"./classes":1,"./clone":2,"./extend":3,"./merge":5,"./mix":6}],5:[function(_dereq_,module,exports){ 'use strict'; var util = _dereq_('./util'), each = util.each, flatten = util.flatten, has = util.has, isUndefined = util.isUndefined; function required() { throw new Error('An implementation is required'); } function conflict() { throw new Error('This property was defined by multiple merged objects, override it with the proper implementation'); } function mapProperties( srcObj, iterator, result ) { each( srcObj, function( value, prop ) { result[ prop ] = iterator.call( this, value, prop ); }, result); return result; } function valueHasPrecedence( thisValue, value ) { return isUndefined( thisValue ) || thisValue === value || thisValue === required; } function mergeProperty( value, prop ) { /*jshint validthis:true */ var thisValue = has( this, prop ) ? this[ prop ] : undefined; if ( valueHasPrecedence( thisValue, value ) ) { return value; } else if ( value === required ) { return thisValue; } else { return conflict; } } function merge() { var result = {}; each( flatten( arguments ), function( obj ) { mapProperties( obj, mergeProperty, result ); } ); return result; } merge.required = required; merge.conflict = conflict; merge.assertNoConflict = function ( obj ) { var conflicts = []; each( obj, function( value, name ) { if ( value === merge.conflict ) { conflicts.push( name ); } }); if ( conflicts.length > 0 ) { throw new Error( 'There is a merge conflict for the following properties: ' + conflicts.sort().join( ',' ) ); } }; module.exports = merge; },{"./util":7}],6:[function(_dereq_,module,exports){ 'use strict'; var merge = _dereq_('./merge'), clone = _dereq_('./clone'), extend = _dereq_('./extend'), util = _dereq_('./util'), isArray = util.isArray, isObject = util.isObject, toArray = util.toArray; function _mix( parent, traits, spec ) { var result = extend( clone( parent ), merge( traits ), spec ); merge.assertNoConflict( result ); return result; } function mix() { var args = toArray( arguments ), parent = {}, traits = []; if ( args.length > 1 && isObject( args[ 0 ] ) && !isArray( args[ 0 ] ) ) { parent = args.shift(); } if ( isArray( args[ 0 ] ) ) { traits = args.shift(); } return _mix( parent, traits, args[ 0 ] ); } module.exports = mix; },{"./clone":2,"./extend":3,"./merge":5,"./util":7}],7:[function(_dereq_,module,exports){ 'use strict'; var ArrayProto = Array.prototype, nativeForEach = ArrayProto.forEach, slice = ArrayProto.slice; function isUndefined( value ) { return typeof value === 'undefined'; } function isFunction( value ) { return typeof value === 'function'; } function has( object, property ) { return object ? Object.prototype.hasOwnProperty.call( object, property ) : false; } function isObject( value ) { return value === Object( value ); } function toArray( value ) { return slice.call( value ); } function tail( value ) { return slice.call( value, 1 ); } var JSCRIPT_NON_ENUMERABLE = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; function eachKeyStd( obj, func, context ) { for ( var key in obj ) { func.call( context, obj[ key ], key, obj ); } } function eachKeyFix( obj, func, context ) { var i, len; eachKeyStd( obj, func, context ); for ( i = 0, len = JSCRIPT_NON_ENUMERABLE.length; i < len; i++ ) { if ( has( obj, JSCRIPT_NON_ENUMERABLE[ i ] ) ) { func.call( context, obj[ JSCRIPT_NON_ENUMERABLE[ i ] ], JSCRIPT_NON_ENUMERABLE[ i ], obj ); } } } var enumObjectOverrides = (function() { var obj = { constructor: 1 }; for ( var key in obj ) { if ( has( obj, key ) ) { return true; } } return false; })(), eachKey = enumObjectOverrides ? eachKeyStd : eachKeyFix; function each( obj, func, context ) { var i, len; if ( isUndefined( obj ) || obj === null ) { return; } if ( nativeForEach && obj.forEach === nativeForEach ) { obj.forEach( func, context ); } else if ( obj.length === +obj.length ) { for ( i = 0, len = obj.length; i < len; i++ ) { func.call( context, obj[ i ], i, obj ); } } else { eachKey( obj, func, context ); } } function defineSpecialPropertyStd( obj, name, value ) { Object.defineProperty( obj, name, { value: value, writable: false, enumerable: false, configurable: false } ); return obj; } function defineSpecialPropertyFix( obj, name, value ) { obj[ name ] = value; return obj; } var defineSpecialProperty = isFunction( Object.getOwnPropertyNames ) ? defineSpecialPropertyStd : defineSpecialPropertyFix; var isArray = isFunction( Array.isArray ) ? Array.isArray : function( value ) { var toString = Object.prototype.toString; return toString.call( value ) === '[object Array]'; }; function _flatten( result, array ) { var length = array.length, value = null; for (var i = 0; i < length; i++) { value = array[i]; if ( isArray(value) ) { _flatten( result, value ); } else { result.push(value); } } return result; } function flatten( array ) { return _flatten([], array); } module.exports = { defineSpecialProperty: defineSpecialProperty, each: each, flatten: flatten, has: has, isArray: isArray, isFunction: isFunction, isObject: isObject, isUndefined: isUndefined, tail: tail, toArray: toArray }; },{}]},{},[4]) (4) });
Timbioz/cdnjs
ajax/libs/barman/0.4.2/barman.js
JavaScript
mit
9,226
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:ng="http://angularjs.org" ng-app> <head> <link rel="stylesheet" type="text/css" href="style.css"/> <script type="text/javascript" src="../../../src/angular-bootstrap.js"></script> </head> <body ng-init="$window.$scope = this"> <table> <tr> <th width="330">Description</th> <th>Test</th> <th>Result</th> </tr> <tr><th colspan="3">Input text field</th></tr> <tr> <td>basic</td> <td id="text-basic-box"> <input type="text" ng-model="text.basic"/> </td> <td>text.basic={{text.basic}}</td> </tr> <tr> <td>password</td> <td><input type="password" ng-model="text.password" /></td> <td>text.password={{text.password}}</td> </tr> <tr> <td>hidden</td> <td><input type="hidden" ng-model="text.hidden" ng-init="text.hidden='hiddenValue'" /></td> <td>text.hidden={{text.hidden}}</td> </tr> <tr><th colspan="3">Input selection field</th></tr> <tr id="gender-box" ng-init="gender='male'"> <td>radio</td> <td> <input type="radio" ng-model="gender" value="female"/> Female <br/> <input type="radio" ng-model="gender" value="male"/> Male </td> <td>gender={{gender}}</td> </tr> <tr> <td>checkbox</td> <td ng-init="checkbox={'tea': true, 'coffee': false}"> <input type="checkbox" ng-model="checkbox.tea" value="on"/> Tea<br/> <input type="checkbox" ng-model="checkbox.coffee" value="on"/> Coffe </td> <td> <pre>checkbox={{checkbox}}</pre> </td> </tr> <tr> <td>select</td> <td> <select ng-model="select"> <option>A</option> <option>B</option> <option>C</option> </select> </td> <td>select={{select}}</td> </tr> <tr> <td>multiselect</td> <td> <select ng-model="multiselect" multiple> <option>A</option> <option>B</option> <option>C</option> </select> </td> <td>multiselect={{multiselect}}</td> </tr> <tr><th colspan="3">Buttons</th></tr> <tr> <td>ng-change<br/>ng-click</td> <td ng-init="button.count = 0; form.count = 0;"> <form ng-submit="form.count = form.count + 1"> <input type="button" value="button" ng-click="button.count = button.count + 1"/> <br/> <input type="submit" value="submit input" ng-click="button.count = button.count + 1"/><br/> <button type="submit">submit button</button> <input type="image" src="" ng-click="button.count = button.count + 1"/><br/> <a href="" ng-click="button.count = button.count + 1">action</a> </form> </td> <td>button={{button}} form={{form}}</td> </tr> <tr><th colspan="3">Repeaters</th></tr> <tr id="repeater-row"> <td>ng-repeat</td> <td> <ul> <li ng-repeat="name in ['misko', 'adam']">{{name}}</li> </ul> </td> <td></td> </tr> </table> </body> </html>
spencerapplegate/angular.js
test/ngScenario/e2e/widgets.html
HTML
mit
3,347
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Bold/LetterlikeSymbols.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS["STIXGeneral-bold"],{8450:[691,19,727,45,672],8453:[688,12,873,38,835],8455:[691,19,699,65,662],8460:[701,205,843,42,795],8461:[676,0,768,75,693],8462:[685,10,576,50,543],8463:[685,10,576,50,543],8465:[701,25,790,54,735],8467:[699,14,500,43,632],8469:[676,0,738,75,663],8470:[691,18,1093,10,1042],8471:[691,19,747,26,721],8472:[541,219,850,55,822],8473:[676,0,700,75,670],8474:[691,64,797,45,747],8476:[701,25,884,50,841],8477:[676,0,783,75,758],8478:[676,101,722,26,726],8482:[676,-271,1000,24,977],8484:[691,0,777,52,727],8485:[676,205,448,21,424],8486:[692,0,758,35,723],8487:[674,18,758,35,723],8488:[701,195,755,44,703],8489:[475,0,312,9,244],8491:[920,0,722,9,689],8493:[701,19,773,54,731],8498:[676,0,616,48,546],8501:[694,34,766,76,690],8502:[694,34,703,60,659],8503:[694,34,562,71,493],8504:[694,34,599,40,559],8508:[461,11,804,55,759],8509:[486,203,646,23,624],8510:[676,0,497,75,643],8511:[676,0,768,75,693],8512:[773,269,976,36,952],8523:[690,17,833,61,788]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Bold/LetterlikeSymbols.js");
joscha/cdnjs
ajax/libs/mathjax/2.3/jax/output/HTML-CSS/fonts/STIX/General/Bold/LetterlikeSymbols.js
JavaScript
mit
1,846
YUI.add("axis-base",function(e,t){function r(){}var n=e.Lang;r.ATTRS={styles:{getter:function(){return this._styles=this._styles||this._getDefaultStyles(),this._styles},setter:function(e){this._styles=this._setStyles(e)}},graphic:{}},r.NAME="renderer",r.prototype={_styles:null,_setStyles:function(e){var t=this.get("styles");return this._mergeStyles(e,t)},_mergeStyles:function(t,r){r||(r={});var i=e.merge(r,{});return e.Object.each(t,function(e,t){r.hasOwnProperty(t)&&n.isObject(e)&&!n.isFunction(e)&&!n.isArray(e)?i[t]=this._mergeStyles(e,r[t]):i[t]=e},this),i},_copyObject:function(e){var t={},r,i;for(r in e)e.hasOwnProperty(r)&&(i=e[r],typeof i=="object"&&!n.isArray(i)?t[r]=this._copyObject(i):t[r]=i);return t},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}}}},e.augment(r,e.Attribute),e.Renderer=r,e.AxisBase=e.Base.create("axisBase",e.Base,[e.Renderer],{initializer:function(){this.after("minimumChange",e.bind(this._keyChangeHandler,this)),this.after("maximumChange",e.bind(this._keyChangeHandler,this)),this.after("keysChange",this._keyChangeHandler),this.after("dataProviderChange",this._dataProviderChangeHandler)},getOrigin:function(){return this.get("minimum")},_dataProviderChangeHandler:function(){var e=this.get("keyCollection").concat(),t=this.get("keys"),n;if(t)for(n in t)t.hasOwnProperty(n)&&delete t[n];e&&e.length&&this.set("keys",e)},_updateMinAndMax:function(){},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:!0,_dataReady:!1,addKey:function(e){this.set("keys",e)},_getKeyArray:function(e,t){var n=0,r,i=[],s=t.length;for(;n<s;++n)r=t[n],i[n]=r[e];return i},_updateTotalData:function(){var e=this.get("keys"),t;this._data=[];for(t in e)e.hasOwnProperty(t)&&(this._data=this._data.concat(e[t]));this._updateTotalDataFlag=!1},removeKey:function(e){var t=this.get("keys");t.hasOwnProperty(e)&&(delete t[e],this._keyChangeHandler())},getKeyValueAt:function(e,t){var r=NaN,i=this.get("keys");return i[e]&&n.isNumber(parseFloat(i[e][t]))&&(r=i[e][t]),parseFloat(r)},getDataByKey:function(e){var t,r,i,s,o=this.get("keys");if(n.isArray(e)){t={},i=e.length;for(r=0;r<i;r+=1)s=e[r],o[s]&&(t[s]=this.getDataByKey(s))}else o[e]?t=o[e]:t=null;return t},getTotalMajorUnits:function(){var e,t=this.get("styles").majorUnit;return e=t.count,e},getEdgeOffset:function(e,t){var n;return this.get("calculateEdgeOffset")?n=t/e/2:n=0,n},_keyChangeHandler:function(){this._updateMinAndMax(),this._updateTotalDataFlag=!0,this.fire("dataUpdate")},_getDefaultStyles:function(){var e={majorUnit:{determinant:"count",count:11,distance:75}};return e},_maximumGetter:function(){var e=this.get("dataMaximum"),t=this.get("minimum");return t===0&&e===0&&(e=10),n.isNumber(this._setMaximum)&&(e=this._setMaximum),parseFloat(e)},_maximumSetter:function(e){return this._setMaximum=parseFloat(e),e},_minimumGetter:function(){var e=this.get("dataMinimum");return n.isNumber(this._setMinimum)&&(e=this._setMinimum),parseFloat(e)},_minimumSetter:function(e){return this._setMinimum=parseFloat(e),e},_getSetMax:function(){return n.isNumber(this._setMaximum)},_getCoordsFromValues:function(e,t,n,r,i,s){var o,u=[],a=r.length;for(o=0;o<a;o+=1)u.push(this._getCoordFromValue.apply(this,[e,t,n,r[o],i,s]));return u},_getDataValuesByCount:function(e,t,n){var r=[],i=t,s=e-1,o=n-t,u=o/s,a;for(a=0;a<s;a+=1)r.push(i),i+=u;return r.push(n),r},_getSetMin:function(){return n.isNumber(this._setMinimum)}},{ATTRS:{calculateEdgeOffset:{value:!1},labelFunction:{valueFn:function(){return this.formatLabel}},keys:{value:{},setter:function(e){var t={},r,i,s=this.get("dataProvider");if(n.isArray(e)){i=e.length;for(r=0;r<i;++r)t[e[r]]=this._getKeyArray(e[r],s)}else if(n.isString(e))t=this.get("keys"),t[e]=this._getKeyArray(e,s);else for(r in e)e.hasOwnProperty(r)&&(t[r]=this._getKeyArray(r,s));return this._updateTotalDataFlag=!0,t}},type:{readOnly:!0,getter:function(){return this._type}},dataProvider:{setter:function(e){return e}},dataMaximum:{getter:function(){return n.isNumber(this._dataMaximum)||this._updateMinAndMax(),this._dataMaximum}},maximum:{lazyAdd:!1,getter:"_maximumGetter",setter:"_maximumSetter"},dataMinimum:{getter:function(){return n.isNumber(this._dataMinimum)||this._updateMinAndMax(),this._dataMinimum}},minimum:{lazyAdd:!1,getter:"_minimumGetter",setter:"_minimumSetter"},setMax:{readOnly:!0,getter:"_getSetMax"},setMin:{readOnly:!0,getter:"_getSetMin"},data:{getter:function(){return(!this._data||this._updateTotalDataFlag)&&this._updateTotalData(),this._data}},keyCollection:{getter:function(){var e=this.get("keys"),t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},readOnly:!0},labelFunctionScope:{}}})},"@VERSION@",{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]});
tjbp/cdnjs
ajax/libs/yui/3.14.0/axis-base/axis-base-min.js
JavaScript
mit
4,801
// moment.js language configuration // language : italian (it) // author : Lorenzo : https://github.com/aliem (function () { var lang = { months : "Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre".split("_"), monthsShort : "Gen_Feb_Mar_Apr_Mag_Giu_Lug_Ago_Set_Ott_Nov_Dic".split("_"), weekdays : "Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"), weekdaysShort : "Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"), weekdaysMin : "D_L_Ma_Me_G_V_S".split("_"), longDateFormat : { LT : "HH:mm", L : "DD/MM/YYYY", LL : "D MMMM YYYY", LLL : "D MMMM YYYY LT", LLLL : "dddd, D MMMM YYYY LT" }, calendar : { sameDay: '[Oggi alle] LT', nextDay: '[Domani alle] LT', nextWeek: 'dddd [alle] LT', lastDay: '[Ieri alle] LT', lastWeek: '[lo scorso] dddd [alle] LT', sameElse: 'L' }, relativeTime : { future : "in %s", past : "%s fa", s : "secondi", m : "un minuto", mm : "%d minuti", h : "un'ora", hh : "%d ore", d : "un giorno", dd : "%d giorni", M : "un mese", MM : "%d mesi", y : "un anno", yy : "%d anni" }, ordinal: function () { return 'º'; } }; // Node if (typeof module !== 'undefined' && module.exports) { module.exports = lang; } // Browser if (typeof window !== 'undefined' && this.moment && this.moment.lang) { this.moment.lang('it', lang); } }());
rwjblue/cdnjs
ajax/libs/moment.js/1.7.1/lang/it.js
JavaScript
mit
1,917
YUI.add("datatable-keynav",function(e,t){var n=e.Array.each,r=function(){};r.KEY_NAMES={8:"backspace",9:"tab",13:"enter",27:"esc",32:"space",33:"pgup",34:"pgdown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},r.ARIA_ACTIONS={left:"_keyMoveLeft",right:"_keyMoveRight",up:"_keyMoveUp",down:"_keyMoveDown",home:"_keyMoveRowStart",end:"_keyMoveRowEnd",pgup:"_keyMoveColTop",pgdown:"_keyMoveColBottom"},r.ATTRS={focusedCell:{setter:"_focusedCellSetter"},keyIntoHeaders:{value:!0}},e.mix(r.prototype,{keyActions:null,_keyNavSubscr:null,_keyNavTHead:null,_keyNavNestedHeaders:!1,_keyNavColPrefix:null,_keyNavColRegExp:null,initializer:function(){this.onceAfter("render",this._afterKeyNavRender),this._keyNavSubscr=[this.after("focusedCellChange",this._afterKeyNavFocusedCellChange),this.after("focusedChange",this._afterKeyNavFocusedChange)],this._keyNavColPrefix=this.getClassName("col",""),this._keyNavColRegExp=new RegExp(this._keyNavColPrefix+"(.+?)(\\s|$)"),this.keyActions=e.clone(r.ARIA_ACTIONS)},destructor:function(){n(this._keyNavSubscr,function(e){e&&e.detach&&e.detach()})},_afterKeyNavFocusedCellChange:function(e){var t=e.newVal,n=e.prevVal;n&&n.set("tabIndex",-1),t?(t.set("tabIndex",0),this.get("focused")&&(t.scrollIntoView(),t.focus())):this.set("focused",null)},_afterKeyNavFocusedChange:function(e){var t=this.get("focusedCell");e.newVal?t?(t.scrollIntoView(),t.focus()):this._keyMoveFirst():t&&t.blur()},_afterKeyNavRender:function(){var e=this.get("contentBox");this._keyNavSubscr.push(e.on("keydown",this._onKeyNavKeyDown,this),e.on("click",this._onKeyNavClick,this)),this._keyNavTHead=(this._yScrollHeader||this._tableNode).one("thead"),this._keyMoveFirst(),this._keyNavNestedHeaders=this.get("columns").length!==this.head.theadNode.all("th").size()},_onKeyNavClick:function(e){var t=e.target.ancestor(this.get("keyIntoHeaders")?"td, th":"td",!0);t&&(this.focus(),this.set("focusedCell",t))},_onKeyNavKeyDown:function(e){var t=e.keyCode,i=r.KEY_NAMES[t]||t,s;n(["alt","ctrl","meta","shift"],function(n){e[n+"Key"]&&(t=n+"-"+t,i=n+"-"+i)}),s=this.keyActions[t]||this.keyActions[i],typeof s=="string"?this[s]?this[s].call(this,e):this._keyNavFireEvent(s,e):s.call(this,e)},_keyNavFireEvent:function(e,t){var n=t.target.ancestor("td, th",!0);n&&this.fire(e,{cell:n,row:n.ancestor("tr"),record:this.getRecord(n),column:this.getColumn(n.get("cellIndex"))},t)},_keyMoveFirst:function(){this.set("focusedCell",this.get("keyIntoHeaders")?this._keyNavTHead.one("th"):this._tbodyNode.one("td"),{src:"keyNav"})},_keyMoveLeft:function(e){var t=this.get("focusedCell"),n=t.get("cellIndex"),r=t.ancestor();e.preventDefault();if(n===0)return;t=r.get("cells").item(n-1),this.set("focusedCell",t,{src:"keyNav"})},_keyMoveRight:function(e){var t=this.get("focusedCell"),n=t.ancestor("tr"),r=n.ancestor(),i=r===this._keyNavTHead,s,o;e.preventDefault(),s=t.next();if(n.get("rowIndex")!==0&&i&&this._keyNavNestedHeaders)if(s)t=s;else{o=this._getTHParent(t);if(!o||!o.next())return;t=o.next()}else{if(!s)return;t=s}this.set("focusedCell",t,{src:"keyNav"})},_keyMoveUp:function(e){var t=this.get("focusedCell"),n=t.get("cellIndex"),r=t.ancestor("tr"),i=r.get("rowIndex"),s=r.ancestor(),o=s.get("rows"),u=s===this._keyNavTHead,a;e.preventDefault(),u||(i-=s.get("firstChild").get("rowIndex"));if(i===0){if(u||!this.get("keyIntoHeaders"))return;s=this._keyNavTHead,o=s.get("rows"),this._keyNavNestedHeaders?(key=this._getCellColumnName(t),t=s.one("."+this._keyNavColPrefix+key),n=t.get("cellIndex"),r=t.ancestor("tr")):(r=s.get("firstChild"),t=r.get("cells").item(n))}else u&&this._keyNavNestedHeaders?(key=this._getCellColumnName(t),a=this._columnMap[key]._parent,a&&(t=s.one("#"+a.id))):(r=o.item(i-1),t=r.get("cells").item(n));this.set("focusedCell",t)},_keyMoveDown:function(e){var t=this.get("focusedCell"),n=t.get("cellIndex"),r=t.ancestor("tr"),i=r.get("rowIndex")+1,s=r.ancestor(),o=s===this._keyNavTHead,u=this.body&&this.body.tbodyNode,a=s.get("rows"),f,l;e.preventDefault(),o&&(this._keyNavNestedHeaders?(f=this._getCellColumnName(t),l=this._columnMap[f].children,i+=(t.getAttribute("rowspan")||1)-1,l?t=s.one("#"+l[0].id):(t=u.one("."+this._keyNavColPrefix+f),s=u,a=s.get("rows")),n=t.get("cellIndex")):(r=u.one("tr"),t=r.get("cells").item(n))),i-=a.item(0).get("rowIndex");if(i>=a.size()){if(!o)return;s=u,r=s.one("tr")}else r=a.item(i);this.set("focusedCell",r.get("cells").item(n))},_keyMoveRowStart:function(e){var t=this.get("focusedCell").ancestor();this.set("focusedCell",t.get("firstChild"),{src:"keyNav"}),e.preventDefault()},_keyMoveRowEnd:function(e){var t=this.get("focusedCell").ancestor();this.set("focusedCell",t.get("lastChild"),{src:"keyNav"}),e.preventDefault()},_keyMoveColTop:function(e){var t=this.get("focusedCell"),n=t.get("cellIndex"),r,i;e.preventDefault();if(this._keyNavNestedHeaders&&this.get("keyIntoHeaders")){r=this._getCellColumnName(t),i=this._columnMap[r];while(i._parent)i=i._parent;t=this._keyNavTHead.one("#"+i.id)}else t=(this.get("keyIntoHeaders")?this._keyNavTHead:this._tbodyNode).get("firstChild").get("cells").item(n);this.set("focusedCell",t,{src:"keyNav"})},_keyMoveColBottom:function(e){var t=this.get("focusedCell"),n=t.get("cellIndex");this.set("focusedCell",this._tbodyNode.get("lastChild").get("cells").item(n),{src:"keyNav"}),e.preventDefault()},_focusedCellSetter:function(t){if(t instanceof e.Node){var n=t.get("tagName").toUpperCase();if((n==="TD"||n==="TH")&&this.get("contentBox").contains(t))return t}else if(t===null)return t;return e.Attribute.INVALID_VALUE},_getTHParent:function(e){var t=this._getCellColumnName(e),n=this._columnMap[t]&&this._columnMap[t]._parent;return n?e.ancestor().ancestor().one("."+this._keyNavColPrefix+n.key):null},_getCellColumnName:function(e){return e.getData("yui3-col-id")||this._keyNavColRegExp.exec(e.get("className"))[1]}}),e.DataTable.KeyNav=r,e.Base.mix(e.DataTable,[r])},"@VERSION@" ,{requires:["datatable-base"]});
menuka94/cdnjs
ajax/libs/yui/3.18.1/datatable-keynav/datatable-keynav-min.js
JavaScript
mit
6,040
/*! * Select2 4.0.3 * https://select2.github.io * * Released under the MIT license * https://github.com/select2/select2/blob/master/LICENSE.md */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function (jQuery) { // This is needed so we can catch the AMD loader configuration and use it // The inner file should be wrapped (by `banner.start.js`) in a function that // returns the AMD loader references. var S2 = (function () { // Restore the Select2 AMD loader so it can be used // Needed mostly in the language files, where the loader is not inserted if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { var S2 = jQuery.fn.select2.amd; } var S2;(function () { if (!S2 || !S2.requirejs) { if (!S2) { S2 = {}; } else { require = S2; } /** * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*jslint sloppy: true */ /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name && name.charAt(0) === ".") { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { name = name.split('/'); lastIndex = name.length - 1; // Node .js allowance: if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } //Lop off the last part of baseParts, so that . matches the //"directory" and not name of the baseName's module. For instance, //baseName of "one/two/three", maps to "one/two/three.js", but we //want the directory, "one/two" for this normalization. name = baseParts.slice(0, baseParts.length - 1).concat(name); //start trimDots for (i = 0; i < name.length; i += 1) { part = name[i]; if (part === ".") { name.splice(i, 1); i -= 1; } else if (part === "..") { if (i === 1 && (name[2] === '..' || name[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join("/"); } else if (name.indexOf('./') === 0) { // No baseName, so this is ID is resolved relative // to baseUrl, pull off the leading dot. name = name.substring(2); } } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only //one arg, it is the array form without a callback. Insert //a null so that the following concat is correct. if (typeof args[0] !== 'string' && args.length === 1) { args.push(null); } return req.apply(undef, args.concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relName) { var plugin, parts = splitPrefix(name), prefix = parts[0]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relName)); } else { name = normalize(name, relName); } } else { name = normalize(name, relName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relName); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, callback).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { if (typeof name !== 'string') { throw new Error('See almond README: incorrect module build, no module name'); } //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); S2.requirejs = requirejs;S2.require = require;S2.define = define; } }()); S2.define("almond", function(){}); /* global jQuery:false, $:false */ S2.define('jquery',[],function () { var _$ = jQuery || $; if (_$ == null && console && console.error) { console.error( 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.' ); } return _$; }); S2.define('select2/utils',[ 'jquery' ], function ($) { var Utils = {}; Utils.Extend = function (ChildClass, SuperClass) { var __hasProp = {}.hasOwnProperty; function BaseConstructor () { this.constructor = ChildClass; } for (var key in SuperClass) { if (__hasProp.call(SuperClass, key)) { ChildClass[key] = SuperClass[key]; } } BaseConstructor.prototype = SuperClass.prototype; ChildClass.prototype = new BaseConstructor(); ChildClass.__super__ = SuperClass.prototype; return ChildClass; }; function getMethods (theClass) { var proto = theClass.prototype; var methods = []; for (var methodName in proto) { var m = proto[methodName]; if (typeof m !== 'function') { continue; } if (methodName === 'constructor') { continue; } methods.push(methodName); } return methods; } Utils.Decorate = function (SuperClass, DecoratorClass) { var decoratedMethods = getMethods(DecoratorClass); var superMethods = getMethods(SuperClass); function DecoratedClass () { var unshift = Array.prototype.unshift; var argCount = DecoratorClass.prototype.constructor.length; var calledConstructor = SuperClass.prototype.constructor; if (argCount > 0) { unshift.call(arguments, SuperClass.prototype.constructor); calledConstructor = DecoratorClass.prototype.constructor; } calledConstructor.apply(this, arguments); } DecoratorClass.displayName = SuperClass.displayName; function ctr () { this.constructor = DecoratedClass; } DecoratedClass.prototype = new ctr(); for (var m = 0; m < superMethods.length; m++) { var superMethod = superMethods[m]; DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod]; } var calledMethod = function (methodName) { // Stub out the original method if it's not decorating an actual method var originalMethod = function () {}; if (methodName in DecoratedClass.prototype) { originalMethod = DecoratedClass.prototype[methodName]; } var decoratedMethod = DecoratorClass.prototype[methodName]; return function () { var unshift = Array.prototype.unshift; unshift.call(arguments, originalMethod); return decoratedMethod.apply(this, arguments); }; }; for (var d = 0; d < decoratedMethods.length; d++) { var decoratedMethod = decoratedMethods[d]; DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); } return DecoratedClass; }; var Observable = function () { this.listeners = {}; }; Observable.prototype.on = function (event, callback) { this.listeners = this.listeners || {}; if (event in this.listeners) { this.listeners[event].push(callback); } else { this.listeners[event] = [callback]; } }; Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; // Params should always come in as an array if (params == null) { params = []; } // If there are no arguments to the event, use a temporary object if (params.length === 0) { params.push({}); } // Set the `_type` of the first object to the event params[0]._type = event; if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); } if ('*' in this.listeners) { this.invoke(this.listeners['*'], arguments); } }; Observable.prototype.invoke = function (listeners, params) { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].apply(this, params); } }; Utils.Observable = Observable; Utils.generateChars = function (length) { var chars = ''; for (var i = 0; i < length; i++) { var randomChar = Math.floor(Math.random() * 36); chars += randomChar.toString(36); } return chars; }; Utils.bind = function (func, context) { return function () { func.apply(context, arguments); }; }; Utils._convertData = function (data) { for (var originalKey in data) { var keys = originalKey.split('-'); var dataLevel = data; if (keys.length === 1) { continue; } for (var k = 0; k < keys.length; k++) { var key = keys[k]; // Lowercase the first letter // By default, dash-separated becomes camelCase key = key.substring(0, 1).toLowerCase() + key.substring(1); if (!(key in dataLevel)) { dataLevel[key] = {}; } if (k == keys.length - 1) { dataLevel[key] = data[originalKey]; } dataLevel = dataLevel[key]; } delete data[originalKey]; } return data; }; Utils.hasScroll = function (index, el) { // Adapted from the function created by @ShadowScripter // and adapted by @BillBarry on the Stack Exchange Code Review website. // The original code can be found at // http://codereview.stackexchange.com/q/13338 // and was designed to be used with the Sizzle selector engine. var $el = $(el); var overflowX = el.style.overflowX; var overflowY = el.style.overflowY; //Check both x and y declarations if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) { return false; } if (overflowX === 'scroll' || overflowY === 'scroll') { return true; } return ($el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth); }; Utils.escapeMarkup = function (markup) { var replaceMap = { '\\': '&#92;', '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;', '/': '&#47;' }; // Do not try to escape the markup if it's not a string if (typeof markup !== 'string') { return markup; } return String(markup).replace(/[&<>"'\/\\]/g, function (match) { return replaceMap[match]; }); }; // Append an array of jQuery nodes to a given element. Utils.appendMany = function ($element, $nodes) { // jQuery 1.7.x does not support $.fn.append() with an array // Fall back to a jQuery object collection using $.fn.add() if ($.fn.jquery.substr(0, 3) === '1.7') { var $jqNodes = $(); $.map($nodes, function (node) { $jqNodes = $jqNodes.add(node); }); $nodes = $jqNodes; } $element.append($nodes); }; return Utils; }); S2.define('select2/results',[ 'jquery', './utils' ], function ($, Utils) { function Results ($element, options, dataAdapter) { this.$element = $element; this.data = dataAdapter; this.options = options; Results.__super__.constructor.call(this); } Utils.Extend(Results, Utils.Observable); Results.prototype.render = function () { var $results = $( '<ul class="select2-results__options" role="tree"></ul>' ); if (this.options.get('multiple')) { $results.attr('aria-multiselectable', 'true'); } this.$results = $results; return $results; }; Results.prototype.clear = function () { this.$results.empty(); }; Results.prototype.displayMessage = function (params) { var escapeMarkup = this.options.get('escapeMarkup'); this.clear(); this.hideLoading(); var $message = $( '<li role="treeitem" aria-live="assertive"' + ' class="select2-results__option"></li>' ); var message = this.options.get('translations').get(params.message); $message.append( escapeMarkup( message(params.args) ) ); $message[0].className += ' select2-results__message'; this.$results.append($message); }; Results.prototype.hideMessages = function () { this.$results.find('.select2-results__message').remove(); }; Results.prototype.append = function (data) { this.hideLoading(); var $options = []; if (data.results == null || data.results.length === 0) { if (this.$results.children().length === 0) { this.trigger('results:message', { message: 'noResults' }); } return; } data.results = this.sort(data.results); for (var d = 0; d < data.results.length; d++) { var item = data.results[d]; var $option = this.option(item); $options.push($option); } this.$results.append($options); }; Results.prototype.position = function ($results, $dropdown) { var $resultsContainer = $dropdown.find('.select2-results'); $resultsContainer.append($results); }; Results.prototype.sort = function (data) { var sorter = this.options.get('sorter'); return sorter(data); }; Results.prototype.highlightFirstItem = function () { var $options = this.$results .find('.select2-results__option[aria-selected]'); var $selected = $options.filter('[aria-selected=true]'); // Check if there are any selected options if ($selected.length > 0) { // If there are selected options, highlight the first $selected.first().trigger('mouseenter'); } else { // If there are no selected options, highlight the first option // in the dropdown $options.first().trigger('mouseenter'); } this.ensureHighlightVisible(); }; Results.prototype.setClasses = function () { var self = this; this.data.current(function (selected) { var selectedIds = $.map(selected, function (s) { return s.id.toString(); }); var $options = self.$results .find('.select2-results__option[aria-selected]'); $options.each(function () { var $option = $(this); var item = $.data(this, 'data'); // id needs to be converted to a string when comparing var id = '' + item.id; if ((item.element != null && item.element.selected) || (item.element == null && $.inArray(id, selectedIds) > -1)) { $option.attr('aria-selected', 'true'); } else { $option.attr('aria-selected', 'false'); } }); }); }; Results.prototype.showLoading = function (params) { this.hideLoading(); var loadingMore = this.options.get('translations').get('searching'); var loading = { disabled: true, loading: true, text: loadingMore(params) }; var $loading = this.option(loading); $loading.className += ' loading-results'; this.$results.prepend($loading); }; Results.prototype.hideLoading = function () { this.$results.find('.loading-results').remove(); }; Results.prototype.option = function (data) { var option = document.createElement('li'); option.className = 'select2-results__option'; var attrs = { 'role': 'treeitem', 'aria-selected': 'false' }; if (data.disabled) { delete attrs['aria-selected']; attrs['aria-disabled'] = 'true'; } if (data.id == null) { delete attrs['aria-selected']; } if (data._resultId != null) { option.id = data._resultId; } if (data.title) { option.title = data.title; } if (data.children) { attrs.role = 'group'; attrs['aria-label'] = data.text; delete attrs['aria-selected']; } for (var attr in attrs) { var val = attrs[attr]; option.setAttribute(attr, val); } if (data.children) { var $option = $(option); var label = document.createElement('strong'); label.className = 'select2-results__group'; var $label = $(label); this.template(data, label); var $children = []; for (var c = 0; c < data.children.length; c++) { var child = data.children[c]; var $child = this.option(child); $children.push($child); } var $childrenContainer = $('<ul></ul>', { 'class': 'select2-results__options select2-results__options--nested' }); $childrenContainer.append($children); $option.append(label); $option.append($childrenContainer); } else { this.template(data, option); } $.data(option, 'data', data); return option; }; Results.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-results'; this.$results.attr('id', id); container.on('results:all', function (params) { self.clear(); self.append(params.data); if (container.isOpen()) { self.setClasses(); self.highlightFirstItem(); } }); container.on('results:append', function (params) { self.append(params.data); if (container.isOpen()) { self.setClasses(); } }); container.on('query', function (params) { self.hideMessages(); self.showLoading(params); }); container.on('select', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('unselect', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('open', function () { // When the dropdown is open, aria-expended="true" self.$results.attr('aria-expanded', 'true'); self.$results.attr('aria-hidden', 'false'); self.setClasses(); self.ensureHighlightVisible(); }); container.on('close', function () { // When the dropdown is closed, aria-expended="false" self.$results.attr('aria-expanded', 'false'); self.$results.attr('aria-hidden', 'true'); self.$results.removeAttr('aria-activedescendant'); }); container.on('results:toggle', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } $highlighted.trigger('mouseup'); }); container.on('results:select', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } var data = $highlighted.data('data'); if ($highlighted.attr('aria-selected') == 'true') { self.trigger('close', {}); } else { self.trigger('select', { data: data }); } }); container.on('results:previous', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further if (currentIndex === 0) { return; } var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first if ($highlighted.length === 0) { nextIndex = 0; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top; var nextTop = $next.offset().top; var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextTop - currentOffset < 0) { self.$results.scrollTop(nextOffset); } }); container.on('results:next', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var nextIndex = currentIndex + 1; // If we are at the last option, stay there if (nextIndex >= $options.length) { return; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var nextBottom = $next.offset().top + $next.outerHeight(false); var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextBottom > currentOffset) { self.$results.scrollTop(nextOffset); } }); container.on('results:focus', function (params) { params.element.addClass('select2-results__option--highlighted'); }); container.on('results:message', function (params) { self.displayMessage(params); }); if ($.fn.mousewheel) { this.$results.on('mousewheel', function (e) { var top = self.$results.scrollTop(); var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); if (isAtTop) { self.$results.scrollTop(0); e.preventDefault(); e.stopPropagation(); } else if (isAtBottom) { self.$results.scrollTop( self.$results.get(0).scrollHeight - self.$results.height() ); e.preventDefault(); e.stopPropagation(); } }); } this.$results.on('mouseup', '.select2-results__option[aria-selected]', function (evt) { var $this = $(this); var data = $this.data('data'); if ($this.attr('aria-selected') === 'true') { if (self.options.get('multiple')) { self.trigger('unselect', { originalEvent: evt, data: data }); } else { self.trigger('close', {}); } return; } self.trigger('select', { originalEvent: evt, data: data }); }); this.$results.on('mouseenter', '.select2-results__option[aria-selected]', function (evt) { var data = $(this).data('data'); self.getHighlightedResults() .removeClass('select2-results__option--highlighted'); self.trigger('results:focus', { data: data, element: $(this) }); }); }; Results.prototype.getHighlightedResults = function () { var $highlighted = this.$results .find('.select2-results__option--highlighted'); return $highlighted; }; Results.prototype.destroy = function () { this.$results.remove(); }; Results.prototype.ensureHighlightVisible = function () { var $highlighted = this.getHighlightedResults(); if ($highlighted.length === 0) { return; } var $options = this.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var currentOffset = this.$results.offset().top; var nextTop = $highlighted.offset().top; var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); var offsetDelta = nextTop - currentOffset; nextOffset -= $highlighted.outerHeight(false) * 2; if (currentIndex <= 2) { this.$results.scrollTop(0); } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { this.$results.scrollTop(nextOffset); } }; Results.prototype.template = function (result, container) { var template = this.options.get('templateResult'); var escapeMarkup = this.options.get('escapeMarkup'); var content = template(result, container); if (content == null) { container.style.display = 'none'; } else if (typeof content === 'string') { container.innerHTML = escapeMarkup(content); } else { $(container).append(content); } }; return Results; }); S2.define('select2/keys',[ ], function () { var KEYS = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; return KEYS; }); S2.define('select2/selection/base',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '<span class="select2-selection" role="combobox" ' + ' aria-haspopup="true" aria-expanded="false">' + '</span>' ); this._tabindex = 0; if (this.$element.data('old-tabindex') != null) { this._tabindex = this.$element.data('old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); self.$selection.focus(); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = $this.data('element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; }); S2.define('select2/selection/single',[ 'jquery', './base', '../utils', '../keys' ], function ($, BaseSelection, Utils, KEYS) { function SingleSelection () { SingleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(SingleSelection, BaseSelection); SingleSelection.prototype.render = function () { var $selection = SingleSelection.__super__.render.call(this); $selection.addClass('select2-selection--single'); $selection.html( '<span class="select2-selection__rendered"></span>' + '<span class="select2-selection__arrow" role="presentation">' + '<b role="presentation"></b>' + '</span>' ); return $selection; }; SingleSelection.prototype.bind = function (container, $container) { var self = this; SingleSelection.__super__.bind.apply(this, arguments); var id = container.id + '-container'; this.$selection.find('.select2-selection__rendered').attr('id', id); this.$selection.attr('aria-labelledby', id); this.$selection.on('mousedown', function (evt) { // Only respond to left clicks if (evt.which !== 1) { return; } self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on('focus', function (evt) { // User focuses on the container }); this.$selection.on('blur', function (evt) { // User exits the container }); container.on('focus', function (evt) { if (!container.isOpen()) { self.$selection.focus(); } }); container.on('selection:update', function (params) { self.update(params.data); }); }; SingleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; SingleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; SingleSelection.prototype.selectionContainer = function () { return $('<span></span>'); }; SingleSelection.prototype.update = function (data) { if (data.length === 0) { this.clear(); return; } var selection = data[0]; var $rendered = this.$selection.find('.select2-selection__rendered'); var formatted = this.display(selection, $rendered); $rendered.empty().append(formatted); $rendered.prop('title', selection.title || selection.text); }; return SingleSelection; }); S2.define('select2/selection/multiple',[ 'jquery', './base', '../utils' ], function ($, BaseSelection, Utils) { function MultipleSelection ($element, options) { MultipleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(MultipleSelection, BaseSelection); MultipleSelection.prototype.render = function () { var $selection = MultipleSelection.__super__.render.call(this); $selection.addClass('select2-selection--multiple'); $selection.html( '<ul class="select2-selection__rendered"></ul>' ); return $selection; }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; MultipleSelection.__super__.bind.apply(this, arguments); this.$selection.on('click', function (evt) { self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on( 'click', '.select2-selection__choice__remove', function (evt) { // Ignore the event if it is disabled if (self.options.get('disabled')) { return; } var $remove = $(this); var $selection = $remove.parent(); var data = $selection.data('data'); self.trigger('unselect', { originalEvent: evt, data: data }); } ); }; MultipleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; MultipleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; MultipleSelection.prototype.selectionContainer = function () { var $container = $( '<li class="select2-selection__choice">' + '<span class="select2-selection__choice__remove" role="presentation">' + '&times;' + '</span>' + '</li>' ); return $container; }; MultipleSelection.prototype.update = function (data) { this.clear(); if (data.length === 0) { return; } var $selections = []; for (var d = 0; d < data.length; d++) { var selection = data[d]; var $selection = this.selectionContainer(); var formatted = this.display(selection, $selection); $selection.append(formatted); $selection.prop('title', selection.title || selection.text); $selection.data('data', selection); $selections.push($selection); } var $rendered = this.$selection.find('.select2-selection__rendered'); Utils.appendMany($rendered, $selections); }; return MultipleSelection; }); S2.define('select2/selection/placeholder',[ '../utils' ], function (Utils) { function Placeholder (decorated, $element, options) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options); } Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { var $placeholder = this.selectionContainer(); $placeholder.html(this.display(placeholder)); $placeholder.addClass('select2-selection__placeholder') .removeClass('select2-selection__choice'); return $placeholder; }; Placeholder.prototype.update = function (decorated, data) { var singlePlaceholder = ( data.length == 1 && data[0].id != this.placeholder.id ); var multipleSelections = data.length > 1; if (multipleSelections || singlePlaceholder) { return decorated.call(this, data); } this.clear(); var $placeholder = this.createPlaceholder(this.placeholder); this.$selection.find('.select2-selection__rendered').append($placeholder); }; return Placeholder; }); S2.define('select2/selection/allowClear',[ 'jquery', '../keys' ], function ($, KEYS) { function AllowClear () { } AllowClear.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); if (this.placeholder == null) { if (this.options.get('debug') && window.console && console.error) { console.error( 'Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.' ); } } this.$selection.on('mousedown', '.select2-selection__clear', function (evt) { self._handleClear(evt); }); container.on('keypress', function (evt) { self._handleKeyboardClear(evt, container); }); }; AllowClear.prototype._handleClear = function (_, evt) { // Ignore the event if it is disabled if (this.options.get('disabled')) { return; } var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected if ($clear.length === 0) { return; } evt.stopPropagation(); var data = $clear.data('data'); for (var d = 0; d < data.length; d++) { var unselectData = { data: data[d] }; // Trigger the `unselect` event, so people can prevent it from being // cleared. this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out. if (unselectData.prevented) { return; } } this.$element.val(this.placeholder.id).trigger('change'); this.trigger('toggle', {}); }; AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { if (container.isOpen()) { return; } if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { this._handleClear(evt); } }; AllowClear.prototype.update = function (decorated, data) { decorated.call(this, data); if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) { return; } var $remove = $( '<span class="select2-selection__clear">' + '&times;' + '</span>' ); $remove.data('data', data); this.$selection.find('.select2-selection__rendered').prepend($remove); }; return AllowClear; }); S2.define('select2/selection/search',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function Search (decorated, $element, options) { decorated.call(this, $element, options); } Search.prototype.render = function (decorated) { var $search = $( '<li class="select2-search select2-search--inline">' + '<input class="select2-search__field" type="search" tabindex="-1"' + ' autocomplete="off" autocorrect="off" autocapitalize="off"' + ' spellcheck="false" role="textbox" aria-autocomplete="list" />' + '</li>' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('open', function () { self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.id); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = container.id + '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id && this.container != null) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var checkText = option.text === params.term; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '<span class="select2-dropdown">' + '<span class="select2-results"></span>' + '</span>' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '<span class="select2-search select2-search--dropdown">' + '<input class="select2-search__field" type="search" tabindex="-1"' + ' autocomplete="off" autocorrect="off" autocapitalize="off"' + ' spellcheck="false" role="textbox" />' + '</span>' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '<li ' + 'class="select2-results__option select2-results__option--load-more"' + 'role="treeitem" aria-disabled="true"></li>' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $('<span></span>'); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('keypress', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } } else { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '<span class="select2 select2-container">' + '<span class="selection"></span>' + '<span class="dropdown-wrapper" aria-hidden="true"></span>' + '</span>' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('select2/compat/utils',[ 'jquery' ], function ($) { function syncCssClasses ($dest, $src, adapter) { var classes, replacements = [], adapted; classes = $.trim($dest.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Save all Select2 classes if (this.indexOf('select2-') === 0) { replacements.push(this); } }); } classes = $.trim($src.attr('class')); if (classes) { classes = '' + classes; // for IE which returns object $(classes.split(/\s+/)).each(function () { // Only adapt non-Select2 classes if (this.indexOf('select2-') !== 0) { adapted = adapter(this); if (adapted != null) { replacements.push(adapted); } } }); } $dest.attr('class', replacements.join(' ')); } return { syncCssClasses: syncCssClasses }; }); S2.define('select2/compat/containerCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _containerAdapter (clazz) { return null; } function ContainerCSS () { } ContainerCSS.prototype.render = function (decorated) { var $container = decorated.call(this); var containerCssClass = this.options.get('containerCssClass') || ''; if ($.isFunction(containerCssClass)) { containerCssClass = containerCssClass(this.$element); } var containerCssAdapter = this.options.get('adaptContainerCssClass'); containerCssAdapter = containerCssAdapter || _containerAdapter; if (containerCssClass.indexOf(':all:') !== -1) { containerCssClass = containerCssClass.replace(':all:', ''); var _cssAdapter = containerCssAdapter; containerCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var containerCss = this.options.get('containerCss') || {}; if ($.isFunction(containerCss)) { containerCss = containerCss(this.$element); } CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); $container.css(containerCss); $container.addClass(containerCssClass); return $container; }; return ContainerCSS; }); S2.define('select2/compat/dropdownCss',[ 'jquery', './utils' ], function ($, CompatUtils) { // No-op CSS adapter that discards all classes by default function _dropdownAdapter (clazz) { return null; } function DropdownCSS () { } DropdownCSS.prototype.render = function (decorated) { var $dropdown = decorated.call(this); var dropdownCssClass = this.options.get('dropdownCssClass') || ''; if ($.isFunction(dropdownCssClass)) { dropdownCssClass = dropdownCssClass(this.$element); } var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; if (dropdownCssClass.indexOf(':all:') !== -1) { dropdownCssClass = dropdownCssClass.replace(':all:', ''); var _cssAdapter = dropdownCssAdapter; dropdownCssAdapter = function (clazz) { var adapted = _cssAdapter(clazz); if (adapted != null) { // Append the old one along with the adapted one return adapted + ' ' + clazz; } return clazz; }; } var dropdownCss = this.options.get('dropdownCss') || {}; if ($.isFunction(dropdownCss)) { dropdownCss = dropdownCss(this.$element); } CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); $dropdown.css(dropdownCss); $dropdown.addClass(dropdownCssClass); return $dropdown; }; return DropdownCSS; }); S2.define('select2/compat/initSelection',[ 'jquery' ], function ($) { function InitSelection (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `initSelection` option has been deprecated in favor' + ' of a custom data adapter that overrides the `current` method. ' + 'This method is now called multiple times instead of a single ' + 'time when the instance is initialized. Support will be removed ' + 'for the `initSelection` option in future versions of Select2' ); } this.initSelection = options.get('initSelection'); this._isInitialized = false; decorated.call(this, $element, options); } InitSelection.prototype.current = function (decorated, callback) { var self = this; if (this._isInitialized) { decorated.call(this, callback); return; } this.initSelection.call(null, this.$element, function (data) { self._isInitialized = true; if (!$.isArray(data)) { data = [data]; } callback(data); }); }; return InitSelection; }); S2.define('select2/compat/inputData',[ 'jquery' ], function ($) { function InputData (decorated, $element, options) { this._currentData = []; this._valueSeparator = options.get('valueSeparator') || ','; if ($element.prop('type') === 'hidden') { if (options.get('debug') && console && console.warn) { console.warn( 'Select2: Using a hidden input with Select2 is no longer ' + 'supported and may stop working in the future. It is recommended ' + 'to use a `<select>` element instead.' ); } } decorated.call(this, $element, options); } InputData.prototype.current = function (_, callback) { function getSelected (data, selectedIds) { var selected = []; if (data.selected || $.inArray(data.id, selectedIds) !== -1) { data.selected = true; selected.push(data); } else { data.selected = false; } if (data.children) { selected.push.apply(selected, getSelected(data.children, selectedIds)); } return selected; } var selected = []; for (var d = 0; d < this._currentData.length; d++) { var data = this._currentData[d]; selected.push.apply( selected, getSelected( data, this.$element.val().split( this._valueSeparator ) ) ); } callback(selected); }; InputData.prototype.select = function (_, data) { if (!this.options.get('multiple')) { this.current(function (allData) { $.map(allData, function (data) { data.selected = false; }); }); this.$element.val(data.id); this.$element.trigger('change'); } else { var value = this.$element.val(); value += this._valueSeparator + data.id; this.$element.val(value); this.$element.trigger('change'); } }; InputData.prototype.unselect = function (_, data) { var self = this; data.selected = false; this.current(function (allData) { var values = []; for (var d = 0; d < allData.length; d++) { var item = allData[d]; if (data.id == item.id) { continue; } values.push(item.id); } self.$element.val(values.join(self._valueSeparator)); self.$element.trigger('change'); }); }; InputData.prototype.query = function (_, params, callback) { var results = []; for (var d = 0; d < this._currentData.length; d++) { var data = this._currentData[d]; var matches = this.matches(params, data); if (matches !== null) { results.push(matches); } } callback({ results: results }); }; InputData.prototype.addOptions = function (_, $options) { var options = $.map($options, function ($option) { return $.data($option[0], 'data'); }); this._currentData.push.apply(this._currentData, options); }; return InputData; }); S2.define('select2/compat/matcher',[ 'jquery' ], function ($) { function oldMatcher (matcher) { function wrappedMatcher (params, data) { var match = $.extend(true, {}, data); if (params.term == null || $.trim(params.term) === '') { return match; } if (data.children) { for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; // Check if the child object matches // The old matcher returned a boolean true or false var doesMatch = matcher(params.term, child.text, child); // If the child didn't match, pop it off if (!doesMatch) { match.children.splice(c, 1); } } if (match.children.length > 0) { return match; } } if (matcher(params.term, data.text, data)) { return match; } return null; } return wrappedMatcher; } return oldMatcher; }); S2.define('select2/compat/query',[ ], function () { function Query (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `query` option has been deprecated in favor of a ' + 'custom data adapter that overrides the `query` method. Support ' + 'will be removed for the `query` option in future versions of ' + 'Select2.' ); } decorated.call(this, $element, options); } Query.prototype.query = function (_, params, callback) { params.callback = callback; var query = this.options.get('query'); query.call(null, params); }; return Query; }); S2.define('select2/dropdown/attachContainer',[ ], function () { function AttachContainer (decorated, $element, options) { decorated.call(this, $element, options); } AttachContainer.prototype.position = function (decorated, $dropdown, $container) { var $dropdownContainer = $container.find('.dropdown-wrapper'); $dropdownContainer.append($dropdown); $dropdown.addClass('select2-dropdown--below'); $container.addClass('select2-container--below'); }; return AttachContainer; }); S2.define('select2/dropdown/stopPropagation',[ ], function () { function StopPropagation () { } StopPropagation.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); var stoppedEvents = [ 'blur', 'change', 'click', 'dblclick', 'focus', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'keypress', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseover', 'mouseup', 'search', 'touchend', 'touchstart' ]; this.$dropdown.on(stoppedEvents.join(' '), function (evt) { evt.stopPropagation(); }); }; return StopPropagation; }); S2.define('select2/selection/stopPropagation',[ ], function () { function StopPropagation () { } StopPropagation.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); var stoppedEvents = [ 'blur', 'change', 'click', 'dblclick', 'focus', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'keypress', 'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseover', 'mouseup', 'search', 'touchend', 'touchstart' ]; this.$selection.on(stoppedEvents.join(' '), function (evt) { evt.stopPropagation(); }); }; return StopPropagation; }); /*! * jQuery Mousewheel 3.1.13 * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license */ (function (factory) { if ( typeof S2.define === 'function' && S2.define.amd ) { // AMD. Register as an anonymous module. S2.define('jquery-mousewheel',['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS style for Browserify module.exports = factory; } else { // Browser globals factory(jQuery); } }(function ($) { var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], slice = Array.prototype.slice, nullLowestDeltaTimeout, lowestDelta; if ( $.event.fixHooks ) { for ( var i = toFix.length; i; ) { $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; } } var special = $.event.special.mousewheel = { version: '3.1.12', setup: function() { if ( this.addEventListener ) { for ( var i = toBind.length; i; ) { this.addEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = handler; } // Store the line height and page height for this particular element $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); }, teardown: function() { if ( this.removeEventListener ) { for ( var i = toBind.length; i; ) { this.removeEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = null; } // Clean up the data we added to the element $.removeData(this, 'mousewheel-line-height'); $.removeData(this, 'mousewheel-page-height'); }, getLineHeight: function(elem) { var $elem = $(elem), $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent'](); if (!$parent.length) { $parent = $('body'); } return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16; }, getPageHeight: function(elem) { return $(elem).height(); }, settings: { adjustOldDeltas: true, // see shouldAdjustOldDeltas() below normalizeOffset: true // calls getBoundingClientRect for each event } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); }, unmousewheel: function(fn) { return this.unbind('mousewheel', fn); } }); function handler(event) { var orgEvent = event || window.event, args = slice.call(arguments, 1), delta = 0, deltaX = 0, deltaY = 0, absDelta = 0, offsetX = 0, offsetY = 0; event = $.event.fix(orgEvent); event.type = 'mousewheel'; // Old school scrollwheel delta if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } // Firefox < 17 horizontal scrolling related to DOMMouseScroll event if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { deltaX = deltaY * -1; deltaY = 0; } // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy delta = deltaY === 0 ? deltaX : deltaY; // New school wheel delta (wheel event) if ( 'deltaY' in orgEvent ) { deltaY = orgEvent.deltaY * -1; delta = deltaY; } if ( 'deltaX' in orgEvent ) { deltaX = orgEvent.deltaX; if ( deltaY === 0 ) { delta = deltaX * -1; } } // No change actually happened, no reason to go any further if ( deltaY === 0 && deltaX === 0 ) { return; } // Need to convert lines and pages to pixels if we aren't already in pixels // There are three delta modes: // * deltaMode 0 is by pixels, nothing to do // * deltaMode 1 is by lines // * deltaMode 2 is by pages if ( orgEvent.deltaMode === 1 ) { var lineHeight = $.data(this, 'mousewheel-line-height'); delta *= lineHeight; deltaY *= lineHeight; deltaX *= lineHeight; } else if ( orgEvent.deltaMode === 2 ) { var pageHeight = $.data(this, 'mousewheel-page-height'); delta *= pageHeight; deltaY *= pageHeight; deltaX *= pageHeight; } // Store lowest absolute delta to normalize the delta values absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; // Adjust older deltas if necessary if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { lowestDelta /= 40; } } // Adjust older deltas if necessary if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { // Divide all the things by 40! delta /= 40; deltaX /= 40; deltaY /= 40; } // Get a whole, normalized value for the deltas delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); // Normalise offsetX and offsetY properties if ( special.settings.normalizeOffset && this.getBoundingClientRect ) { var boundingRect = this.getBoundingClientRect(); offsetX = event.clientX - boundingRect.left; offsetY = event.clientY - boundingRect.top; } // Add information to the event object event.deltaX = deltaX; event.deltaY = deltaY; event.deltaFactor = lowestDelta; event.offsetX = offsetX; event.offsetY = offsetY; // Go ahead and set deltaMode to 0 since we converted to pixels // Although this is a little odd since we overwrite the deltaX/Y // properties with normalized deltas. event.deltaMode = 0; // Add event and delta to the front of the arguments args.unshift(event, delta, deltaX, deltaY); // Clearout lowestDelta after sometime to better // handle multiple device types that give different // a different lowestDelta // Ex: trackpad = 3 and mouse wheel = 120 if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); return ($.event.dispatch || $.event.handle).apply(this, args); } function nullLowestDelta() { lowestDelta = null; } function shouldAdjustOldDeltas(orgEvent, absDelta) { // If this is an older event and the delta is divisable by 120, // then we are assuming that the browser is treating this as an // older mouse wheel event and that we should divide the deltas // by 40 to try and get a more usable deltaFactor. // Side note, this actually impacts the reported scroll distance // in older browsers and can cause scrolling to be slower than native. // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; } })); S2.define('jquery.select2',[ 'jquery', 'jquery-mousewheel', './select2/core', './select2/defaults' ], function ($, _, Select2, Defaults) { if ($.fn.select2 == null) { // All methods that should return the element var thisMethods = ['open', 'close', 'destroy']; $.fn.select2 = function (options) { options = options || {}; if (typeof options === 'object') { this.each(function () { var instanceOptions = $.extend(true, {}, options); var instance = new Select2($(this), instanceOptions); }); return this; } else if (typeof options === 'string') { var ret; var args = Array.prototype.slice.call(arguments, 1); this.each(function () { var instance = $(this).data('select2'); if (instance == null && window.console && console.error) { console.error( 'The select2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.' ); } ret = instance[options].apply(instance, args); }); // Check if we should be returning `this` if ($.inArray(options, thisMethods) > -1) { return this; } return ret; } else { throw new Error('Invalid arguments for Select2: ' + options); } }; } if ($.fn.select2.defaults == null) { $.fn.select2.defaults = Defaults; } return Select2; }); // Return the AMD loader configuration so it can be used outside of this file return { define: S2.define, require: S2.require }; }()); // Autoload the jQuery bindings // We know that all of the modules exist above this, so we're safe var select2 = S2.require('jquery.select2'); // Hold the AMD module references on the jQuery function that was just loaded // This allows Select2 to use the internal loader outside of this file, such // as in the language files. jQuery.fn.select2.amd = S2; // Return the Select2 instance for anyone who is importing it. return select2; }));
CyrusSUEN/cdnjs
ajax/libs/select2/4.0.3/js/select2.full.js
JavaScript
mit
161,832
var Absurd=function(){function b(a){return a?a.replace(/^\s+|\s+$/g,""):""}var d={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{},helpers:{}},component:{plugins:{}}}},e=function(a){return a.indexOf("css/CSS.js")>0||"/../CSS.js"==a?d.processors.css.CSS:a.indexOf("html/HTML.js")>0?d.processors.html.HTML:a.indexOf("component/Component.js")>0?d.processors.component.Component:"js-beautify"==a?{html:function(a){return a}}:"./helpers/PropAnalyzer"==a?d.processors.html.helpers.PropAnalyzer:"../../helpers/TransformUppercase"==a?d.helpers.TransformUppercase:"./helpers/TemplateEngine"==a||"../html/helpers/TemplateEngine"==a?d.processors.html.helpers.TemplateEngine:"../helpers/Extend"==a?d.helpers.Extend:"../helpers/Clone"==a?d.helpers.Clone:"../helpers/Prefixes"==a||"/../../../helpers/Prefixes"==a?d.helpers.Prefixes:a==f+"/../../../../"?Absurd:"../helpers/CSSParse"==a?d.helpers.CSSParse:function(){}},f="",g=function(a,b){!function c(){a.length>0&&a.shift().apply(b||{},[c].concat(Array.prototype.slice.call(arguments,0)))}()},h=function(a){var b={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],body:[0,"",""],_default:[1,"<div>","</div>"]};b.optgroup=b.option,b.tbody=b.tfoot=b.colgroup=b.caption=b.thead,b.th=b.td;var c=/<\s*\w.*?>/g.exec(a),d=document.createElement("div");if(null!=c){var e=c[0].replace(/</g,"").replace(/>/g,"").split(" ")[0];if("body"===e.toLowerCase()){var f=(document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),document.createElement("body"));d.innerHTML=a.replace(/<body/g,"<div").replace(/<\/body>/g,"</div>");var g=d.firstChild.attributes;f.innerHTML=a;for(var h=0;h<g.length;h++)f.setAttribute(g[h].name,g[h].value);return f}var d,i=b[e]||b._default;a=i[1]+a+i[2],d.innerHTML=a;for(var j=i[0]+1;j--;)d=d.lastChild}else d.innerHTML=a,d=d.lastChild;return d},i=function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!1),!0):a.attachEvent?a.attachEvent("on"+b,c):void 0},j=function(a){for(var b,c=a.childNodes,d=c.length,e=0,f=/^\s*$/;d>e;e++)b=c[e],3==b.nodeType&&f.test(b.nodeValue)&&(a.removeChild(b),e--,d--);return a},k=function(b,c,d){for(var e=document.createElement(b),f=0;f<c.length,a=c[f];f++)e.setAttribute(a.name,a.value);return e.innerHTML=d,e},l=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelector(a)},m=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelectorAll(a)},n=function(a,b){return b=b||this.el,b&&b.currentStyle?b.currentStyle[a]:window.getComputedStyle?document.defaultView.getComputedStyle(b,null).getPropertyValue(a):null},q=function(a,b){if(b=b||this.el,b.classList)b.classList.add(a);else{var c=b.className;c.indexOf(a)<0&&(""==c?b.className=a:b.className+=" "+a)}return this},r=function(a,b){if(b=b||this.el,b.classList)b.classList.remove(a);else{for(var c=b.className.split(" "),d=[],e=0;e<c.length;e++)c[e]!=a&&d.push(c[e]);b.className=d.join(" ")}return this},s=function(a,b,c){c=c||this.el;for(var d=c.className.split(" "),e=!1,f=0;f<d.length;f++)d[f]==a&&(e=!0,d[f]=b);return e?(c.className=d.join(" "),this):q(b,c)},t=function(a,b){if(b=b||this.el,b.classList)b.classList.toggle(a);else{for(var c=b.className.split(" "),d=-1,e=c.length;e--;)c[e]===a&&(d=e);d>=0?c.splice(d,1):c.push(a),b.className=c.join(" ")}return this},u=function(a,b,c){return b instanceof Array&&(c=b,b=this),b||(b=this),function(){a.apply(b,(c||[]).concat(Array.prototype.slice.call(arguments,0)))}},w=function(a,b,c,e){var f=d.helpers.Extend({__name:a},e),o=d.helpers.Extend,p=[];f.listeners=p,f.on=function(a,b,c){return p[a]||(p[a]=[]),p[a].push({callback:b,scope:c}),this},f.off=function(a,b){return p[a]?(b||(p[a]=[]),this):this},f.dispatch=function(a,b,d){if(!b||"object"!=typeof b||b instanceof Array||(b.target=this),p[a])for(var e=0;e<p[a].length;e++){var f=p[a][e].callback;f.apply(d||p[a][e].scope||{},[b])}return this[a]&&"function"==typeof this[a]&&this[a](b),c&&c.dispatch(a,b),this};var v={};f.set=function(a,b){return v[a]=b,this},f.get=function(a){return v[a]};var w=!1;f.__handleCSS=function(c){return this.css?b.flush().morph("dynamic-css").add(this.css).compile(function(b,d){if(w)w.raw!==d&&(w.raw=d,w.element.innerHTML=d);else{var e=k("style",[{name:"id",value:a+"-css"},{name:"type",value:"text/css"}],d);(l("head")||l("body")).appendChild(e),w={raw:d,element:e}}c()},this):c(),this},f.applyCSS=function(a,b,c){if(this.html&&"string"==typeof this.html&&!b){var d={};d[this.html]=a,a=d}return this.css=a,c||this.populate(),this};var x=!1;f.__mergeDOMElements=function(a,b){if(j(a),j(b),"undefined"!=typeof a&&"undefined"!=typeof b&&!a.isEqualNode(b)){if(a.nodeName!==b.nodeName)return void(a.parentNode&&a.parentNode.replaceChild(b,a));if(a.nodeValue!==b.nodeValue&&(a.nodeValue=b.nodeValue),a.attributes){for(var c,d,e=a.attributes,g=b.attributes,h={},i=0;i<e.length,c=e[i];i++){for(var k=0;k<g.length,d=g[k];k++)c.name===d.name&&(a.setAttribute(c.name,d.value),h[c.name]=!0,"value"===c.name&&(a.value=d.value));h[c.name]||a.removeAttribute(c.name)}for(var i=0;i<g.length,d=g[i];i++)h[d.name]||(a.setAttribute(d.name,d.value),"value"===d.name&&(a.value=d.value))}var l=[];if(a.childNodes.length>=b.childNodes.length)for(var i=0;i<a.childNodes.length;i++)b.childNodes[i]||b.appendChild(document.createTextNode("")),l.push([a.childNodes[i],b.childNodes[i]]);else for(var i=0;i<b.childNodes.length;i++)a.appendChild(document.createTextNode("")),l.push([a.childNodes[i],b.childNodes[i]]);for(var i=0;i<l.length;i++)f.__mergeDOMElements(l[i][0],l[i][1])}},f.__handleHTML=function(a){var c=this,d=function(){b.flush().morph("html").add(x).compile(function(b,d){c.el?f.__mergeDOMElements(c.el,h(d)):c.el=h(d),a()},c)};if(this.html)if("string"==typeof this.html){if(!this.el){var e=l(this.html);e&&(this.el=e,x={"":this.el.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")})}d()}else"object"==typeof this.html?(x=o({},this.html),d()):a();else a();return this},f.applyHTML=function(a,b){return this.html=a,b||this.populate(),this};var y=!1;f.__append=function(a){return!y&&this.el&&this.get("parent")&&(y=!0,this.get("parent").appendChild(this.el)),a(),this};var z={events:{}};f.__handleEvents=function(a){if(this.el){var b=this,c=function(a){var c=a.getAttribute("data-absurd-event"),d=function(c){if(c=c.split(":"),c.length>=2){var d=c[0],e=c[1];c.splice(0,2);var f=c;(!z.events[d]||z.events[d].indexOf(a)<0)&&(z.events[d]||(z.events[d]=[]),z.events[d].push(a),i(a,d,function(a){if("function"==typeof b[e]){var c=b[e];c.apply(b,[a].concat(f))}}))}};c=c.split(/, ?/g);for(var e=0;e<c.length;e++)d(c[e])};this.el.hasAttribute&&this.el.hasAttribute("data-absurd-event")&&c(this.el);for(var d=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-event]"):[],e=0;e<d.length;e++)c(d[e])}return a(),this},f.__getAnimAndTransEndEventName=function(a){if(a){var b,c={animation:["animationend","transitionend"],OAnimation:["oAnimationEnd","oTransitionEnd"],MozAnimation:["animationend","transitionend"],WebkitAnimation:["webkitAnimationEnd","webkitTransitionEnd"]};for(b in c)if(void 0!==a.style[b])return c[b]}},f.onAnimationEnd=function(a,b){1==arguments.length&&(b=a,a=this.el);var c=this,d=f.__getAnimAndTransEndEventName(a);return d?void this.addEventListener(a,d[0],function(a){b.apply(c,[a])}):void b.apply(this,[{error:"Animations not supported."}])},f.onTransitionEnd=function(a,b){1==arguments.length&&(b=a,a=this.el);var c=this,d=f.__getAnimAndTransEndEventName(a);return d?void this.addEventListener(a,d[1],function(a){b.apply(c,[a])}):void b.apply(this,[{error:"Animations not supported."}])};var A={funcs:{},index:0};f.__handleAsyncFunctions=function(a){if(this.el){var b=[];if(this.el.hasAttribute&&this.el.hasAttribute("data-absurd-async"))b.push(this.el);else for(var c=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-async]"):[],d=0;d<c.length;d++)b.push(c[d]);if(0===b.length)a();else{var e=this;!function f(){if(0===b.length)a();else{var c=b.shift(),d=c.getAttribute("data-absurd-async"),g=function(a){"string"==typeof a?c.parentNode.replaceChild(h(a),c):c.parentNode.replaceChild(a,c),f()};"function"==typeof e[A.funcs[d].name]?e[A.funcs[d].name].apply(e,[g].concat(A.funcs[d].args)):"function"==typeof A.funcs[d].func&&A.funcs[d].func.apply(e,[g].concat(A.funcs[d].args))}}()}}else a();return this},f.async=function(){var a=Array.prototype.slice.call(arguments,0),b=a.shift(),c="_"+A.index++;return A.funcs[c]={args:a,name:b},'<script data-absurd-async="'+c+'"></script>'},f.child=function(){var a=Array.prototype.slice.call(arguments,0),b=this.get("children"),c=b&&b[a.shift()],d="_"+A.index++;return A.funcs[d]={args:a,func:function(a){c.populate({callback:function(b){a(b.html.element)}})}},'<script data-absurd-async="'+d+'"></script>'},f.wire=function(a){return b.components.events.on(a,this[a]||function(){},this),this};var B=!1;return f.populate=function(a){return B?void 0:(B=!0,g([f.__handleCSS,f.__handleHTML,f.__append,f.__handleEvents,f.__handleAsyncFunctions,function(){B=!1,A={funcs:{},index:0};var b={css:w,html:{element:this.el}};this.dispatch("populated",b),a&&"function"==typeof a.callback&&a.callback(b)}],this),this)},f.str2DOMElement=h,f.addEventListener=i,f.queue=g,f.qs=l,f.qsa=m,f.getStyle=n,f.addClass=q,f.removeClass=r,f.replaceClass=s,f.bind=u,f.toggleClass=t,f.compileHTML=function(a,c,d){b.flush().morph("html").add(a).compile(c,d)},f.compileCSS=function(a,c,d){b.flush().add(a).compile(c,d)},f.delay=function(a,b,c){var d=this;setTimeout(function(){b.apply(d,c)},a)},f},x=function(a){a.di.register("is",{appended:function(a){return"undefined"==typeof a&&(a=this.host.html),l(a)?!0:!1},hidden:function(a){return a=a||this.host.el,null===a.offsetParent}}),a.di.register("router",{routes:[],mode:null,root:"/",getFragment:function(){var a="";if("history"===this.mode){if(!location)return"";a=this.clearSlashes(decodeURI(location.pathname+location.search)),a=a.replace(/\?(.*)$/,""),a="/"!=this.root?a.replace(this.root,""):a}else{if(!window)return"";var b=window.location.href.match(/#(.*)$/);a=b?b[1]:""}return this.clearSlashes(a)},clearSlashes:function(a){return a.toString().replace(/\/$/,"").replace(/^\//,"")},add:function(a,b){return"function"==typeof a&&(b=a,a=""),this.routes.push({re:a,handler:b}),this},remove:function(a){for(var b,c=0;c<this.routes.length,b=this.routes[c];c++)if(b.handler===a||b.re===a)return this.routes.splice(c,1),this;return this},flush:function(){return this.routes=[],this.mode=null,this.root="/",this},config:function(a){return this.mode=a&&a.mode&&"history"==a.mode&&history.pushState?"history":"hash",this.root=a&&a.root?"/"+this.clearSlashes(a.root)+"/":"/",this},listen:function(a){var b=this,c=b.getFragment(),d=function(){c!==b.getFragment()&&(c=b.getFragment(),b.check(c))};return clearInterval(this.interval),this.interval=setInterval(d,a||50),this},check:function(a){for(var b=a||this.getFragment(),c=0;c<this.routes.length;c++){var d=b.match(this.routes[c].re);if(d)return d.shift(),this.routes[c].handler.apply(this.host||{},d),this}return this},navigate:function(a){return a=a?a:"","history"===this.mode?history.pushState(null,null,this.root+this.clearSlashes(a)):(window.location.href.match(/#(.*)$/),window.location.href=window.location.href.replace(/#(.*)$/,"")+"#"+a),this}}),a.di.register("ajax",{request:function(a){"string"==typeof a&&(a={url:a}),a.url=a.url||"",a.method=a.method||"get",a.data=a.data||{};var b=function(a,b){var c,d=[];for(var e in a)d.push(e+"="+encodeURIComponent(a[e]));return c=d.join("&"),""!=c?b?b.indexOf("?")<0?"?"+c:"&"+c:c:""},c={host:this.host||{},process:function(a){var c=this;return this.xhr=null,window.ActiveXObject?this.xhr=new ActiveXObject("Microsoft.XMLHTTP"):window.XMLHttpRequest&&(this.xhr=new XMLHttpRequest),this.xhr&&(this.xhr.onreadystatechange=function(){if(4==c.xhr.readyState&&200==c.xhr.status){var b=c.xhr.responseText;a.json===!0&&"undefined"!=typeof JSON&&(b=JSON.parse(b)),c.doneCallback&&c.doneCallback.apply(c.host,[b,c.xhr])}else 4==c.xhr.readyState&&c.failCallback&&c.failCallback.apply(c.host,[c.xhr]);c.alwaysCallback&&c.alwaysCallback.apply(c.host,[c.xhr])},"get"==a.method?this.xhr.open("GET",a.url+b(a.data,a.url),!0):(this.xhr.open(a.method,a.url,!0),this.setHeaders({"X-Requested-With":"XMLHttpRequest","Content-type":"application/x-www-form-urlencoded"})),a.headers&&"object"==typeof a.headers&&this.setHeaders(a.headers),setTimeout(function(){"get"==a.method?c.xhr.send():c.xhr.send(b(a.data))},20)),this},done:function(a){return this.doneCallback=a,this},fail:function(a){return this.failCallback=a,this},always:function(a){return this.alwaysCallback=a,this},setHeaders:function(a){for(var b in a)this.xhr&&this.xhr.setRequestHeader(b,a[b])}};return c.process(a)}});var b=function(a,c){var d=b.prototype.host,e={el:null};switch(typeof a){case"undefined":e.el=d.el;break;case"string":c=c&&"string"==typeof c?l.apply(d,[c]):c,e.el=l(a,c||d.el||document);break;case"object":if("undefined"==typeof a.nodeName){var f=function(a,b){b=b||this;for(var c in b)"undefined"!=typeof b[c].el?b[c]=b[c].val(a):"object"==typeof b[c]&&(b[c]=f(a,b[c]));return delete b.val,b},g={val:f};for(var h in a)g[h]=b.apply(this,[a[h]]);return g}e.el=a}return e.val=function(a){if(!this.el)return null;var b=!!a,d=function(a){return b?(this.el.value=a,e):this.el.value};switch(this.el.nodeName.toLowerCase()){case"input":var f=this.el.getAttribute("type");if("radio"!=f&&"checkbox"!=f)return d.apply(this,[a]);for(var g=m('[name="'+this.el.getAttribute("name")+'"]',c),h=[],i=0;i<g.length;i++)b&&g[i].checked&&g[i].value!==a?g[i].removeAttribute("checked"):b&&g[i].value===a?(g[i].setAttribute("checked","checked"),g[i].checked="checked"):g[i].checked&&h.push(g[i].value);if(!b)return"radio"==f?h[0]:h;break;case"textarea":return d.apply(this,[a]);case"select":if(!b)return this.el.value;for(var j=m("option",this.el),i=0;i<j.length;i++)j[i].getAttribute("value")===a?this.el.selectedIndex=i:j[i].removeAttribute("selected");break;default:if(!b)return"undefined"!=typeof this.el.textContent?this.el.textContent:"undefined"!=typeof this.el.innerText?typeof this.el.innerText:this.el.innerHTML;this.el.innerHTML=a}return b?e:null},e.dom=function(a,c){return b(a,c||e.el)},e};a.di.register("dom",b);var c=function(b,d,e){var f=c.prototype.host,g=!(!window||!window.matchMedia||e);if(g){var h=window.matchMedia(b);d.apply(f,[h.matches,h.media]),h.addListener(function(a){d.apply(f,[a.matches,a.media])})}else{var i=".match-media-"+a.components.numOfComponents,j={},k={};j[i]={display:"block"},j[i]["@media "+b]={display:"none"},k["span"+i]="",a.component(i+"-component",{css:j,html:k,intervaliTime:30,status:"",loop:function(){var a=this;if(this.el){var b=this.getStyle("display");this.status!=b&&(this.status=b,d.apply(f,["none"===b]))}setTimeout(function(){a.loop()},this.intervaliTime)},constructor:["dom",function(a){var b=this;this.set("parent",a("body").el).populate(),setTimeout(function(){b.loop()},this.intervaliTime)}]})()}};a.di.register("mq",c)},y=function(){return function(a){var b=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:d.processors.css.CSS()},f={},g={},i={},j={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return i},e.getStorage=function(){return g},e.flush=function(){return f={},g=[],j={},e.defaultProcessor=d.processors.css.CSS(),e},e.import=function(){return e.callHooks("import",arguments)?e:e},e.handlecss=function(a,b){var c=e.getPlugins();if(a&&"stylesheet"===a.type&&a.stylesheet&&a.stylesheet.rules)for(var d=a.stylesheet.rules,f=0;rule=d[f];f++)switch(rule.type){case"rule":e.handlecssrule(rule);break;case"import":e.handlecssimport(rule,b);break;default:c[rule.type]&&c[rule.type](e,rule)}return e},e.handlecssimport=function(){return e},e.handlecssrule=function(a,c){var d={},f={};if(a.declarations&&a.declarations.length>0){for(var g=0;decl=a.declarations[g];g++)"declaration"===decl.type&&(f[decl.property]=decl.value);if(a.selectors&&a.selectors.length>0)for(var g=0;selector=a.selectors[g];g++)d[selector]=b({},f);e.add(d,c)}return e},e.addHook=function(a,b){j[a]||(j[a]=[]);for(var d=!1,e=0;c=j[a][e];e++)c===b&&(d=!0);d===!1?j[a].push(b):null},e.callHooks=function(a,b){if(j[a])for(var d=0;c=j[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.components=function(a){var b=d.helpers.Extend,c=d.helpers.Clone,e={},f=[],g=b({},w()),h={};return function(a){window&&(window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a))}(function(){h.broadcast("ready")}),h={numOfComponents:0,events:g,register:function(d,h){return this.numOfComponents+=1,e[d]=function(){var e=b({},w(d,a,g,c(h)));return a.di.resolveObject(e),f.push(e),"function"==typeof e.constructor&&e.constructor.apply(e,Array.prototype.slice.call(arguments,0)),e}},get:function(a){if(e[a])return e[a];throw new Error("There is no component with name '"+a+"'.")},remove:function(a){return e[a]?(delete e[a],!0):!1},list:function(){var a=[];for(var b in e)a.push(b);return a},flush:function(){return e={},f=[],this},broadcast:function(a,b){for(var c=0;c<f.length,instance=f[c];c++)"function"==typeof instance[a]&&instance[a](b);return this}}}(e),e.component=function(a){return function(b,c){return"undefined"==typeof c?a.components.get(b):a.components.register(b,c)}}(e),e.di=d.DI(e),x(e),e.compile=function(a,c){if(e.callHooks("compile",arguments))return e;var d={combineSelectors:!0,minify:!1,processor:e.defaultProcessor,keepCamelCase:!1,api:e};c=b(d,c||{});var f=c.processor(e.getRules(),a||function(){},c);return e.flush(),f};for(var k in d.api)"compile"!==k&&(e[k]=d.api[k](e),e[k]=function(a){return function(){var b=d.api[a](e);return e.callHooks(a,arguments)?e:b.apply(e,arguments)}}(k));for(var l in d.processors.css.plugins)e.plugin(l,d.processors.css.plugins[l]());return"function"==typeof a&&a(e),"undefined"!=typeof Organic&&Organic.init(e),e.utils={str2DOMElement:h},e}};d.DI=function(){var a={dependencies:{},register:function(a,b){return this.dependencies[a]=b,this},resolve:function(){var a,b,c,d=this,e=!1;"string"==typeof arguments[0]?(a=arguments[1],b=arguments[0].replace(/ /g,"").split(","),c=arguments[2]||{}):(a=arguments[0],b=a.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].replace(/ /g,"").split(","),c=arguments[1]||{});for(var f=0;f<b.length;f++)"undefined"!=typeof this.dependencies[b[f]]&&(e=!0);return e?function(){for(var e=[],f=Array.prototype.slice.call(arguments,0),g=0;g<b.length;g++){var h=b[g];if("undefined"!=typeof d.dependencies[h]){var i=d.dependencies[h];"function"==typeof i?i.prototype.host=c:"object"==typeof i&&(i.host=c),e.push(i)}else e.push(f.shift())}return a.apply(c,e)}:a},resolveObject:function(a){if("object"==typeof a)for(var b in a)"function"==typeof a[b]?a[b]=this.resolve(a[b],a):a[b]instanceof Array&&2==a[b].length&&"string"==typeof a[b][0]&&"function"==typeof a[b][1]&&(a[b]=this.resolve(a[b][0],a[b][1],a));return this},flush:function(){return this.dependencies={},this}};return a},d.api.add=function(a){var b=e("../helpers/Extend"),c=e("../helpers/Prefixes"),d=[],f={combineSelectors:!0,preventCombining:["@font-face"]},g=function(b,d,e,f,g){var i=c.nonPrefixProp(d),j=a.getPlugins()[i.prop];if("undefined"!=typeof j){var k=j(a,e,i.prefix);return k&&h(b,k,f,g),!0}return!1},h=function(a,b,e,i){if(e=e||"mainstream",null!==b&&"undefined"!=typeof b&&b!==!1)if(i||a||(a=""),"undefined"!=typeof b.classify&&b.classify===!0&&(b="undefined"!=typeof b.toJSON?b.toJSON():b.toString()),/, ?/g.test(a)&&f.combineSelectors)for(var j=a.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)h(p,b,e,i);else if(!g(null,a,b,e,i))if("undefined"==typeof b.length||"object"!=typeof b){var l={},m=a,n={},o={};for(var q in b){b[q]&&"undefined"!=typeof b[q].classify&&b[q].classify===!0&&(b[q]="undefined"!=typeof b[q].toJSON?b[q].toJSON():b[q].toString());var r=typeof b[q];"object"!==r&&"function"!==r&&b[q]!==!1&&b[q]!==!0?g(a,q,b[q],e,i)===!1&&(m=0===m.indexOf("^")?m.substr(1,m.length-1)+("undefined"!=typeof i?" "+i:""):"undefined"!=typeof i?i+" "+a:a,l[q]=b[q],c.addPrefixes(q,l)):"object"===r?n[q]=b[q]:"function"===r&&(o[q]=b[q])}d.push({selector:m,props:l,stylesheet:e});for(var q in n)if(":"===q.charAt(0))h(a+q,n[q],e,i);else if(/&/g.test(q))if(/, ?/g.test(q)&&f.combineSelectors)for(var j=q.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)p.indexOf("&")>=0?h(p.replace(/&/g,a),n[q],e,i):h(p,n[q],e,"undefined"!=typeof i?i+" "+a:a);else h(q.replace(/&/g,a),n[q],e,i);else 0===q.indexOf("@media")||0===q.indexOf("@supports")?h(a,n[q],q,i):0===a.indexOf("@media")||0===q.indexOf("@supports")?h(q,n[q],a,i):0===a.indexOf("^")?h(a.substr(1,a.length-1)+("undefined"!=typeof i?" "+i:"")+" "+q,n[q],e):g(a,q,n[q],e,i)===!1&&h(q,n[q],e,(i?i+" ":"")+a);for(var q in o){var s={};s[q]=o[q](),h(a,s,e,i)}}else for(var k=0;k<b.length,q=b[k];k++)h(a,q,e,i)},i=function(c,e,g){if(a.jsonify)return b(a.getRules(e||"mainstream"),c),a;try{d=[],a.numOfAddedRules+=1,"object"==typeof e&&"undefined"==typeof g&&(f={combineSelectors:"undefined"!=typeof e.combineSelectors?e.combineSelectors:f.combineSelectors,preventCombining:f.preventCombining.concat(e.preventCombining||[])},e=null),"undefined"!=typeof g&&(f={combineSelectors:g.combineSelectors||f.combineSelectors,preventCombining:f.preventCombining.concat(g.preventCombining||[])});var i,j=a.defaultProcessor.type;for(var k in c)h(k,c[k],e||"mainstream");for(var l=0;l<d.length;l++){var e=d[l].stylesheet,k=d[l].selector,m=d[l].props,n=a.getRules(e),o=f&&f.preventCombining?"|"+f.preventCombining.join("|"):"",i=o.indexOf("|"+k)>=0?"~~"+a.numOfAddedRules+"~~":"",p=n[i+k]||{};for(var q in m){var r=m[q];q=i+q,"object"!=typeof r&&(p[q]="css"==j?"+"===r.toString().charAt(0)?p&&p[q]?p[q]+", "+r.substr(1,r.length-1):r.substr(1,r.length-1):">"===r.toString().charAt(0)?p&&p[q]?p[q]+" "+r.substr(1,r.length-1):r.substr(1,r.length-1):r:r)}n[i+k]=p}return a}catch(s){throw new Error("Error adding: "+JSON.stringify({rules:c,error:s.toString()}))}};return i};var z=e("../helpers/Extend");d.api.compile=function(a){return function(){for(var b=null,c=function(){},d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var f={combineSelectors:!0,minify:!1,keepCamelCase:!1,processor:a.defaultProcessor,api:a};return d=z(f,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{var f=e;"object"==typeof f&&(f=JSON.stringify(f)),C.writeFile(b,f,function(a){c(a,e)})}catch(d){c.apply({},arguments)}else c.apply({},arguments);a.flush()},d)}},d.api.compileFile=function(a){return a.compile};var A=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};d.api.darken=function(){return function(a,b){return A(a,-(b/100))}},d.api.define=function(a){return function(b,c){return a.getStorage().__defined||(a.getStorage().__defined={}),a.getStorage().__defined[b]=c,a}},d.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}},d.api.importCSS=function(a){var b=e("../helpers/CSSParse");return function(c){try{var d=b(c);a.handlecss(d,"")}catch(e){console.log("Error in the CSS: '"+c+"'",e,e.stack)}return a}};var A=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};d.api.lighten=function(){return function(a,b){return A(a,b/100)}};var B={html:function(a){a.defaultProcessor=e(f+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})},component:function(a){a.defaultProcessor=e(f+"/../processors/component/Component.js")(),a.hook("add",function(b){b instanceof Array||(b=[b]);for(var d=0;d<b.length,c=b[d];d++)a.getRules("mainstream").push(c);return!0})},jsonify:function(a){a.jsonify=!0},"dynamic-css":function(a){a.dynamicCSS=!0}};d.api.morph=function(a){return function(b){return B[b]&&(a.flush(),B[b](a)),a}},d.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},d.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}};{var C=e("fs");e("path")}d.api.rawImport=function(a){var b=function(b){var c=C.readFileSync(b,{encoding:"utf8"});a.raw(c)};return function(c){var d,e,f;if("string"==typeof c)b(c);else for(e=0,f=c.length;f>e;e++)d=c[e],b(d);return a}},d.api.register=function(a){return function(b,c){return a[b]=c,a}},d.api.storage=function(a){var b=a.getStorage(),c=function(d,e){if("undefined"!=typeof e)b[d]=e;else{if("object"!=typeof d){if(b[d])return b[d];throw new Error("There is no data in the storage associated with '"+d+"'")}for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&c(f,d[f])}return a};return c};var D=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;d.helpers.CSSParse=function(a,c){function d(a){var b=a.match(/\n/g);b&&(F+=b.length);var c=a.lastIndexOf("\n");G=~c?a.length-c:G+a.length}function e(){var a={line:F,column:G};return c.position?function(b){return b.position=new f(a),n(),b}:g}function f(a){this.start=a,this.end={line:F,column:G},this.source=c.source}function g(a){return n(),a}function h(b){var d=new Error(b+" near line "+F+":"+G);throw d.filename=c.source,d.line=F,d.column=G,d.source=a,d}function i(){return{type:"stylesheet",stylesheet:{rules:l()}}}function j(){return m(/^{\s*/)}function k(){return m(/^}/)}function l(){var b,c=[];for(n(),o(c);a.length&&"}"!=a.charAt(0)&&(b=C()||E());)c.push(b),o(c);return c}function m(b){var c=b.exec(a);if(c){var e=c[0];return d(e),a=a.slice(e.length),c}}function n(){m(/^\s*/)}function o(a){var b;for(a=a||[];b=p();)a.push(b);return a}function p(){var b=e();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var c=2;""!=a.charAt(c)&&("*"!=a.charAt(c)||"/"!=a.charAt(c+1));)++c;if(c+=2,""===a.charAt(c-1))return h("End of comment missing");var f=a.slice(2,c-2);return G+=2,d(f),a=a.slice(c),G+=2,b({type:"comment",comment:f})}}function q(){var a=m(/^([^{]+)/);if(a)return b(a[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").split(/\s*,\s*/)}function r(){var a=e(),c=m(/^(\*?[-#\/\*\w]+(\[[0-9a-z_-]+\])?)\s*/);if(c){if(c=b(c[0]),!m(/^:\s*/))return h("property missing ':'");var d=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);if(!d)return h("property missing value");var f=a({type:"declaration",property:c.replace(D,""),value:b(d[0]).replace(D,"")});return m(/^[;\s]*/),f}}function s(){var a=[];if(!j())return h("missing '{'");o(a);for(var b;b=r();)a.push(b),o(a);return k()?a:h("missing '}'")}function t(){for(var a,b=[],c=e();a=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)b.push(a[1]),m(/^,\s*/);return b.length?c({type:"keyframe",values:b,declarations:s()}):void 0}function u(){var a=e(),b=m(/^@([-\w]+)?keyframes */);if(b){var c=b[1],b=m(/^([-\w]+)\s*/);if(!b)return h("@keyframes missing name");var d=b[1];if(!j())return h("@keyframes missing '{'");for(var f,g=o();f=t();)g.push(f),g=g.concat(o());return k()?a({type:"keyframes",name:d,vendor:c,keyframes:g}):h("@keyframes missing '}'")}}function v(){var a=e(),c=m(/^@supports *([^{]+)/);if(c){var d=b(c[1]);if(!j())return h("@supports missing '{'");var f=o().concat(l());return k()?a({type:"supports",supports:d,rules:f}):h("@supports missing '}'")}}function w(){var a=e(),b=m(/^@host */);if(b){if(!j())return h("@host missing '{'");var c=o().concat(l());return k()?a({type:"host",rules:c}):h("@host missing '}'")}}function x(){var a=e(),c=m(/^@media *([^{]+)/);if(c){var d=b(c[1]);if(!j())return h("@media missing '{'");var f=o().concat(l());return k()?a({type:"media",media:d,rules:f}):h("@media missing '}'")}}function y(){var a=e(),b=m(/^@page */);if(b){var c=q()||[];if(!j())return h("@page missing '{'");for(var d,f=o();d=r();)f.push(d),f=f.concat(o());return k()?a({type:"page",selectors:c,declarations:f}):h("@page missing '}'")}}function z(){var a=e(),c=m(/^@([-\w]+)?document *([^{]+)/);if(c){var d=b(c[1]),f=b(c[2]);if(!j())return h("@document missing '{'");var g=o().concat(l());return k()?a({type:"document",document:f,vendor:d,rules:g}):h("@document missing '}'")}}function A(){var a=e(),b=m(/^@font-face */);if(b){if(!j())return h("@font-face missing '{'");for(var c,d=o();c=r();)d.push(c),d=d.concat(o());return k()?a({type:"font-face",declarations:d}):h("@font-face missing '}'")}}function B(a){var b=new RegExp("^@"+a+" *([^;\\n]+);");return function(){var c=e(),d=m(b);if(d){var f={type:a};return f[a]=d[1].trim(),c(f)}}}function C(){return"@"==a[0]?u()||x()||v()||H()||I()||J()||z()||y()||w()||A():void 0}function E(){var a=e(),b=q();return b?(o(),a({type:"rule",selectors:b,declarations:s()})):h("selector missing")}c=c||{},c.position=c.position===!1?!1:!0;var F=1,G=1;f.prototype.content=a;var H=B("import"),I=B("charset"),J=B("namespace");return i()},d.helpers.Clone=function X(a){if(!a)return a;var b,c=[Number,String,Boolean];if(c.forEach(function(c){a instanceof c&&(b=c(a))}),"undefined"==typeof b)if("[object Array]"===Object.prototype.toString.call(a))b=[],a.forEach(function(a,c){b[c]=X(a)});else if("object"==typeof a)if(a.nodeType&&"function"==typeof a.cloneNode)var b=a.cloneNode(!0);else if(a.prototype)b=a;else if(a instanceof Date)b=new Date(a);else{b={};for(var d in a)b[d]=X(a[d])}else b=a;return b},d.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},d.helpers.Extend=function(){for(var a=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},b=arguments[0],c=1;c<arguments.length;c++)b=a(b,arguments[c]);return b};var E=function(a){var b,c;return(c=a.match(/^\-(w|m|s|o)+\-/)||"-"===a.charAt(0))&&!a.match(/^\-(webkit|moz|ms)+\-/)?null!==c&&c[0]?(b={prefix:c[0].replace(/-/g,"")},b.prop=a.replace(c[0],"")):(b={prefix:""},b.prop=a.substr(1,a.length)):b={prefix:!1,prop:a},b};d.helpers.Prefixes={addPrefixes:function(a,b){var c=a,d=E(a),e=b[a];d.prefix!==!1&&(delete b[c],b[d.prop]=e,(""===d.prefix||d.prefix.indexOf("w")>=0)&&(b["-webkit-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("m")>=0)&&(b["-moz-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("s")>=0)&&(b["-ms-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("o")>=0)&&(b["-o-"+d.prop]=e))},nonPrefixProp:function(a){var b=E(a);return b.prefix!==!1&&(b.prefix=""==b.prefix?"-":"-"+b.prefix+"-"),b}},d.helpers.RequireUncached=function(a){return delete e.cache[e.resolve(a)],e(a)},d.helpers.TransformUppercase=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};var F=function(a,b,d){var g="",h="",i=[],j=d.api;cssPreprocessor=e(f+"/../css/CSS.js")(),htmlPreprocessor=e(f+"/../html/HTML.js")();for(var k=function(a){for(var b=0;b<i.length,component=i[b];b++)"function"==typeof component&&(component=component()),j.add(component.css?component.css:{});cssPreprocessor(j.getRules(),function(b,c){g+=c,a(b)},d)},l=function(b){var c=0,e=null,f=function(){if(c>a.length-1)return void b(e);var g=a[c];"function"==typeof g&&(g=g()),j.morph("html").add(g.html?g.html:{}),htmlPreprocessor(j.getRules(),function(a,b){h+=b,c+=1,e=a,f()},d)};f()},m=function(a){for(var b in a)if("_include"===b)if(a[b]instanceof Array)for(var d=0;d<a[b].length,c=a[b][d];d++)"function"==typeof c&&(c=c()),i.push(c),m(c); else"function"==typeof a[b]&&(a[b]=a[b]()),i.push(a[b]),m(a[b]);else"object"==typeof a[b]&&m(a[b])},n=0;n<a.length,c=a[n];n++)"function"==typeof c&&(c=c()),i.push(c),m(c);j.flush(),k(function(a){j.morph("html"),l(function(c){b(a||c?{error:{css:a,html:c}}:null,g,h)})})};d.processors.component.Component=function(){var a=function(a,b,c){F(a.mainstream,b,c)};return a.type="component",a};var G="\n",H={combineSelectors:!0,minify:!1,keepCamelCase:!1},I=e("../../helpers/TransformUppercase"),z=e("../../helpers/Extend"),J=function(a,b,c){var d="";c=c||[""," "];for(var e in a)if(0===e.indexOf("____raw"))d+=a[e][e]+G;else{var f=c[0]+e.replace(/~~(.+)~~/,"").replace(/^%(.*)+?%/,"")+" {"+G,g="";for(var h in a[e]){var i=a[e][h];""===i&&(i='""'),h=h.replace(/~~(.+)~~/,"").replace(/^%(.*)+?%/,""),g+=b&&b.keepCamelCase===!0?c[1]+h+": "+i+";"+G:c[1]+I(h)+": "+i+";"+G}""!=g&&(f+=g,f+=c[0]+"}"+G,d+=f)}return d},K=function(a){var b={};for(var c in a){var d=a[c];if("mainstream"==c)for(var e in d){b[e]={};for(var f in d[e])b[e][f]=d[e][f]}else if(c.indexOf("@media")>=0){b[c]={};for(var e in d){b[c][e]={};for(var f in d[e])b[c][e][f]=d[e][f]}}}return b},L=function(a,b){var c=[],d={},b=[].concat(b||[]);b.splice(0,0,""),b=b.join("|");for(var e in a){var f=a[e];for(var g in f)c.push({selector:e,prop:g,value:f[g],combine:b.indexOf("|"+g)<0})}for(var h=0;h<c.length;h++)if(c[h].combine===!0&&c[h].selector!==!1)for(var i=h+1;i<c.length;i++)c[h].prop===c[i].prop&&c[h].value===c[i].value&&(c[h].selector+=", "+c[i].selector,c[i].selector=!1);for(var h=0;h<c.length;h++)c[h].selector!==!1&&(d[c[h].selector]||(d[c[h].selector]={}),d[c[h].selector][c[h].prop]=c[h].value);return d},M=function(a){return a=a.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),a=a.replace(/ {2,}/g," "),a=a.replace(/ ([{:}]) /g,"$1"),a=a.replace(/([;,]) /g,"$1"),a=a.replace(/ !/g,"!")},N=function(a,b){if(b&&b.api&&b.api.getStorage().__defined){var c=b.api.getStorage().__defined;for(var d in c){var e=new RegExp("<%( )?"+d+"( )?%>","g");a="function"!=typeof c[d]?a.replace(e,c[d]):a.replace(e,c[d]())}}return a};d.processors.css.CSS=function(){var a=function(a,b,c){if(c=c||H,c.api&&c.api.jsonify){var d=K(a,c);return b(null,d),d}var f="";for(var g in a){var h=a[g];h=c.combineSelectors?L(h,c.preventCombining):h,f+="mainstream"===g?J(h,c):g+" {"+G+J(h,c,[" "," "])+"}"+G}return f=N(f,c),c&&c.api&&c.api.dynamicCSS&&(f=e("../html/helpers/TemplateEngine")(f,c)),c.minify?(f=M(f),b&&b(null,f)):b&&b(null,f),f};return a.type="css",a},d.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},d.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},d.processors.css.plugins.keyframes=function(){return function(a,b){e(f+"/../CSS.js")(),e(f+"/../../../helpers/Prefixes");if("object"==typeof b){var c;if("undefined"!=typeof b.frames)c=b.frames;else if("undefined"!=typeof b.keyframes){c={};for(var d=0;rule=b.keyframes[d];d++)if("keyframe"===rule.type)for(var g=c[rule.values]={},h=0;declaration=rule.declarations[h];h++)"declaration"===declaration.type&&(g[declaration.property]=declaration.value)}if(a.jsonify){var i={};i.keyframes={name:b.name,frames:c},a.add(i)}else{var j=e(f+"/../../../../")();j.add(c).compile(function(c,d){var e="@keyframes "+b.name+" {\n";e+=d,e+="}",e=e+"\n"+e.replace("@keyframes","@-webkit-keyframes"),a.raw(e)},{combineSelectors:!1})}}}},d.processors.css.plugins.media=function(){return function(a,b){var c=e(f+"/../CSS.js")();if("object"==typeof b){for(var d="@media "+b.media+" {\n",g={},h={},i=0;rule=b.rules[i];i++){var j=g[rule.selectors.toString()]={},k=h[rule.selectors.toString()]={};if("rule"===rule.type)for(var l=0;declaration=rule.declarations[l];l++)"declaration"===declaration.type&&(j[declaration.property]=declaration.value,k[declaration.property]=declaration.value)}d+=c({mainstream:g}),d+="}",a.jsonify?a.add(h,"@media "+b.media):a.raw(d)}}},d.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},d.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},d.processors.css.plugins.supports=function(){return function(a,b){var c=e(f+"/../CSS.js")();if("object"==typeof b){for(var d="@supports "+b.supports+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}d+=c({mainstream:g}),d+="}",a.raw(d)}}};var O=null,G="\n",H={},P=e("js-beautify").html,Q=e("../../helpers/TransformUppercase"),R={},S=function(a){var b="";for(var c in O)if(c==a)for(var d=O[c].length,e=0;d>e;e++)b+=U("",O[c][e]);return b},T=function(a,b){return b&&b.keepCamelCase===!0?a:Q(a,b)},U=function(a,b){var c="",d="",f="",g=e("./helpers/PropAnalyzer")(a);if(a=g.tag,""!=g.attrs&&(d+=" "+g.attrs),"string"==typeof b||null===b)return V(a,d,b);var h=function(a){""!=f&&(f+=G),f+=a};for(var i in b){var j=b[i];switch(i){case"_attrs":for(var k in j)d+="function"==typeof j[k]?" "+T(k,R)+'="'+j[k]()+'"':" "+T(k,R)+'="'+j[k]+'"';break;case"_":h(j);break;case"_tpl":if("string"==typeof j)h(S(j));else if(j instanceof Array){for(var l="",m=0;tpl=j[m];m++)l+=S(tpl),m<j.length-1&&(l+=G);h(l)}break;case"_include":var l="",n=function(a){"function"==typeof a&&(a=a()),a.css&&a.html&&(a=a.html),l+=U("",a)};if(j instanceof Array)for(var m=0;m<j.length,o=j[m];m++)n(o);else"object"==typeof j&&n(j);h(l);break;default:switch(typeof j){case"string":h(U(i,j));break;case"object":if(j&&j.length&&j.length>0){for(var l="",m=0;v=j[m];m++)l+=U("","function"==typeof v?v():v),m<j.length-1&&(l+=G);h(U(i,l))}else h(U(i,j));break;case"function":h(U(i,j()))}}}return c+=""!=a?V(a,d,f):f},V=function(a,b,c){var d="";return""==a&&""==b&&""!=c?c:(a=""==a?"div":a,d+=null!==c?"<"+T(a,R)+b+">"+G+c+G+"</"+T(a,R)+">":"<"+T(a,R)+b+"/>")},W=function(a){return a=e("./helpers/TemplateEngine")(a.replace(/[\r\t\n]/g,""),R),R.minify?a:P(a,{indent_size:R.indentSize||4})};return d.processors.html.HTML=function(){var a=function(a,b,c){O=a,b=b||function(){},c=R=c||H;var d=W(S("mainstream"));return b(null,d),d};return a.type="html",a},d.processors.html.helpers.PropAnalyzer=function(a){var b={tag:"",attrs:""},d=(a.length,""),e=!1,f=[],g="",h=!1,i="",j=!1;if(/(#|\.|\[|\])/gi.test(a)===!1)return{tag:a,attrs:""};for(var k=0;k<a.length,c=a[k];k++)"["!==c||j?j?"]"!=c?i+=c:(j=!1,k-=1):"."!==c||e?e?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?d+=c:(f.push(d),e=!1,d="",k-=1):"#"!==c||h?h?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?g+=c:(h=!1,k-=1):"."!=c&&"#"!=c&&"["!=c&&"]"!=c&&(b.tag+=c):h=!0:e=!0:j=!0;""!=d&&f.push(d);for(var l="",k=0;cls=f[k];k++)l+=""===l?cls:" "+cls;return b.attrs+=""!=l?'class="'+l+'"':"",""!=g&&(b.attrs+=(""!=b.attrs?" ":"")+'id="'+g+'"'),""===b.tag&&""!=b.attrs&&(b.tag="div"),""!=i&&(b.attrs+=(""!=b.attrs?" ":"")+i),b},d.processors.html.helpers.TemplateEngine=function(a,b){for(var c,d=/<%(.+?)%>/g,e=/(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,f="with(obj) { var r=[];\n",g=0,h=function(a,b){return f+=b?a.match(e)?a+"\n":"r.push("+a+");\n":""!=a?'r.push("'+a.replace(/"/g,'\\"')+'");\n':"",h};match=d.exec(a);)h(a.slice(g,match.index))(match[1],!0),g=match.index+match[0].length;h(a.substr(g,a.length-g)),f=(f+'return r.join(""); }').replace(/[\r\t\n]/g,"");try{c=new Function("obj",f).apply(b,[b])}catch(i){console.error("'"+i.message+"'"," in \n\nCode:\n",f,"\n")}return c},y()}(window);
joseluisq/cdnjs
ajax/libs/absurd/0.3.24/absurd.min.js
JavaScript
mit
40,311
/*! * VERSION: beta 1.9.3 * DATE: 2013-04-04 * JavaScript * UPDATES AND DOCS AT: http://www.greensock.com * * @license Copyright (c) 2008-2013, GreenSock. All rights reserved. * This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com */ (window._gsQueue||(window._gsQueue=[])).push(function(){"use strict";window._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,b){var d,e,f,g,c=function(){a.call(this,"css"),this._overwriteProps.length=0},h={},i=c.prototype=new a("css");i.constructor=c,c.version="1.9.3",c.API=2,c.defaultTransformPerspective=0,i="px",c.suffixMap={top:i,right:i,bottom:i,left:i,width:i,height:i,fontSize:i,padding:i,margin:i,perspective:i};var I,J,K,L,M,N,j=/(?:\d|\-\d|\.\d|\-\.\d)+/g,k=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,l=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,m=/[^\d\-\.]/g,n=/(?:\d|\-|\+|=|#|\.)*/g,o=/opacity *= *([^)]*)/,p=/opacity:([^;]*)/,q=/alpha\(opacity *=.+?\)/i,r=/^(rgb|hsl)/,s=/([A-Z])/g,t=/-([a-z])/gi,u=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,v=function(a,b){return b.toUpperCase()},w=/(?:Left|Right|Width)/i,x=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,y=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,z=/,(?=[^\)]*(?:\(|$))/gi,A=Math.PI/180,B=180/Math.PI,C={},D=document,E=D.createElement("div"),F=D.createElement("img"),G=c._internals={_specialProps:h},H=navigator.userAgent,O=function(){var c,a=H.indexOf("Android"),b=D.createElement("div");return K=-1!==H.indexOf("Safari")&&-1===H.indexOf("Chrome")&&(-1===a||Number(H.substr(a+8,1))>3),M=K&&6>Number(H.substr(H.indexOf("Version/")+8,1)),L=-1!==H.indexOf("Firefox"),/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(H),N=parseFloat(RegExp.$1),b.innerHTML="<a style='top:1px;opacity:.55;'>a</a>",c=b.getElementsByTagName("a")[0],c?/^0.55/.test(c.style.opacity):!1}(),P=function(a){return o.test("string"==typeof a?a:(a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100:1},Q=function(a){window.console&&console.log(a)},R="",S="",T=function(a,b){b=b||E;var d,e,c=b.style;if(void 0!==c[a])return a;for(a=a.charAt(0).toUpperCase()+a.substr(1),d=["O","Moz","ms","Ms","Webkit"],e=5;--e>-1&&void 0===c[d[e]+a];);return e>=0?(S=3===e?"ms":d[e],R="-"+S.toLowerCase()+"-",S+a):null},U=D.defaultView?D.defaultView.getComputedStyle:function(){},V=c.getStyle=function(a,b,c,d,e){var f;return O||"opacity"!==b?(!d&&a.style[b]?f=a.style[b]:(c=c||U(a,null))?(a=c.getPropertyValue(b.replace(s,"-$1").toLowerCase()),f=a||c.length?a:c[b]):a.currentStyle&&(c=a.currentStyle,f=c[b]),null==e||f&&"none"!==f&&"auto"!==f&&"auto auto"!==f?f:e):P(a)},W=function(a,b,c,d,e){if("px"===d||!d)return c;if("auto"===d||!c)return 0;var j,f=w.test(b),g=a,h=E.style,i=0>c;return i&&(c=-c),"%"===d&&-1!==b.indexOf("border")?j=c/100*(f?a.clientWidth:a.clientHeight):(h.cssText="border-style:solid; border-width:0; position:absolute; line-height:0;","%"!==d&&g.appendChild?h[f?"borderLeftWidth":"borderTopWidth"]=c+d:(g=a.parentNode||D.body,h[f?"width":"height"]=c+d),g.appendChild(E),j=parseFloat(E[f?"offsetWidth":"offsetHeight"]),g.removeChild(E),0!==j||e||(j=W(a,b,c,d,!0))),i?-j:j},X=function(a,b,c){if("absolute"!==V(a,"position",c))return 0;var d="left"===b?"Left":"Top",e=V(a,"margin"+d,c);return a["offset"+d]-(W(a,b,parseFloat(e),e.replace(n,""))||0)},Y=function(a,b){var d,e,c={};if(b=b||U(a,null))if(d=b.length)for(;--d>-1;)c[b[d].replace(t,v)]=b.getPropertyValue(b[d]);else for(d in b)c[d]=b[d];else if(b=a.currentStyle||a.style)for(d in b)c[d.replace(t,v)]=b[d];return O||(c.opacity=P(a)),e=zb(a,b,!1),c.rotation=e.rotation*B,c.skewX=e.skewX*B,c.scaleX=e.scaleX,c.scaleY=e.scaleY,c.x=e.x,c.y=e.y,yb&&(c.z=e.z,c.rotationX=e.rotationX*B,c.rotationY=e.rotationY*B,c.scaleZ=e.scaleZ),c.filters&&delete c.filters,c},Z=function(a,b,c,d,e){var h,i,j,f={},g=a.style;for(i in c)"cssText"!==i&&"length"!==i&&isNaN(i)&&(b[i]!==(h=c[i])||e&&e[i])&&-1===i.indexOf("Origin")&&("number"==typeof h||"string"==typeof h)&&(f[i]="auto"!==h||"left"!==i&&"top"!==i?""!==h&&"auto"!==h&&"none"!==h||"string"!=typeof b[i]||""===b[i].replace(m,"")?h:0:X(a,i),void 0!==g[i]&&(j=new mb(g,i,g[i],j)));if(d)for(i in d)"className"!==i&&(f[i]=d[i]);return{difs:f,firstMPT:j}},$={width:["Left","Right"],height:["Top","Bottom"]},_=["marginLeft","marginRight","marginTop","marginBottom"],ab=function(a,b,c){var d=parseFloat("width"===b?a.offsetWidth:a.offsetHeight),e=$[b],f=e.length;for(c=c||U(a,null);--f>-1;)d-=parseFloat(V(a,"padding"+e[f],c,!0))||0,d-=parseFloat(V(a,"border"+e[f]+"Width",c,!0))||0;return d},bb=function(a,b){(null==a||""===a||"auto"===a||"auto auto"===a)&&(a="0 0");var c=a.split(" "),d=-1!==a.indexOf("left")?"0%":-1!==a.indexOf("right")?"100%":c[0],e=-1!==a.indexOf("top")?"0%":-1!==a.indexOf("bottom")?"100%":c[1];return null==e?e="0":"center"===e&&(e="50%"),("center"===d||isNaN(parseFloat(d)))&&(d="50%"),b&&(b.oxp=-1!==d.indexOf("%"),b.oyp=-1!==e.indexOf("%"),b.oxr="="===d.charAt(1),b.oyr="="===e.charAt(1),b.ox=parseFloat(d.replace(m,"")),b.oy=parseFloat(e.replace(m,""))),d+" "+e+(c.length>2?" "+c[2]:"")},cb=function(a,b){return"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2)):parseFloat(a)-parseFloat(b)},db=function(a,b){return null==a?b:"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*Number(a.substr(2))+b:parseFloat(a)},eb=function(a,b,c,d){var f,g,h,i,j,e=1e-6;return null==a?j=b:"number"==typeof a?j=a*A:(f=2*Math.PI,g=a.split("_"),h=Number(g[0].replace(m,""))*(-1===a.indexOf("rad")?A:1)-("="===a.charAt(1)?0:b),i=g[1],i&&d&&(d[c]=b+h),"short"===i?(h%=f,h!==h%(f/2)&&(h=0>h?h+f:h-f)):"cw"===i&&0>h?h=(h+9999999999*f)%f-(0|h/f)*f:"ccw"===i&&h>0&&(h=(h-9999999999*f)%f-(0|h/f)*f),j=b+h),e>j&&j>-e&&(j=0),j},fb={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},gb=function(a,b,c){return a=0>a?a+1:a>1?a-1:a,0|255*(1>6*a?b+6*(c-b)*a:.5>a?c:2>3*a?b+6*(c-b)*(2/3-a):b)+.5},hb=function(a){var b,c,d,e,f,g;return a&&""!==a?"number"==typeof a?[a>>16,255&a>>8,255&a]:(","===a.charAt(a.length-1)&&(a=a.substr(0,a.length-1)),fb[a]?fb[a]:"#"===a.charAt(0)?(4===a.length&&(b=a.charAt(1),c=a.charAt(2),d=a.charAt(3),a="#"+b+b+c+c+d+d),a=parseInt(a.substr(1),16),[a>>16,255&a>>8,255&a]):"hsl"===a.substr(0,3)?(a=a.match(j),e=Number(a[0])%360/360,f=Number(a[1])/100,g=Number(a[2])/100,c=.5>=g?g*(f+1):g+f-g*f,b=2*g-c,a.length>3&&(a[3]=Number(a[3])),a[0]=gb(e+1/3,b,c),a[1]=gb(e,b,c),a[2]=gb(e-1/3,b,c),a):(a=a.match(j)||fb.transparent,a[0]=Number(a[0]),a[1]=Number(a[1]),a[2]=Number(a[2]),a.length>3&&(a[3]=Number(a[3])),a)):fb.black},ib="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(i in fb)ib+="|"+i+"\\b";ib=RegExp(ib+")","gi");var jb=function(a,b,c,d){if(null==a)return function(a){return a};var n,e=b?(a.match(ib)||[""])[0]:"",f=a.split(e).join("").match(l)||[],g=a.substr(0,a.indexOf(f[0])),h=")"===a.charAt(a.length-1)?")":"",i=-1!==a.indexOf(" ")?" ":",",k=f.length,m=k>0?f[0].replace(j,""):"";return k?n=b?function(a){var b,j,o,p;if("number"==typeof a)a+=m;else if(d&&z.test(a)){for(p=a.replace(z,"|").split("|"),o=0;p.length>o;o++)p[o]=n(p[o]);return p.join(",")}if(b=(a.match(ib)||[e])[0],j=a.split(b).join("").match(l)||[],o=j.length,k>o--)for(;k>++o;)j[o]=c?j[(o-1)/2>>0]:f[o];return g+j.join(i)+i+b+h+(-1!==a.indexOf("inset")?" inset":"")}:function(a){var b,e,j;if("number"==typeof a)a+=m;else if(d&&z.test(a)){for(e=a.replace(z,"|").split("|"),j=0;e.length>j;j++)e[j]=n(e[j]);return e.join(",")}if(b=a.match(l)||[],j=b.length,k>j--)for(;k>++j;)b[j]=c?b[(j-1)/2>>0]:f[j];return g+b.join(i)+h}:function(a){return a}},kb=function(a){return a=a.split(","),function(b,c,d,e,f,g,h){var j,i=(c+"").split(" ");for(h={},j=0;4>j;j++)h[a[j]]=i[j]=i[j]||i[(j-1)/2>>0];return e.parse(b,h,f,g)}},mb=(G._setPluginRatio=function(a){this.plugin.setRatio(a);for(var f,g,h,i,b=this.data,c=b.proxy,d=b.firstMPT,e=1e-6;d;)f=c[d.v],d.r?f=f>0?f+.5>>0:f-.5>>0:e>f&&f>-e&&(f=0),d.t[d.p]=f,d=d._next;if(b.autoRotate&&(b.autoRotate.rotation=c.rotation),1===a)for(d=b.firstMPT;d;){if(g=d.t,g.type){if(1===g.type){for(i=g.xs0+g.s+g.xs1,h=1;g.l>h;h++)i+=g["xn"+h]+g["xs"+(h+1)];g.e=i}}else g.e=g.s+g.xs0;d=d._next}},function(a,b,c,d,e){this.t=a,this.p=b,this.v=c,this.r=e,d&&(d._prev=this,this._next=d)}),ob=(G._parseToProxy=function(a,b,c,d,e,f){var l,m,n,o,p,g=d,h={},i={},j=c._transform,k=C;for(c._transform=null,C=b,d=p=c.parse(a,b,d,e),C=k,f&&(c._transform=j,g&&(g._prev=null,g._prev&&(g._prev._next=null)));d&&d!==g;){if(1>=d.type&&(m=d.p,i[m]=d.s+d.c,h[m]=d.s,f||(o=new mb(d,"s",m,o,d.r),d.c=0),1===d.type))for(l=d.l;--l>0;)n="xn"+l,m=d.p+"_"+n,i[m]=d.data[n],h[m]=d[n],f||(o=new mb(d,n,m,o,d.rxp[n]));d=d._next}return{proxy:h,end:i,firstMPT:o,pt:p}},G.CSSPropTween=function(a,b,c,e,f,h,i,j,k,l,m){this.t=a,this.p=b,this.s=c,this.c=e,this.n=i||"css_"+b,a instanceof ob||g.push(this.n),this.r=j,this.type=h||0,k&&(this.pr=k,d=!0),this.b=void 0===l?c:l,this.e=void 0===m?c+e:m,f&&(this._next=f,f._prev=this)}),pb=c.parseComplex=function(a,b,c,d,e,f,g,h,i,l){g=new ob(a,b,0,0,g,l?2:1,null,!1,h,c,d),d+="";var q,s,t,u,v,w,x,y,A,B,C,D,m=c.split(", ").join(",").split(" "),n=d.split(", ").join(",").split(" "),o=m.length,p=I!==!1;for((-1!==d.indexOf(",")||-1!==c.indexOf(","))&&(m=m.join(" ").replace(z,", ").split(" "),n=n.join(" ").replace(z,", ").split(" "),o=m.length),o!==n.length&&(m=(f||"").split(" "),o=m.length),g.plugin=i,g.setRatio=l,q=0;o>q;q++)if(u=m[q],v=n[q],y=parseFloat(u),y||0===y)g.appendXtra("",y,cb(v,y),v.replace(k,""),p&&-1!==v.indexOf("px"),!0);else if(e&&("#"===u.charAt(0)||fb[u]||r.test(u)))D=","===v.charAt(v.length-1)?"),":")",u=hb(u),v=hb(v),A=u.length+v.length>6,A&&!O&&0===v[3]?(g["xs"+g.l]+=g.l?" transparent":"transparent",g.e=g.e.split(n[q]).join("transparent")):(O||(A=!1),g.appendXtra(A?"rgba(":"rgb(",u[0],v[0]-u[0],",",!0,!0).appendXtra("",u[1],v[1]-u[1],",",!0).appendXtra("",u[2],v[2]-u[2],A?",":D,!0),A&&(u=4>u.length?1:u[3],g.appendXtra("",u,(4>v.length?1:v[3])-u,D,!1)));else if(w=u.match(j)){if(x=v.match(k),!x||x.length!==w.length)return g;for(t=0,s=0;w.length>s;s++)C=w[s],B=u.indexOf(C,t),g.appendXtra(u.substr(t,B-t),Number(C),cb(x[s],C),"",p&&"px"===u.substr(B+C.length,2),0===s),t=B+C.length;g["xs"+g.l]+=u.substr(t)}else g["xs"+g.l]+=g.l?" "+u:u;if(-1!==d.indexOf("=")&&g.data){for(D=g.xs0+g.data.s,q=1;g.l>q;q++)D+=g["xs"+q]+g.data["xn"+q];g.e=D+g["xs"+q]}return g.l||(g.type=-1,g.xs0=g.e),g.xfirst||g},qb=9;for(i=ob.prototype,i.l=i.pr=0;--qb>0;)i["xn"+qb]=0,i["xs"+qb]="";i.xs0="",i._next=i._prev=i.xfirst=i.data=i.plugin=i.setRatio=i.rxp=null,i.appendXtra=function(a,b,c,d,e,f){var g=this,h=g.l;return g["xs"+h]+=f&&h?" "+a:a||"",c||0===h||g.plugin?(g.l++,g.type=g.setRatio?2:1,g["xs"+g.l]=d||"",h>0?(g.data["xn"+h]=b+c,g.rxp["xn"+h]=e,g["xn"+h]=b,g.plugin||(g.xfirst=new ob(g,"xn"+h,b,c,g.xfirst||g,0,g.n,e,g.pr),g.xfirst.xs0=0),g):(g.data={s:b+c},g.rxp={},g.s=b,g.c=c,g.r=e,g)):(g["xs"+h]+=b+(d||""),g)};var rb=function(a,b){b=b||{},this.p=b.prefix?T(a)||a:a,h[a]=h[this.p]=this,this.format=b.formatter||jb(b.defaultValue,b.color,b.collapsible,b.multi),b.parser&&(this.parse=b.parser),this.clrs=b.color,this.multi=b.multi,this.keyword=b.keyword,this.dflt=b.defaultValue,this.pr=b.priority||0},sb=G._registerComplexSpecialProp=function(a,b,c){"object"!=typeof b&&(b={parser:c});var f,g,d=a.split(","),e=b.defaultValue;for(c=c||[e],f=0;d.length>f;f++)b.prefix=0===f&&b.prefix,b.defaultValue=c[f]||e,g=new rb(d[f],b)},tb=function(a){if(!h[a]){var b=a.charAt(0).toUpperCase()+a.substr(1)+"Plugin";sb(a,{parser:function(a,c,d,e,f,g,i){var j=(window.GreenSockGlobals||window).com.greensock.plugins[b];return j?(j._cssRegister(),h[d].parse(a,c,d,e,f,g,i)):(Q("Error: "+b+" js file not loaded."),f)}})}};i=rb.prototype,i.parseComplex=function(a,b,c,d,e,f){var h,i,j,k,l,m,g=this.keyword;if(this.multi&&(z.test(c)||z.test(b)?(i=b.replace(z,"|").split("|"),j=c.replace(z,"|").split("|")):g&&(i=[b],j=[c])),j){for(k=j.length>i.length?j.length:i.length,h=0;k>h;h++)b=i[h]=i[h]||this.dflt,c=j[h]=j[h]||this.dflt,g&&(l=b.indexOf(g),m=c.indexOf(g),l!==m&&(c=-1===m?j:i,c[h]+=" "+g));b=i.join(", "),c=j.join(", ")}return pb(a,this.p,b,c,this.clrs,this.dflt,d,this.pr,e,f)},i.parse=function(a,b,c,d,e,g){return this.parseComplex(a.style,this.format(V(a,this.p,f,!1,this.dflt)),this.format(b),e,g)},c.registerSpecialProp=function(a,b,c){sb(a,{parser:function(a,d,e,f,g,h){var j=new ob(a,e,0,0,g,2,e,!1,c);return j.plugin=h,j.setRatio=b(a,d,f._tween,e),j},priority:c})};var ub="scaleX,scaleY,scaleZ,x,y,z,skewX,rotation,rotationX,rotationY,perspective".split(","),vb=T("transform"),wb=R+"transform",xb=T("transformOrigin"),yb=null!==T("perspective"),zb=function(a,b,d){var l,m,n,o,p,q,r,s,t,u,v,w,y,e=d?a._gsTransform||{skewY:0}:{skewY:0},f=0>e.scaleX,g=2e-5,h=1e5,i=-Math.PI+1e-4,j=Math.PI-1e-4,k=yb?parseFloat(V(a,xb,b,!1,"0 0 0").split(" ")[2])||e.zOrigin||0:0;for(vb?l=V(a,wb,b,!0):a.currentStyle&&(l=a.currentStyle.filter.match(x),l=l&&4===l.length?l[0].substr(4)+","+Number(l[2].substr(4))+","+Number(l[1].substr(4))+","+l[3].substr(4)+","+(e?e.x:0)+","+(e?e.y:0):null),m=(l||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],n=m.length;--n>-1;)o=Number(m[n]),m[n]=(p=o-(o|=0))?(0|p*h+(0>p?-.5:.5))/h+o:o;if(16===m.length){var z=m[8],A=m[9],B=m[10],C=m[12],D=m[13],E=m[14];if(e.zOrigin&&(E=-e.zOrigin,C=z*E-m[12],D=A*E-m[13],E=B*E+e.zOrigin-m[14]),!d||C!==e.x||D!==e.y||E!==e.z){var Q,R,S,T,U,W,X,Y,F=m[0],G=m[1],H=m[2],I=m[3],J=m[4],K=m[5],L=m[6],M=m[7],N=m[11],O=e.rotationX=Math.atan2(L,B),P=i>O||O>j;O&&(U=Math.cos(-O),W=Math.sin(-O),Q=J*U+z*W,R=K*U+A*W,S=L*U+B*W,T=M*U+N*W,z=J*-W+z*U,A=K*-W+A*U,B=L*-W+B*U,N=M*-W+N*U,J=Q,K=R,L=S),O=e.rotationY=Math.atan2(z,F),O&&(X=i>O||O>j,U=Math.cos(-O),W=Math.sin(-O),Q=F*U-z*W,R=G*U-A*W,S=H*U-B*W,T=I*U-N*W,A=G*W+A*U,B=H*W+B*U,N=I*W+N*U,F=Q,G=R,H=S),O=e.rotation=Math.atan2(G,K),O&&(Y=i>O||O>j,U=Math.cos(-O),W=Math.sin(-O),F=F*U+J*W,R=G*U+K*W,K=G*-W+K*U,L=H*-W+L*U,G=R),Y&&P?e.rotation=e.rotationX=0:Y&&X?e.rotation=e.rotationY=0:X&&P&&(e.rotationY=e.rotationX=0),e.scaleX=(Math.sqrt(F*F+G*G)*h+.5>>0)/h,e.scaleY=(Math.sqrt(K*K+A*A)*h+.5>>0)/h,e.scaleZ=(Math.sqrt(L*L+B*B)*h+.5>>0)/h,e.skewX=0,e.perspective=N?1/(0>N?-N:N):0,e.x=C,e.y=D,e.z=E}}else if(!(yb&&0!==m.length&&e.x===m[4]&&e.y===m[5]&&(e.rotationX||e.rotationY)||void 0!==e.x&&"none"===V(a,"display",b))){var Z=m.length>=6,$=Z?m[0]:1,_=m[1]||0,ab=m[2]||0,bb=Z?m[3]:1;e.x=m[4]||0,e.y=m[5]||0,q=Math.sqrt($*$+_*_),r=Math.sqrt(bb*bb+ab*ab),s=$||_?Math.atan2(_,$):e.rotation||0,t=ab||bb?Math.atan2(ab,bb)+s:e.skewX||0,u=q-Math.abs(e.scaleX||0),v=r-Math.abs(e.scaleY||0),Math.abs(t)>Math.PI/2&&Math.abs(t)<1.5*Math.PI&&(f?(q*=-1,t+=0>=s?Math.PI:-Math.PI,s+=0>=s?Math.PI:-Math.PI):(r*=-1,t+=0>=t?Math.PI:-Math.PI)),w=(s-e.rotation)%Math.PI,y=(t-e.skewX)%Math.PI,(void 0===e.skewX||u>g||-g>u||v>g||-g>v||w>i&&j>w&&0!==w*h>>0||y>i&&j>y&&0!==y*h>>0)&&(e.scaleX=q,e.scaleY=r,e.rotation=s,e.skewX=t),yb&&(e.rotationX=e.rotationY=e.z=0,e.perspective=parseFloat(c.defaultTransformPerspective)||0,e.scaleZ=1)}e.zOrigin=k;for(n in e)g>e[n]&&e[n]>-g&&(e[n]=0);return d&&(a._gsTransform=e),e},Ab=function(a){var l,m,b=this.data,c=-b.rotation,d=c+b.skewX,e=1e5,f=(Math.cos(c)*b.scaleX*e>>0)/e,g=(Math.sin(c)*b.scaleX*e>>0)/e,h=(Math.sin(d)*-b.scaleY*e>>0)/e,i=(Math.cos(d)*b.scaleY*e>>0)/e,j=this.t.style,k=this.t.currentStyle;if(k){m=g,g=-h,h=-m,l=k.filter,j.filter="";var v,w,p=this.t.offsetWidth,q=this.t.offsetHeight,r="absolute"!==k.position,s="progid:DXImageTransform.Microsoft.Matrix(M11="+f+", M12="+g+", M21="+h+", M22="+i,t=b.x,u=b.y;if(null!=b.ox&&(v=(b.oxp?.01*p*b.ox:b.ox)-p/2,w=(b.oyp?.01*q*b.oy:b.oy)-q/2,t+=v-(v*f+w*g),u+=w-(v*h+w*i)),r)v=p/2,w=q/2,s+=", Dx="+(v-(v*f+w*g)+t)+", Dy="+(w-(v*h+w*i)+u)+")";else{var z,A,B,x=8>N?1:-1;for(v=b.ieOffsetX||0,w=b.ieOffsetY||0,b.ieOffsetX=Math.round((p-((0>f?-f:f)*p+(0>g?-g:g)*q))/2+t),b.ieOffsetY=Math.round((q-((0>i?-i:i)*q+(0>h?-h:h)*p))/2+u),qb=0;4>qb;qb++)A=_[qb],z=k[A],m=-1!==z.indexOf("px")?parseFloat(z):W(this.t,A,parseFloat(z),z.replace(n,""))||0,B=m!==b[A]?2>qb?-b.ieOffsetX:-b.ieOffsetY:2>qb?v-b.ieOffsetX:w-b.ieOffsetY,j[A]=(b[A]=Math.round(m-B*(0===qb||2===qb?1:x)))+"px";s+=", sizingMethod='auto expand')"}j.filter=-1!==l.indexOf("DXImageTransform.Microsoft.Matrix(")?l.replace(y,s):s+" "+l,(0===a||1===a)&&1===f&&0===g&&0===h&&1===i&&(r&&-1===s.indexOf("Dx=0, Dy=0")||o.test(l)&&100!==parseFloat(RegExp.$1)||-1===l.indexOf("gradient(")&&j.removeAttribute("filter"))}},Bb=function(){var x,y,z,A,B,C,D,E,F,b=this.data,c=this.t.style,d=b.perspective,e=b.scaleX,f=0,g=0,h=0,i=0,j=b.scaleY,k=0,l=0,m=0,n=0,o=b.scaleZ,p=0,q=0,r=0,s=d?-1/d:0,t=b.rotation,u=b.zOrigin,v=",",w=1e5;L&&(D=c.top?"top":c.bottom?"bottom":parseFloat(V(this.t,"top",null,!1))?"bottom":"top",z=V(this.t,D,null,!1),E=parseFloat(z)||0,F=z.substr((E+"").length)||"px",b._ffFix=!b._ffFix,c[D]=(b._ffFix?E+.05:E-.05)+F),(t||b.skewX)&&(z=e*Math.cos(t),A=j*Math.sin(t),t-=b.skewX,f=e*-Math.sin(t),j*=Math.cos(t),e=z,i=A),t=b.rotationY,t&&(x=Math.cos(t),y=Math.sin(t),z=e*x,A=i*x,B=o*-y,C=s*-y,g=e*y,k=i*y,o*=x,s*=x,e=z,i=A,m=B,q=C),t=b.rotationX,t&&(x=Math.cos(t),y=Math.sin(t),z=f*x+g*y,A=j*x+k*y,B=n*x+o*y,C=r*x+s*y,g=f*-y+g*x,k=j*-y+k*x,o=n*-y+o*x,s=r*-y+s*x,f=z,j=A,n=B,r=C),u&&(p-=u,h=g*p,l=k*p,p=o*p+u),h=(z=(h+=b.x)-(h|=0))?(0|z*w+(0>z?-.5:.5))/w+h:h,l=(z=(l+=b.y)-(l|=0))?(0|z*w+(0>z?-.5:.5))/w+l:l,p=(z=(p+=b.z)-(p|=0))?(0|z*w+(0>z?-.5:.5))/w+p:p,c[vb]="matrix3d("+(e*w>>0)/w+v+(i*w>>0)/w+v+(m*w>>0)/w+v+(q*w>>0)/w+v+(f*w>>0)/w+v+(j*w>>0)/w+v+(n*w>>0)/w+v+(r*w>>0)/w+v+(g*w>>0)/w+v+(k*w>>0)/w+v+(o*w>>0)/w+v+(s*w>>0)/w+v+h+v+l+v+p+v+(d?1+-p/d:1)+")"},Cb=function(){var e,f,g,h,i,j,k,l,m,b=this.data,c=this.t,d=c.style;L&&(e=d.top?"top":d.bottom?"bottom":parseFloat(V(c,"top",null,!1))?"bottom":"top",f=V(c,e,null,!1),g=parseFloat(f)||0,h=f.substr((g+"").length)||"px",b._ffFix=!b._ffFix,d[e]=(b._ffFix?g+.05:g-.05)+h),b.rotation||b.skewX?(i=b.rotation,j=i-b.skewX,k=1e5,l=b.scaleX*k,m=b.scaleY*k,d[vb]="matrix("+(Math.cos(i)*l>>0)/k+","+(Math.sin(i)*l>>0)/k+","+(Math.sin(j)*-m>>0)/k+","+(Math.cos(j)*m>>0)/k+","+b.x+","+b.y+")"):d[vb]="matrix("+b.scaleX+",0,0,"+b.scaleY+","+b.x+","+b.y+")"};sb("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation",{parser:function(a,b,c,d,e,g,h){if(d._transform)return e;var o,p,q,r,s,t,u,i=d._transform=zb(a,f,!0),j=a.style,k=1e-6,l=ub.length,m=h,n={};if("string"==typeof m.transform&&vb)q=j.cssText,j[vb]=m.transform,j.display="block",o=zb(a,null,!1),j.cssText=q;else if("object"==typeof m){if(o={scaleX:db(null!=m.scaleX?m.scaleX:m.scale,i.scaleX),scaleY:db(null!=m.scaleY?m.scaleY:m.scale,i.scaleY),scaleZ:db(null!=m.scaleZ?m.scaleZ:m.scale,i.scaleZ),x:db(m.x,i.x),y:db(m.y,i.y),z:db(m.z,i.z),perspective:db(m.transformPerspective,i.perspective)},u=m.directionalRotation,null!=u)if("object"==typeof u)for(q in u)m[q]=u[q];else m.rotation=u;o.rotation=eb("rotation"in m?m.rotation:"shortRotation"in m?m.shortRotation+"_short":"rotationZ"in m?m.rotationZ:i.rotation*B,i.rotation,"rotation",n),yb&&(o.rotationX=eb("rotationX"in m?m.rotationX:"shortRotationX"in m?m.shortRotationX+"_short":i.rotationX*B||0,i.rotationX,"rotationX",n),o.rotationY=eb("rotationY"in m?m.rotationY:"shortRotationY"in m?m.shortRotationY+"_short":i.rotationY*B||0,i.rotationY,"rotationY",n)),o.skewX=null==m.skewX?i.skewX:eb(m.skewX,i.skewX),o.skewY=null==m.skewY?i.skewY:eb(m.skewY,i.skewY),(p=o.skewY-i.skewY)&&(o.skewX+=p,o.rotation+=p)}for(s=i.z||i.rotationX||i.rotationY||o.z||o.rotationX||o.rotationY||o.perspective,s||null==m.scale||(o.scaleZ=1);--l>-1;)c=ub[l],r=o[c]-i[c],(r>k||-k>r||null!=C[c])&&(t=!0,e=new ob(i,c,i[c],r,e),c in n&&(e.e=n[c]),e.xs0=0,e.plugin=g,d._overwriteProps.push(e.n));return r=m.transformOrigin,(r||yb&&s&&i.zOrigin)&&(vb?(t=!0,r=(r||V(a,c,f,!1,"50% 50%"))+"",c=xb,e=new ob(j,c,0,0,e,-1,"css_transformOrigin"),e.b=j[c],e.plugin=g,yb?(q=i.zOrigin,r=r.split(" "),i.zOrigin=(r.length>2?parseFloat(r[2]):q)||0,e.xs0=e.e=j[c]=r[0]+" "+(r[1]||"50%")+" 0px",e=new ob(i,"zOrigin",0,0,e,-1,e.n),e.b=q,e.xs0=e.e=i.zOrigin):e.xs0=e.e=j[c]=r):bb(r+"",i)),t&&(d._transformType=s||3===this._transformType?3:2),e},prefix:!0}),sb("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),sb("borderRadius",{defaultValue:"0px",parser:function(a,b,c,d,g){b=this.format(b);var k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,i=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],j=a.style;for(s=parseFloat(a.offsetWidth),t=parseFloat(a.offsetHeight),k=b.split(" "),l=0;i.length>l;l++)this.p.indexOf("border")&&(i[l]=T(i[l])),o=n=V(a,i[l],f,!1,"0px"),-1!==o.indexOf(" ")&&(n=o.split(" "),o=n[0],n=n[1]),p=m=k[l],q=parseFloat(o),v=o.substr((q+"").length),w="="===p.charAt(1),w?(r=parseInt(p.charAt(0)+"1",10),p=p.substr(2),r*=parseFloat(p),u=p.substr((r+"").length-(0>r?1:0))||""):(r=parseFloat(p),u=p.substr((r+"").length)),""===u&&(u=e[c]||v),u!==v&&(x=W(a,"borderLeft",q,v),y=W(a,"borderTop",q,v),"%"===u?(o=100*(x/s)+"%",n=100*(y/t)+"%"):"em"===u?(z=W(a,"borderLeft",1,"em"),o=x/z+"em",n=y/z+"em"):(o=x+"px",n=y+"px"),w&&(p=parseFloat(o)+r+u,m=parseFloat(n)+r+u)),g=pb(j,i[l],o+" "+n,p+" "+m,!1,"0px",g);return g},prefix:!0,formatter:jb("0px 0px 0px 0px",!1,!0)}),sb("backgroundPosition",{defaultValue:"0 0",parser:function(a,b,c,d,e,g){var l,m,n,o,p,q,h="background-position",i=f||U(a,null),j=this.format((i?N?i.getPropertyValue(h+"-x")+" "+i.getPropertyValue(h+"-y"):i.getPropertyValue(h):a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY)||"0 0"),k=this.format(b);if(-1!==j.indexOf("%")!=(-1!==k.indexOf("%"))&&(q=V(a,"backgroundImage").replace(u,""),q&&"none"!==q)){for(l=j.split(" "),m=k.split(" "),F.setAttribute("src",q),n=2;--n>-1;)j=l[n],o=-1!==j.indexOf("%"),o!==(-1!==m[n].indexOf("%"))&&(p=0===n?a.offsetWidth-F.width:a.offsetHeight-F.height,l[n]=o?parseFloat(j)/100*p+"px":100*(parseFloat(j)/p)+"%");j=l.join(" ")}return this.parseComplex(a.style,j,k,e,g)},formatter:bb}),sb("backgroundSize",{defaultValue:"0 0",formatter:bb}),sb("perspective",{defaultValue:"0px",prefix:!0}),sb("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),sb("transformStyle",{prefix:!0}),sb("backfaceVisibility",{prefix:!0}),sb("margin",{parser:kb("marginTop,marginRight,marginBottom,marginLeft")}),sb("padding",{parser:kb("paddingTop,paddingRight,paddingBottom,paddingLeft")}),sb("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(a,b,c,d,e,g){var h,i,j;return 9>N?(i=a.currentStyle,j=8>N?" ":",",h="rect("+i.clipTop+j+i.clipRight+j+i.clipBottom+j+i.clipLeft+")",b=this.format(b).split(",").join(j)):(h=this.format(V(a,this.p,f,!1,this.dflt)),b=this.format(b)),this.parseComplex(a.style,h,b,e,g)}}),sb("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),sb("autoRound,strictUnits",{parser:function(a,b,c,d,e){return e}}),sb("border",{defaultValue:"0px solid #000",parser:function(a,b,c,d,e,g){return this.parseComplex(a.style,this.format(V(a,"borderTopWidth",f,!1,"0px")+" "+V(a,"borderTopStyle",f,!1,"solid")+" "+V(a,"borderTopColor",f,!1,"#000")),this.format(b),e,g)},color:!0,formatter:function(a){var b=a.split(" ");return b[0]+" "+(b[1]||"solid")+" "+(a.match(ib)||["#000"])[0]}}),sb("float,cssFloat,styleFloat",{parser:function(a,b,c,d,e){var g=a.style,h="cssFloat"in g?"cssFloat":"styleFloat";return new ob(g,h,0,0,e,-1,c,!1,0,g[h],b)}});var Db=function(a){var e,b=this.t,c=b.filter,d=this.s+this.c*a>>0;100===d&&(-1===c.indexOf("atrix(")&&-1===c.indexOf("radient(")?(b.removeAttribute("filter"),e=!V(this.data,"filter")):(b.filter=c.replace(q,""),e=!0)),e||(this.xn1&&(b.filter=c=c||"alpha(opacity=100)"),-1===c.indexOf("opacity")?b.filter+=" alpha(opacity="+d+")":b.filter=c.replace(o,"opacity="+d))};sb("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(a,b,c,d,e,g){var j,h=parseFloat(V(a,"opacity",f,!1,"1")),i=a.style;return b=parseFloat(b),"autoAlpha"===c&&(j=V(a,"visibility",f),1===h&&"hidden"===j&&0!==b&&(h=0),e=new ob(i,"visibility",0,0,e,-1,null,!1,0,0!==h?"visible":"hidden",0===b?"hidden":"visible"),e.xs0="visible",d._overwriteProps.push(e.n)),O?e=new ob(i,"opacity",h,b-h,e):(e=new ob(i,"opacity",100*h,100*(b-h),e),e.xn1="autoAlpha"===c?1:0,i.zoom=1,e.type=2,e.b="alpha(opacity="+e.s+")",e.e="alpha(opacity="+(e.s+e.c)+")",e.data=a,e.plugin=g,e.setRatio=Db),e}});var Eb=function(a,b){b&&(a.removeProperty?a.removeProperty(b.replace(s,"-$1").toLowerCase()):a.removeAttribute(b))},Fb=function(a){if(this.t._gsClassPT=this,1===a||0===a){this.t.className=0===a?this.b:this.e;for(var b=this.data,c=this.t.style;b;)b.v?c[b.p]=b.v:Eb(c,b.p),b=b._next;1===a&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.className!==this.e&&(this.t.className=this.e)};sb("className",{parser:function(a,b,c,e,g,h,i){var l,m,n,o,p,j=a.className,k=a.style.cssText;if(g=e._classNamePT=new ob(a,c,0,0,g,2),g.setRatio=Fb,g.pr=-11,d=!0,g.b=j,m=Y(a,f),n=a._gsClassPT){for(o={},p=n.data;p;)o[p.p]=1,p=p._next;n.setRatio(1)}return a._gsClassPT=g,g.e="="!==b.charAt(1)?b:j.replace(RegExp("\\s*\\b"+b.substr(2)+"\\b"),"")+("+"===b.charAt(0)?" "+b.substr(2):""),e._tween._duration&&(a.className=g.e,l=Z(a,m,Y(a),i,o),a.className=j,g.data=l.firstMPT,a.style.cssText=k,g=g.xfirst=e.parse(a,l.difs,g,h)),g}});var Gb=function(a){if((1===a||0===a)&&this.data._totalTime===this.data._totalDuration)for(var g,b="all"===this.e,c=this.t.style,d=b?c.cssText.split(";"):this.e.split(","),e=d.length,f=h.transform.parse;--e>-1;)g=d[e],b&&(g=g.substr(0,g.indexOf(":")).split(" ").join("")),h[g]&&(g=h[g].parse===f?vb:h[g].p),Eb(c,g)};for(sb("clearProps",{parser:function(a,b,c,e,f){return f=new ob(a,c,0,0,f,2),f.setRatio=Gb,f.e=b,f.pr=-10,f.data=e._tween,d=!0,f}}),i="bezier,throwProps,physicsProps,physics2D".split(","),qb=i.length;qb--;)tb(i[qb]);i=c.prototype,i._firstPT=null,i._onInitTween=function(a,b,h){if(!a.nodeType)return!1;this._target=a,this._tween=h,this._vars=b,I=b.autoRound,d=!1,e=b.suffixMap||c.suffixMap,f=U(a,""),g=this._overwriteProps;var j,k,l,m,n,o,q,r,s,i=a.style;if(J&&""===i.zIndex&&(j=V(a,"zIndex",f),("auto"===j||""===j)&&(i.zIndex=0)),"string"==typeof b&&(m=i.cssText,j=Y(a,f),i.cssText=m+";"+b,j=Z(a,j,Y(a)).difs,!O&&p.test(b)&&(j.opacity=parseFloat(RegExp.$1)),b=j,i.cssText=m),this._firstPT=k=this.parse(a,b,null),this._transformType){for(s=3===this._transformType,vb?K&&(J=!0,""===i.zIndex&&(q=V(a,"zIndex",f),("auto"===q||""===q)&&(i.zIndex=0)),M&&(i.WebkitBackfaceVisibility=this._vars.WebkitBackfaceVisibility||(s?"visible":"hidden"))):i.zoom=1,l=k;l&&l._next;)l=l._next;r=new ob(a,"transform",0,0,null,2),this._linkCSSP(r,null,l),r.setRatio=s&&yb?Bb:vb?Cb:Ab,r.data=this._transform||zb(a,f,!0),g.pop()}if(d){for(;k;){for(o=k._next,l=m;l&&l.pr>k.pr;)l=l._next;(k._prev=l?l._prev:n)?k._prev._next=k:m=k,(k._next=l)?l._prev=k:n=k,k=o}this._firstPT=m}return!0},i.parse=function(a,b,c,d){var i,j,k,l,m,o,p,q,s,t,g=a.style;for(i in b)o=b[i],j=h[i],j?c=j.parse(a,o,i,this,c,d,b):(m=V(a,i,f)+"",s="string"==typeof o,"color"===i||"fill"===i||"stroke"===i||-1!==i.indexOf("Color")||s&&r.test(o)?(s||(o=hb(o),o=(o.length>3?"rgba(":"rgb(")+o.join(",")+")"),c=pb(g,i,m,o,!0,"transparent",c,0,d)):!s||-1===o.indexOf(" ")&&-1===o.indexOf(",")?(k=parseFloat(m),p=k||0===k?m.substr((k+"").length):"",(""===m||"auto"===m)&&("width"===i||"height"===i?(k=ab(a,i,f),p="px"):"left"===i||"top"===i?(k=X(a,i,f),p="px"):(k="opacity"!==i?0:1,p="")),t=s&&"="===o.charAt(1),t?(l=parseInt(o.charAt(0)+"1",10),o=o.substr(2),l*=parseFloat(o),q=o.replace(n,"")):(l=parseFloat(o),q=s?o.substr((l+"").length)||"":""),""===q&&(q=e[i]||p),o=l||0===l?(t?l+k:l)+q:b[i],p!==q&&""!==q&&(l||0===l)&&(k||0===k)&&(k=W(a,i,k,p),"%"===q?(k/=W(a,i,100,"%")/100,k>100&&(k=100),b.strictUnits!==!0&&(m=k+"%")):"em"===q?k/=W(a,i,1,"em"):(l=W(a,i,l,q),q="px"),t&&(l||0===l)&&(o=l+k+q)),t&&(l+=k),!k&&0!==k||!l&&0!==l?o||"NaN"!=o+""&&null!=o?(c=new ob(g,i,l||k||0,0,c,-1,"css_"+i,!1,0,m,o),c.xs0="none"!==o||"display"!==i&&-1===i.indexOf("Style")?o:m):Q("invalid "+i+" tween value: "+b[i]):(c=new ob(g,i,k,l-k,c,0,"css_"+i,I!==!1&&("px"===q||"zIndex"===i),0,m,o),c.xs0=q)):c=pb(g,i,m,o,!0,null,c,0,d)),d&&c&&!c.plugin&&(c.plugin=d);return c},i.setRatio=function(a){var d,e,f,b=this._firstPT,c=1e-6;if(1!==a||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(a||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;b;){if(d=b.c*a+b.s,b.r?d=d>0?d+.5>>0:d-.5>>0:c>d&&d>-c&&(d=0),b.type)if(1===b.type)if(f=b.l,2===f)b.t[b.p]=b.xs0+d+b.xs1+b.xn1+b.xs2;else if(3===f)b.t[b.p]=b.xs0+d+b.xs1+b.xn1+b.xs2+b.xn2+b.xs3;else if(4===f)b.t[b.p]=b.xs0+d+b.xs1+b.xn1+b.xs2+b.xn2+b.xs3+b.xn3+b.xs4;else if(5===f)b.t[b.p]=b.xs0+d+b.xs1+b.xn1+b.xs2+b.xn2+b.xs3+b.xn3+b.xs4+b.xn4+b.xs5;else{for(e=b.xs0+d+b.xs1,f=1;b.l>f;f++)e+=b["xn"+f]+b["xs"+(f+1)];b.t[b.p]=e}else-1===b.type?b.t[b.p]=b.xs0:b.setRatio&&b.setRatio(a);else b.t[b.p]=d+b.xs0;b=b._next}else for(;b;)2!==b.type?b.t[b.p]=b.b:b.setRatio(a),b=b._next;else for(;b;)2!==b.type?b.t[b.p]=b.e:b.setRatio(a),b=b._next},i._enableTransforms=function(a){this._transformType=a||3===this._transformType?3:2},i._linkCSSP=function(a,b,c,d){return a&&(b&&(b._prev=a),a._next&&(a._next._prev=a._prev),c?c._next=a:d||null!==this._firstPT||(this._firstPT=a),a._prev?a._prev._next=a._next:this._firstPT===a&&(this._firstPT=a._next),a._next=b,a._prev=c),a},i._kill=function(b){var d,e,f,c=b;if(b.css_autoAlpha||b.css_alpha){c={};for(e in b)c[e]=b[e];c.css_opacity=1,c.css_autoAlpha&&(c.css_visibility=1)}return b.css_className&&(d=this._classNamePT)&&(f=d.xfirst,f&&f._prev?this._linkCSSP(f._prev,d._next,f._prev._prev):f===this._firstPT&&(this._firstPT=d._next),d._next&&this._linkCSSP(d._next,d._next._next,f._prev),this._classNamePT=null),a.prototype._kill.call(this,c)};var Hb=function(a,b,c){var d,e,f,g;if(a.slice)for(e=a.length;--e>-1;)Hb(a[e],b,c);else for(d=a.childNodes,e=d.length;--e>-1;)f=d[e],g=f.type,f.style&&(b.push(Y(f)),c&&c.push(f)),1!==g&&9!==g&&11!==g||!f.childNodes.length||Hb(f,b,c)};return c.cascadeTo=function(a,c,d){var k,l,m,e=b.to(a,c,d),f=[e],g=[],h=[],i=[],j=b._internals.reservedProps;for(a=e._targets||e.target,Hb(a,g,i),e.render(c,!0),Hb(a,h),e.render(0,!0),e._enabled(!0),k=i.length;--k>-1;)if(l=Z(i[k],g[k],h[k]),l.firstMPT){l=l.difs;for(m in d)j[m]&&(l[m]=d[m]);f.push(b.to(i[k],c,l))}return f},a.activate([c]),c},!0)}),window._gsDefine&&window._gsQueue.pop()();
lmccart/cdnjs
ajax/libs/gsap/1.9.3/plugins/CSSPlugin.min.js
JavaScript
mit
30,917
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/Latin1Supplement.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{161:[468,218,330,96,202],162:[579,138,500,53,448],163:[676,8,500,12,490],164:[534,10,500,-22,522],165:[662,0,500,-53,512],166:[676,14,200,67,133],167:[676,148,500,70,426],169:[676,14,760,38,722],170:[676,-394,276,4,270],171:[416,-33,500,42,456],173:[257,-194,333,39,285],174:[676,14,760,38,722],176:[676,-390,400,57,343],178:[676,-270,300,1,296],179:[676,-262,300,13,291],180:[678,-507,333,93,317],181:[450,218,500,36,512],182:[662,154,592,60,532],184:[0,215,333,52,261],185:[676,-270,300,57,248],186:[676,-394,310,6,304],187:[416,-33,500,43,458],188:[676,14,750,42,713],189:[676,14,750,36,741],190:[676,14,750,13,718],191:[467,218,444,30,376],192:[928,0,722,15,707],193:[928,0,722,15,707],194:[924,0,722,15,707],195:[888,0,722,15,707],196:[872,0,722,15,707],197:[961,0,722,15,707],198:[662,0,889,0,863],199:[676,215,667,28,633],200:[928,0,611,12,597],201:[928,0,611,12,597],202:[924,0,611,12,597],203:[872,0,611,12,597],204:[928,0,333,18,315],205:[928,0,333,18,315],206:[924,0,333,10,321],207:[872,0,333,17,315],208:[662,0,722,16,685],209:[888,11,722,12,707],210:[928,14,722,34,688],211:[928,14,722,34,688],212:[924,14,722,34,688],213:[888,14,722,34,688],214:[872,14,722,34,688],216:[734,80,722,34,688],217:[928,14,722,14,705],218:[928,14,722,14,705],219:[924,14,722,14,705],220:[872,14,722,14,705],221:[928,0,722,22,703],222:[662,0,556,16,542],223:[683,9,500,12,468],224:[678,10,444,37,442],225:[678,10,444,37,442],226:[674,10,444,37,442],227:[638,10,444,37,442],228:[622,10,444,37,442],229:[713,10,444,37,442],230:[460,7,667,38,632],231:[460,215,444,25,412],232:[678,10,444,25,424],233:[678,10,444,25,424],234:[674,10,444,25,424],235:[622,10,444,25,424],236:[678,0,278,6,243],237:[678,0,278,16,273],238:[674,0,278,-17,294],239:[622,0,278,-10,288],240:[686,10,500,29,471],241:[638,0,500,16,485],242:[678,10,500,29,470],243:[678,10,500,29,470],244:[674,10,500,29,470],245:[638,10,500,29,470],246:[622,10,500,29,470],248:[551,112,500,29,470],249:[678,10,500,9,480],250:[678,10,500,9,480],251:[674,10,500,9,480],252:[622,10,500,9,480],253:[678,218,500,14,475],254:[683,217,500,5,470],255:[622,218,500,14,475]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/Latin1Supplement.js");
Sneezry/cdnjs
ajax/libs/mathjax/2.3.0/jax/output/HTML-CSS/fonts/STIX/General/Regular/Latin1Supplement.js
JavaScript
mit
3,001
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbolsAndArrows.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{11026:[662,157,910,45,865],11027:[662,157,910,45,865],11028:[662,157,910,45,865],11029:[662,157,910,45,865],11030:[744,242,1064,39,1025],11031:[744,242,1064,39,1025],11032:[744,242,1064,39,1025],11033:[744,242,1064,39,1025],11034:[662,157,910,45,865],11035:[780,180,1040,40,1000],11036:[780,180,1040,40,1000],11037:[332,-172,240,50,190],11038:[332,-172,240,50,190],11039:[690,105,910,36,874],11040:[690,105,910,36,874],11041:[680,178,910,82,828],11042:[680,178,910,82,828],11043:[633,127,926,24,902],11044:[785,282,1207,70,1137],11045:[581,96,779,45,734],11046:[581,96,779,45,734],11047:[609,105,544,40,504],11048:[609,105,544,40,504],11049:[488,-16,523,26,497],11050:[488,-16,357,26,331],11051:[488,-16,357,26,331],11052:[500,-4,842,50,792],11053:[500,-4,842,50,792],11054:[623,119,596,50,546],11055:[623,119,596,50,546],11056:[448,-57,926,70,856],11057:[739,232,926,60,866],11058:[569,61,1200,52,1147],11059:[449,-58,1574,55,1519],11060:[450,-57,926,56,871],11061:[450,-57,926,55,871],11062:[450,-57,926,55,871],11063:[449,-57,1412,55,1357],11064:[449,-57,926,55,873],11065:[450,-57,926,55,871],11066:[450,-57,926,55,871],11067:[449,-57,926,55,871],11068:[450,-57,926,55,871],11069:[450,-57,926,50,876],11070:[449,-57,926,55,871],11071:[449,-57,926,55,871],11072:[565,-57,926,55,871],11073:[508,-57,926,55,871],11074:[449,141,926,55,871],11075:[532,26,926,45,871],11076:[532,26,926,45,871],11077:[701,195,928,55,873],11078:[701,195,928,55,873],11079:[508,-57,926,55,871],11080:[449,141,926,55,871],11081:[508,-57,926,55,871],11082:[449,141,926,55,871],11083:[449,2,926,55,871],11084:[449,2,926,55,871],11088:[619,30,794,60,734],11089:[619,30,794,60,734],11090:[597,13,700,35,665],11091:[712,126,865,45,840],11092:[712,127,865,45,840]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/MiscSymbolsAndArrows.js");
luhad/cdnjs
ajax/libs/mathjax/2.3/jax/output/HTML-CSS/fonts/STIX/General/Regular/MiscSymbolsAndArrows.js
JavaScript
mit
2,637
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiactForSymbols.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{8400:[760,-627,0,-453,-17],8401:[760,-627,0,-453,-17],8402:[662,156,0,-242,-192],8406:[760,-548,0,-453,-17],8411:[622,-523,0,-462,35],8412:[622,-523,0,-600,96],8413:[725,221,0,-723,223],8414:[780,180,0,-730,230],8415:[843,341,0,-840,344],8417:[760,-548,0,-453,25],8420:[1023,155,0,-970,490],8421:[662,156,0,-430,-40],8422:[662,156,0,-335,-102],8423:[725,178,0,-650,166],8424:[-119,218,0,-462,35],8425:[681,-538,0,-480,53],8426:[419,-87,0,-658,118],8427:[756,217,0,-448,193],8428:[-119,252,0,-453,-17],8429:[-119,252,0,-453,-17],8430:[-40,252,0,-453,-17],8431:[-40,252,0,-453,-17],8432:[819,-517,0,-357,-87]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/CombDiactForSymbols.js");
jonathantneal/cdnjs
ajax/libs/mathjax/2.3.0/jax/output/HTML-CSS/fonts/STIX/General/Regular/CombDiactForSymbols.js
JavaScript
mit
1,506
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuppMathOperators.js * * Copyright (c) 2009-2013 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXGeneral,{10759:[763,259,1180,83,1097],10760:[763,259,1180,83,1097],10761:[763,259,1021,50,971],10762:[763,259,914,58,856],10763:[824,320,690,33,659],10764:[824,320,1184,32,1364],10765:[824,320,499,32,639],10766:[824,320,499,32,639],10767:[824,320,499,32,639],10768:[824,320,499,32,639],10769:[824,320,499,32,639],10770:[824,320,519,32,639],10771:[824,320,499,32,639],10772:[824,320,628,32,688],10773:[824,320,499,32,639],10774:[824,320,529,32,639],10775:[824,320,738,32,818],10776:[824,320,539,32,639],10777:[824,320,559,32,639],10778:[824,320,559,32,639],10779:[947,320,459,32,639],10780:[824,443,459,32,639],10781:[770,252,1270,93,1177],10782:[764,258,1018,45,924],10783:[566,291,503,110,410],10784:[633,127,1177,98,1079],10785:[805,300,547,215,472],10786:[819,41,685,48,636],10787:[707,41,685,48,636],10788:[704,41,685,48,636],10789:[547,235,685,48,636],10790:[547,198,685,48,636],10791:[547,210,685,41,673],10792:[547,41,685,48,636],10793:[556,-220,685,48,637],10794:[286,5,685,48,637],10795:[511,5,685,48,637],10796:[511,5,685,48,637],10797:[623,119,724,50,674],10798:[623,119,724,50,674],10799:[447,-59,490,50,439],10800:[686,25,640,43,597],10801:[529,130,640,43,597],10802:[529,45,640,43,597],10803:[538,32,685,57,627],10804:[623,119,674,50,624],10805:[623,119,674,50,624],10806:[810,119,842,50,792],10807:[752,248,1100,50,1050],10808:[623,119,842,50,792],10809:[811,127,1145,35,1110],10810:[811,127,1145,35,1110],10811:[811,127,1145,35,1110],10812:[393,-115,600,48,552],10813:[393,-115,600,48,552],10814:[488,170,300,60,230],10816:[536,31,620,48,572],10817:[536,31,620,48,572],10818:[668,31,620,48,572],10819:[668,31,620,48,572],10820:[536,31,620,48,572],10821:[536,31,620,48,572],10822:[914,406,620,48,572],10823:[914,406,620,48,572],10824:[914,406,620,48,572],10825:[914,406,620,48,572],10826:[528,39,1078,48,1030],10827:[527,40,1078,48,1030],10828:[602,31,620,10,610],10829:[536,97,620,10,610],10830:[536,31,620,48,572],10831:[536,31,620,48,572],10832:[602,31,620,10,610],10833:[710,29,620,31,589],10834:[710,29,620,31,589],10835:[536,29,620,31,589],10836:[536,29,620,31,589],10837:[536,29,780,32,748],10838:[536,29,780,32,748],10839:[536,29,706,106,683],10840:[536,29,706,23,600],10841:[585,77,620,31,589],10842:[536,29,620,31,589],10843:[536,29,620,31,589],10844:[536,29,620,31,589],10845:[536,29,620,31,589],10846:[796,29,620,31,589],10847:[536,139,620,30,590],10848:[536,289,620,30,590],10849:[479,0,620,45,575],10850:[806,29,620,30,590],10851:[536,289,620,30,590],10852:[791,284,1043,70,1008],10853:[791,284,1043,70,1008],10854:[386,105,685,48,637],10855:[703,-28,685,48,637],10856:[695,189,685,48,637],10857:[662,156,685,48,637],10858:[521,-148,685,48,637],10859:[521,13,685,48,637],10860:[543,38,685,48,637],10861:[703,27,685,48,637],10862:[847,-120,685,48,637],10863:[707,-25,685,48,637],10864:[650,146,685,48,637],10865:[648,141,685,48,637],10866:[648,141,685,48,637],10867:[532,27,685,48,637],10868:[417,-89,1015,48,967],10869:[386,-120,997,48,949],10870:[386,-120,1436,48,1388],10871:[611,106,685,48,637],10872:[703,-28,685,38,647],10873:[532,26,685,44,609],10874:[532,26,685,76,641],10875:[806,26,685,44,609],10876:[806,26,685,76,641],10877:[625,137,685,56,621],10878:[625,137,685,56,621],10879:[625,137,685,60,625],10880:[625,137,685,60,625],10881:[625,137,685,60,625],10882:[625,137,685,60,625],10883:[777,137,685,60,625],10884:[777,137,685,60,625],10885:[746,275,685,48,637],10886:[746,275,685,48,637],10887:[628,216,685,60,625],10888:[628,216,687,56,621],10889:[746,309,685,48,637],10890:[746,309,685,48,637],10891:[930,424,685,56,621],10892:[930,424,685,56,621],10893:[746,176,685,48,637],10894:[746,176,685,48,637],10895:[867,361,685,60,649],10896:[867,361,685,60,649],10897:[844,338,685,55,630],10898:[844,338,685,55,630],10899:[866,361,685,60,625],10900:[866,361,685,60,625],10901:[640,122,685,56,621],10902:[640,122,685,56,621],10903:[640,122,685,56,621],10904:[640,122,685,56,621],10905:[718,211,685,60,625],10906:[718,211,685,60,625],10907:[726,220,685,60,625],10908:[726,220,685,60,625],10909:[664,164,685,53,642],10910:[664,164,685,43,632],10911:[774,267,685,48,637],10912:[774,267,685,48,637],10913:[532,26,685,44,609],10914:[532,26,685,76,641],10915:[609,103,933,25,908],10916:[532,26,782,60,722],10917:[532,26,855,60,795],10918:[532,26,685,35,625],10919:[532,26,685,60,650],10920:[625,137,685,50,640],10921:[626,137,685,45,635],10922:[537,31,685,45,609],10923:[537,31,685,76,640],10924:[613,103,685,60,625],10925:[613,103,685,60,625],10926:[563,-28,685,48,637],10929:[628,216,685,60,625],10930:[628,216,685,60,625],10931:[717,211,685,60,625],10932:[717,211,685,60,625],10933:[747,260,685,65,622],10934:[747,260,685,65,622],10935:[747,275,685,48,637],10936:[747,275,685,48,637],10937:[747,309,685,48,637],10938:[747,309,685,48,637],10939:[532,26,933,25,908],10940:[532,26,933,25,908],10941:[532,26,685,60,625],10942:[532,26,685,60,625],10943:[607,103,685,60,625],10944:[607,103,685,60,625],10945:[607,103,685,60,625],10946:[607,103,685,60,625],10947:[709,103,685,60,625],10948:[709,103,685,60,625],10949:[717,211,685,64,622],10950:[717,211,685,65,623],10951:[665,164,685,60,625],10952:[665,164,685,60,625],10953:[746,274,685,60,625],10954:[746,274,685,60,625],10955:[717,319,685,61,619],10956:[717,319,685,66,624],10957:[558,53,1352,64,1288],10958:[558,53,1352,64,1288],10959:[532,26,685,50,615],10960:[532,26,685,70,635],10961:[609,103,685,60,626],10962:[609,103,685,60,625],10963:[715,209,685,60,625],10964:[715,209,685,60,625],10965:[715,209,685,60,625],10966:[715,209,685,60,625],10967:[532,26,1250,60,1190],10968:[532,26,1250,60,1190],10969:[536,31,620,48,572],10970:[697,128,620,48,572],10971:[695,97,620,48,572],10972:[557,10,620,11,572],10973:[557,10,620,48,572],10974:[662,0,497,64,433],10975:[371,0,685,48,637],10976:[371,0,685,48,637],10977:[662,0,685,48,637],10978:[662,0,685,60,625],10979:[662,0,860,46,803],10980:[662,0,685,60,625],10981:[662,0,860,46,803],10982:[662,0,685,57,626],10983:[571,0,685,48,637],10984:[571,0,685,48,637],10985:[691,185,685,48,637],10986:[662,0,685,48,637],10987:[662,0,685,48,637],10988:[489,-18,600,48,552],10989:[489,-18,600,48,552],10990:[690,189,404,23,381],10991:[660,154,502,101,401],10992:[660,154,502,101,401],10993:[693,187,502,101,401],10994:[695,189,523,10,513],10995:[695,189,685,48,637],10996:[695,189,685,131,555],10997:[695,189,685,12,674],10998:[608,102,685,279,406],10999:[661,155,1170,58,1080],11000:[661,155,1170,90,1112],11001:[726,220,685,60,625],11002:[726,220,685,60,625],11003:[710,222,894,46,848],11004:[763,259,654,94,560],11005:[710,222,709,46,663],11006:[690,189,410,100,310],11007:[763,259,478,94,384]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/General/Regular/SuppMathOperators.js");
pzp1997/cdnjs
ajax/libs/mathjax/2.3/jax/output/HTML-CSS/fonts/STIX/General/Regular/SuppMathOperators.js
JavaScript
mit
7,497
/* * L.TileLayer is used for standard xyz-numbered tile layers. */ /* global ymaps: true */ L.Yandex = L.Class.extend({ includes: L.Mixin.Events, options: { minZoom: 0, maxZoom: 18, attribution: '', opacity: 1, traffic: false }, possibleShortMapTypes: { schemaMap: 'map', satelliteMap: 'satellite', hybridMap: 'hybrid', publicMap: 'publicMap', publicMapInHybridView: 'publicMapHybrid' }, _getPossibleMapType: function (mapType) { var result = 'yandex#map'; if (typeof mapType !== 'string') { return result; } for (var key in this.possibleShortMapTypes) { if (mapType === this.possibleShortMapTypes[key]) { result = 'yandex#' + mapType; break; } if (mapType === ('yandex#' + this.possibleShortMapTypes[key])) { result = mapType; } } return result; }, // Possible types: yandex#map, yandex#satellite, yandex#hybrid, yandex#publicMap, yandex#publicMapHybrid // Or their short names: map, satellite, hybrid, publicMap, publicMapHybrid initialize: function(type, options) { L.Util.setOptions(this, options); //Assigning an initial map type for the Yandex layer this._type = this._getPossibleMapType(type); }, onAdd: function(map, insertAtTheBottom) { this._map = map; this._insertAtTheBottom = insertAtTheBottom; // create a container div for tiles this._initContainer(); this._initMapObject(); // set up events map.on('viewreset', this._resetCallback, this); this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this); map.on('move', this._update, this); map._controlCorners.bottomright.style.marginBottom = '3em'; this._reset(); this._update(true); }, onRemove: function(map) { this._map._container.removeChild(this._container); this._map.off('viewreset', this._resetCallback, this); this._map.off('move', this._update, this); map._controlCorners.bottomright.style.marginBottom = '0em'; }, getAttribution: function() { return this.options.attribution; }, setOpacity: function(opacity) { this.options.opacity = opacity; if (opacity < 1) { L.DomUtil.setOpacity(this._container, opacity); } }, setElementSize: function(e, size) { e.style.width = size.x + 'px'; e.style.height = size.y + 'px'; }, _initContainer: function() { var tilePane = this._map._container, first = tilePane.firstChild; if (!this._container) { this._container = L.DomUtil.create('div', 'leaflet-yandex-layer leaflet-top leaflet-left'); this._container.id = '_YMapContainer_' + L.Util.stamp(this); this._container.style.zIndex = 'auto'; } if (this.options.overlay) { first = this._map._container.getElementsByClassName('leaflet-map-pane')[0]; first = first.nextSibling; // XXX: Bug with layer order if (L.Browser.opera) this._container.className += ' leaflet-objects-pane'; } tilePane.insertBefore(this._container, first); this.setOpacity(this.options.opacity); this.setElementSize(this._container, this._map.getSize()); }, _initMapObject: function() { if (this._yandex) return; // Check that ymaps.Map is ready if (ymaps.Map === undefined) { return ymaps.load(['package.map'], this._initMapObject, this); } // If traffic layer is requested check if control.TrafficControl is ready if (this.options.traffic) if (ymaps.control === undefined || ymaps.control.TrafficControl === undefined) { return ymaps.load(['package.traffic', 'package.controls'], this._initMapObject, this); } //Creating ymaps map-object without any default controls on it var map = new ymaps.Map(this._container, { center: [0, 0], zoom: 0, behaviors: [], controls: [] }); if (this.options.traffic) map.controls.add(new ymaps.control.TrafficControl({shown: true})); if (this._type === 'yandex#null') { this._type = new ymaps.MapType('null', []); map.container.getElement().style.background = 'transparent'; } map.setType(this._type); this._yandex = map; this._update(true); //Reporting that map-object was initialized this.fire('MapObjectInitialized', { mapObject: map }); }, _resetCallback: function(e) { this._reset(e.hard); }, _reset: function(clearOldContainer) { this._initContainer(); }, _update: function(force) { if (!this._yandex) return; this._resize(force); var center = this._map.getCenter(); var _center = [center.lat, center.lng]; var zoom = this._map.getZoom(); if (force || this._yandex.getZoom() !== zoom) this._yandex.setZoom(zoom); this._yandex.panTo(_center, {duration: 0, delay: 0}); }, _resize: function(force) { var size = this._map.getSize(), style = this._container.style; if (style.width === size.x + 'px' && style.height === size.y + 'px') if (force !== true) return; this.setElementSize(this._container, size); var b = this._map.getBounds(), sw = b.getSouthWest(), ne = b.getNorthEast(); this._yandex.container.fitToViewport(); } });
CyrusSUEN/cdnjs
ajax/libs/leaflet-plugins/1.5.0/layer/tile/Yandex.js
JavaScript
mit
4,938
<?php /* * This file is part of the Monolog package. * * (c) Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Monolog\Logger; use Monolog\Formatter\JsonFormatter; class AmqpHandler extends AbstractProcessingHandler { /** * @var \AMQPExchange $exchange */ protected $exchange; /** * @param \AMQPExchange $exchange AMQP exchange, ready for use * @param string $exchangeName * @param int $level * @param bool $bubble Whether the messages that are handled can bubble up the stack or not */ public function __construct(\AMQPExchange $exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true) { $this->exchange = $exchange; $this->exchange->setName($exchangeName); parent::__construct($level, $bubble); } /** * {@inheritDoc} */ protected function write(array $record) { $data = $record["formatted"]; $routingKey = sprintf( '%s.%s', substr($record['level_name'], 0, 4), $record['channel'] ); $this->exchange->publish( $data, strtolower($routingKey), 0, array( 'delivery_mode' => 2, 'Content-type' => 'application/json' ) ); } /** * {@inheritDoc} */ protected function getDefaultFormatter() { return new JsonFormatter(); } }
Lullaby460/Pumped
vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php
PHP
mit
1,644
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "fm", "em" ], "DAY": [ "s\u00f6ndag", "m\u00e5ndag", "tisdag", "onsdag", "torsdag", "fredag", "l\u00f6rdag" ], "ERANAMES": [ "f\u00f6re Kristus", "efter Kristus" ], "ERAS": [ "f.Kr.", "e.Kr." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december" ], "SHORTDAY": [ "s\u00f6n", "m\u00e5n", "tis", "ons", "tors", "fre", "l\u00f6r" ], "SHORTMONTH": [ "jan.", "feb.", "mars", "apr.", "maj", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec." ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE'en' 'den' d:'e' MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "dd-MM-y HH:mm", "shortDate": "dd-MM-y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20ac", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "sv-fi", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
samthor/cdnjs
ajax/libs/angular-i18n/1.4.3/angular-locale_sv-fi.js
JavaScript
mit
2,540
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "sn.", "gn." ], "DAY": [ "Axad", "Isniin", "Talaado", "Arbaco", "Khamiis", "Jimco", "Sabti" ], "ERANAMES": [ "Ciise ka hor (CS)", "Ciise ka dib (CS)" ], "ERAS": [ "CK", "CD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Bisha Koobaad", "Bisha Labaad", "Bisha Saddexaad", "Bisha Afraad", "Bisha Shanaad", "Bisha Lixaad", "Bisha Todobaad", "Bisha Sideedaad", "Bisha Sagaalaad", "Bisha Tobnaad", "Bisha Kow iyo Tobnaad", "Bisha Laba iyo Tobnaad" ], "SHORTDAY": [ "Axd", "Isn", "Tal", "Arb", "Kha", "Jim", "Sab" ], "SHORTMONTH": [ "Kob", "Lab", "Sad", "Afr", "Sha", "Lix", "Tod", "Sid", "Sag", "Tob", "KIT", "LIT" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, MMMM dd, y", "longDate": "dd MMMM y", "medium": "dd-MMM-y h:mm:ss a", "mediumDate": "dd-MMM-y", "mediumTime": "h:mm:ss a", "short": "dd/MM/yy h:mm a", "shortDate": "dd/MM/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Fdj", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "so-dj", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
steadiest/cdnjs
ajax/libs/angular.js/1.4.0-rc.1/i18n/angular-locale_so-dj.js
JavaScript
mit
2,576
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sande", "Orwokubanza", "Orwakabiri", "Orwakashatu", "Orwakana", "Orwakataano", "Orwamukaaga" ], "ERANAMES": [ "Kurisito Atakaijire", "Kurisito Yaijire" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Okwokubanza", "Okwakabiri", "Okwakashatu", "Okwakana", "Okwakataana", "Okwamukaaga", "Okwamushanju", "Okwamunaana", "Okwamwenda", "Okwaikumi", "Okwaikumi na kumwe", "Okwaikumi na ibiri" ], "SHORTDAY": [ "SAN", "ORK", "OKB", "OKS", "OKN", "OKT", "OMK" ], "SHORTMONTH": [ "KBZ", "KBR", "KST", "KKN", "KTN", "KMK", "KMS", "KMN", "KMW", "KKM", "KNK", "KNB" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "UGX", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "cgg-ug", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
fredericksilva/cdnjs
ajax/libs/angular.js/1.4.0-rc.1/i18n/angular-locale_cgg-ug.js
JavaScript
mit
2,559
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "Tesiran", "Teipa" ], "DAY": [ "Mderot ee are", "Mderot ee kuni", "Mderot ee ong\u2019wan", "Mderot ee inet", "Mderot ee ile", "Mderot ee sapa", "Mderot ee kwe" ], "ERANAMES": [ "Kabla ya Christo", "Baada ya Christo" ], "ERAS": [ "KK", "BK" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Lapa le obo", "Lapa le waare", "Lapa le okuni", "Lapa le ong\u2019wan", "Lapa le imet", "Lapa le ile", "Lapa le sapa", "Lapa le isiet", "Lapa le saal", "Lapa le tomon", "Lapa le tomon obo", "Lapa le tomon waare" ], "SHORTDAY": [ "Are", "Kun", "Ong", "Ine", "Ile", "Sap", "Kwe" ], "SHORTMONTH": [ "Obo", "Waa", "Oku", "Ong", "Ime", "Ile", "Sap", "Isi", "Saa", "Tom", "Tob", "Tow" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Ksh", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "saq-ke", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
CrossEye/cdnjs
ajax/libs/angular.js/1.4.0-beta.6/i18n/angular-locale_saq-ke.js
JavaScript
mit
2,626
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u1295\u1309\u1206 \u1230\u12d3\u1270", "\u12f5\u1215\u122d \u1230\u12d3\u1275" ], "DAY": [ "\u1230\u1295\u1260\u1275", "\u1230\u1291\u12ed", "\u1230\u1209\u1235", "\u1228\u1261\u12d5", "\u1213\u1219\u1235", "\u12d3\u122d\u1262", "\u1240\u12f3\u121d" ], "ERANAMES": [ "\u12d3/\u12d3", "\u12d3/\u121d" ], "ERAS": [ "\u12d3/\u12d3", "\u12d3/\u121d" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u1325\u122a", "\u1208\u12ab\u1272\u1275", "\u1218\u130b\u1262\u1275", "\u121a\u12eb\u12dd\u12eb", "\u130d\u1295\u1266\u1275", "\u1230\u1290", "\u1213\u121d\u1208", "\u1290\u1213\u1230", "\u1218\u1235\u12a8\u1228\u121d", "\u1325\u1245\u121d\u1272", "\u1215\u12f3\u122d", "\u1273\u1215\u1233\u1235" ], "SHORTDAY": [ "\u1230\u1295\u1260\u1275", "\u1230\u1291\u12ed", "\u1230\u1209\u1235", "\u1228\u1261\u12d5", "\u1213\u1219\u1235", "\u12d3\u122d\u1262", "\u1240\u12f3\u121d" ], "SHORTMONTH": [ "\u1325\u122a", "\u1208\u12ab\u1272", "\u1218\u130b\u1262", "\u121a\u12eb\u12dd", "\u130d\u1295\u1266", "\u1230\u1290", "\u1213\u121d\u1208", "\u1290\u1213\u1230", "\u1218\u1235\u12a8", "\u1325\u1245\u121d", "\u1215\u12f3\u122d", "\u1273\u1215\u1233" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE\u1361 dd MMMM \u1218\u12d3\u120d\u1272 y G", "longDate": "dd MMMM y", "medium": "dd-MMM-y h:mm:ss a", "mediumDate": "dd-MMM-y", "mediumTime": "h:mm:ss a", "short": "dd/MM/yy h:mm a", "shortDate": "dd/MM/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Nfk", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "ti-er", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
ppoffice/cdnjs
ajax/libs/angular.js/1.4.0-rc.2/i18n/angular-locale_ti-er.js
JavaScript
mit
3,135
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u092a\u0942\u0930\u094d\u0935 \u092e\u0927\u094d\u092f\u093e\u0928\u094d\u0939", "\u0909\u0924\u094d\u0924\u0930 \u092e\u0927\u094d\u092f\u093e\u0928\u094d\u0939" ], "DAY": [ "\u0906\u0907\u0924\u092c\u093e\u0930", "\u0938\u094b\u092e\u092c\u093e\u0930", "\u092e\u0919\u094d\u0917\u0932\u092c\u093e\u0930", "\u092c\u0941\u0927\u092c\u093e\u0930", "\u092c\u093f\u0939\u0940\u092c\u093e\u0930", "\u0936\u0941\u0915\u094d\u0930\u092c\u093e\u0930", "\u0936\u0928\u093f\u092c\u093e\u0930" ], "ERANAMES": [ "\u0908\u0938\u093e \u092a\u0942\u0930\u094d\u0935", "\u0938\u0928\u094d" ], "ERAS": [ "\u0908\u0938\u093e \u092a\u0942\u0930\u094d\u0935", "\u0938\u0928\u094d" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "\u091c\u0928\u0935\u0930\u0940", "\u092b\u0947\u092c\u094d\u0930\u0941\u0905\u0930\u0940", "\u092e\u093e\u0930\u094d\u091a", "\u0905\u092a\u094d\u0930\u093f\u0932", "\u092e\u0947", "\u091c\u0941\u0928", "\u091c\u0941\u0932\u093e\u0908", "\u0905\u0917\u0938\u094d\u091f", "\u0938\u0947\u092a\u094d\u091f\u0947\u092e\u094d\u092c\u0930", "\u0905\u0915\u094d\u091f\u094b\u092c\u0930", "\u0928\u094b\u092d\u0947\u092e\u094d\u092c\u0930", "\u0921\u093f\u0938\u0947\u092e\u094d\u092c\u0930" ], "SHORTDAY": [ "\u0906\u0907\u0924", "\u0938\u094b\u092e", "\u092e\u0919\u094d\u0917\u0932", "\u092c\u0941\u0927", "\u092c\u093f\u0939\u0940", "\u0936\u0941\u0915\u094d\u0930", "\u0936\u0928\u093f" ], "SHORTMONTH": [ "\u091c\u0928\u0935\u0930\u0940", "\u092b\u0947\u092c\u094d\u0930\u0941\u0905\u0930\u0940", "\u092e\u093e\u0930\u094d\u091a", "\u0905\u092a\u094d\u0930\u093f\u0932", "\u092e\u0947", "\u091c\u0941\u0928", "\u091c\u0941\u0932\u093e\u0908", "\u0905\u0917\u0938\u094d\u091f", "\u0938\u0947\u092a\u094d\u091f\u0947\u092e\u094d\u092c\u0930", "\u0905\u0915\u094d\u091f\u094b\u092c\u0930", "\u0928\u094b\u092d\u0947\u092e\u094d\u092c\u0930", "\u0921\u093f\u0938\u0947\u092e\u094d\u092c\u0930" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "y MMMM d, EEEE", "longDate": "y MMMM d", "medium": "y MMM d HH:mm:ss", "mediumDate": "y MMM d", "mediumTime": "HH:mm:ss", "short": "y-MM-dd HH:mm", "shortDate": "y-MM-dd", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Rs", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "ne", "pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
tjbp/cdnjs
ajax/libs/angular-i18n/1.4.2/angular-locale_ne.js
JavaScript
mit
3,466
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-gd", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
bspaulding/cdnjs
ajax/libs/angular.js/1.4.2/i18n/angular-locale_en-gd.js
JavaScript
mit
2,464
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi" ], "ERANAMES": [ "Kabla ya Kristo", "Baada ya Kristo" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba" ], "SHORTDAY": [ "Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi" ], "SHORTMONTH": [ "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Ksh", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "sw-ke", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
samthor/cdnjs
ajax/libs/angular-i18n/1.4.0/angular-locale_sw-ke.js
JavaScript
mit
2,503
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "SLL", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-sl", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
eduardo-costa/cdnjs
ajax/libs/angular.js/1.4.0-rc.0/i18n/angular-locale_en-sl.js
JavaScript
mit
2,466
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 5, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "WEEKENDRANGE": [ 4, 5 ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "SDG", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-sd", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
zhangbg/cdnjs
ajax/libs/angular.js/1.4.0-rc.0/i18n/angular-locale_en-sd.js
JavaScript
mit
2,466
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u04d5\u043c\u0431\u0438\u0441\u0431\u043e\u043d\u044b \u0440\u0430\u0437\u043c\u04d5", "\u04d5\u043c\u0431\u0438\u0441\u0431\u043e\u043d\u044b \u0444\u04d5\u0441\u0442\u04d5" ], "DAY": [ "\u0445\u0443\u044b\u0446\u0430\u0443\u0431\u043e\u043d", "\u043a\u044a\u0443\u044b\u0440\u0438\u0441\u04d5\u0440", "\u0434\u044b\u0446\u0446\u04d5\u0433", "\u04d5\u0440\u0442\u044b\u0446\u0446\u04d5\u0433", "\u0446\u044b\u043f\u043f\u04d5\u0440\u04d5\u043c", "\u043c\u0430\u0439\u0440\u04d5\u043c\u0431\u043e\u043d", "\u0441\u0430\u0431\u0430\u0442" ], "ERANAMES": [ "\u043d.\u0434.\u0430.", "\u043d.\u0434." ], "ERAS": [ "\u043d.\u0434.\u0430.", "\u043d.\u0434." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u044f\u043d\u0432\u0430\u0440\u044b", "\u0444\u0435\u0432\u0440\u0430\u043b\u044b", "\u043c\u0430\u0440\u0442\u044a\u0438\u0439\u044b", "\u0430\u043f\u0440\u0435\u043b\u044b", "\u043c\u0430\u0439\u044b", "\u0438\u044e\u043d\u044b", "\u0438\u044e\u043b\u044b", "\u0430\u0432\u0433\u0443\u0441\u0442\u044b", "\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044b", "\u043e\u043a\u0442\u044f\u0431\u0440\u044b", "\u043d\u043e\u044f\u0431\u0440\u044b", "\u0434\u0435\u043a\u0430\u0431\u0440\u044b" ], "SHORTDAY": [ "\u0445\u0446\u0431", "\u043a\u0440\u0441", "\u0434\u0446\u0433", "\u04d5\u0440\u0442", "\u0446\u043f\u0440", "\u043c\u0440\u0431", "\u0441\u0431\u0442" ], "SHORTMONTH": [ "\u044f\u043d\u0432.", "\u0444\u0435\u0432.", "\u043c\u0430\u0440.", "\u0430\u043f\u0440.", "\u043c\u0430\u044f", "\u0438\u044e\u043d\u044b", "\u0438\u044e\u043b\u044b", "\u0430\u0432\u0433.", "\u0441\u0435\u043d.", "\u043e\u043a\u0442.", "\u043d\u043e\u044f.", "\u0434\u0435\u043a." ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM, y '\u0430\u0437'", "longDate": "d MMMM, y '\u0430\u0437'", "medium": "dd MMM y '\u0430\u0437' HH:mm:ss", "mediumDate": "dd MMM y '\u0430\u0437'", "mediumTime": "HH:mm:ss", "short": "dd.MM.yy HH:mm", "shortDate": "dd.MM.yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u0440\u0443\u0431.", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "os-ru", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
tonytomov/cdnjs
ajax/libs/angular-i18n/1.4.3/angular-locale_os-ru.js
JavaScript
mit
3,717
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u01c1goagas", "\u01c3uias" ], "DAY": [ "Sontaxtsees", "Mantaxtsees", "Denstaxtsees", "Wunstaxtsees", "Dondertaxtsees", "Fraitaxtsees", "Satertaxtsees" ], "ERANAMES": [ "Xristub ai\u01c3\u00e2", "Xristub khao\u01c3g\u00e2" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u01c3Khanni", "\u01c3Khan\u01c0g\u00f4ab", "\u01c0Khuu\u01c1kh\u00e2b", "\u01c3H\u00f4a\u01c2khaib", "\u01c3Khaits\u00e2b", "Gama\u01c0aeb", "\u01c2Khoesaob", "Ao\u01c1khuum\u00fb\u01c1kh\u00e2b", "Tara\u01c0khuum\u00fb\u01c1kh\u00e2b", "\u01c2N\u00fb\u01c1n\u00e2iseb", "\u01c0Hoo\u01c2gaeb", "H\u00f4asore\u01c1kh\u00e2b" ], "SHORTDAY": [ "Son", "Ma", "De", "Wu", "Do", "Fr", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "naq-na", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
AMoo-Miki/cdnjs
ajax/libs/angular-i18n/1.4.0-rc.1/angular-locale_naq-na.js
JavaScript
mit
2,739
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" ], "ERANAMES": [ "Sebelum Masehi", "M" ], "ERAS": [ "SM", "M" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" ], "SHORTDAY": [ "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nov", "Des" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, dd MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH.mm.ss", "mediumDate": "d MMM y", "mediumTime": "HH.mm.ss", "short": "dd/MM/yy HH.mm", "shortDate": "dd/MM/yy", "shortTime": "HH.mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Rp", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "id-id", "pluralCat": function(n, opt_precision) { return PLURAL_CATEGORY.OTHER;} }); }]);
ahocevar/cdnjs
ajax/libs/angular.js/1.4.0/i18n/angular-locale_id-id.js
JavaScript
mit
1,995
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "ERANAMES": [ "Before Christ", "Anno Domini" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 6, "MONTH": [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], "SHORTDAY": [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, MMMM d, y", "longDate": "MMMM d, y", "medium": "MMM d, y h:mm:ss a", "mediumDate": "MMM d, y", "mediumTime": "h:mm:ss a", "short": "M/d/yy h:mm a", "shortDate": "M/d/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "en-vi", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
nolsherry/cdnjs
ajax/libs/angular.js/1.4.0-rc.2/i18n/angular-locale_en-vi.js
JavaScript
mit
2,464
'use strict'; function preserveCamelCase(str) { var isLastCharLower = false; for (var i = 0; i < str.length; i++) { var c = str.charAt(i); if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) { str = str.substr(0, i) + '-' + str.substr(i); isLastCharLower = false; i++; } else { isLastCharLower = (c.toLowerCase() === c); } } return str; } module.exports = function () { var str = [].map.call(arguments, function (str) { return str.trim(); }).filter(function (str) { return str.length; }).join('-'); if (!str.length) { return ''; } if (str.length === 1) { return str.toLowerCase(); } if (!(/[_.\- ]+/).test(str)) { if (str === str.toUpperCase()) { return str.toLowerCase(); } if (str[0] !== str[0].toLowerCase()) { return str[0].toLowerCase() + str.slice(1); } return str; } str = preserveCamelCase(str); return str .replace(/^[_.\- ]+/, '') .toLowerCase() .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); };
dfrey382/opencharity
node_modules/yargs-parser/node_modules/camelcase/index.js
JavaScript
mit
1,030
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u0628.\u0646", "\u062f.\u0646" ], "DAY": [ "\u06cc\u06d5\u06a9\u0634\u06d5\u0645\u0645\u06d5", "\u062f\u0648\u0648\u0634\u06d5\u0645\u0645\u06d5", "\u0633\u06ce\u0634\u06d5\u0645\u0645\u06d5", "\u0686\u0648\u0627\u0631\u0634\u06d5\u0645\u0645\u06d5", "\u067e\u06ce\u0646\u062c\u0634\u06d5\u0645\u0645\u06d5", "\u06be\u06d5\u06cc\u0646\u06cc", "\u0634\u06d5\u0645\u0645\u06d5" ], "ERANAMES": [ "\u067e\u06ce\u0634 \u0632\u0627\u06cc\u06cc\u0646", "\u0632\u0627\u06cc\u06cc\u0646\u06cc" ], "ERAS": [ "\u067e\u06ce\u0634 \u0632\u0627\u06cc\u06cc\u06cc\u0646", "\u0632" ], "FIRSTDAYOFWEEK": 5, "MONTH": [ "\u06a9\u0627\u0646\u0648\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645", "\u0634\u0648\u0628\u0627\u062a", "\u0626\u0627\u0632\u0627\u0631", "\u0646\u06cc\u0633\u0627\u0646", "\u0626\u0627\u06cc\u0627\u0631", "\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646", "\u062a\u06d5\u0645\u0648\u0648\u0632", "\u0626\u0627\u0628", "\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644", "\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645", "\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645", "\u06a9\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645" ], "SHORTDAY": [ "\u06cc\u06d5\u06a9\u0634\u06d5\u0645\u0645\u06d5", "\u062f\u0648\u0648\u0634\u06d5\u0645\u0645\u06d5", "\u0633\u06ce\u0634\u06d5\u0645\u0645\u06d5", "\u0686\u0648\u0627\u0631\u0634\u06d5\u0645\u0645\u06d5", "\u067e\u06ce\u0646\u062c\u0634\u06d5\u0645\u0645\u06d5", "\u06be\u06d5\u06cc\u0646\u06cc", "\u0634\u06d5\u0645\u0645\u06d5" ], "SHORTMONTH": [ "\u06a9\u0627\u0646\u0648\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645", "\u0634\u0648\u0628\u0627\u062a", "\u0626\u0627\u0632\u0627\u0631", "\u0646\u06cc\u0633\u0627\u0646", "\u0626\u0627\u06cc\u0627\u0631", "\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646", "\u062a\u06d5\u0645\u0648\u0648\u0632", "\u0626\u0627\u0628", "\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644", "\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645", "\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645", "\u06a9\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645" ], "WEEKENDRANGE": [ 4, 5 ], "fullDate": "y MMMM d, EEEE", "longDate": "d\u06cc MMMM\u06cc y", "medium": "y MMM d HH:mm:ss", "mediumDate": "y MMM d", "mediumTime": "HH:mm:ss", "short": "y-MM-dd HH:mm", "shortDate": "y-MM-dd", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "din", "DECIMAL_SEP": "\u066b", "GROUP_SEP": "\u066c", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "ckb", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
Amomo/cdnjs
ajax/libs/angular-i18n/1.4.2/angular-locale_ckb.js
JavaScript
mit
4,139
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u0642\u0628\u0644\u200c\u0627\u0632\u0638\u0647\u0631", "\u0628\u0639\u062f\u0627\u0632\u0638\u0647\u0631" ], "DAY": [ "\u06cc\u06a9\u0634\u0646\u0628\u0647", "\u062f\u0648\u0634\u0646\u0628\u0647", "\u0633\u0647\u200c\u0634\u0646\u0628\u0647", "\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647", "\u067e\u0646\u062c\u0634\u0646\u0628\u0647", "\u062c\u0645\u0639\u0647", "\u0634\u0646\u0628\u0647" ], "ERANAMES": [ "\u0642\u0628\u0644 \u0627\u0632 \u0645\u06cc\u0644\u0627\u062f", "\u0645\u06cc\u0644\u0627\u062f\u06cc" ], "ERAS": [ "\u0642.\u0645.", "\u0645." ], "FIRSTDAYOFWEEK": 5, "MONTH": [ "\u0698\u0627\u0646\u0648\u06cc\u0647\u0654", "\u0641\u0648\u0631\u06cc\u0647\u0654", "\u0645\u0627\u0631\u0633", "\u0622\u0648\u0631\u06cc\u0644", "\u0645\u0647\u0654", "\u0698\u0648\u0626\u0646", "\u0698\u0648\u0626\u06cc\u0647\u0654", "\u0627\u0648\u062a", "\u0633\u067e\u062a\u0627\u0645\u0628\u0631", "\u0627\u06a9\u062a\u0628\u0631", "\u0646\u0648\u0627\u0645\u0628\u0631", "\u062f\u0633\u0627\u0645\u0628\u0631" ], "SHORTDAY": [ "\u06cc\u06a9\u0634\u0646\u0628\u0647", "\u062f\u0648\u0634\u0646\u0628\u0647", "\u0633\u0647\u200c\u0634\u0646\u0628\u0647", "\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647", "\u067e\u0646\u062c\u0634\u0646\u0628\u0647", "\u062c\u0645\u0639\u0647", "\u0634\u0646\u0628\u0647" ], "SHORTMONTH": [ "\u0698\u0627\u0646\u0648\u06cc\u0647\u0654", "\u0641\u0648\u0631\u06cc\u0647\u0654", "\u0645\u0627\u0631\u0633", "\u0622\u0648\u0631\u06cc\u0644", "\u0645\u0647\u0654", "\u0698\u0648\u0626\u0646", "\u0698\u0648\u0626\u06cc\u0647\u0654", "\u0627\u0648\u062a", "\u0633\u067e\u062a\u0627\u0645\u0628\u0631", "\u0627\u06a9\u062a\u0628\u0631", "\u0646\u0648\u0627\u0645\u0628\u0631", "\u062f\u0633\u0627\u0645\u0628\u0631" ], "WEEKENDRANGE": [ 4, 4 ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y H:mm:ss", "mediumDate": "d MMM y", "mediumTime": "H:mm:ss", "short": "y/M/d H:mm", "shortDate": "y/M/d", "shortTime": "H:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Rial", "DECIMAL_SEP": "\u066b", "GROUP_SEP": "\u066c", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u200e\u00a4-", "negSuf": "", "posPre": "\u200e\u00a4", "posSuf": "" } ] }, "id": "fa", "pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
gaearon/cdnjs
ajax/libs/angular-i18n/1.4.3/angular-locale_fa.js
JavaScript
mit
3,358
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "atm", "ptm" ], "DAY": [ "diman\u0109o", "lundo", "mardo", "merkredo", "\u0135a\u016ddo", "vendredo", "sabato" ], "ERANAMES": [ "aK", "pK" ], "ERAS": [ "aK", "pK" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "januaro", "februaro", "marto", "aprilo", "majo", "junio", "julio", "a\u016dgusto", "septembro", "oktobro", "novembro", "decembro" ], "SHORTDAY": [ "di", "lu", "ma", "me", "\u0135a", "ve", "sa" ], "SHORTMONTH": [ "jan", "feb", "mar", "apr", "maj", "jun", "jul", "a\u016dg", "sep", "okt", "nov", "dec" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d-'a' 'de' MMMM y", "longDate": "y-MMMM-dd", "medium": "y-MMM-dd HH:mm:ss", "mediumDate": "y-MMM-dd", "mediumTime": "HH:mm:ss", "short": "yy-MM-dd HH:mm", "shortDate": "yy-MM-dd", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "eo-001", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
dannyxx001/cdnjs
ajax/libs/angular-i18n/1.4.0-rc.1/angular-locale_eo-001.js
JavaScript
mit
2,494
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u042d\u0418", "\u042d\u041a" ], "DAY": [ "\u0411\u0430\u0441\u043a\u044b\u04bb\u044b\u0430\u043d\u043d\u044c\u0430", "\u0411\u044d\u043d\u0438\u0434\u0438\u044d\u043b\u0438\u043d\u043d\u044c\u0438\u043a", "\u041e\u043f\u0442\u0443\u043e\u0440\u0443\u043d\u043d\u044c\u0443\u043a", "\u0421\u044d\u0440\u044d\u0434\u044d", "\u0427\u044d\u043f\u043f\u0438\u044d\u0440", "\u0411\u044d\u044d\u0442\u0438\u04a5\u0441\u044d", "\u0421\u0443\u0431\u0443\u043e\u0442\u0430" ], "ERANAMES": [ "\u0431. \u044d. \u0438.", "\u0431. \u044d" ], "ERAS": [ "\u0431. \u044d. \u0438.", "\u0431. \u044d" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u0422\u043e\u0445\u0441\u0443\u043d\u043d\u044c\u0443", "\u041e\u043b\u0443\u043d\u043d\u044c\u0443", "\u041a\u0443\u043b\u0443\u043d \u0442\u0443\u0442\u0430\u0440", "\u041c\u0443\u0443\u0441 \u0443\u0441\u0442\u0430\u0440", "\u042b\u0430\u043c \u044b\u0439\u044b\u043d", "\u0411\u044d\u0441 \u044b\u0439\u044b\u043d", "\u041e\u0442 \u044b\u0439\u044b\u043d", "\u0410\u0442\u044b\u0440\u0434\u044c\u044b\u0445 \u044b\u0439\u044b\u043d", "\u0411\u0430\u043b\u0430\u0495\u0430\u043d \u044b\u0439\u044b\u043d", "\u0410\u043b\u0442\u044b\u043d\u043d\u044c\u044b", "\u0421\u044d\u0442\u0438\u043d\u043d\u044c\u0438", "\u0410\u0445\u0441\u044b\u043d\u043d\u044c\u044b" ], "SHORTDAY": [ "\u0411\u0441", "\u0411\u043d", "\u041e\u043f", "\u0421\u044d", "\u0427\u043f", "\u0411\u044d", "\u0421\u0431" ], "SHORTMONTH": [ "\u0422\u043e\u0445\u0441", "\u041e\u043b\u0443\u043d", "\u041a\u043b\u043d_\u0442\u0442\u0440", "\u041c\u0443\u0441_\u0443\u0441\u0442", "\u042b\u0430\u043c_\u0439\u043d", "\u0411\u044d\u0441_\u0439\u043d", "\u041e\u0442_\u0439\u043d", "\u0410\u0442\u0440\u0434\u044c_\u0439\u043d", "\u0411\u043b\u0495\u043d_\u0439\u043d", "\u0410\u043b\u0442", "\u0421\u044d\u0442", "\u0410\u0445\u0441" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "y '\u0441\u044b\u043b' MMMM d '\u043a\u04af\u043d\u044d', EEEE", "longDate": "y, MMMM d", "medium": "y, MMM d HH:mm:ss", "mediumDate": "y, MMM d", "mediumTime": "HH:mm:ss", "short": "yy/M/d HH:mm", "shortDate": "yy/M/d", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u0440\u0443\u0431.", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "sah", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
tonytlwu/cdnjs
ajax/libs/angular-i18n/1.4.0/angular-locale_sah.js
JavaScript
mit
3,862
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "a.\u00a0m.", "p.\u00a0m." ], "DAY": [ "domingo", "lunes", "martes", "mi\u00e9rcoles", "jueves", "viernes", "s\u00e1bado" ], "ERANAMES": [ "antes de Cristo", "despu\u00e9s de Cristo" ], "ERAS": [ "a. C.", "d. C." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "setiembre", "octubre", "noviembre", "diciembre" ], "SHORTDAY": [ "dom.", "lun.", "mar.", "mi\u00e9.", "jue.", "vie.", "s\u00e1b." ], "SHORTMONTH": [ "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "set.", "oct.", "nov.", "dic." ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d 'de' MMMM 'de' y", "longDate": "d 'de' MMMM 'de' y", "medium": "d 'de' MMM 'de' y h:mm:ss a", "mediumDate": "d 'de' MMM 'de' y", "mediumTime": "h:mm:ss a", "short": "d/M/yy h:mm a", "shortDate": "d/M/yy", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "$", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "es-uy", "pluralCat": function(n, opt_precision) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
Amomo/cdnjs
ajax/libs/angular-i18n/1.4.1/angular-locale_es-uy.js
JavaScript
mit
2,189
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "\u0635", "\u0645" ], "DAY": [ "\u0627\u0644\u0623\u062d\u062f", "\u0627\u0644\u0627\u062b\u0646\u064a\u0646", "\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621", "\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621", "\u0627\u0644\u062e\u0645\u064a\u0633", "\u0627\u0644\u062c\u0645\u0639\u0629", "\u0627\u0644\u0633\u0628\u062a" ], "ERANAMES": [ "\u0642\u0628\u0644 \u0627\u0644\u0645\u064a\u0644\u0627\u062f", "\u0645\u064a\u0644\u0627\u062f\u064a" ], "ERAS": [ "\u0642.\u0645", "\u0645" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u064a\u0646\u0627\u064a\u0631", "\u0641\u0628\u0631\u0627\u064a\u0631", "\u0645\u0627\u0631\u0633", "\u0625\u0628\u0631\u064a\u0644", "\u0645\u0627\u064a\u0648", "\u064a\u0648\u0646\u064a\u0648", "\u064a\u0648\u0644\u064a\u0648", "\u0623\u063a\u0634\u062a", "\u0634\u062a\u0645\u0628\u0631", "\u0623\u0643\u062a\u0648\u0628\u0631", "\u0646\u0648\u0641\u0645\u0628\u0631", "\u062f\u062c\u0645\u0628\u0631" ], "SHORTDAY": [ "\u0627\u0644\u0623\u062d\u062f", "\u0627\u0644\u0627\u062b\u0646\u064a\u0646", "\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621", "\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621", "\u0627\u0644\u062e\u0645\u064a\u0633", "\u0627\u0644\u062c\u0645\u0639\u0629", "\u0627\u0644\u0633\u0628\u062a" ], "SHORTMONTH": [ "\u064a\u0646\u0627\u064a\u0631", "\u0641\u0628\u0631\u0627\u064a\u0631", "\u0645\u0627\u0631\u0633", "\u0625\u0628\u0631\u064a\u0644", "\u0645\u0627\u064a\u0648", "\u064a\u0648\u0646\u064a\u0648", "\u064a\u0648\u0644\u064a\u0648", "\u0623\u063a\u0634\u062a", "\u0634\u062a\u0645\u0628\u0631", "\u0623\u0643\u062a\u0648\u0628\u0631", "\u0646\u0648\u0641\u0645\u0628\u0631", "\u062f\u062c\u0645\u0628\u0631" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE\u060c d MMMM\u060c y", "longDate": "d MMMM\u060c y", "medium": "dd\u200f/MM\u200f/y h:mm:ss a", "mediumDate": "dd\u200f/MM\u200f/y", "mediumTime": "h:mm:ss a", "short": "d\u200f/M\u200f/y h:mm a", "shortDate": "d\u200f/M\u200f/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "MRO", "DECIMAL_SEP": "\u066b", "GROUP_SEP": "\u066c", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4\u00a0-", "negSuf": "", "posPre": "\u00a4\u00a0", "posSuf": "" } ] }, "id": "ar-mr", "pluralCat": function(n, opt_precision) { if (n == 0) { return PLURAL_CATEGORY.ZERO; } if (n == 1) { return PLURAL_CATEGORY.ONE; } if (n == 2) { return PLURAL_CATEGORY.TWO; } if (n % 100 >= 3 && n % 100 <= 10) { return PLURAL_CATEGORY.FEW; } if (n % 100 >= 11 && n % 100 <= 99) { return PLURAL_CATEGORY.MANY; } return PLURAL_CATEGORY.OTHER;} }); }]);
Ridvan11/angular.js
src/ngLocale/angular-locale_ar-mr.js
JavaScript
mit
3,572
div.DTTT_container{position:relative;float:right;margin-bottom:1em}@media screen and (max-width: 640px){div.DTTT_container{float:none !important;text-align:center}div.DTTT_container:after{visibility:hidden;display:block;content:"";clear:both;height:0}}button.DTTT_button,div.DTTT_button,a.DTTT_button{position:relative;display:inline-block;margin-right:3px;padding:5px 8px;border:1px solid #999;cursor:pointer;*cursor:hand;font-size:0.88em;color:black !important;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:1px 1px 3px #ccc;-moz-box-shadow:1px 1px 3px #ccc;-ms-box-shadow:1px 1px 3px #ccc;-o-box-shadow:1px 1px 3px #ccc;box-shadow:1px 1px 3px #ccc;background:#ffffff;background:-webkit-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-moz-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-ms-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-o-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 )}button.DTTT_button{height:30px;padding:3px 8px}.DTTT_button embed{outline:none}button.DTTT_button:hover:not(.DTTT_disabled),div.DTTT_button:hover:not(.DTTT_disabled),a.DTTT_button:hover:not(.DTTT_disabled){border:1px solid #666;text-decoration:none !important;-webkit-box-shadow:1px 1px 3px #999;-moz-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999;background:#f3f3f3;background:-webkit-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-moz-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-ms-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-o-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f3', endColorstr='#f4f4f4',GradientType=0 )}button.DTTT_button:focus,div.DTTT_button:focus,a.DTTT_button:focus{border:1px solid #426c9e;text-shadow:0 1px 0 #c4def1;outline:none;background-color:#a3d0ef 100%;background-image:-webkit-linear-gradient(top, #a3d0ef 0%, #79ace9 65%, #a3d0ef 100%);background-image:-moz-linear-gradient(top, #a3d0ef 0%, #79ace9 65%, #a3d0ef 100%);background-image:-ms-linear-gradient(top, #a3d0ef 0%, #79ace9 65%, #a3d0ef 100%);background-image:-o-linear-gradient(top, #a3d0ef 0%, #79ace9 65%, #a3d0ef 100%);background-image:linear-gradient(top, #a3d0ef 0%, #79ace9 65%, #a3d0ef 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#a3d0ef', EndColorStr='#a3d0ef')}button.DTTT_button:active:not(.DTTT_disabled),div.DTTT_button:active:not(.DTTT_disabled),a.DTTT_button:active:not(.DTTT_disabled){-webkit-box-shadow:inset 1px 1px 3px #999999;-moz-box-shadow:inset 1px 1px 3px #999999;box-shadow:inset 1px 1px 3px #999999}button.DTTT_disabled,div.DTTT_disabled,a.DTTT_disabled{color:#999 !important;border:1px solid #d0d0d0;cursor:default;background:#ffffff;background:-webkit-linear-gradient(top, #fff 0%, #f9f9f9 89%, #fafafa 100%);background:-moz-linear-gradient(top, #fff 0%, #f9f9f9 89%, #fafafa 100%);background:-ms-linear-gradient(top, #fff 0%, #f9f9f9 89%, #fafafa 100%);background:-o-linear-gradient(top, #fff 0%, #f9f9f9 89%, #fafafa 100%);background:linear-gradient(top, #fff 0%, #f9f9f9 89%, #fafafa 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#fafafa',GradientType=0 )}button.DTTT_button_collection span{padding-right:17px;background:url(../images/collection.png) no-repeat center right}button.DTTT_button_collection:hover span{padding-right:17px;background:#f0f0f0 url(../images/collection_hover.png) no-repeat center right}table.DTTT_selectable tbody tr{cursor:pointer;*cursor:hand}table.dataTable tr.DTTT_selected.odd{background-color:#9FAFD1}table.dataTable tr.DTTT_selected.odd td.sorting_1{background-color:#9FAFD1}table.dataTable tr.DTTT_selected.odd td.sorting_2{background-color:#9FAFD1}table.dataTable tr.DTTT_selected.odd td.sorting_3{background-color:#9FAFD1}table.dataTable tr.DTTT_selected.even{background-color:#B0BED9}table.dataTable tr.DTTT_selected.even td.sorting_1{background-color:#B0BED9}table.dataTable tr.DTTT_selected.even td.sorting_2{background-color:#B0BED9}table.dataTable tr.DTTT_selected.even td.sorting_3{background-color:#B0BED9}div.DTTT_collection{width:150px;padding:8px 8px 4px 8px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:#f3f3f3;background-color:rgba(255,255,255,0.3);overflow:hidden;z-index:2002;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-moz-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-ms-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-o-box-shadow:3px 3px 5px rgba(0,0,0,0.3);box-shadow:3px 3px 5px rgba(0,0,0,0.3)}div.DTTT_collection_background{background:black;z-index:2001}div.DTTT_collection button.DTTT_button,div.DTTT_collection div.DTTT_button,div.DTTT_collection a.DTTT_button{position:relative;left:0;right:0;display:block;float:none;margin-bottom:4px;-webkit-box-shadow:1px 1px 3px #999;-moz-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999}.DTTT_print_info{position:fixed;top:50%;left:50%;width:400px;height:150px;margin-left:-200px;margin-top:-75px;text-align:center;color:#333;padding:10px 30px;background:#ffffff;background:-webkit-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-moz-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-ms-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-o-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 );opacity:0.95;border:1px solid black;border:1px solid rgba(0,0,0,0.5);-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.5);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.5);-ms-box-shadow:0 3px 7px rgba(0,0,0,0.5);-o-box-shadow:0 3px 7px rgba(0,0,0,0.5);box-shadow:0 3px 7px rgba(0,0,0,0.5)}.DTTT_print_info h6{font-weight:normal;font-size:28px;line-height:28px;margin:1em}.DTTT_print_info p{font-size:14px;line-height:20px}
adrianturnes/menorcagastronomic
public/assets/backend/plugins/datatables/extensions/TableTools/css/dataTables.tableTools.min.css
CSS
mit
6,695
var baseClone = require('./_baseClone'); /** Used to compose bitmasks for cloning. */ var CLONE_SYMBOLS_FLAG = 4; /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } module.exports = cloneWith;
thoughtbit/node-web-starter
node-api/node_modules/babel-cli/node_modules/lodash/cloneWith.js
JavaScript
mit
1,194
var baseIndexOf = require('./_baseIndexOf'), isArrayLike = require('./isArrayLike'), isString = require('./isString'), toInteger = require('./toInteger'), values = require('./values'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } module.exports = includes;
pbentoncron/nice
Jerrod_Quintana/Assignments/express/quoting_dojo_redux/node_modules/lodash/includes.js
JavaScript
mit
1,772
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, cb), and it'll handle all // the drain event emission and buffering. module.exports = Writable; /*<replacement>*/ var Buffer = require('buffer').Buffer; /*</replacement>*/ Writable.WritableState = WritableState; /*<replacement>*/ var util = require('core-util-is'); util.inherits = require('inherits'); /*</replacement>*/ var Stream = require('stream'); util.inherits(Writable, Stream); function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; } function WritableState(options, stream) { var Duplex = require('./_stream_duplex'); options = options || {}; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm = options.highWaterMark; var defaultHwm = options.objectMode ? 16 : 16 * 1024; this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // cast to ints. this.highWaterMark = ~~this.highWaterMark; this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function(er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.buffer = []; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; } function Writable(options) { var Duplex = require('./_stream_duplex'); // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); // legacy. this.writable = true; Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function() { this.emit('error', new Error('Cannot pipe. Not readable.')); }; function writeAfterEnd(stream, state, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); process.nextTick(function() { cb(er); }); } // If we get something that is not a buffer, string, null, or undefined, // and we're not in objectMode, then that's an error. // Otherwise stream chunks are all considered to be of length=1, and the // watermarks determine how many objects to keep in the buffer, rather than // how many bytes or characters. function validChunk(stream, state, chunk, cb) { var valid = true; if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); process.nextTick(function() { cb(er); }); valid = false; } return valid; } Writable.prototype.write = function(chunk, encoding, cb) { var state = this._writableState; var ret = false; if (util.isFunction(encoding)) { cb = encoding; encoding = null; } if (util.isBuffer(chunk)) encoding = 'buffer'; else if (!encoding) encoding = state.defaultEncoding; if (!util.isFunction(cb)) cb = function() {}; if (state.ended) writeAfterEnd(this, state, cb); else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function() { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function() { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.buffer.length) clearBuffer(this, state); } }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && util.isString(chunk)) { chunk = new Buffer(chunk, encoding); } return chunk; } // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); if (util.isBuffer(chunk)) encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) state.buffer.push(new WriteReq(chunk, encoding, cb)); else doWrite(stream, state, false, len, chunk, encoding, cb); return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { if (sync) process.nextTick(function() { state.pendingcb--; cb(er); }); else { state.pendingcb--; cb(er); } stream._writableState.errorEmitted = true; stream.emit('error', er); } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb); else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(stream, state); if (!finished && !state.corked && !state.bufferProcessing && state.buffer.length) { clearBuffer(stream, state); } if (sync) { process.nextTick(function() { afterWrite(stream, state, finished, cb); }); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; if (stream._writev && state.buffer.length > 1) { // Fast case, write everything using _writev() var cbs = []; for (var c = 0; c < state.buffer.length; c++) cbs.push(state.buffer[c].callback); // count the one we are adding, as well. // TODO(isaacs) clean this up state.pendingcb++; doWrite(stream, state, true, state.length, state.buffer, '', function(err) { for (var i = 0; i < cbs.length; i++) { state.pendingcb--; cbs[i](err); } }); // Clear buffer state.buffer = []; } else { // Slow case, write chunks one-by-one for (var c = 0; c < state.buffer.length; c++) { var entry = state.buffer[c]; var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { c++; break; } } if (c < state.buffer.length) state.buffer = state.buffer.slice(c); else state.buffer.length = 0; } state.bufferProcessing = false; } Writable.prototype._write = function(chunk, encoding, cb) { cb(new Error('not implemented')); }; Writable.prototype._writev = null; Writable.prototype.end = function(chunk, encoding, cb) { var state = this._writableState; if (util.isFunction(chunk)) { cb = chunk; chunk = null; encoding = null; } else if (util.isFunction(encoding)) { cb = encoding; encoding = null; } if (!util.isNullOrUndefined(chunk)) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending && !state.finished) endWritable(this, state, cb); }; function needFinish(stream, state) { return (state.ending && state.length === 0 && !state.finished && !state.writing); } function prefinish(stream, state) { if (!state.prefinished) { state.prefinished = true; stream.emit('prefinish'); } } function finishMaybe(stream, state) { var need = needFinish(stream, state); if (need) { if (state.pendingcb === 0) { prefinish(stream, state); state.finished = true; stream.emit('finish'); } else prefinish(stream, state); } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb); else stream.once('finish', cb); } state.ended = true; }
SongMaoOpen/anmDemo
web-test/node_modules/karma/node_modules/chokidar/node_modules/fsevents/node_modules/readable-stream/lib/_stream_writable.js
JavaScript
mit
13,069
//! moment.js locale configuration //! locale : canadian english (en-ca) //! author : Jonathan Abourbih : https://github.com/jonbca import moment from '../moment'; export default moment.defineLocale('en-ca', { months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), longDateFormat : { LT : 'h:mm A', LTS : 'h:mm:ss A', L : 'YYYY-MM-DD', LL : 'D MMMM, YYYY', LLL : 'D MMMM, YYYY LT', LLLL : 'dddd, D MMMM, YYYY LT' }, calendar : { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }, relativeTime : { future : 'in %s', past : '%s ago', s : 'a few seconds', m : 'a minute', mm : '%d minutes', h : 'an hour', hh : '%d hours', d : 'a day', dd : '%d days', M : 'a month', MM : '%d months', y : 'a year', yy : '%d years' }, ordinalParse: /\d{1,2}(st|nd|rd|th)/, ordinal : function (number) { var b = number % 10, output = (~~(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } });
josealencar/Aritter
src/Aritter.Web/wwwroot/assets/libs/moment/src/locale/en-ca.js
JavaScript
mit
1,703