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
/* Chinese initialisation for the jQuery UI date picker plugin. */ /* Written by Cloudream (cloudream@gmail.com). */ (function($) { $.datepick.regional['zh-CN'] = { clearText: '清除', clearStatus: '清除已选日期', closeText: '关闭', closeStatus: '不改变当前选择', prevText: '<上月', prevStatus: '显示上月', prevBigText: '<<', prevBigStatus: '显示上一年', nextText: '下月>', nextStatus: '显示下月', nextBigText: '>>', nextBigStatus: '显示下一年', currentText: '今天', currentStatus: '显示本月', monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'], monthStatus: '选择月份', yearStatus: '选择年份', weekHeader: '周', weekStatus: '年内周次', dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '请选择日期', isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepick.setDefaults($.datepick.regional['zh-CN']); })(jQuery);
Amomo/cdnjs
ajax/libs/datepick/3.7.2/js/jquery.datepick-zh-CN.js
JavaScript
mit
1,447
<div bs-panel="controls outline"> <h1 bs-heading><svg bs-svg-icon><use xlink:href="#svg-"></use></svg> Help Content</h1> </div> <div bs-panel> <div bs-panel-content="basic"> <p class="lede"> Browsersync is an open-source project created and maintained by the front-end designers/developers at [JH](http://www.wearejh.com) . Together with contributors from all over the world, we aim to make modern, multi-device web development faster & easier. </p> </div> </div> <div bs-panel> <div bs-panel-content="basic"> <h2>Help</h2> <dl> <dt>Why isn&rsquo;t Browsersync connecting with my project?</dt> <dd>99% of the time, it's because your web page doesn't have a `body` tag. In order for Browsersync to connect properly the `body` tag must be present in your website (we add a script tag just after it). Alternatively you can provide a custom rule for the snippet using [snippetOptions](http://www.browsersync.io/docs/options/#option-snippetOptions) </dd> <dt>Which mode should I be running in?</dt> <dd> <ul> <li>If you have simple HTML, CSS & JavaScript files, you need the [server option](http://www.browsersync.io/docs/options/#option-server).</li> <li>If you already have an existing server setup (such as an Express app, Mamp, Rails etc, then you need the [proxy option](http://www.browsersync.io/docs/options/#option-proxy).</li> <li>If you intend to copy/paste the snippet into your website manually, you use the `snippet` mode. This is the default mode and is achieved by omitting both the server & proxy options</li> </ul> </dd> <dt>Where can I report an issue?</dt> <dd> <p>If you have found an issue with the Browsersync UI, please use our [issue tracker](https://github.com/Browsersync/UI/issues) </p> </dd> </dl> <hr> <p>Need more assistance? Please try our [documentation](http://www.browsersync.io/docs/) for user guides or our [stackoverflow](http://stackoverflow.com/questions/tagged/browser-sync) tag for answers to common problems.</p> </div> </div> <div bs-panel> <div bs-panel-content="basic"> <h2>Contribute</h2> <p>We'd love for you to contribute to Browsersync and help make it even better than it is today! Please read our [contributor guidelines](https://github.com/shakyShane/browser-sync/blob/master/CONTRIBUTING.md).</p> </div> </div>
ALProjects/ALProjects.github.io
node_modules/browser-sync-ui/static/components/help-content.html
HTML
mit
2,652
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * 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. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * Input Class * * Pre-processes global input data for security * * @package CodeIgniter * @subpackage Libraries * @category Input * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/libraries/input.html */ class CI_Input { /** * IP address of the current user * * @var string */ protected $ip_address = FALSE; /** * Allow GET array flag * * If set to FALSE, then $_GET will be set to an empty array. * * @var bool */ protected $_allow_get_array = TRUE; /** * Standardize new lines flag * * If set to TRUE, then newlines are standardized. * * @var bool */ protected $_standardize_newlines; /** * Enable XSS flag * * Determines whether the XSS filter is always active when * GET, POST or COOKIE data is encountered. * Set automatically based on config setting. * * @var bool */ protected $_enable_xss = FALSE; /** * Enable CSRF flag * * Enables a CSRF cookie token to be set. * Set automatically based on config setting. * * @var bool */ protected $_enable_csrf = FALSE; /** * List of all HTTP request headers * * @var array */ protected $headers = array(); /** * Raw input stream data * * Holds a cache of php://input contents * * @var string */ protected $_raw_input_stream; /** * Parsed input stream data * * Parsed from php://input at runtime * * @see CI_Input::input_stream() * @var array */ protected $_input_stream; protected $security; protected $uni; // -------------------------------------------------------------------- /** * Class constructor * * Determines whether to globally enable the XSS processing * and whether to allow the $_GET array. * * @return void */ public function __construct() { $this->_allow_get_array = (config_item('allow_get_array') === TRUE); $this->_enable_xss = (config_item('global_xss_filtering') === TRUE); $this->_enable_csrf = (config_item('csrf_protection') === TRUE); $this->_standardize_newlines = (bool) config_item('standardize_newlines'); $this->security =& load_class('Security', 'core'); // Do we need the UTF-8 class? if (UTF8_ENABLED === TRUE) { $this->uni =& load_class('Utf8', 'core'); } // Sanitize global arrays $this->_sanitize_globals(); // CSRF Protection check if ($this->_enable_csrf === TRUE && ! is_cli()) { $this->security->csrf_verify(); } log_message('info', 'Input Class Initialized'); } // -------------------------------------------------------------------- /** * Fetch from array * * Internal method used to retrieve values from global arrays. * * @param array &$array $_GET, $_POST, $_COOKIE, $_SERVER, etc. * @param mixed $index Index for item to be fetched from $array * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ protected function _fetch_from_array(&$array, $index = NULL, $xss_clean = NULL) { is_bool($xss_clean) OR $xss_clean = $this->_enable_xss; // If $index is NULL, it means that the whole $array is requested isset($index) OR $index = array_keys($array); // allow fetching multiple keys at once if (is_array($index)) { $output = array(); foreach ($index as $key) { $output[$key] = $this->_fetch_from_array($array, $key, $xss_clean); } return $output; } if (isset($array[$index])) { $value = $array[$index]; } elseif (($count = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $index, $matches)) > 1) // Does the index contain array notation { $value = $array; for ($i = 0; $i < $count; $i++) { $key = trim($matches[0][$i], '[]'); if ($key === '') // Empty notation will return the value as array { break; } if (isset($value[$key])) { $value = $value[$key]; } else { return NULL; } } } else { return NULL; } return ($xss_clean === TRUE) ? $this->security->xss_clean($value) : $value; } // -------------------------------------------------------------------- /** * Fetch an item from the GET array * * @param mixed $index Index for item to be fetched from $_GET * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function get($index = NULL, $xss_clean = NULL) { return $this->_fetch_from_array($_GET, $index, $xss_clean); } // -------------------------------------------------------------------- /** * Fetch an item from the POST array * * @param mixed $index Index for item to be fetched from $_POST * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function post($index = NULL, $xss_clean = NULL) { return $this->_fetch_from_array($_POST, $index, $xss_clean); } // -------------------------------------------------------------------- /** * Fetch an item from POST data with fallback to GET * * @param string $index Index for item to be fetched from $_POST or $_GET * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function post_get($index, $xss_clean = NULL) { return isset($_POST[$index]) ? $this->post($index, $xss_clean) : $this->get($index, $xss_clean); } // -------------------------------------------------------------------- /** * Fetch an item from GET data with fallback to POST * * @param string $index Index for item to be fetched from $_GET or $_POST * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function get_post($index, $xss_clean = NULL) { return isset($_GET[$index]) ? $this->get($index, $xss_clean) : $this->post($index, $xss_clean); } // -------------------------------------------------------------------- /** * Fetch an item from the COOKIE array * * @param mixed $index Index for item to be fetched from $_COOKIE * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function cookie($index = NULL, $xss_clean = NULL) { return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); } // -------------------------------------------------------------------- /** * Fetch an item from the SERVER array * * @param mixed $index Index for item to be fetched from $_SERVER * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function server($index, $xss_clean = NULL) { return $this->_fetch_from_array($_SERVER, $index, $xss_clean); } // ------------------------------------------------------------------------ /** * Fetch an item from the php://input stream * * Useful when you need to access PUT, DELETE or PATCH request data. * * @param string $index Index for item to be fetched * @param bool $xss_clean Whether to apply XSS filtering * @return mixed */ public function input_stream($index = NULL, $xss_clean = NULL) { // Prior to PHP 5.6, the input stream can only be read once, // so we'll need to check if we have already done that first. if ( ! is_array($this->_input_stream)) { // $this->raw_input_stream will trigger __get(). parse_str($this->raw_input_stream, $this->_input_stream); is_array($this->_input_stream) OR $this->_input_stream = array(); } return $this->_fetch_from_array($this->_input_stream, $index, $xss_clean); } // ------------------------------------------------------------------------ /** * Set cookie * * Accepts an arbitrary number of parameters (up to 7) or an associative * array in the first parameter containing all the values. * * @param string|mixed[] $name Cookie name or an array containing parameters * @param string $value Cookie value * @param int $expire Cookie expiration time in seconds * @param string $domain Cookie domain (e.g.: '.yourdomain.com') * @param string $path Cookie path (default: '/') * @param string $prefix Cookie name prefix * @param bool $secure Whether to only transfer cookies via SSL * @param bool $httponly Whether to only makes the cookie accessible via HTTP (no javascript) * @return void */ public function set_cookie($name, $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL) { if (is_array($name)) { // always leave 'name' in last place, as the loop will break otherwise, due to $$item foreach (array('value', 'expire', 'domain', 'path', 'prefix', 'secure', 'httponly', 'name') as $item) { if (isset($name[$item])) { $$item = $name[$item]; } } } if ($prefix === '' && config_item('cookie_prefix') !== '') { $prefix = config_item('cookie_prefix'); } if ($domain == '' && config_item('cookie_domain') != '') { $domain = config_item('cookie_domain'); } if ($path === '/' && config_item('cookie_path') !== '/') { $path = config_item('cookie_path'); } $secure = ($secure === NULL && config_item('cookie_secure') !== NULL) ? (bool) config_item('cookie_secure') : (bool) $secure; $httponly = ($httponly === NULL && config_item('cookie_httponly') !== NULL) ? (bool) config_item('cookie_httponly') : (bool) $httponly; if ( ! is_numeric($expire)) { $expire = time() - 86500; } else { $expire = ($expire > 0) ? time() + $expire : 0; } setcookie($prefix.$name, $value, $expire, $path, $domain, $secure, $httponly); } // -------------------------------------------------------------------- /** * Fetch the IP Address * * Determines and validates the visitor's IP address. * * @return string IP address */ public function ip_address() { if ($this->ip_address !== FALSE) { return $this->ip_address; } $proxy_ips = config_item('proxy_ips'); if ( ! empty($proxy_ips) && ! is_array($proxy_ips)) { $proxy_ips = explode(',', str_replace(' ', '', $proxy_ips)); } $this->ip_address = $this->server('REMOTE_ADDR'); if ($proxy_ips) { foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP') as $header) { if (($spoof = $this->server($header)) !== NULL) { // Some proxies typically list the whole chain of IP // addresses through which the client has reached us. // e.g. client_ip, proxy_ip1, proxy_ip2, etc. sscanf($spoof, '%[^,]', $spoof); if ( ! $this->valid_ip($spoof)) { $spoof = NULL; } else { break; } } } if ($spoof) { for ($i = 0, $c = count($proxy_ips); $i < $c; $i++) { // Check if we have an IP address or a subnet if (strpos($proxy_ips[$i], '/') === FALSE) { // An IP address (and not a subnet) is specified. // We can compare right away. if ($proxy_ips[$i] === $this->ip_address) { $this->ip_address = $spoof; break; } continue; } // We have a subnet ... now the heavy lifting begins isset($separator) OR $separator = $this->valid_ip($this->ip_address, 'ipv6') ? ':' : '.'; // If the proxy entry doesn't match the IP protocol - skip it if (strpos($proxy_ips[$i], $separator) === FALSE) { continue; } // Convert the REMOTE_ADDR IP address to binary, if needed if ( ! isset($ip, $sprintf)) { if ($separator === ':') { // Make sure we're have the "full" IPv6 format $ip = explode(':', str_replace('::', str_repeat(':', 9 - substr_count($this->ip_address, ':')), $this->ip_address ) ); for ($j = 0; $j < 8; $j++) { $ip[$j] = intval($ip[$j], 16); } $sprintf = '%016b%016b%016b%016b%016b%016b%016b%016b'; } else { $ip = explode('.', $this->ip_address); $sprintf = '%08b%08b%08b%08b'; } $ip = vsprintf($sprintf, $ip); } // Split the netmask length off the network address sscanf($proxy_ips[$i], '%[^/]/%d', $netaddr, $masklen); // Again, an IPv6 address is most likely in a compressed form if ($separator === ':') { $netaddr = explode(':', str_replace('::', str_repeat(':', 9 - substr_count($netaddr, ':')), $netaddr)); for ($j = 0; $j < 8; $j++) { $netaddr[$j] = intval($netaddr[$j], 16); } } else { $netaddr = explode('.', $netaddr); } // Convert to binary and finally compare if (strncmp($ip, vsprintf($sprintf, $netaddr), $masklen) === 0) { $this->ip_address = $spoof; break; } } } } if ( ! $this->valid_ip($this->ip_address)) { return $this->ip_address = '0.0.0.0'; } return $this->ip_address; } // -------------------------------------------------------------------- /** * Validate IP Address * * @param string $ip IP address * @param string $which IP protocol: 'ipv4' or 'ipv6' * @return bool */ public function valid_ip($ip, $which = '') { switch (strtolower($which)) { case 'ipv4': $which = FILTER_FLAG_IPV4; break; case 'ipv6': $which = FILTER_FLAG_IPV6; break; default: $which = NULL; break; } return (bool) filter_var($ip, FILTER_VALIDATE_IP, $which); } // -------------------------------------------------------------------- /** * Fetch User Agent string * * @return string|null User Agent string or NULL if it doesn't exist */ public function user_agent($xss_clean = NULL) { return $this->_fetch_from_array($_SERVER, 'HTTP_USER_AGENT', $xss_clean); } // -------------------------------------------------------------------- /** * Sanitize Globals * * Internal method serving for the following purposes: * * - Unsets $_GET data, if query strings are not enabled * - Cleans POST, COOKIE and SERVER data * - Standardizes newline characters to PHP_EOL * * @return void */ protected function _sanitize_globals() { // Is $_GET data allowed? If not we'll set the $_GET to an empty array if ($this->_allow_get_array === FALSE) { $_GET = array(); } elseif (is_array($_GET)) { foreach ($_GET as $key => $val) { $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); } } // Clean $_POST Data if (is_array($_POST)) { foreach ($_POST as $key => $val) { $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val); } } // Clean $_COOKIE Data if (is_array($_COOKIE)) { // Also get rid of specially treated cookies that might be set by a server // or silly application, that are of no use to a CI application anyway // but that when present will trip our 'Disallowed Key Characters' alarm // http://www.ietf.org/rfc/rfc2109.txt // note that the key names below are single quoted strings, and are not PHP variables unset( $_COOKIE['$Version'], $_COOKIE['$Path'], $_COOKIE['$Domain'] ); foreach ($_COOKIE as $key => $val) { if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE) { $_COOKIE[$cookie_key] = $this->_clean_input_data($val); } else { unset($_COOKIE[$key]); } } } // Sanitize PHP_SELF $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']); log_message('debug', 'Global POST, GET and COOKIE data sanitized'); } // -------------------------------------------------------------------- /** * Clean Input Data * * Internal method that aids in escaping data and * standardizing newline characters to PHP_EOL. * * @param string|string[] $str Input string(s) * @return string */ protected function _clean_input_data($str) { if (is_array($str)) { $new_array = array(); foreach (array_keys($str) as $key) { $new_array[$this->_clean_input_keys($key)] = $this->_clean_input_data($str[$key]); } return $new_array; } /* We strip slashes if magic quotes is on to keep things consistent NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and it will probably not exist in future versions at all. */ if ( ! is_php('5.4') && get_magic_quotes_gpc()) { $str = stripslashes($str); } // Clean UTF-8 if supported if (UTF8_ENABLED === TRUE) { $str = $this->uni->clean_string($str); } // Remove control characters $str = remove_invisible_characters($str, FALSE); // Standardize newlines if needed if ($this->_standardize_newlines === TRUE) { return preg_replace('/(?:\r\n|[\r\n])/', PHP_EOL, $str); } return $str; } // -------------------------------------------------------------------- /** * Clean Keys * * Internal method that helps to prevent malicious users * from trying to exploit keys we make sure that keys are * only named with alpha-numeric text and a few other items. * * @param string $str Input string * @param bool $fatal Whether to terminate script exection * or to return FALSE if an invalid * key is encountered * @return string|bool */ protected function _clean_input_keys($str, $fatal = TRUE) { if ( ! preg_match('/^[a-z0-9:_\/|-]+$/i', $str)) { if ($fatal === TRUE) { return FALSE; } else { set_status_header(503); echo 'Disallowed Key Characters.'; exit(7); // EXIT_USER_INPUT } } // Clean UTF-8 if supported if (UTF8_ENABLED === TRUE) { return $this->uni->clean_string($str); } return $str; } // -------------------------------------------------------------------- /** * Request Headers * * @param bool $xss_clean Whether to apply XSS filtering * @return array */ public function request_headers($xss_clean = FALSE) { // If header is already defined, return it immediately if ( ! empty($this->headers)) { return $this->_fetch_from_array($this->headers, NULL, $xss_clean); } // In Apache, you can simply call apache_request_headers() if (function_exists('apache_request_headers')) { $this->headers = apache_request_headers(); } else { isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE']; foreach ($_SERVER as $key => $val) { if (sscanf($key, 'HTTP_%s', $header) === 1) { // take SOME_HEADER and turn it into Some-Header $header = str_replace('_', ' ', strtolower($header)); $header = str_replace(' ', '-', ucwords($header)); $this->headers[$header] = $_SERVER[$key]; } } } return $this->_fetch_from_array($this->headers, NULL, $xss_clean); } // -------------------------------------------------------------------- /** * Get Request Header * * Returns the value of a single member of the headers class member * * @param string $index Header name * @param bool $xss_clean Whether to apply XSS filtering * @return string|null The requested header on success or NULL on failure */ public function get_request_header($index, $xss_clean = FALSE) { static $headers; if ( ! isset($headers)) { empty($this->headers) && $this->request_headers(); foreach ($this->headers as $key => $value) { $headers[strtolower($key)] = $value; } } $index = strtolower($index); if ( ! isset($headers[$index])) { return NULL; } return ($xss_clean === TRUE) ? $this->security->xss_clean($headers[$index]) : $headers[$index]; } // -------------------------------------------------------------------- /** * Is AJAX request? * * Test to see if a request contains the HTTP_X_REQUESTED_WITH header. * * @return bool */ public function is_ajax_request() { return ( ! empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'); } // -------------------------------------------------------------------- /** * Is CLI request? * * Test to see if a request was made from the command line. * * @deprecated 3.0.0 Use is_cli() instead * @return bool */ public function is_cli_request() { return is_cli(); } // -------------------------------------------------------------------- /** * Get Request Method * * Return the request method * * @param bool $upper Whether to return in upper or lower case * (default: FALSE) * @return string */ public function method($upper = FALSE) { return ($upper) ? strtoupper($this->server('REQUEST_METHOD')) : strtolower($this->server('REQUEST_METHOD')); } // ------------------------------------------------------------------------ /** * Magic __get() * * Allows read access to protected properties * * @param string $name * @return mixed */ public function __get($name) { if ($name === 'raw_input_stream') { isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); return $this->_raw_input_stream; } elseif ($name === 'ip_address') { return $this->ip_address; } } }
scafinicv90/Una-gauchada
system/core/Input.php
PHP
mit
22,583
(function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)})(function(e,t){(t.defineLocale||t.lang).call(t,"en-au",{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",L:"DD/MM/YYYY",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"},ordinal:function(e){var t=e%10,n=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n},week:{dow:1,doy:4}}),e.fullCalendar.datepickerLang("en-au","en-AU",{closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),e.fullCalendar.lang("en-au")});
NamPNQ/cdnjs
ajax/libs/fullcalendar/2.2.0/lang/en-au.js
JavaScript
mit
1,745
describe('PIXI.Container', function () { describe('parent', function () { it('should be present when adding children to Container', function() { var container = new PIXI.Container(), child = new PIXI.DisplayObject(); expect(container.children.length).to.be.equals(0); container.addChild(child); expect(container.children.length).to.be.equals(1); expect(child.parent).to.be.equals(container); }); }); describe('events', function () { it('should trigger "added" and "removed" events on it\'s children', function () { var container = new PIXI.Container(), child = new PIXI.DisplayObject(), triggeredAdded = false, triggeredRemoved = false; child.on('added', function(to) { triggeredAdded = true; expect(container.children.length).to.be.equals(1); expect(child.parent).to.be.equals(to); }); child.on('removed', function(from) { triggeredRemoved = true; expect(container.children.length).to.be.equals(0); expect(child.parent).to.be.null(); expect(container).to.be.equals(from); }); container.addChild(child); expect(triggeredAdded).to.be.true(); expect(triggeredRemoved).to.be.false(); container.removeChild(child); expect(triggeredRemoved).to.be.true(); }); }); });
DarkEngineer/pixi.js
test/unit/core/display/Container.test.js
JavaScript
mit
1,572
Shindo.tests('Rackspace | Compute', ['rackspace']) do def assert_method(url, method) @service.instance_variable_set "@rackspace_auth_url", url returns(method) { @service.send :authentication_method } end tests('#authentication_method') do @service = Fog::Compute::Rackspace.new assert_method nil, :authenticate_v2 assert_method 'https://identity.api.rackspacecloud.com', :authenticate_v1 assert_method 'https://identity.api.rackspacecloud.com/v1', :authenticate_v1 assert_method 'https://identity.api.rackspacecloud.com/v1.1', :authenticate_v1 assert_method 'https://identity.api.rackspacecloud.com/v2.0', :authenticate_v2 assert_method 'https://lon.identity.api.rackspacecloud.com', :authenticate_v1 assert_method 'https://lon.identity.api.rackspacecloud.com/v1', :authenticate_v1 assert_method 'https://lon.identity.api.rackspacecloud.com/v1.1', :authenticate_v1 assert_method 'https://lon.identity.api.rackspacecloud.com/v2.0', :authenticate_v2 end tests('authentication v1') do pending if Fog.mocking? tests('variables populated').succeeds do @service = Fog::Compute::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v1.0' returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(false, "path populated") { @service.instance_variable_get("@uri").nil? } returns(true, "identity_service was not used") { @service.instance_variable_get("@identity_service").nil? } @service.list_flavors end tests('custom endpoint') do @service = Fog::Compute::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v1.0', :rackspace_compute_v1_url => 'https://my-custom-endpoint.com' returns(false, "auth token populated") { @service.send(:auth_token).nil? } returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil } end end tests('authentication v2') do pending if Fog.mocking? tests('variables populated').succeeds do @service = Fog::Compute::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :connection_options => { :ssl_verify_peer => true } returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(true) { (@service.instance_variable_get("@uri").host == 'servers.api.rackspacecloud.com') != nil } identity_service = @service.instance_variable_get("@identity_service") returns(false, "identity service was used") { identity_service.nil? } returns(true, "connection_options are passed") { identity_service.instance_variable_get("@connection_options").key?(:ssl_verify_peer) } @service.list_flavors end tests('custom endpoint') do @service = Fog::Compute::Rackspace.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :rackspace_compute_v1_url => 'https://my-custom-endpoint.com' returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil } end end tests('default auth') do pending if Fog.mocking? tests('no params').succeeds do @service = Fog::Compute::Rackspace.new :rackspace_region => nil returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(true) { (@service.instance_variable_get("@uri").host == 'servers.api.rackspacecloud.com') != nil } @service.list_flavors end tests('specify region').succeeds do @service = Fog::Compute::Rackspace.new :rackspace_region => :ord returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(true) { (@service.instance_variable_get("@uri").host == 'servers.api.rackspacecloud.com') != nil } @service.list_flavors end tests('custom endpoint') do @service = Fog::Compute::Rackspace.new :rackspace_compute_v1_url => 'https://my-custom-endpoint.com' returns(true, "auth token populated") { !@service.send(:auth_token).nil? } returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /my-custom-endpoint\.com/) != nil } end end tests('reauthentication') do pending if Fog.mocking? tests('should reauth with valid credentials') do @service = Fog::Compute::Rackspace.new returns(true, "auth token populated") { !@service.send(:auth_token).nil? } @service.instance_variable_set("@auth_token", "bad-token") returns(true) { [200, 203].include?(@service.list_flavors.status) } end tests('should terminate with incorrect credentials') do raises(Excon::Errors::Unauthorized) { Fog::Compute::Rackspace.new :rackspace_api_key => 'bad_key' } end end end
backupify/fog
tests/rackspace/compute_tests.rb
Ruby
mit
4,919
/* * Copyright (c) 2007, Cameron Rich * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the axTLS project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * HMAC implementation - This code was originally taken from RFC2104 * See http://www.ietf.org/rfc/rfc2104.txt and * http://www.faqs.org/rfcs/rfc2202.html */ //#include <string.h> #include "ssl/ssl_os_port.h" #include "ssl/ssl_crypto.h" /** * Perform HMAC-MD5 * NOTE: does not handle keys larger than the block size. */ void ICACHE_FLASH_ATTR ssl_hmac_md5(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest) { MD5_CTX context; uint8_t k_ipad[64]; uint8_t k_opad[64]; int i; os_memset(k_ipad, 0, sizeof k_ipad); os_memset(k_opad, 0, sizeof k_opad); os_memcpy(k_ipad, key, key_len); os_memcpy(k_opad, key, key_len); for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } MD5_Init(&context); MD5_Update(&context, k_ipad, 64); MD5_Update(&context, msg, length); MD5_Final(digest, &context); MD5_Init(&context); MD5_Update(&context, k_opad, 64); MD5_Update(&context, digest, MD5_SIZE); MD5_Final(digest, &context); } /** * Perform HMAC-SHA1 * NOTE: does not handle keys larger than the block size. */ void ICACHE_FLASH_ATTR ssl_hmac_sha1(const uint8_t *msg, int length, const uint8_t *key, int key_len, uint8_t *digest) { SHA1_CTX context; uint8_t k_ipad[64]; uint8_t k_opad[64]; int i; os_memset(k_ipad, 0, sizeof k_ipad); os_memset(k_opad, 0, sizeof k_opad); os_memcpy(k_ipad, key, key_len); os_memcpy(k_opad, key, key_len); for (i = 0; i < 64; i++) { k_ipad[i] ^= 0x36; k_opad[i] ^= 0x5c; } SHA1_Init(&context); SHA1_Update(&context, k_ipad, 64); SHA1_Update(&context, msg, length); SHA1_Final(digest, &context); SHA1_Init(&context); SHA1_Update(&context, k_opad, 64); SHA1_Update(&context, digest, SHA1_SIZE); SHA1_Final(digest, &context); }
AllAboutEE/nodemcu-firmware
app/ssl/crypto/ssl_hmac.c
C
mit
3,487
var url = require('url'); var http = require('http'); var https = require('https'); var through = require('through'); var duplexer = require('duplexer'); module.exports = hyperquest; function bind (obj, fn) { var args = Array.prototype.slice.call(arguments, 2); return function () { var argv = args.concat(Array.prototype.slice.call(arguments)); return fn.apply(obj, argv); } } function hyperquest (uri, opts, cb, extra) { if (typeof uri === 'object') { cb = opts; opts = uri; uri = undefined; } if (typeof opts === 'function') { cb = opts; opts = undefined; } if (!opts) opts = {}; if (uri !== undefined) opts.uri = uri; if (extra) opts.method = extra.method; var req = new Req(opts); var ws = req.duplex && through(); if (ws) ws.pause(); var rs = through(); var dup = req.duplex ? duplexer(ws, rs) : rs; if (!req.duplex) { rs.writable = false; } dup.request = req; dup.setHeader = bind(req, req.setHeader); dup.setLocation = bind(req, req.setLocation); var closed = false; dup.on('close', function () { closed = true }); process.nextTick(function () { if (closed) return; dup.on('close', function () { r.destroy() }); var r = req._send(); r.on('error', bind(dup, dup.emit, 'error')); r.on('response', function (res) { dup.response = res; dup.emit('response', res); if (req.duplex) res.pipe(rs) else { res.on('data', function (buf) { rs.queue(buf) }); res.on('end', function () { rs.queue(null) }); } }); if (req.duplex) { ws.pipe(r); ws.resume(); } else r.end(); }); if (cb) { dup.on('error', cb); dup.on('response', bind(dup, cb, null)); } return dup; } hyperquest.get = hyperquest; hyperquest.post = function (uri, opts, cb) { return hyperquest(uri, opts, cb, { method: 'POST' }); }; hyperquest.put = function (uri, opts, cb) { return hyperquest(uri, opts, cb, { method: 'PUT' }); }; hyperquest['delete'] = function (uri, opts, cb) { return hyperquest(uri, opts, cb, { method: 'DELETE' }); }; function Req (opts) { this.headers = opts.headers || {}; var method = (opts.method || 'GET').toUpperCase(); this.method = method; this.duplex = !(method === 'GET' || method === 'DELETE' || method === 'HEAD'); this.auth = opts.auth; this.options = opts; if (opts.uri) this.setLocation(opts.uri); } Req.prototype._send = function () { this._sent = true; var headers = this.headers || {}; var u = url.parse(this.uri); var au = u.auth || this.auth; if (au) { headers.authorization = 'Basic ' + Buffer(au).toString('base64'); } var protocol = u.protocol || ''; var iface = protocol === 'https:' ? https : http; var opts = { scheme: protocol.replace(/:$/, ''), method: this.method, host: u.hostname, port: Number(u.port) || (protocol === 'https:' ? 443 : 80), path: u.path, agent: false, headers: headers }; if (protocol === 'https:') { opts.pfx = this.options.pfx; opts.key = this.options.key; opts.cert = this.options.cert; opts.ca = this.options.ca; opts.ciphers = this.options.ciphers; opts.rejectUnauthorized = this.options.rejectUnauthorized; opts.secureProtocol = this.options.secureProtocol; } var req = iface.request(opts); if (req.setTimeout) req.setTimeout(Math.pow(2, 32) * 1000); return req; }; Req.prototype.setHeader = function (key, value) { if (this._sent) throw new Error('request already sent'); this.headers[key] = value; return this; }; Req.prototype.setLocation = function (uri) { this.uri = uri; return this; };
fristys/personal-node-cms
node_modules/mongodb/node_modules/readable-stream/node_modules/string_decoder/build/node_modules/hyperquest/index.js
JavaScript
mit
4,025
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build riscv64,linux package unix import "unsafe" func EpollCreate(size int) (fd int, err error) { if size <= 0 { return -1, EINVAL } return EpollCreate1(0) } //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) //sysnb Geteuid() (euid int) //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) //sys Listen(s int, n int) (err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { var ts *Timespec if timeout != nil { ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} } return Pselect(nfd, r, w, e, ts, nil) } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) //sys setfsgid(gid int) (prev int, err error) //sys setfsuid(uid int) (prev int, err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) //sysnb Setreuid(ruid int, euid int) (err error) //sys Shutdown(fd int, how int) (err error) //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) func Stat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, 0) } func Lchown(path string, uid int, gid int) (err error) { return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) } func Lstat(path string, stat *Stat_t) (err error) { return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) } //sys Statfs(path string, buf *Statfs_t) (err error) //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) //sys Truncate(path string, length int64) (err error) func Ustat(dev int, ubuf *Ustat_t) (err error) { return ENOSYS } //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) //sysnb setgroups(n int, list *_Gid_t) (err error) //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) //sysnb socket(domain int, typ int, proto int) (fd int, err error) //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) //sysnb Gettimeofday(tv *Timeval) (err error) func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(dirfd, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func Time(t *Time_t) (Time_t, error) { var tv Timeval err := Gettimeofday(&tv) if err != nil { return 0, err } if t != nil { *t = Time_t(tv.Sec) } return Time_t(tv.Sec), nil } func Utime(path string, buf *Utimbuf) error { tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, } return Utimes(path, tv) } func utimes(path string, tv *[2]Timeval) (err error) { if tv == nil { return utimensat(AT_FDCWD, path, nil, 0) } ts := []Timespec{ NsecToTimespec(TimevalToNsec(tv[0])), NsecToTimespec(TimevalToNsec(tv[1])), } return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) } func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int err = pipe2(&pp, 0) p[0] = int(pp[0]) p[1] = int(pp[1]) return } //sysnb pipe2(p *[2]_C_int, flags int) (err error) func Pipe2(p []int, flags int) (err error) { if len(p) != 2 { return EINVAL } var pp [2]_C_int err = pipe2(&pp, flags) p[0] = int(pp[0]) p[1] = int(pp[1]) return } func (r *PtraceRegs) PC() uint64 { return r.Pc } func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint64(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint64(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint64(length) } func InotifyInit() (fd int, err error) { return InotifyInit1(0) } func Dup2(oldfd int, newfd int) (err error) { return Dup3(oldfd, newfd, 0) } func Pause() error { _, err := ppoll(nil, 0, nil, nil) return err } func Poll(fds []PollFd, timeout int) (n int, err error) { var ts *Timespec if timeout >= 0 { ts = new(Timespec) *ts = NsecToTimespec(int64(timeout) * 1e6) } if len(fds) == 0 { return ppoll(nil, 0, ts, nil) } return ppoll(&fds[0], len(fds), ts, nil) } func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0) } //sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { cmdlineLen := len(cmdline) if cmdlineLen > 0 { // Account for the additional NULL byte added by // BytePtrFromString in kexecFileLoad. The kexec_file_load // syscall expects a NULL-terminated string. cmdlineLen++ } return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) }
parsley42/gopherbot
vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
GO
mit
7,058
/*! * fullPage 2.9.0 * https://github.com/alvarotrigo/fullPage.js * MIT licensed * * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo */ html.fp-enabled, .fp-enabled body { margin: 0; padding: 0; overflow:hidden; /*Avoid flicker on slides transitions for mobile phones #336 */ -webkit-tap-highlight-color: rgba(0,0,0,0); } #superContainer { height: 100%; position: relative; /* Touch detection for Windows 8 */ -ms-touch-action: none; /* IE 11 on Windows Phone 8.1*/ touch-action: none; } .fp-section { position: relative; -webkit-box-sizing: border-box; /* Safari<=5 Android<=3 */ -moz-box-sizing: border-box; /* <=28 */ box-sizing: border-box; } .fp-slide { float: left; } .fp-slide, .fp-slidesContainer { height: 100%; display: block; } .fp-slides { z-index:1; height: 100%; overflow: hidden; position: relative; -webkit-transition: all 0.3s ease-out; /* Safari<=6 Android<=4.3 */ transition: all 0.3s ease-out; } .fp-section.fp-table, .fp-slide.fp-table { display: table; table-layout:fixed; width: 100%; } .fp-tableCell { display: table-cell; vertical-align: middle; width: 100%; height: 100%; } .fp-slidesContainer { float: left; position: relative; } .fp-controlArrow { -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -khtml-user-select: none; /* webkit (konqueror) browsers */ -ms-user-select: none; /* IE10+ */ position: absolute; z-index: 4; top: 50%; cursor: pointer; width: 0; height: 0; border-style: solid; margin-top: -38px; -webkit-transform: translate3d(0,0,0); -ms-transform: translate3d(0,0,0); transform: translate3d(0,0,0); } .fp-controlArrow.fp-prev { left: 15px; width: 0; border-width: 38.5px 34px 38.5px 0; border-color: transparent #fff transparent transparent; } .fp-controlArrow.fp-next { right: 15px; border-width: 38.5px 0 38.5px 34px; border-color: transparent transparent transparent #fff; } .fp-scrollable { overflow: hidden; position: relative; } .fp-scroller{ overflow: hidden; } .iScrollIndicator{ border: 0 !important; } .fp-notransition { -webkit-transition: none !important; transition: none !important; } #fp-nav { position: fixed; z-index: 100; margin-top: -32px; top: 50%; opacity: 1; -webkit-transform: translate3d(0,0,0); } #fp-nav.right { right: 17px; } #fp-nav.left { left: 17px; } .fp-slidesNav{ position: absolute; z-index: 4; left: 50%; opacity: 1; -webkit-transform: translate3d(0,0,0); -ms-transform: translate3d(0,0,0); transform: translate3d(0,0,0); } .fp-slidesNav.bottom { bottom: 17px; } .fp-slidesNav.top { top: 17px; } #fp-nav ul, .fp-slidesNav ul { margin: 0; padding: 0; } #fp-nav ul li, .fp-slidesNav ul li { display: block; width: 14px; height: 13px; margin: 7px; position:relative; } .fp-slidesNav ul li { display: inline-block; } #fp-nav ul li a, .fp-slidesNav ul li a { display: block; position: relative; z-index: 1; width: 100%; height: 100%; cursor: pointer; text-decoration: none; } #fp-nav ul li a.active span, .fp-slidesNav ul li a.active span, #fp-nav ul li:hover a.active span, .fp-slidesNav ul li:hover a.active span{ height: 12px; width: 12px; margin: -6px 0 0 -6px; border-radius: 100%; } #fp-nav ul li a span, .fp-slidesNav ul li a span { border-radius: 50%; position: absolute; z-index: 1; height: 4px; width: 4px; border: 0; background: #333; left: 50%; top: 50%; margin: -2px 0 0 -2px; -webkit-transition: all 0.1s ease-in-out; -moz-transition: all 0.1s ease-in-out; -o-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out; } #fp-nav ul li:hover a span, .fp-slidesNav ul li:hover a span{ width: 10px; height: 10px; margin: -5px 0px 0px -5px; } #fp-nav ul li .fp-tooltip { position: absolute; top: -2px; color: #fff; font-size: 14px; font-family: arial, helvetica, sans-serif; white-space: nowrap; max-width: 220px; overflow: hidden; display: block; opacity: 0; width: 0; cursor: pointer; } #fp-nav ul li:hover .fp-tooltip, #fp-nav.fp-show-active a.active + .fp-tooltip { -webkit-transition: opacity 0.2s ease-in; transition: opacity 0.2s ease-in; width: auto; opacity: 1; } #fp-nav ul li .fp-tooltip.right { right: 20px; } #fp-nav ul li .fp-tooltip.left { left: 20px; } .fp-auto-height.fp-section, .fp-auto-height .fp-slide, .fp-auto-height .fp-tableCell{ height: auto !important; } .fp-responsive .fp-auto-height-responsive.fp-section, .fp-responsive .fp-auto-height-responsive .fp-slide, .fp-responsive .fp-auto-height-responsive .fp-tableCell { height: auto !important; }
dlueth/cdnjs
ajax/libs/fullPage.js/2.9.0/jquery.fullPage.css
CSS
mit
5,218
!function(e,n){var t,i,s,o,c={beforeChange:"deck.beforeChange",change:"deck.change",beforeInitialize:"deck.beforeInit",initialize:"deck.init"},r={},a=e(document),d=e(window),l=function(e){e.stopPropagation()},u=function(){var e=s.data("onSlide");s.removeClass(r.classes.onPrefix+e),s.addClass(r.classes.onPrefix+i),s.data("onSlide",i)},f=function(){var n=e("."+r.classes.current),s=n.parentsUntil(r.selectors.container),o=t[i],c=o.parentsUntil(r.selectors.container);s.removeClass(r.classes.childCurrent),c.addClass(r.classes.childCurrent)},h=function(){var n=e();e.each(t,function(e,t){n=n.add(t)}),n.removeClass([r.classes.before,r.classes.previous,r.classes.current,r.classes.next,r.classes.after].join(" "))},g=function(){t[i].addClass(r.classes.current),i>0&&t[i-1].addClass(r.classes.previous),i+1<t.length&&t[i+1].addClass(r.classes.next),i>1&&e.each(t.slice(0,i-1),function(e,n){n.addClass(r.classes.before)}),i+2<t.length&&e.each(t.slice(i+2),function(e,n){n.addClass(r.classes.after)})},k=function(){e(r.selectors.slides).each(function(){var n=e(this),t=n.closest("."+r.classes.childCurrent).length,i=n.hasClass(r.classes.before)&&!t,s=n.hasClass(r.classes.previous)&&!t,o=n.hasClass(r.classes.next),c=n.hasClass(r.classes.after),a=i||s||o||c;n.attr("aria-hidden",a)})},v=function(){u(),f(),h(),g(),r.setAriaHiddens&&k()},p=function(n){e.isArray(n)?e.each(n,function(n,i){t.push(e(i))}):e(n).each(function(n,i){t.push(e(i))})},w=function(){var n=["input","textarea","select","button","meter","progress","[contentEditable]"].join(", ");a.unbind("keydown.deck").bind("keydown.deck",function(n){var t=n.which===r.keys.next,i=n.which===r.keys.previous;t=t||e.inArray(n.which,r.keys.next)>-1,i=i||e.inArray(n.which,r.keys.previous)>-1,t?(E.next(),n.preventDefault()):i&&(E.prev(),n.preventDefault())}),a.undelegate(n,"keydown.deck",l),a.delegate(n,"keydown.deck",l)},b=function(){var t,i=r.touch.swipeDirection,o=r.touch.swipeTolerance,c={both:!0,horizontal:!0}[i],a={both:!0,vertical:!0}[i];s.unbind("touchstart.deck"),s.bind("touchstart.deck",function(n){t||(t=e.extend({},n.originalEvent.targetTouches[0]))}),s.unbind("touchmove.deck"),s.bind("touchmove.deck",function(i){e.each(i.originalEvent.changedTouches,function(i,s){if(!t||s.identifier!==t.identifier)return!0;var r=s.screenX-t.screenX,d=s.screenY-t.screenY,l=r>o&&c,u=-o>r&&c,f=d>o&&a,h=-o>d&&a;return l||f?(e.deck("prev"),t=n):(u||h)&&(e.deck("next"),t=n),!1}),a&&i.preventDefault()}),s.unbind("touchend.deck"),s.bind("touchend.deck",function(i){e.each(i.originalEvent.changedTouches,function(e,i){t&&i.identifier===t.identifier&&(t=n)})})},C=function(e){return"number"==typeof e&&e>=0&&e<t.length},y=function(){var n=e.Event(c.beforeInitialize);return n.locks=0,n.done=e.noop,n.lockInit=function(){++n.locks},n.releaseInit=function(){--n.locks,n.locks||n.done()},n},x=function(n){var i=n.substr(n.indexOf("#")+1);e.each(t,function(n,t){return t.attr("id")===i?(e.deck("go",n),!1):void 0}),r.preventFragmentScroll&&e.deck("getContainer").scrollLeft(0).scrollTop(0)},m=function(e,n){var t=n.attr("id"),i=n.data("deckAssignedId")===t;(!t||i)&&(n.attr("id",r.hashPrefix+e),n.data("deckAssignedId",r.hashPrefix+e))},S=function(e){s.removeClass(r.classes.onPrefix+e)},T=function(e){s.addClass(r.classes.onPrefix+e)},P=function(){o=e(),e.each(t,function(n,t){var i;m(n,t),i="#"+t.attr("id"),i===window.location.hash&&setTimeout(function(){e.deck("go",n)},1),o=o.add('a[href="'+i+'"]')}),t.length&&T(e.deck("getSlide").attr("id"))},z=function(n,t){var i="#"+e.deck("getSlide",t).attr("id"),s=window.location.href.replace(/#.*/,"")+i;S(e.deck("getSlide",n).attr("id")),T(e.deck("getSlide",t).attr("id")),Modernizr.history&&window.history.replaceState({},"",s)},E={init:function(n){var o=y(),d=n;e.isPlainObject(n)||(d=arguments[1]||{},e.extend(!0,d,{selectors:{slides:arguments[0]}})),r=e.extend(!0,{},e.deck.defaults,d),t=[],i=0,s=e(r.selectors.container),s.addClass(r.classes.loading),p(r.selectors.slides),o.done=function(){t=[],p(r.selectors.slides),P(),w(),b(),s.scrollLeft(0).scrollTop(0),t.length&&v(),s.removeClass(r.classes.loading),a.trigger(c.initialize)},a.trigger(o),o.locks||o.done(),window.setTimeout(function(){o.locks&&(window.console&&window.console.warn("Something locked deck initialization without releasing it before the timeout. Proceeding with initialization anyway."),o.done())},r.initLockTimeout)},go:function(n){var s,o=e.Event(c.beforeChange);C(n)?s=n:"string"==typeof n&&e.each(t,function(e,t){return t.attr("id")===n?(s=e,!1):void 0}),"undefined"!=typeof s&&(a.trigger(o,[i,s]),o.isDefaultPrevented()||(a.trigger(c.change,[i,s]),z(i,s),i=s,v()))},next:function(){E.go(i+1)},prev:function(){E.go(i-1)},getSlide:function(e){return e="undefined"!=typeof e?e:i,C(e)?t[e]:null},getSlides:function(){return t},getTopLevelSlides:function(){var n=[],i=r.selectors.slides,s=[i,i].join(" ");return e.each(t,function(e,t){t.is(s)||n.push(t)}),n},getNestedSlides:function(n){var t=null==n?i:n,s=e.deck("getSlide",t),o=s.find(r.selectors.slides),c=o.get();return e.map(c,function(n){return e(n)})},getContainer:function(){return s},getOptions:function(){return r},extend:function(e,n){E[e]=n}};e.deck=function(e,n){var t=Array.prototype.slice.call(arguments,1);return E[e]?E[e].apply(this,t):E.init(e,n)},e.deck.defaults={classes:{after:"deck-after",before:"deck-before",childCurrent:"deck-child-current",current:"deck-current",loading:"deck-loading",next:"deck-next",onPrefix:"on-slide-",previous:"deck-previous"},selectors:{container:".deck-container",slides:".slide"},keys:{next:[13,32,34,39,40],previous:[8,33,37,38]},touch:{swipeDirection:"horizontal",swipeTolerance:60},initLockTimeout:1e4,hashPrefix:"slide-",preventFragmentScroll:!0,setAriaHiddens:!0},a.ready(function(){e("html").addClass("ready")}),d.bind("hashchange.deck",function(e){x(e.originalEvent&&e.originalEvent.newURL?e.originalEvent.newURL:window.location.hash)}),d.bind("load.deck",function(){r.preventFragmentScroll&&s.scrollLeft(0).scrollTop(0)})}(jQuery);
codfish/cdnjs
ajax/libs/deck.js/1.1.0/core/deck.core.min.js
JavaScript
mit
6,033
/*! * Fine Uploader * * Copyright 2013-present, Widen Enterprises, Inc. * * Version: 5.10.0 * * Homepage: http://fineuploader.com * * Repository: git://github.com/FineUploader/fine-uploader.git * * Licensed only under the MIT license (http://fineuploader.com/licensing). */ /* --------------------------------------- /* Fine Uploader Styles /* --------------------------------------- /* Buttons ------------------------------------------ */ .qq-btn { box-shadow: 0 1px 1px rgba(255, 255, 255, 0.37) inset, 1px 0 1px rgba(255, 255, 255, 0.07) inset, 0 1px 0 rgba(0, 0, 0, 0.36), 0 -2px 12px rgba(0, 0, 0, 0.08) inset; padding: 3px 4px; border: 1px solid #CCCCCC; border-radius: 2px; color: inherit; background-color: #FFFFFF; } .qq-upload-delete, .qq-upload-pause, .qq-upload-continue { display: inline; } .qq-upload-delete { background-color: #e65c47; color: #FAFAFA; border-color: #dc523d; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55); } .qq-upload-delete:hover { background-color: #f56b56; } .qq-upload-cancel { background-color: #F5D7D7; border-color: #e6c8c8; } .qq-upload-cancel:hover { background-color: #ffe1e1; } .qq-upload-retry { background-color: #EBF6E0; border-color: #d2ddc7; } .qq-upload-retry:hover { background-color: #f7ffec; } .qq-upload-pause, .qq-upload-continue { background-color: #00ABC7; color: #FAFAFA; border-color: #2dadc2; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55); } .qq-upload-pause:hover, .qq-upload-continue:hover { background-color: #0fbad6; } /* Upload Button ------------------------------------------ */ .qq-upload-button { display: inline; width: 105px; margin-bottom: 10px; padding: 7px 10px; text-align: center; float: left; background: #00ABC7; color: #FFFFFF; border-radius: 2px; border: 1px solid #2dadc2; box-shadow: 0 1px 1px rgba(255, 255, 255, 0.37) inset, 1px 0 1px rgba(255, 255, 255, 0.07) inset, 0 1px 0 rgba(0, 0, 0, 0.36), 0 -2px 12px rgba(0, 0, 0, 0.08) inset; } .qq-upload-button-hover { background: #33B6CC; } .qq-upload-button-focus { outline: 1px dotted #000000; } /* Drop Zone ------------------------------------------ */ .qq-uploader { position: relative; min-height: 200px; max-height: 490px; overflow-y: hidden; width: inherit; border-radius: 6px; background-color: #FDFDFD; border: 1px dashed #CCCCCC; padding: 20px; } .qq-uploader:before { content: attr(qq-drop-area-text) " "; position: absolute; font-size: 200%; left: 0; width: 100%; text-align: center; top: 45%; opacity: 0.25; } .qq-upload-drop-area, .qq-upload-extra-drop-area { position: absolute; top: 0; left: 0; width: 100%; height: 100%; min-height: 30px; z-index: 2; background: #F9F9F9; border-radius: 4px; border: 1px dashed #CCCCCC; text-align: center; } .qq-upload-drop-area span { display: block; position: absolute; top: 50%; width: 100%; margin-top: -8px; font-size: 16px; } .qq-upload-extra-drop-area { position: relative; margin-top: 50px; font-size: 16px; padding-top: 30px; height: 20px; min-height: 40px; } .qq-upload-drop-area-active { background: #FDFDFD; border-radius: 4px; border: 1px dashed #CCCCCC; } .qq-upload-list { margin: 0; padding: 0; list-style: none; max-height: 450px; overflow-y: auto; box-shadow: 0px 1px 0px rgba(15, 15, 50, 0.14); clear: both; } /* Uploaded Elements ------------------------------------------ */ .qq-upload-list li { margin: 0; padding: 9px; line-height: 15px; font-size: 16px; color: #424242; background-color: #F6F6F6; border-top: 1px solid #FFFFFF; border-bottom: 1px solid #DDDDDD; } .qq-upload-list li:first-child { border-top: none; } .qq-upload-list li:last-child { border-bottom: none; } .qq-upload-file, .qq-upload-spinner, .qq-upload-size, .qq-upload-cancel, .qq-upload-retry, .qq-upload-failed-text, .qq-upload-delete, .qq-upload-pause, .qq-upload-continue { margin-right: 12px; display: inline; } .qq-upload-file { vertical-align: middle; display: inline-block; width: 300px; text-overflow: ellipsis; white-space: nowrap; overflow-x: hidden; height: 18px; } .qq-upload-spinner { display: inline-block; background: url("loading.gif"); width: 15px; height: 15px; vertical-align: text-bottom; } .qq-drop-processing { display: block; } .qq-drop-processing-spinner { display: inline-block; background: url("processing.gif"); width: 24px; height: 24px; vertical-align: text-bottom; } .qq-upload-size, .qq-upload-cancel, .qq-upload-retry, .qq-upload-delete, .qq-upload-pause, .qq-upload-continue { font-size: 12px; font-weight: normal; cursor: pointer; vertical-align: middle; } .qq-upload-status-text { font-size: 14px; font-weight: bold; display: block; } .qq-upload-failed-text { display: none; font-style: italic; font-weight: bold; } .qq-upload-failed-icon { display:none; width:15px; height:15px; vertical-align:text-bottom; } .qq-upload-fail .qq-upload-failed-text { display: inline; } .qq-upload-retrying .qq-upload-failed-text { display: inline; } .qq-upload-list li.qq-upload-success { background-color: #EBF6E0; color: #424242; border-bottom: 1px solid #D3DED1; border-top: 1px solid #F7FFF5; } .qq-upload-list li.qq-upload-fail { background-color: #F5D7D7; color: #424242; border-bottom: 1px solid #DECACA; border-top: 1px solid #FCE6E6; } .qq-progress-bar { display: block; display: block; background: #00abc7; width: 0%; height: 15px; border-radius: 6px; margin-bottom: 3px; } .qq-total-progress-bar { height: 25px; border-radius: 9px; } .qq-total-progress-bar-container { margin-left: 9px; display: inline; float: right; width: 500px; } INPUT.qq-edit-filename { position: absolute; opacity: 0; filter: alpha(opacity=0); z-index: -1; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; } .qq-upload-file.qq-editable { cursor: pointer; margin-right: 4px; } .qq-edit-filename-icon.qq-editable { display: inline-block; cursor: pointer; } INPUT.qq-edit-filename.qq-editing { position: static; height: 28px; padding: 0 8px; margin-right: 10px; margin-bottom: -5px; border: 1px solid #ccc; border-radius: 2px; font-size: 16px; opacity: 1; filter: alpha(opacity=100); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; } .qq-edit-filename-icon { display: none; background: url("edit.gif"); width: 15px; height: 15px; vertical-align: text-bottom; margin-right: 16px; } .qq-hide { display: none; } /* Thumbnail ------------------------------------------ */ .qq-thumbnail-selector { vertical-align: middle; margin-right: 12px; } /* <dialog> element styles */ .qq-uploader DIALOG { display: none; } .qq-uploader DIALOG[open] { display: block; } .qq-uploader DIALOG { display: none; } .qq-uploader DIALOG[open] { display: block; } .qq-uploader DIALOG .qq-dialog-buttons { text-align: center; padding-top: 10px; } .qq-uploader DIALOG .qq-dialog-buttons BUTTON { margin-left: 5px; margin-right: 5px; } .qq-uploader DIALOG .qq-dialog-message-selector { padding-bottom: 10px; } .qq-uploader DIALOG::backdrop { background-color: rgba(0, 0, 0, 0.7); } /*! 2016-06-16 */
pvnr0082t/cdnjs
ajax/libs/file-uploader/5.10.0/all.fine-uploader/fine-uploader-new.css
CSS
mit
7,773
/*! JointJS v0.9.3 - JavaScript diagramming library 2015-02-03 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ .viewport{-webkit-user-select:none;-moz-user-select:none;user-select:none}[magnet=true]:not(.element){cursor:crosshair}[magnet=true]:not(.element):hover{opacity:.7}.element{cursor:move}.element *{vector-effect:non-scaling-stroke;-moz-user-select:none;user-drag:none}.connection-wrap{fill:none;stroke:#000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;opacity:0;cursor:move}.connection-wrap:hover{opacity:.4;stroke-opacity:.4}.connection{fill:none;stroke-linejoin:round}.marker-source,.marker-target{vector-effect:non-scaling-stroke}.marker-vertices{opacity:0;cursor:move}.marker-arrowheads{opacity:0;cursor:move;cursor:-webkit-grab;cursor:-moz-grab}.link-tools{opacity:0;cursor:pointer}.link-tools .tool-options{display:none}.link-tools .tool-remove circle{fill:red}.link-tools .tool-remove path{fill:#fff}.link:hover .marker-vertices,.link:hover .marker-arrowheads,.link:hover .link-tools{opacity:1}.marker-vertex{fill:#1ABC9C}.marker-vertex:hover{fill:#34495E;stroke:none}.marker-arrowhead{fill:#1ABC9C}.marker-arrowhead:hover{fill:#F39C12;stroke:none}.marker-vertex-remove{cursor:pointer;opacity:.1;fill:#fff}.marker-vertex-group:hover .marker-vertex-remove{opacity:1}.marker-vertex-remove-area{opacity:.1;cursor:pointer}.marker-vertex-group:hover .marker-vertex-remove-area{opacity:1}.highlighted{opacity:.7}text.highlighted{fill:red}@media screen and (-webkit-min-device-pixel-ratio:0){.highlighted{outline:2px solid red;opacity:initial}}.element .fobj body{background-color:transparent;margin:0}.element .fobj div{text-align:center;vertical-align:middle;display:table-cell;padding:0 5px}
hasantayyar/cdnjs
ajax/libs/jointjs/0.9.3/joint.all.min.css
CSS
mit
1,871
YUI.add('event-synthetic', function (Y, NAME) { /** * Define new DOM events that can be subscribed to from Nodes. * * @module event * @submodule event-synthetic */ var CustomEvent = Y.CustomEvent, DOMMap = Y.Env.evt.dom_map, toArray = Y.Array, YLang = Y.Lang, isObject = YLang.isObject, isString = YLang.isString, isArray = YLang.isArray, query = Y.Selector.query, noop = function () {}; /** * <p>The triggering mechanism used by SyntheticEvents.</p> * * <p>Implementers should not instantiate these directly. Use the Notifier * provided to the event's implemented <code>on(node, sub, notifier)</code> or * <code>delegate(node, sub, notifier, filter)</code> methods.</p> * * @class SyntheticEvent.Notifier * @constructor * @param handle {EventHandle} the detach handle for the subscription to an * internal custom event used to execute the callback passed to * on(..) or delegate(..) * @param emitFacade {Boolean} take steps to ensure the first arg received by * the subscription callback is an event facade * @private * @since 3.2.0 */ function Notifier(handle, emitFacade) { this.handle = handle; this.emitFacade = emitFacade; } /** * <p>Executes the subscription callback, passing the firing arguments as the * first parameters to that callback. For events that are configured with * emitFacade=true, it is common practice to pass the triggering DOMEventFacade * as the first parameter. Barring a proper DOMEventFacade or EventFacade * (from a CustomEvent), a new EventFacade will be generated. In that case, if * fire() is called with a simple object, it will be mixed into the facade. * Otherwise, the facade will be prepended to the callback parameters.</p> * * <p>For notifiers provided to delegate logic, the first argument should be an * object with a &quot;currentTarget&quot; property to identify what object to * default as 'this' in the callback. Typically this is gleaned from the * DOMEventFacade or EventFacade, but if configured with emitFacade=false, an * object must be provided. In that case, the object will be removed from the * callback parameters.</p> * * <p>Additional arguments passed during event subscription will be * automatically added after those passed to fire().</p> * * @method fire * @param {EventFacade|DOMEventFacade|any} e (see description) * @param {any[]} [arg*] additional arguments received by all subscriptions * @private */ Notifier.prototype.fire = function (e) { // first arg to delegate notifier should be an object with currentTarget var args = toArray(arguments, 0, true), handle = this.handle, ce = handle.evt, sub = handle.sub, thisObj = sub.context, delegate = sub.filter, event = e || {}, ret; if (this.emitFacade) { if (!e || !e.preventDefault) { event = ce._getFacade(); if (isObject(e) && !e.preventDefault) { Y.mix(event, e, true); args[0] = event; } else { args.unshift(event); } } event.type = ce.type; event.details = args.slice(); if (delegate) { event.container = ce.host; } } else if (delegate && isObject(e) && e.currentTarget) { args.shift(); } sub.context = thisObj || event.currentTarget || ce.host; ret = ce.fire.apply(ce, args); // have to handle preventedFn and stoppedFn manually because // Notifier CustomEvents are forced to emitFacade=false if (e.prevented && ce.preventedFn) { ce.preventedFn.apply(ce, args); } if (e.stopped && ce.stoppedFn) { ce.stoppedFn.apply(ce, args); } sub.context = thisObj; // reset for future firing // to capture callbacks that return false to stopPropagation. // Useful for delegate implementations return ret; }; /** * Manager object for synthetic event subscriptions to aggregate multiple synths on the * same node without colliding with actual DOM subscription entries in the global map of * DOM subscriptions. Also facilitates proper cleanup on page unload. * * @class SynthRegistry * @constructor * @param el {HTMLElement} the DOM element * @param yuid {String} the yuid stamp for the element * @param key {String} the generated id token used to identify an event type + * element in the global DOM subscription map. * @private */ function SynthRegistry(el, yuid, key) { this.handles = []; this.el = el; this.key = key; this.domkey = yuid; } SynthRegistry.prototype = { constructor: SynthRegistry, // A few object properties to fake the CustomEvent interface for page // unload cleanup. DON'T TOUCH! type : '_synth', fn : noop, capture : false, /** * Adds a subscription from the Notifier registry. * * @method register * @param handle {EventHandle} the subscription * @since 3.4.0 */ register: function (handle) { handle.evt.registry = this; this.handles.push(handle); }, /** * Removes the subscription from the Notifier registry. * * @method _unregisterSub * @param sub {Subscription} the subscription * @since 3.4.0 */ unregister: function (sub) { var handles = this.handles, events = DOMMap[this.domkey], i; for (i = handles.length - 1; i >= 0; --i) { if (handles[i].sub === sub) { handles.splice(i, 1); break; } } // Clean up left over objects when there are no more subscribers. if (!handles.length) { delete events[this.key]; if (!Y.Object.size(events)) { delete DOMMap[this.domkey]; } } }, /** * Used by the event system's unload cleanup process. When navigating * away from the page, the event system iterates the global map of element * subscriptions and detaches everything using detachAll(). Normally, * the map is populated with custom events, so this object needs to * at least support the detachAll method to duck type its way to * cleanliness. * * @method detachAll * @private * @since 3.4.0 */ detachAll : function () { var handles = this.handles, i = handles.length; while (--i >= 0) { handles[i].detach(); } } }; /** * <p>Wrapper class for the integration of new events into the YUI event * infrastructure. Don't instantiate this object directly, use * <code>Y.Event.define(type, config)</code>. See that method for details.</p> * * <p>Properties that MAY or SHOULD be specified in the configuration are noted * below and in the description of <code>Y.Event.define</code>.</p> * * @class SyntheticEvent * @constructor * @param cfg {Object} Implementation pieces and configuration * @since 3.1.0 * @in event-synthetic */ function SyntheticEvent() { this._init.apply(this, arguments); } Y.mix(SyntheticEvent, { Notifier: Notifier, SynthRegistry: SynthRegistry, /** * Returns the array of subscription handles for a node for the given event * type. Passing true as the third argument will create a registry entry * in the event system's DOM map to host the array if one doesn't yet exist. * * @method getRegistry * @param node {Node} the node * @param type {String} the event * @param create {Boolean} create a registration entry to host a new array * if one doesn't exist. * @return {Array} * @static * @protected * @since 3.2.0 */ getRegistry: function (node, type, create) { var el = node._node, yuid = Y.stamp(el), key = 'event:' + yuid + type + '_synth', events = DOMMap[yuid]; if (create) { if (!events) { events = DOMMap[yuid] = {}; } if (!events[key]) { events[key] = new SynthRegistry(el, yuid, key); } } return (events && events[key]) || null; }, /** * Alternate <code>_delete()</code> method for the CustomEvent object * created to manage SyntheticEvent subscriptions. * * @method _deleteSub * @param sub {Subscription} the subscription to clean up * @private * @since 3.2.0 */ _deleteSub: function (sub) { if (sub && sub.fn) { var synth = this.eventDef, method = (sub.filter) ? 'detachDelegate' : 'detach'; this._subscribers = []; if (CustomEvent.keepDeprecatedSubs) { this.subscribers = {}; } synth[method](sub.node, sub, this.notifier, sub.filter); this.registry.unregister(sub); delete sub.fn; delete sub.node; delete sub.context; } }, prototype: { constructor: SyntheticEvent, /** * Construction logic for the event. * * @method _init * @protected */ _init: function () { var config = this.publishConfig || (this.publishConfig = {}); // The notification mechanism handles facade creation this.emitFacade = ('emitFacade' in config) ? config.emitFacade : true; config.emitFacade = false; }, /** * <p>Implementers MAY provide this method definition.</p> * * <p>Implement this function if the event supports a different * subscription signature. This function is used by both * <code>on()</code> and <code>delegate()</code>. The second parameter * indicates that the event is being subscribed via * <code>delegate()</code>.</p> * * <p>Implementations must remove extra arguments from the args list * before returning. The required args for <code>on()</code> * subscriptions are</p> * <pre><code>[type, callback, target, context, argN...]</code></pre> * * <p>The required args for <code>delegate()</code> * subscriptions are</p> * * <pre><code>[type, callback, target, filter, context, argN...]</code></pre> * * <p>The return value from this function will be stored on the * subscription in the '_extra' property for reference elsewhere.</p> * * @method processArgs * @param args {Array} parmeters passed to Y.on(..) or Y.delegate(..) * @param delegate {Boolean} true if the subscription is from Y.delegate * @return {any} */ processArgs: noop, /** * <p>Implementers MAY override this property.</p> * * <p>Whether to prevent multiple subscriptions to this event that are * classified as being the same. By default, this means the subscribed * callback is the same function. See the <code>subMatch</code> * method. Setting this to true will impact performance for high volume * events.</p> * * @property preventDups * @type {Boolean} * @default false */ //preventDups : false, /** * <p>Implementers SHOULD provide this method definition.</p> * * Implementation logic for subscriptions done via <code>node.on(type, * fn)</code> or <code>Y.on(type, fn, target)</code>. This * function should set up the monitor(s) that will eventually fire the * event. Typically this involves subscribing to at least one DOM * event. It is recommended to store detach handles from any DOM * subscriptions to make for easy cleanup in the <code>detach</code> * method. Typically these handles are added to the <code>sub</code> * object. Also for SyntheticEvents that leverage a single DOM * subscription under the hood, it is recommended to pass the DOM event * object to <code>notifier.fire(e)</code>. (The event name on the * object will be updated). * * @method on * @param node {Node} the node the subscription is being applied to * @param sub {Subscription} the object to track this subscription * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to * trigger the execution of the subscribers */ on: noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for detaching subscriptions done via * <code>node.on(type, fn)</code>. This function should clean up any * subscriptions made in the <code>on()</code> phase.</p> * * @method detach * @param node {Node} the node the subscription was applied to * @param sub {Subscription} the object tracking this subscription * @param notifier {SyntheticEvent.Notifier} the Notifier used to * trigger the execution of the subscribers */ detach: noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for subscriptions done via * <code>node.delegate(type, fn, filter)</code> or * <code>Y.delegate(type, fn, container, filter)</code>. Like with * <code>on()</code> above, this function should monitor the environment * for the event being fired, and trigger subscription execution by * calling <code>notifier.fire(e)</code>.</p> * * <p>This function receives a fourth argument, which is the filter * used to identify which Node's are of interest to the subscription. * The filter will be either a boolean function that accepts a target * Node for each hierarchy level as the event bubbles, or a selector * string. To translate selector strings into filter functions, use * <code>Y.delegate.compileFilter(filter)</code>.</p> * * @method delegate * @param node {Node} the node the subscription is being applied to * @param sub {Subscription} the object to track this subscription * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to * trigger the execution of the subscribers * @param filter {String|Function} Selector string or function that * accepts an event object and returns null, a Node, or an * array of Nodes matching the criteria for processing. * @since 3.2.0 */ delegate : noop, /** * <p>Implementers SHOULD provide this method definition.</p> * * <p>Implementation logic for detaching subscriptions done via * <code>node.delegate(type, fn, filter)</code> or * <code>Y.delegate(type, fn, container, filter)</code>. This function * should clean up any subscriptions made in the * <code>delegate()</code> phase.</p> * * @method detachDelegate * @param node {Node} the node the subscription was applied to * @param sub {Subscription} the object tracking this subscription * @param notifier {SyntheticEvent.Notifier} the Notifier used to * trigger the execution of the subscribers * @param filter {String|Function} Selector string or function that * accepts an event object and returns null, a Node, or an * array of Nodes matching the criteria for processing. * @since 3.2.0 */ detachDelegate : noop, /** * Sets up the boilerplate for detaching the event and facilitating the * execution of subscriber callbacks. * * @method _on * @param args {Array} array of arguments passed to * <code>Y.on(...)</code> or <code>Y.delegate(...)</code> * @param delegate {Boolean} true if called from * <code>Y.delegate(...)</code> * @return {EventHandle} the detach handle for this subscription * @private * since 3.2.0 */ _on: function (args, delegate) { var handles = [], originalArgs = args.slice(), extra = this.processArgs(args, delegate), selector = args[2], method = delegate ? 'delegate' : 'on', nodes, handle; // Can't just use Y.all because it doesn't support window (yet?) nodes = (isString(selector)) ? query(selector) : toArray(selector || Y.one(Y.config.win)); if (!nodes.length && isString(selector)) { handle = Y.on('available', function () { Y.mix(handle, Y[method].apply(Y, originalArgs), true); }, selector); return handle; } Y.Array.each(nodes, function (node) { var subArgs = args.slice(), filter; node = Y.one(node); if (node) { if (delegate) { filter = subArgs.splice(3, 1)[0]; } // (type, fn, el, thisObj, ...) => (fn, thisObj, ...) subArgs.splice(0, 4, subArgs[1], subArgs[3]); if (!this.preventDups || !this.getSubs(node, args, null, true)) { handles.push(this._subscribe(node, method, subArgs, extra, filter)); } } }, this); return (handles.length === 1) ? handles[0] : new Y.EventHandle(handles); }, /** * Creates a new Notifier object for use by this event's * <code>on(...)</code> or <code>delegate(...)</code> implementation * and register the custom event proxy in the DOM system for cleanup. * * @method _subscribe * @param node {Node} the Node hosting the event * @param method {String} "on" or "delegate" * @param args {Array} the subscription arguments passed to either * <code>Y.on(...)</code> or <code>Y.delegate(...)</code> * after running through <code>processArgs(args)</code> to * normalize the argument signature * @param extra {any} Extra data parsed from * <code>processArgs(args)</code> * @param filter {String|Function} the selector string or function * filter passed to <code>Y.delegate(...)</code> (not * present when called from <code>Y.on(...)</code>) * @return {EventHandle} * @private * @since 3.2.0 */ _subscribe: function (node, method, args, extra, filter) { var dispatcher = new Y.CustomEvent(this.type, this.publishConfig), handle = dispatcher.on.apply(dispatcher, args), notifier = new Notifier(handle, this.emitFacade), registry = SyntheticEvent.getRegistry(node, this.type, true), sub = handle.sub; sub.node = node; sub.filter = filter; if (extra) { this.applyArgExtras(extra, sub); } Y.mix(dispatcher, { eventDef : this, notifier : notifier, host : node, // I forget what this is for currentTarget: node, // for generating facades target : node, // for generating facades el : node._node, // For category detach _delete : SyntheticEvent._deleteSub }, true); handle.notifier = notifier; registry.register(handle); // Call the implementation's "on" or "delegate" method this[method](node, sub, notifier, filter); return handle; }, /** * <p>Implementers MAY provide this method definition.</p> * * <p>Implement this function if you want extra data extracted during * processArgs to be propagated to subscriptions on a per-node basis. * That is to say, if you call <code>Y.on('xyz', fn, xtra, 'div')</code> * the data returned from processArgs will be shared * across the subscription objects for all the divs. If you want each * subscription to receive unique information, do that processing * here.</p> * * <p>The default implementation adds the data extracted by processArgs * to the subscription object as <code>sub._extra</code>.</p> * * @method applyArgExtras * @param extra {any} Any extra data extracted from processArgs * @param sub {Subscription} the individual subscription */ applyArgExtras: function (extra, sub) { sub._extra = extra; }, /** * Removes the subscription(s) from the internal subscription dispatch * mechanism. See <code>SyntheticEvent._deleteSub</code>. * * @method _detach * @param args {Array} The arguments passed to * <code>node.detach(...)</code> * @private * @since 3.2.0 */ _detach: function (args) { // Can't use Y.all because it doesn't support window (yet?) // TODO: Does Y.all support window now? var target = args[2], els = (isString(target)) ? query(target) : toArray(target), node, i, len, handles, j; // (type, fn, el, context, filter?) => (type, fn, context, filter?) args.splice(2, 1); for (i = 0, len = els.length; i < len; ++i) { node = Y.one(els[i]); if (node) { handles = this.getSubs(node, args); if (handles) { for (j = handles.length - 1; j >= 0; --j) { handles[j].detach(); } } } } }, /** * Returns the detach handles of subscriptions on a node that satisfy a * search/filter function. By default, the filter used is the * <code>subMatch</code> method. * * @method getSubs * @param node {Node} the node hosting the event * @param args {Array} the array of original subscription args passed * to <code>Y.on(...)</code> (before * <code>processArgs</code> * @param filter {Function} function used to identify a subscription * for inclusion in the returned array * @param first {Boolean} stop after the first match (used to check for * duplicate subscriptions) * @return {EventHandle[]} detach handles for the matching subscriptions */ getSubs: function (node, args, filter, first) { var registry = SyntheticEvent.getRegistry(node, this.type), handles = [], allHandles, i, len, handle; if (registry) { allHandles = registry.handles; if (!filter) { filter = this.subMatch; } for (i = 0, len = allHandles.length; i < len; ++i) { handle = allHandles[i]; if (filter.call(this, handle.sub, args)) { if (first) { return handle; } else { handles.push(allHandles[i]); } } } } return handles.length && handles; }, /** * <p>Implementers MAY override this to define what constitutes a * &quot;same&quot; subscription. Override implementations should * consider the lack of a comparator as a match, so calling * <code>getSubs()</code> with no arguments will return all subs.</p> * * <p>Compares a set of subscription arguments against a Subscription * object to determine if they match. The default implementation * compares the callback function against the second argument passed to * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p> * * @method subMatch * @param sub {Subscription} the existing subscription * @param args {Array} the calling arguments passed to * <code>Y.on(...)</code> etc. * @return {Boolean} true if the sub can be described by the args * present * @since 3.2.0 */ subMatch: function (sub, args) { // Default detach cares only about the callback matching return !args[1] || sub.fn === args[1]; } } }, true); Y.SyntheticEvent = SyntheticEvent; /** * <p>Defines a new event in the DOM event system. Implementers are * responsible for monitoring for a scenario whereby the event is fired. A * notifier object is provided to the functions identified below. When the * criteria defining the event are met, call notifier.fire( [args] ); to * execute event subscribers.</p> * * <p>The first parameter is the name of the event. The second parameter is a * configuration object which define the behavior of the event system when the * new event is subscribed to or detached from. The methods that should be * defined in this configuration object are <code>on</code>, * <code>detach</code>, <code>delegate</code>, and <code>detachDelegate</code>. * You are free to define any other methods or properties needed to define your * event. Be aware, however, that since the object is used to subclass * SyntheticEvent, you should avoid method names used by SyntheticEvent unless * your intention is to override the default behavior.</p> * * <p>This is a list of properties and methods that you can or should specify * in the configuration object:</p> * * <dl> * <dt><code>on</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for subscription. Any special setup you need to * do to create the environment for the event being fired--E.g. native * DOM event subscriptions. Store subscription related objects and * state on the <code>subscription</code> object. When the * criteria have been met to fire the synthetic event, call * <code>notifier.fire(e)</code>. See Notifier's <code>fire()</code> * method for details about what to pass as parameters.</dd> * * <dt><code>detach</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for cleaning up a detached subscription. E.g. * detach any DOM subscriptions added in <code>on</code>.</dd> * * <dt><code>delegate</code></dt> * <dd><code>function (node, subscription, notifier, filter)</code> The * implementation logic for subscription via <code>Y.delegate</code> or * <code>node.delegate</code>. The filter is typically either a selector * string or a function. You can use * <code>Y.delegate.compileFilter(selectorString)</code> to create a * filter function from a selector string if needed. The filter function * expects an event object as input and should output either null, a * matching Node, or an array of matching Nodes. Otherwise, this acts * like <code>on</code> DOM event subscriptions. Store subscription * related objects and information on the <code>subscription</code> * object. When the criteria have been met to fire the synthetic event, * call <code>notifier.fire(e)</code> as noted above.</dd> * * <dt><code>detachDelegate</code></dt> * <dd><code>function (node, subscription, notifier)</code> The * implementation logic for cleaning up a detached delegate subscription. * E.g. detach any DOM delegate subscriptions added in * <code>delegate</code>.</dd> * * <dt><code>publishConfig</code></dt> * <dd>(Object) The configuration object that will be used to instantiate * the underlying CustomEvent. See Notifier's <code>fire</code> method * for details.</dd> * * <dt><code>processArgs</code></dt * <dd> * <p><code>function (argArray, fromDelegate)</code> Optional method * to extract any additional arguments from the subscription * signature. Using this allows <code>on</code> or * <code>delegate</code> signatures like * <code>node.on(&quot;hover&quot;, overCallback, * outCallback)</code>.</p> * <p>When processing an atypical argument signature, make sure the * args array is returned to the normal signature before returning * from the function. For example, in the &quot;hover&quot; example * above, the <code>outCallback</code> needs to be <code>splice</code>d * out of the array. The expected signature of the args array for * <code>on()</code> subscriptions is:</p> * <pre> * <code>[type, callback, target, contextOverride, argN...]</code> * </pre> * <p>And for <code>delegate()</code>:</p> * <pre> * <code>[type, callback, target, filter, contextOverride, argN...]</code> * </pre> * <p>where <code>target</code> is the node the event is being * subscribed for. You can see these signatures documented for * <code>Y.on()</code> and <code>Y.delegate()</code> respectively.</p> * <p>Whatever gets returned from the function will be stored on the * <code>subscription</code> object under * <code>subscription._extra</code>.</p></dd> * <dt><code>subMatch</code></dt> * <dd> * <p><code>function (sub, args)</code> Compares a set of * subscription arguments against a Subscription object to determine * if they match. The default implementation compares the callback * function against the second argument passed to * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p> * </dd> * </dl> * * @method define * @param type {String} the name of the event * @param config {Object} the prototype definition for the new event (see above) * @param force {Boolean} override an existing event (use with caution) * @return {SyntheticEvent} the subclass implementation instance created to * handle event subscriptions of this type * @static * @for Event * @since 3.1.0 * @in event-synthetic */ Y.Event.define = function (type, config, force) { var eventDef, Impl, synth; if (type && type.type) { eventDef = type; force = config; } else if (config) { eventDef = Y.merge({ type: type }, config); } if (eventDef) { if (force || !Y.Node.DOM_EVENTS[eventDef.type]) { Impl = function () { SyntheticEvent.apply(this, arguments); }; Y.extend(Impl, SyntheticEvent, eventDef); synth = new Impl(); type = synth.type; Y.Node.DOM_EVENTS[type] = Y.Env.evt.plugins[type] = { eventDef: synth, on: function () { return synth._on(toArray(arguments)); }, delegate: function () { return synth._on(toArray(arguments), true); }, detach: function () { return synth._detach(toArray(arguments)); } }; } } else if (isString(type) || isArray(type)) { Y.Array.each(toArray(type), function (t) { Y.Node.DOM_EVENTS[t] = 1; }); } return synth; }; }, '@VERSION@', {"requires": ["node-base", "event-custom-complex"]});
liubo404/cdnjs
ajax/libs/yui/3.17.1-rc-1/event-synthetic/event-synthetic.js
JavaScript
mit
32,953
//! moment.js locale configuration //! locale : dutch (nl) //! author : Joris Röling : https://github.com/jjupiter (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); var nl = moment.defineLocale('nl', { months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), monthsShort : function (m, format) { if (/-MMM-/.test(format)) { return monthsShortWithoutDots[m.month()]; } else { return monthsShortWithDots[m.month()]; } }, weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'), weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'LT:ss', L : 'DD-MM-YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY LT', LLLL : 'dddd D MMMM YYYY LT' }, calendar : { sameDay: '[vandaag om] LT', nextDay: '[morgen om] LT', nextWeek: 'dddd [om] LT', lastDay: '[gisteren om] LT', lastWeek: '[afgelopen] dddd [om] LT', sameElse: 'L' }, relativeTime : { future : 'over %s', past : '%s geleden', s : 'een paar seconden', m : 'één minuut', mm : '%d minuten', h : 'één uur', hh : '%d uur', d : 'één dag', dd : '%d dagen', M : 'één maand', MM : '%d maanden', y : 'één jaar', yy : '%d jaar' }, ordinalParse: /\d{1,2}(ste|de)/, ordinal : function (number) { return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); }, week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); return nl; }));
adampmoss/adammossghost
node_modules/moment/locale/nl.js
JavaScript
mit
2,527
//! moment.js locale configuration //! locale : vietnamese (vi) //! author : Bang Nguyen : https://github.com/bangnk (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; var vi = moment.defineLocale('vi', { months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'LT:ss', L : 'DD/MM/YYYY', LL : 'D MMMM [năm] YYYY', LLL : 'D MMMM [năm] YYYY LT', LLLL : 'dddd, D MMMM [năm] YYYY LT', l : 'DD/M/YYYY', ll : 'D MMM YYYY', lll : 'D MMM YYYY LT', llll : 'ddd, D MMM YYYY LT' }, calendar : { sameDay: '[Hôm nay lúc] LT', nextDay: '[Ngày mai lúc] LT', nextWeek: 'dddd [tuần tới lúc] LT', lastDay: '[Hôm qua lúc] LT', lastWeek: 'dddd [tuần rồi lúc] LT', sameElse: 'L' }, relativeTime : { future : '%s tới', past : '%s trước', s : 'vài giây', m : 'một phút', mm : '%d phút', h : 'một giờ', hh : '%d giờ', d : 'một ngày', dd : '%d ngày', M : 'một tháng', MM : '%d tháng', y : 'một năm', yy : '%d năm' }, ordinalParse: /\d{1,2}/, ordinal : function (number) { return number; }, week : { dow : 1, // Monday is the first day of the week. doy : 4 // The week that contains Jan 4th is the first week of the year. } }); return vi; }));
hunterlive/seww
public/moment-locales/vi.js
JavaScript
mit
2,324
;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.offcanvas = { name : 'offcanvas', version : '5.1.1', settings : {}, init : function (scope, method, options) { this.events(); }, events : function () { var S = this.S; S(this.scope).off('.offcanvas') .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) { e.preventDefault(); S(this).closest('.off-canvas-wrap').toggleClass('move-right'); }) .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { e.preventDefault(); S(".off-canvas-wrap").removeClass("move-right"); }) .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) { e.preventDefault(); S(this).closest(".off-canvas-wrap").toggleClass("move-left"); }) .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { e.preventDefault(); S(".off-canvas-wrap").removeClass("move-left"); }); }, reflow : function () {} }; }(jQuery, this, this.document));
ColinEberhardt/cdnjs
ajax/libs/foundation/5.1.1/js/foundation/foundation.offcanvas.js
JavaScript
mit
1,132
#!/usr/bin/env bash ###-begin-{{cmd}}-completion-### # # {{cmd}} command completion script # # Installation: {{cmd}} completion >> ~/.bashrc (or ~/.zshrc) # Or, maybe: {{cmd}} completion > /usr/local/etc/bash_completion.d/{{cmd}} # COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} export COMP_WORDBREAKS if complete &>/dev/null; then _{{cmd}}_completion () { local si="$IFS" IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ COMP_LINE="$COMP_LINE" \ COMP_POINT="$COMP_POINT" \ {{cmd}} completion -- "${COMP_WORDS[@]}" \ 2>/dev/null)) || return $? IFS="$si" } complete -F _{{cmd}}_completion {{cmd}} elif compctl &>/dev/null; then _{{cmd}}_completion () { local cword line point words si read -Ac words read -cn cword let cword-=1 read -l line read -ln point si="$IFS" IFS=$'\n' reply=($(COMP_CWORD="$cword" \ COMP_LINE="$line" \ COMP_POINT="$point" \ {{cmd}} completion -- "${words[@]}" \ 2>/dev/null)) || return $? IFS="$si" } compctl -K _{{cmd}}_completion {{cmd}} fi ###-end-{{cmd}}-completion-###
austinjalexander/sandbox
js/redux/learn-redux/node_modules/coa/lib/completion.sh
Shell
mit
1,291
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)), void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n}); //# sourceMappingURL=jquery.min.map
MarcinakaSin/massplash-app
bower_components/jquery/dist/jquery.min.js
JavaScript
mit
84,380
//======================================================================= // Copyright 2002 Indiana University. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #include <boost/graph/properties.hpp> #include <boost/graph/adjacency_list.hpp> using namespace boost; struct vertex_info_t { }; struct edge_info_t { }; namespace boost { BOOST_INSTALL_PROPERTY(vertex, info); BOOST_INSTALL_PROPERTY(edge, info); }; typedef property<vertex_info_t, double> vertex_properties; typedef property<edge_info_t, double> edge_properties; typedef adjacency_list<vecS, vecS, bidirectionalS, vertex_properties, edge_properties> graph_t; double& foo_1(graph_t& x) { property_map<graph_t, vertex_info_t>::type pmap = get(vertex_info_t(), x); return pmap[vertex(0, x)]; } const double& foo_2(graph_t const & x) { property_map<graph_t, vertex_info_t>::const_type pmap = get(vertex_info_t(), x); return pmap[vertex(0, x)]; } double& bar_1(graph_t& x) { property_map<graph_t, edge_info_t>::type pmap = get(edge_info_t(), x); return pmap[edge(vertex(0, x), vertex(1, x), x).first]; } const double& bar_2(graph_t const & x) { property_map<graph_t, edge_info_t>::const_type pmap = get(edge_info_t(), x); return pmap[edge(vertex(0, x), vertex(1, x), x).first]; } int main() { return 0; }
hand-iemura/lightpng
boost_1_53_0/libs/graph/test/lvalue_pmap.cpp
C++
mit
1,557
<?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\Http\RememberMe; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken; use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\Exception\CookieTheftException; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Cookie; use Psr\Log\LoggerInterface; /** * Base class implementing the RememberMeServicesInterface. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ abstract class AbstractRememberMeServices implements RememberMeServicesInterface, LogoutHandlerInterface { const COOKIE_DELIMITER = ':'; protected $logger; protected $options; private $providerKey; private $secret; private $userProviders; /** * Constructor. * * @param array $userProviders * @param string $secret * @param string $providerKey * @param array $options * @param LoggerInterface $logger * * @throws \InvalidArgumentException */ public function __construct(array $userProviders, $secret, $providerKey, array $options = array(), LoggerInterface $logger = null) { if (empty($secret)) { throw new \InvalidArgumentException('$secret must not be empty.'); } if (empty($providerKey)) { throw new \InvalidArgumentException('$providerKey must not be empty.'); } if (0 === count($userProviders)) { throw new \InvalidArgumentException('You must provide at least one user provider.'); } $this->userProviders = $userProviders; $this->secret = $secret; $this->providerKey = $providerKey; $this->options = $options; $this->logger = $logger; } /** * Returns the parameter that is used for checking whether remember-me * services have been requested. * * @return string */ public function getRememberMeParameter() { return $this->options['remember_me_parameter']; } /** * @deprecated Since version 2.8, to be removed in 3.0. Use getSecret() instead. */ public function getKey() { @trigger_error(__method__.'() is deprecated since version 2.8 and will be removed in 3.0. Use getSecret() instead.', E_USER_DEPRECATED); return $this->getSecret(); } /** * @return string */ public function getSecret() { return $this->secret; } /** * Implementation of RememberMeServicesInterface. Detects whether a remember-me * cookie was set, decodes it, and hands it to subclasses for further processing. * * @param Request $request * * @return TokenInterface|null * * @throws CookieTheftException * @throws \RuntimeException */ final public function autoLogin(Request $request) { if (null === $cookie = $request->cookies->get($this->options['name'])) { return; } if (null !== $this->logger) { $this->logger->debug('Remember-me cookie detected.'); } $cookieParts = $this->decodeCookie($cookie); try { $user = $this->processAutoLoginCookie($cookieParts, $request); if (!$user instanceof UserInterface) { throw new \RuntimeException('processAutoLoginCookie() must return a UserInterface implementation.'); } if (null !== $this->logger) { $this->logger->info('Remember-me cookie accepted.'); } return new RememberMeToken($user, $this->providerKey, $this->secret); } catch (CookieTheftException $e) { $this->cancelCookie($request); throw $e; } catch (UsernameNotFoundException $e) { if (null !== $this->logger) { $this->logger->info('User for remember-me cookie not found.'); } } catch (UnsupportedUserException $e) { if (null !== $this->logger) { $this->logger->warning('User class for remember-me cookie not supported.'); } } catch (AuthenticationException $e) { if (null !== $this->logger) { $this->logger->debug('Remember-Me authentication failed.', array('exception' => $e)); } } $this->cancelCookie($request); } /** * Implementation for LogoutHandlerInterface. Deletes the cookie. * * @param Request $request * @param Response $response * @param TokenInterface $token */ public function logout(Request $request, Response $response, TokenInterface $token) { $this->cancelCookie($request); } /** * Implementation for RememberMeServicesInterface. Deletes the cookie when * an attempted authentication fails. * * @param Request $request */ final public function loginFail(Request $request) { $this->cancelCookie($request); $this->onLoginFail($request); } /** * Implementation for RememberMeServicesInterface. This is called when an * authentication is successful. * * @param Request $request * @param Response $response * @param TokenInterface $token The token that resulted in a successful authentication */ final public function loginSuccess(Request $request, Response $response, TokenInterface $token) { // Make sure any old remember-me cookies are cancelled $this->cancelCookie($request); if (!$token->getUser() instanceof UserInterface) { if (null !== $this->logger) { $this->logger->debug('Remember-me ignores token since it does not contain a UserInterface implementation.'); } return; } if (!$this->isRememberMeRequested($request)) { if (null !== $this->logger) { $this->logger->debug('Remember-me was not requested.'); } return; } if (null !== $this->logger) { $this->logger->debug('Remember-me was requested; setting cookie.'); } // Remove attribute from request that sets a NULL cookie. // It was set by $this->cancelCookie() // (cancelCookie does other things too for some RememberMeServices // so we should still call it at the start of this method) $request->attributes->remove(self::COOKIE_ATTR_NAME); $this->onLoginSuccess($request, $response, $token); } /** * Subclasses should validate the cookie and do any additional processing * that is required. This is called from autoLogin(). * * @param array $cookieParts * @param Request $request * * @return UserInterface */ abstract protected function processAutoLoginCookie(array $cookieParts, Request $request); /** * @param Request $request */ protected function onLoginFail(Request $request) { } /** * This is called after a user has been logged in successfully, and has * requested remember-me capabilities. The implementation usually sets a * cookie and possibly stores a persistent record of it. * * @param Request $request * @param Response $response * @param TokenInterface $token */ abstract protected function onLoginSuccess(Request $request, Response $response, TokenInterface $token); final protected function getUserProvider($class) { foreach ($this->userProviders as $provider) { if ($provider->supportsClass($class)) { return $provider; } } throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class)); } /** * Decodes the raw cookie value. * * @param string $rawCookie * * @return array */ protected function decodeCookie($rawCookie) { return explode(self::COOKIE_DELIMITER, base64_decode($rawCookie)); } /** * Encodes the cookie parts. * * @param array $cookieParts * * @return string * * @throws \InvalidArgumentException When $cookieParts contain the cookie delimiter. Extending class should either remove or escape it. */ protected function encodeCookie(array $cookieParts) { foreach ($cookieParts as $cookiePart) { if (false !== strpos($cookiePart, self::COOKIE_DELIMITER)) { throw new \InvalidArgumentException(sprintf('$cookieParts should not contain the cookie delimiter "%s"', self::COOKIE_DELIMITER)); } } return base64_encode(implode(self::COOKIE_DELIMITER, $cookieParts)); } /** * Deletes the remember-me cookie. * * @param Request $request */ protected function cancelCookie(Request $request) { if (null !== $this->logger) { $this->logger->debug('Clearing remember-me cookie.', array('name' => $this->options['name'])); } $request->attributes->set(self::COOKIE_ATTR_NAME, new Cookie($this->options['name'], null, 1, $this->options['path'], $this->options['domain'])); } /** * Checks whether remember-me capabilities were requested. * * @param Request $request * * @return bool */ protected function isRememberMeRequested(Request $request) { if (true === $this->options['always_remember_me']) { return true; } $parameter = $request->get($this->options['remember_me_parameter'], null, true); if (null === $parameter && null !== $this->logger) { $this->logger->debug('Did not send remember-me cookie.', array('parameter' => $this->options['remember_me_parameter'])); } return $parameter === 'true' || $parameter === 'on' || $parameter === '1' || $parameter === 'yes'; } }
pyrech-forks/symfony
src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php
PHP
mit
10,671
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function(addon) { var component; if (window.UIkit) { component = addon(UIkit); } if (typeof define == "function" && define.amd) { define("uikit-accordion", ["uikit"], function(){ return component || addon(UIkit); }); } })(function(UI){ "use strict"; UI.component('accordion', { defaults: { showfirst : true, collapse : true, animate : true, easing : 'swing', duration : 300, toggle : '.uk-accordion-title', containers : '.uk-accordion-content', clsactive : 'uk-active' }, boot: function() { // init code UI.ready(function(context) { setTimeout(function(){ UI.$("[data-uk-accordion]", context).each(function(){ var ele = UI.$(this); if(!ele.data("accordion")) { UI.accordion(ele, UI.Utils.options(ele.attr('data-uk-accordion'))); } }); }, 0); }); }, init: function() { var $this = this; this.element.on('click.uikit.accordion', this.options.toggle, function(e) { e.preventDefault(); $this.toggleItem(UI.$(this).data('wrapper'), $this.options.animate, $this.options.collapse); }); this.update(); if (this.options.showfirst) { this.toggleItem(this.toggle.eq(0).data('wrapper'), false, false); } }, toggleItem: function(wrapper, animated, collapse) { var $this = this; wrapper.data('toggle').toggleClass(this.options.clsactive); wrapper.data('content').toggleClass(this.options.clsactive); var active = wrapper.data('toggle').hasClass(this.options.clsactive); if (collapse) { this.toggle.not(wrapper.data('toggle')).removeClass(this.options.clsactive); this.content.not(wrapper.data('content')).removeClass(this.options.clsactive) .parent().stop().css('overflow', 'hidden').animate({ height: 0 }, {easing: this.options.easing, duration: animated ? this.options.duration : 0}).attr('aria-expanded', 'false'); } wrapper.stop().css('overflow', 'hidden'); if (animated) { wrapper.animate({ height: active ? getHeight(wrapper.data('content')) : 0 }, {easing: this.options.easing, duration: this.options.duration, complete: function() { if (active) { wrapper.css({'overflow': '', 'height': 'auto'}); UI.Utils.checkDisplay(wrapper.data('content')); } $this.trigger('display.uk.check'); }}); } else { wrapper.height(active ? 'auto' : 0); if (active) { wrapper.css({'overflow': ''}); UI.Utils.checkDisplay(wrapper.data('content')); } this.trigger('display.uk.check'); } // Update ARIA wrapper.attr('aria-expanded', active); this.element.trigger('toggle.uk.accordion', [active, wrapper.data('toggle'), wrapper.data('content')]); }, update: function() { var $this = this, $content, $wrapper, $toggle; this.toggle = this.find(this.options.toggle); this.content = this.find(this.options.containers); this.content.each(function(index) { $content = UI.$(this); if ($content.parent().data('wrapper')) { $wrapper = $content.parent(); } else { $wrapper = UI.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(); // Init ARIA $wrapper.attr('aria-expanded', 'false'); } $toggle = $this.toggle.eq(index); $wrapper.data('toggle', $toggle); $wrapper.data('content', $content); $toggle.data('wrapper', $wrapper); $content.data('wrapper', $wrapper); }); this.element.trigger('update.uk.accordion', [this]); } }); // helper function getHeight(ele) { var $ele = UI.$(ele), height = "auto"; if ($ele.is(":visible")) { height = $ele.outerHeight(); } else { var tmp = { position : $ele.css("position"), visibility : $ele.css("visibility"), display : $ele.css("display") }; height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); $ele.css(tmp); // reset element } return height; } return UI.accordion; });
hare1039/cdnjs
ajax/libs/uikit/2.24.2/js/components/accordion.js
JavaScript
mit
5,211
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Esprima</title> <link rel="stylesheet" type="text/css" href="assets/style.css"/> </head> <body> <div class="container"> <div class="topbar"> <ul class="nav"> <li><a href="index.html">&larr; Home</a></li> <li><a href="http://github.com/ariya/esprima">Code</a></li> <li><a href="doc/index.html">Documentation</a></li> <li><a href="http://issues.esprima.org">Issues</a></li> </ul> </div> <h1>Esprima <small>ECMAScript parsing infrastructure for multipurpose analysis</small></h1> <div class="main"> <p><strong>Esprima</strong> is a high performance, standard-compliant <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript</a> parser written in ECMAScript (also popularly known as <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>).</p> <p>Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as <a href="http://www.mozilla.org/rhino">Rhino</a> and <a href="http://nodejs.org">Node.js</a>.</p> <h3>Features</h3> <ul> <li>Full support for <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript 5.1</a> (ECMA-262)</li> <li>Sensible <a href="doc/index.html#ast">syntax tree format</a>, compatible with Mozilla <a href="https://developer.mozilla.org/en/SpiderMonkey/Parser_API">Parser AST</a></li> <li>Heavily tested (&gt; 550 <a href="http://esprima.org/test/">unit tests</a> with solid 100% statement coverage)</li> <li>Optional tracking of syntax node location (index-based and line-column)</li> <li>Experimental support for ES6/Harmony (module, class, destructuring, ...)</li> </ul> <p>Esprima is blazing fast (see the <a href="http://esprima.org/test/benchmarks.html">benchmark suite</a>). It is up to 3x faster than UglifyJS v1 and it is still <a href="http://esprima.org/test/compare.html">competitive</a> with the new generation of fast parsers.</p> <h3>Applications</h3> Esprima serves as the basis for many popular JavaScript development tools: <ul> <li>Code coverage analysis: <a href="https://github.com/itay/node-cover">node-cover</a>, <a href="https://github.com/yahoo/Istanbul">Istanbul</a></li> <li>Documentation tool: <a href="https://github.com/thejohnfreeman/jfdoc">JFDoc</a>, <a href="https://github.com/senchalabs/jsduck">JSDuck</a></li> <li>Language extension: <a href="http://mbebenita.github.com/LLJS/">LLJS</a> (low-level JS), <a href="http://sweetjs.org/">Sweet.js</a> (macro)</li> <li>ES6/Harmony transpiler: <a href="https://github.com/matthewrobb/six">Six</a>, <a href="https://github.com/jdiamond/harmonizr">Harmonizr</a></li> <li>Eclipse Orion smart editing (<a href="https://github.com/aclement/esprima-outline">outline view</a>, <a href="http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html">content assist</a>)</li> <li>Source transformation: <a href="https://github.com/substack/node-falafel">node-falafel</a>, <a href="https://github.com/millermedeiros/rocambole/">Rocambole</a>, <a href="https://github.com/Constellation/esmangle">Esmangle</a>, <a href="https://github.com/Constellation/escodegen">escodegen</a></li> </ul> <p>Feedback is welcomed! Please join the discussion in the <a href="http://groups.google.com/group/esprima">mailing list</a>.</p> </div> <div class="sidebar"> <h3>Semantic analysis</h3> <ul> <li><a href="demo/parse.html">Code parser</a></li> <li><a href="demo/validate.html">Syntax validator</a></li> <li><a href="demo/precedence.html">Operator precedence</a></li> <li><a href="demo/collector.html">Regex collector</a></li> <li><a href="demo/functiontrace.html">Function tracing</a></li> <li><a href="demo/highlight.html">Identifier highlight</a></li> </ul> <h3>Source transformation</h3> <ul> <li><a href="demo/rewrite.html">Source rewrite</a></li> <li><a href="demo/minify.html">Minify</a></li> </ul> <h3>Harness tests</h3> <ul> <li><a href="test/index.html">Unit tests</a></li> <li><a href="test/compat.html">Compatibility tests</a></li> <li><a href="test/module.html">Module loading</a></li> <li><a href="test/coverage.html">Coverage analysis</a></li> </ul> <h3>Need for speed</h3> <ul> <li><a href="test/benchmarks.html">Benchmarks suite</a></li> <li><a href="test/compare.html">Speed comparison</a></li> </ul> </div> <br clear="all"/> <div class="footer"> <strong>Esprima</strong> is created and maintained by <a href="http://twitter.com/ariyahidayat">Ariya Hidayat</a>, with the help of <a href="https://github.com/ariya/esprima/contributors">many contributors</a>.<br/> Follow <a href="http://twitter.com/Esprima">@Esprima</a> on Twitter to get the development updates. </div> </div> <a href="http://github.com/ariya/esprima"><img style="position: absolute; top: 0; right: 0; border: 0;" src="assets/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> </body> </html>
neon-lab/PriceCalc
node_modules/brfs/node_modules/static-module/node_modules/falafel/node_modules/esprima/index.html
HTML
mit
4,959
;(function(undefined) { 'use strict'; /** * Sigma Quadtree Module for edges * =============================== * * Author: Sébastien Heymann, * from the quad of Guillaume Plique (Yomguithereal) * Version: 0.2 */ /** * Quad Geometric Operations * ------------------------- * * A useful batch of geometric operations used by the quadtree. */ var _geom = { /** * Transforms a graph node with x, y and size into an * axis-aligned square. * * @param {object} A graph node with at least a point (x, y) and a size. * @return {object} A square: two points (x1, y1), (x2, y2) and height. */ pointToSquare: function(n) { return { x1: n.x - n.size, y1: n.y - n.size, x2: n.x + n.size, y2: n.y - n.size, height: n.size * 2 }; }, /** * Transforms a graph edge with x1, y1, x2, y2 and size into an * axis-aligned square. * * @param {object} A graph edge with at least two points * (x1, y1), (x2, y2) and a size. * @return {object} A square: two points (x1, y1), (x2, y2) and height. */ lineToSquare: function(e) { if (e.y1 < e.y2) { // (e.x1, e.y1) on top if (e.x1 < e.x2) { // (e.x1, e.y1) on left return { x1: e.x1 - e.size, y1: e.y1 - e.size, x2: e.x2 + e.size, y2: e.y1 - e.size, height: e.y2 - e.y1 + e.size * 2 }; } // (e.x1, e.y1) on right return { x1: e.x2 - e.size, y1: e.y1 - e.size, x2: e.x1 + e.size, y2: e.y1 - e.size, height: e.y2 - e.y1 + e.size * 2 }; } // (e.x2, e.y2) on top if (e.x1 < e.x2) { // (e.x1, e.y1) on left return { x1: e.x1 - e.size, y1: e.y2 - e.size, x2: e.x2 + e.size, y2: e.y2 - e.size, height: e.y1 - e.y2 + e.size * 2 }; } // (e.x2, e.y2) on right return { x1: e.x2 - e.size, y1: e.y2 - e.size, x2: e.x1 + e.size, y2: e.y2 - e.size, height: e.y1 - e.y2 + e.size * 2 }; }, /** * Transforms a graph edge of type 'curve' with x1, y1, x2, y2, * control point and size into an axis-aligned square. * * @param {object} e A graph edge with at least two points * (x1, y1), (x2, y2) and a size. * @param {object} cp A control point (x,y). * @return {object} A square: two points (x1, y1), (x2, y2) and height. */ quadraticCurveToSquare: function(e, cp) { var pt = sigma.utils.getPointOnQuadraticCurve( 0.5, e.x1, e.y1, e.x2, e.y2, cp.x, cp.y ); // Bounding box of the two points and the point at the middle of the // curve: var minX = Math.min(e.x1, e.x2, pt.x), maxX = Math.max(e.x1, e.x2, pt.x), minY = Math.min(e.y1, e.y2, pt.y), maxY = Math.max(e.y1, e.y2, pt.y); return { x1: minX - e.size, y1: minY - e.size, x2: maxX + e.size, y2: minY - e.size, height: maxY - minY + e.size * 2 }; }, /** * Transforms a graph self loop into an axis-aligned square. * * @param {object} n A graph node with a point (x, y) and a size. * @return {object} A square: two points (x1, y1), (x2, y2) and height. */ selfLoopToSquare: function(n) { // Fitting to the curve is too costly, we compute a larger bounding box // using the control points: var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size); // Bounding box of the point and the two control points: var minX = Math.min(n.x, cp.x1, cp.x2), maxX = Math.max(n.x, cp.x1, cp.x2), minY = Math.min(n.y, cp.y1, cp.y2), maxY = Math.max(n.y, cp.y1, cp.y2); return { x1: minX - n.size, y1: minY - n.size, x2: maxX + n.size, y2: minY - n.size, height: maxY - minY + n.size * 2 }; }, /** * Checks whether a rectangle is axis-aligned. * * @param {object} A rectangle defined by two points * (x1, y1) and (x2, y2). * @return {boolean} True if the rectangle is axis-aligned. */ isAxisAligned: function(r) { return r.x1 === r.x2 || r.y1 === r.y2; }, /** * Compute top points of an axis-aligned rectangle. This is useful in * cases when the rectangle has been rotated (left, right or bottom up) and * later operations need to know the top points. * * @param {object} An axis-aligned rectangle defined by two points * (x1, y1), (x2, y2) and height. * @return {object} A rectangle: two points (x1, y1), (x2, y2) and height. */ axisAlignedTopPoints: function(r) { // Basic if (r.y1 === r.y2 && r.x1 < r.x2) return r; // Rotated to right if (r.x1 === r.x2 && r.y2 > r.y1) return { x1: r.x1 - r.height, y1: r.y1, x2: r.x1, y2: r.y1, height: r.height }; // Rotated to left if (r.x1 === r.x2 && r.y2 < r.y1) return { x1: r.x1, y1: r.y2, x2: r.x2 + r.height, y2: r.y2, height: r.height }; // Bottom's up return { x1: r.x2, y1: r.y1 - r.height, x2: r.x1, y2: r.y1 - r.height, height: r.height }; }, /** * Get coordinates of a rectangle's lower left corner from its top points. * * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). * @return {object} Coordinates of the corner (x, y). */ lowerLeftCoor: function(r) { var width = ( Math.sqrt( Math.pow(r.x2 - r.x1, 2) + Math.pow(r.y2 - r.y1, 2) ) ); return { x: r.x1 - (r.y2 - r.y1) * r.height / width, y: r.y1 + (r.x2 - r.x1) * r.height / width }; }, /** * Get coordinates of a rectangle's lower right corner from its top points * and its lower left corner. * * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). * @param {object} A corner's coordinates (x, y). * @return {object} Coordinates of the corner (x, y). */ lowerRightCoor: function(r, llc) { return { x: llc.x - r.x1 + r.x2, y: llc.y - r.y1 + r.y2 }; }, /** * Get the coordinates of all the corners of a rectangle from its top point. * * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). * @return {array} An array of the four corners' coordinates (x, y). */ rectangleCorners: function(r) { var llc = this.lowerLeftCoor(r), lrc = this.lowerRightCoor(r, llc); return [ {x: r.x1, y: r.y1}, {x: r.x2, y: r.y2}, {x: llc.x, y: llc.y}, {x: lrc.x, y: lrc.y} ]; }, /** * Split a square defined by its boundaries into four. * * @param {object} Boundaries of the square (x, y, width, height). * @return {array} An array containing the four new squares, themselves * defined by an array of their four corners (x, y). */ splitSquare: function(b) { return [ [ {x: b.x, y: b.y}, {x: b.x + b.width / 2, y: b.y}, {x: b.x, y: b.y + b.height / 2}, {x: b.x + b.width / 2, y: b.y + b.height / 2} ], [ {x: b.x + b.width / 2, y: b.y}, {x: b.x + b.width, y: b.y}, {x: b.x + b.width / 2, y: b.y + b.height / 2}, {x: b.x + b.width, y: b.y + b.height / 2} ], [ {x: b.x, y: b.y + b.height / 2}, {x: b.x + b.width / 2, y: b.y + b.height / 2}, {x: b.x, y: b.y + b.height}, {x: b.x + b.width / 2, y: b.y + b.height} ], [ {x: b.x + b.width / 2, y: b.y + b.height / 2}, {x: b.x + b.width, y: b.y + b.height / 2}, {x: b.x + b.width / 2, y: b.y + b.height}, {x: b.x + b.width, y: b.y + b.height} ] ]; }, /** * Compute the four axis between corners of rectangle A and corners of * rectangle B. This is needed later to check an eventual collision. * * @param {array} An array of rectangle A's four corners (x, y). * @param {array} An array of rectangle B's four corners (x, y). * @return {array} An array of four axis defined by their coordinates (x,y). */ axis: function(c1, c2) { return [ {x: c1[1].x - c1[0].x, y: c1[1].y - c1[0].y}, {x: c1[1].x - c1[3].x, y: c1[1].y - c1[3].y}, {x: c2[0].x - c2[2].x, y: c2[0].y - c2[2].y}, {x: c2[0].x - c2[1].x, y: c2[0].y - c2[1].y} ]; }, /** * Project a rectangle's corner on an axis. * * @param {object} Coordinates of a corner (x, y). * @param {object} Coordinates of an axis (x, y). * @return {object} The projection defined by coordinates (x, y). */ projection: function(c, a) { var l = ( (c.x * a.x + c.y * a.y) / (Math.pow(a.x, 2) + Math.pow(a.y, 2)) ); return { x: l * a.x, y: l * a.y }; }, /** * Check whether two rectangles collide on one particular axis. * * @param {object} An axis' coordinates (x, y). * @param {array} Rectangle A's corners. * @param {array} Rectangle B's corners. * @return {boolean} True if the rectangles collide on the axis. */ axisCollision: function(a, c1, c2) { var sc1 = [], sc2 = []; for (var ci = 0; ci < 4; ci++) { var p1 = this.projection(c1[ci], a), p2 = this.projection(c2[ci], a); sc1.push(p1.x * a.x + p1.y * a.y); sc2.push(p2.x * a.x + p2.y * a.y); } var maxc1 = Math.max.apply(Math, sc1), maxc2 = Math.max.apply(Math, sc2), minc1 = Math.min.apply(Math, sc1), minc2 = Math.min.apply(Math, sc2); return (minc2 <= maxc1 && maxc2 >= minc1); }, /** * Check whether two rectangles collide on each one of their four axis. If * all axis collide, then the two rectangles do collide on the plane. * * @param {array} Rectangle A's corners. * @param {array} Rectangle B's corners. * @return {boolean} True if the rectangles collide. */ collision: function(c1, c2) { var axis = this.axis(c1, c2), col = true; for (var i = 0; i < 4; i++) col = col && this.axisCollision(axis[i], c1, c2); return col; } }; /** * Quad Functions * ------------ * * The Quadtree functions themselves. * For each of those functions, we consider that in a splitted quad, the * index of each node is the following: * 0: top left * 1: top right * 2: bottom left * 3: bottom right * * Moreover, the hereafter quad's philosophy is to consider that if an element * collides with more than one nodes, this element belongs to each of the * nodes it collides with where other would let it lie on a higher node. */ /** * Get the index of the node containing the point in the quad * * @param {object} point A point defined by coordinates (x, y). * @param {object} quadBounds Boundaries of the quad (x, y, width, heigth). * @return {integer} The index of the node containing the point. */ function _quadIndex(point, quadBounds) { var xmp = quadBounds.x + quadBounds.width / 2, ymp = quadBounds.y + quadBounds.height / 2, top = (point.y < ymp), left = (point.x < xmp); if (top) { if (left) return 0; else return 1; } else { if (left) return 2; else return 3; } } /** * Get a list of indexes of nodes containing an axis-aligned rectangle * * @param {object} rectangle A rectangle defined by two points (x1, y1), * (x2, y2) and height. * @param {array} quadCorners An array of the quad nodes' corners. * @return {array} An array of indexes containing one to * four integers. */ function _quadIndexes(rectangle, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if ((rectangle.x2 >= quadCorners[i][0].x) && (rectangle.x1 <= quadCorners[i][1].x) && (rectangle.y1 + rectangle.height >= quadCorners[i][0].y) && (rectangle.y1 <= quadCorners[i][2].y)) indexes.push(i); return indexes; } /** * Get a list of indexes of nodes containing a non-axis-aligned rectangle * * @param {array} corners An array containing each corner of the * rectangle defined by its coordinates (x, y). * @param {array} quadCorners An array of the quad nodes' corners. * @return {array} An array of indexes containing one to * four integers. */ function _quadCollision(corners, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if (_geom.collision(corners, quadCorners[i])) indexes.push(i); return indexes; } /** * Subdivide a quad by creating a node at a precise index. The function does * not generate all four nodes not to potentially create unused nodes. * * @param {integer} index The index of the node to create. * @param {object} quad The quad object to subdivide. * @return {object} A new quad representing the node created. */ function _quadSubdivide(index, quad) { var next = quad.level + 1, subw = Math.round(quad.bounds.width / 2), subh = Math.round(quad.bounds.height / 2), qx = Math.round(quad.bounds.x), qy = Math.round(quad.bounds.y), x, y; switch (index) { case 0: x = qx; y = qy; break; case 1: x = qx + subw; y = qy; break; case 2: x = qx; y = qy + subh; break; case 3: x = qx + subw; y = qy + subh; break; } return _quadTree( {x: x, y: y, width: subw, height: subh}, next, quad.maxElements, quad.maxLevel ); } /** * Recursively insert an element into the quadtree. Only points * with size, i.e. axis-aligned squares, may be inserted with this * method. * * @param {object} el The element to insert in the quadtree. * @param {object} sizedPoint A sized point defined by two top points * (x1, y1), (x2, y2) and height. * @param {object} quad The quad in which to insert the element. * @return {undefined} The function does not return anything. */ function _quadInsert(el, sizedPoint, quad) { if (quad.level < quad.maxLevel) { // Searching appropriate quads var indexes = _quadIndexes(sizedPoint, quad.corners); // Iterating for (var i = 0, l = indexes.length; i < l; i++) { // Subdividing if necessary if (quad.nodes[indexes[i]] === undefined) quad.nodes[indexes[i]] = _quadSubdivide(indexes[i], quad); // Recursion _quadInsert(el, sizedPoint, quad.nodes[indexes[i]]); } } else { // Pushing the element in a leaf node quad.elements.push(el); } } /** * Recursively retrieve every elements held by the node containing the * searched point. * * @param {object} point The searched point (x, y). * @param {object} quad The searched quad. * @return {array} An array of elements contained in the relevant * node. */ function _quadRetrievePoint(point, quad) { if (quad.level < quad.maxLevel) { var index = _quadIndex(point, quad.bounds); // If node does not exist we return an empty list if (quad.nodes[index] !== undefined) { return _quadRetrievePoint(point, quad.nodes[index]); } else { return []; } } else { return quad.elements; } } /** * Recursively retrieve every elements contained within an rectangular area * that may or may not be axis-aligned. * * @param {object|array} rectData The searched area defined either by * an array of four corners (x, y) in * the case of a non-axis-aligned * rectangle or an object with two top * points (x1, y1), (x2, y2) and height. * @param {object} quad The searched quad. * @param {function} collisionFunc The collision function used to search * for node indexes. * @param {array?} els The retrieved elements. * @return {array} An array of elements contained in the * area. */ function _quadRetrieveArea(rectData, quad, collisionFunc, els) { els = els || {}; if (quad.level < quad.maxLevel) { var indexes = collisionFunc(rectData, quad.corners); for (var i = 0, l = indexes.length; i < l; i++) if (quad.nodes[indexes[i]] !== undefined) _quadRetrieveArea( rectData, quad.nodes[indexes[i]], collisionFunc, els ); } else for (var j = 0, m = quad.elements.length; j < m; j++) if (els[quad.elements[j].id] === undefined) els[quad.elements[j].id] = quad.elements[j]; return els; } /** * Creates the quadtree object itself. * * @param {object} bounds The boundaries of the quad defined by an * origin (x, y), width and heigth. * @param {integer} level The level of the quad in the tree. * @param {integer} maxElements The max number of element in a leaf node. * @param {integer} maxLevel The max recursion level of the tree. * @return {object} The quadtree object. */ function _quadTree(bounds, level, maxElements, maxLevel) { return { level: level || 0, bounds: bounds, corners: _geom.splitSquare(bounds), maxElements: maxElements || 40, maxLevel: maxLevel || 8, elements: [], nodes: [] }; } /** * Sigma Quad Constructor * ---------------------- * * The edgequad API as exposed to sigma. */ /** * The edgequad core that will become the sigma interface with the quadtree. * * property {object} _tree Property holding the quadtree object. * property {object} _geom Exposition of the _geom namespace for testing. * property {object} _cache Cache for the area method. * property {boolean} _enabled Can index and retreive elements. */ var edgequad = function() { this._geom = _geom; this._tree = null; this._cache = { query: false, result: false }; this._enabled = true; }; /** * Index a graph by inserting its edges into the quadtree. * * @param {object} graph A graph instance. * @param {object} params An object of parameters with at least the quad * bounds. * @return {object} The quadtree object. * * Parameters: * ---------- * bounds: {object} boundaries of the quad defined by its origin (x, y) * width and heigth. * prefix: {string?} a prefix for edge geometric attributes. * maxElements: {integer?} the max number of elements in a leaf node. * maxLevel: {integer?} the max recursion level of the tree. */ edgequad.prototype.index = function(graph, params) { if (!this._enabled) return this._tree; // Enforcing presence of boundaries if (!params.bounds) throw 'sigma.classes.edgequad.index: bounds information not given.'; // Prefix var prefix = params.prefix || '', cp, source, target, n, e; // Building the tree this._tree = _quadTree( params.bounds, 0, params.maxElements, params.maxLevel ); var edges = graph.edges(); // Inserting graph edges into the tree for (var i = 0, l = edges.length; i < l; i++) { source = graph.nodes(edges[i].source); target = graph.nodes(edges[i].target); e = { x1: source[prefix + 'x'], y1: source[prefix + 'y'], x2: target[prefix + 'x'], y2: target[prefix + 'y'], size: edges[i][prefix + 'size'] || 0 }; // Inserting edge if (edges[i].type === 'curve' || edges[i].type === 'curvedArrow') { if (source.id === target.id) { n = { x: source[prefix + 'x'], y: source[prefix + 'y'], size: source[prefix + 'size'] || 0 }; _quadInsert( edges[i], _geom.selfLoopToSquare(n), this._tree); } else { cp = sigma.utils.getQuadraticControlPoint(e.x1, e.y1, e.x2, e.y2); _quadInsert( edges[i], _geom.quadraticCurveToSquare(e, cp), this._tree); } } else { _quadInsert( edges[i], _geom.lineToSquare(e), this._tree); } } // Reset cache: this._cache = { query: false, result: false }; // remove? return this._tree; }; /** * Retrieve every graph edges held by the quadtree node containing the * searched point. * * @param {number} x of the point. * @param {number} y of the point. * @return {array} An array of edges retrieved. */ edgequad.prototype.point = function(x, y) { if (!this._enabled) return []; return this._tree ? _quadRetrievePoint({x: x, y: y}, this._tree) || [] : []; }; /** * Retrieve every graph edges within a rectangular area. The methods keep the * last area queried in cache for optimization reason and will act differently * for the same reason if the area is axis-aligned or not. * * @param {object} A rectangle defined by two top points (x1, y1), (x2, y2) * and height. * @return {array} An array of edges retrieved. */ edgequad.prototype.area = function(rect) { if (!this._enabled) return []; var serialized = JSON.stringify(rect), collisionFunc, rectData; // Returning cache? if (this._cache.query === serialized) return this._cache.result; // Axis aligned ? if (_geom.isAxisAligned(rect)) { collisionFunc = _quadIndexes; rectData = _geom.axisAlignedTopPoints(rect); } else { collisionFunc = _quadCollision; rectData = _geom.rectangleCorners(rect); } // Retrieving edges var edges = this._tree ? _quadRetrieveArea( rectData, this._tree, collisionFunc ) : []; // Object to array var edgesArray = []; for (var i in edges) edgesArray.push(edges[i]); // Caching this._cache.query = serialized; this._cache.result = edgesArray; return edgesArray; }; /** * EXPORT: * ******* */ if (typeof this.sigma !== 'undefined') { this.sigma.classes = this.sigma.classes || {}; this.sigma.classes.edgequad = edgequad; } else if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) exports = module.exports = edgequad; exports.edgequad = edgequad; } else this.edgequad = edgequad; }).call(this);
queenBNE/sigma.js
src/classes/sigma.classes.edgequad.js
JavaScript
mit
24,201
(function(addon) { var component; if (jQuery && UIkit) { component = addon(jQuery, UIkit); } if (typeof define == "function" && define.amd) { define("uikit-cover", ["uikit"], function(){ return component || addon(jQuery, UIkit); }); } })(function($, UI){ "use strict"; UI.component('cover', { defaults: { automute : true }, boot: function() { // auto init UI.ready(function(context) { UI.$("[data-@-cover]", context).each(function(){ var ele = UI.$(this); if(!ele.data("cover")) { var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-@-cover"))); } }); }); }, init: function() { this.parent = this.element.parent(); UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){ this.check(); }.bind(this), 100)); this.on("display.uk.check", function(e) { if(this.element.is(":visible")) this.check(); }.bind(this)); this.check(); this.element.data("cover", this); if (this.element.is('iframe') && this.options.automute) { var src = this.element.attr('src'); this.element.attr('src', '').on('load', function(){ this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*'); }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join('')); } }, check: function() { this.element.css({ 'width' : '', 'height' : '' }); this.dimension = {w: this.element.width(), h: this.element.height()}; if (this.element.attr('width') && !isNaN(this.element.attr('width'))) { this.dimension.w = this.element.attr('width'); } if (this.element.attr('height') && !isNaN(this.element.attr('height'))) { this.dimension.h = this.element.attr('height'); } this.ratio = this.dimension.w / this.dimension.h; var w = this.parent.width(), h = this.parent.height(), width, height; // if element height < parent height (gap underneath) if ((w / this.ratio) < h) { width = Math.ceil(h * this.ratio); height = h; // element width < parent width (gap to right) } else { width = w; height = Math.ceil(w / this.ratio); } this.element.css({ 'width' : width, 'height' : height }); } }); });
tonytlwu/cdnjs
ajax/libs/uikit/2.16.1/js/components/cover.js
JavaScript
mit
2,945
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){!function(e){function n(n,s,t){if(t)return"object"!=typeof n&&(n={}),n;n=e.extend(!0,{},e[a].defaults,n);for(var i=["position","zposition","modal","moveBackground"],o=0,l=i.length;l>o;o++)"undefined"!=typeof n[i[o]]&&(e[a].deprecated('The option "'+i[o]+'"',"offCanvas."+i[o]),n.offCanvas=n.offCanvas||{},n.offCanvas[i[o]]=n[i[o]]);return n}function s(n){n=e.extend(!0,{},e[a].configuration,n);for(var s=["panel","list","selected","label","spacer"],t=0,i=s.length;i>t;t++)"undefined"!=typeof n[s[t]+"Class"]&&(e[a].deprecated('The configuration option "'+s[t]+'Class"',"classNames."+s[t]),n.classNames[s[t]]=n[s[t]+"Class"]);if("undefined"!=typeof n.counterClass&&(e[a].deprecated('The configuration option "counterClass"',"classNames.counters.counter"),n.classNames.counters=n.classNames.counters||{},n.classNames.counters.counter=n.counterClass),"undefined"!=typeof n.collapsedClass&&(e[a].deprecated('The configuration option "collapsedClass"',"classNames.labels.collapsed"),n.classNames.labels=n.classNames.labels||{},n.classNames.labels.collapsed=n.collapsedClass),"undefined"!=typeof n.header)for(var s=["panelHeader","panelNext","panelPrev"],t=0,i=s.length;i>t;t++)"undefined"!=typeof n.header[s[t]+"Class"]&&(e[a].deprecated('The configuration option "header.'+s[t]+'Class"',"classNames.header."+s[t]),n.classNames.header=n.classNames.header||{},n.classNames.header[s[t]]=n.header[s[t]+"Class"]);for(var s=["pageNodetype","pageSelector","menuWrapperSelector","menuInjectMethod"],t=0,i=s.length;i>t;t++)"undefined"!=typeof n[s[t]]&&(e[a].deprecated('The configuration option "'+s[t]+'"',"offCanvas."+s[t]),n.offCanvas=n.offCanvas||{},n.offCanvas[s[t]]=n[s[t]]);return n}function t(){r=!0,c.$wndw=e(window),c.$html=e("html"),c.$body=e("body"),e.each([o,l,d],function(e,n){n.add=function(e){e=e.split(" ");for(var s in e)n[e[s]]=n.mm(e[s])}}),o.mm=function(e){return"mm-"+e},o.add("wrapper menu inline panel list nolist subtitle selected label spacer current highest hidden opened subopened subopen fullsubopen subclose"),o.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},l.mm=function(e){return"mm-"+e},l.add("parent"),d.mm=function(e){return e+".mm"},d.add("toggle open close setSelected transitionend webkitTransitionEnd mousedown mouseup touchstart touchmove touchend scroll resize click keydown keyup"),e[a]._c=o,e[a]._d=l,e[a]._e=d,e[a].glbl=c}var a="mmenu",i="4.4.1";if(!e[a]){var o={},l={},d={},r=!1,c={$wndw:null,$html:null,$body:null};e[a]=function(e,s,t){return this.$menu=e,this.opts=s,this.conf=t,this.vars={},this.opts=n(this.opts,this.conf,this.$menu),this._initMenu(),this._init(this.$menu.children(this.conf.panelNodetype)),this},e[a].version=i,e[a].addons=[],e[a].uniqueId=0,e[a].defaults={classes:"",slidingSubmenus:!0,onClick:{setSelected:!0}},e[a].configuration={panelNodetype:"ul, ol, div",transitionDuration:400,openingInterval:25,classNames:{panel:"Panel",selected:"Selected",label:"Label",spacer:"Spacer"}},e[a].prototype={_init:function(n){n=this._initPanels(n),n=this._initLinks(n),n=this._bindCustomEvents(n);for(var s=0;s<e[a].addons.length;s++)"function"==typeof this["_init_"+e[a].addons[s]]&&this["_init_"+e[a].addons[s]](n);this._update()},_initMenu:function(){this.opts.offCanvas&&this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("*")).filter("[id]").each(function(){e(this).attr("id",o.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$menu.parent().addClass(o.wrapper);var n=[o.menu];n.push(o.mm(this.opts.slidingSubmenus?"horizontal":"vertical")),this.opts.classes&&n.push(this.opts.classes),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var s=this;this.__findAddBack(n,"ul, ol").not("."+o.nolist).addClass(o.list);var t=this.__findAddBack(n,"."+o.list).find("> li");this.__refactorClass(t,this.conf.classNames.selected,"selected"),this.__refactorClass(t,this.conf.classNames.label,"label"),this.__refactorClass(t,this.conf.classNames.spacer,"spacer"),t.off(d.setSelected).on(d.setSelected,function(n,s){n.stopPropagation(),t.removeClass(o.selected),"boolean"!=typeof s&&(s=!0),s&&e(this).addClass(o.selected)}),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel"),n.add(this.__findAddBack(n,"."+o.list).children().children().filter(this.conf.panelNodetype)).addClass(o.panel);var a=this.__findAddBack(n,"."+o.panel),i=e("."+o.panel,this.$menu);a.each(function(){var n=e(this),t=n.attr("id")||s.__getUniqueId();n.attr("id",t)}),a.each(function(){var n=e(this),t=n.is("ul, ol")?n:n.find("ul ,ol").first(),a=n.parent(),i=a.find("> a, > span"),d=a.closest("."+o.panel);if(a.parent().is("."+o.list)){n.data(l.parent,a);var r=e('<a class="'+o.subopen+'" href="#'+n.attr("id")+'" />').insertBefore(i);i.is("a")||r.addClass(o.fullsubopen),s.opts.slidingSubmenus&&t.prepend('<li class="'+o.subtitle+'"><a class="'+o.subclose+'" href="#'+d.attr("id")+'">'+i.text()+"</a></li>")}});var r=this.opts.slidingSubmenus?d.open:d.toggle;if(i.each(function(){var n=e(this),s=n.attr("id");e('a[href="#'+s+'"]',i).off(d.click).on(d.click,function(e){e.preventDefault(),n.trigger(r)})}),this.opts.slidingSubmenus){var c=this.__findAddBack(n,"."+o.list).find("> li."+o.selected);c.parents("li").removeClass(o.selected).end().add(c.parents("li")).each(function(){var n=e(this),s=n.find("> ."+o.panel);s.length&&(n.parents("."+o.panel).addClass(o.subopened),s.addClass(o.opened))}).closest("."+o.panel).addClass(o.opened).parents("."+o.panel).addClass(o.subopened)}else{var c=e("li."+o.selected,i);c.parents("li").removeClass(o.selected).end().add(c.parents("li")).addClass(o.opened)}var u=i.filter("."+o.opened);return u.length||(u=a.first()),u.addClass(o.opened).last().addClass(o.current),this.opts.slidingSubmenus&&a.not(u.last()).addClass(o.hidden).end().appendTo(this.$menu),a},_initLinks:function(n){var s=this;return this.__findAddBack(n,"."+o.list).find("> li > a").not("."+o.subopen).not("."+o.subclose).not('[rel="external"]').not('[target="_blank"]').off(d.click).on(d.click,function(n){var t=e(this),a=t.attr("href")||"";s.__valueOrFn(s.opts.onClick.setSelected,t)&&t.parent().trigger(d.setSelected);var i=s.__valueOrFn(s.opts.onClick.preventDefault,t,"#"==a.slice(0,1));i&&n.preventDefault(),s.__valueOrFn(s.opts.onClick.blockUI,t,!i)&&c.$html.addClass(o.blocking),s.__valueOrFn(s.opts.onClick.close,t,i)&&s.$menu.triggerHandler(d.close)}),n},_bindCustomEvents:function(n){var s=this;return n.off(d.toggle+" "+d.open+" "+d.close).on(d.toggle+" "+d.open+" "+d.close,function(e){e.stopPropagation()}),this.opts.slidingSubmenus?n.on(d.open,function(){return s._openSubmenuHorizontal(e(this))}):n.on(d.toggle,function(){var n=e(this);return n.triggerHandler(n.parent().hasClass(o.opened)?d.close:d.open)}).on(d.open,function(){return e(this).parent().addClass(o.opened),"open"}).on(d.close,function(){return e(this).parent().removeClass(o.opened),"close"}),n},_openSubmenuHorizontal:function(n){if(n.hasClass(o.current))return!1;var s=e("."+o.panel,this.$menu),t=s.filter("."+o.current);return s.removeClass(o.highest).removeClass(o.current).not(n).not(t).addClass(o.hidden),n.hasClass(o.opened)?t.addClass(o.highest).removeClass(o.opened).removeClass(o.subopened):(n.addClass(o.highest),t.addClass(o.subopened)),n.removeClass(o.hidden).addClass(o.current),setTimeout(function(){n.removeClass(o.subopened).addClass(o.opened)},this.conf.openingInterval),"open"},_update:function(e){if(this.updates||(this.updates=[]),"function"==typeof e)this.updates.push(e);else for(var n=0,s=this.updates.length;s>n;n++)this.updates[n].call(this,e)},__valueOrFn:function(e,n,s){return"function"==typeof e?e.call(n[0]):"undefined"==typeof e&&"undefined"!=typeof s?s:e},__refactorClass:function(e,n,s){e.filter("."+n).removeClass(n).addClass(o[s])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__transitionend:function(e,n,s){var t=!1,a=function(){t||n.call(e[0]),t=!0};e.one(d.transitionend,a),e.one(d.webkitTransitionEnd,a),setTimeout(a,1.1*s)},__getUniqueId:function(){return o.mm(e[a].uniqueId++)}},e.fn[a]=function(i,o){return r||t(),i=n(i,o),o=s(o),this.each(function(){var n=e(this);n.data(a)||n.data(a,new e[a](n,i,o))})},function(){var n=window.document,s=window.navigator.userAgent,t="ontouchstart"in n,i="WebkitOverflowScrolling"in n.documentElement.style,o=function(){return s.indexOf("Android")>=0?2.4>parseFloat(s.slice(s.indexOf("Android")+8)):!1}();e[a].support={touch:t,oldAndroidBrowser:o,overflowscrolling:function(){return t?i?!0:o?!1:!0:!0}()}}(),e[a].debug=function(){},e[a].deprecated=function(e,n){"undefined"!=typeof console&&"undefined"!=typeof console.warn&&console.warn("MMENU: "+e+" is deprecated, use "+n+" instead.")}}}(e)});
tkirda/cdnjs
ajax/libs/jQuery.mmenu/4.4.1/js/umd/jquery.mmenu.oncanvas.umd.min.js
JavaScript
mit
8,901
!function(e){function t(t,n,s){if(s)return"object"!=typeof t&&(t={}),t;t=e.extend(!0,{},e[o].defaults,t);for(var a=["position","zposition","modal","moveBackground"],i=0,r=a.length;r>i;i++)"undefined"!=typeof t[a[i]]&&(e[o].deprecated('The option "'+a[i]+'"',"offCanvas."+a[i]),t.offCanvas=t.offCanvas||{},t.offCanvas[a[i]]=t[a[i]]);return t}function n(t){t=e.extend(!0,{},e[o].configuration,t);for(var n=["panel","list","selected","label","spacer"],s=0,a=n.length;a>s;s++)"undefined"!=typeof t[n[s]+"Class"]&&(e[o].deprecated('The configuration option "'+n[s]+'Class"',"classNames."+n[s]),t.classNames[n[s]]=t[n[s]+"Class"]);if("undefined"!=typeof t.counterClass&&(e[o].deprecated('The configuration option "counterClass"',"classNames.counters.counter"),t.classNames.counters=t.classNames.counters||{},t.classNames.counters.counter=t.counterClass),"undefined"!=typeof t.collapsedClass&&(e[o].deprecated('The configuration option "collapsedClass"',"classNames.labels.collapsed"),t.classNames.labels=t.classNames.labels||{},t.classNames.labels.collapsed=t.collapsedClass),"undefined"!=typeof t.header)for(var n=["panelHeader","panelNext","panelPrev"],s=0,a=n.length;a>s;s++)"undefined"!=typeof t.header[n[s]+"Class"]&&(e[o].deprecated('The configuration option "header.'+n[s]+'Class"',"classNames.header."+n[s]),t.classNames.header=t.classNames.header||{},t.classNames.header[n[s]]=t.header[n[s]+"Class"]);for(var n=["pageNodetype","pageSelector","menuWrapperSelector","menuInjectMethod"],s=0,a=n.length;a>s;s++)"undefined"!=typeof t[n[s]]&&(e[o].deprecated('The configuration option "'+n[s]+'"',"offCanvas."+n[s]),t.offCanvas=t.offCanvas||{},t.offCanvas[n[s]]=t[n[s]]);return t}function s(){d=!0,c.$wndw=e(window),c.$html=e("html"),c.$body=e("body"),e.each([i,r,l],function(e,t){t.add=function(e){e=e.split(" ");for(var n in e)t[e[n]]=t.mm(e[n])}}),i.mm=function(e){return"mm-"+e},i.add("wrapper menu inline panel nopanel list nolist subtitle selected label spacer current highest hidden opened subopened subopen fullsubopen subclose"),i.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},r.mm=function(e){return"mm-"+e},r.add("parent"),l.mm=function(e){return e+".mm"},l.add("toggle open close setSelected transitionend webkitTransitionEnd mousedown mouseup touchstart touchmove touchend scroll resize click keydown keyup"),e[o]._c=i,e[o]._d=r,e[o]._e=l,e[o].glbl=c}var o="mmenu",a="4.5.7";if(!e[o]){var i={},r={},l={},d=!1,c={$wndw:null,$html:null,$body:null};e[o]=function(e,n,s){return this.$menu=e,this.opts=n,this.conf=s,this.vars={},this.opts=t(this.opts,this.conf,this.$menu),this._initMenu(),this._init(this.$menu.children(this.conf.panelNodetype)),this},e[o].version=a,e[o].addons=[],e[o].uniqueId=0,e[o].defaults={classes:"",slidingSubmenus:!0,onClick:{setSelected:!0}},e[o].configuration={panelNodetype:"ul, ol, div",transitionDuration:400,openingInterval:25,classNames:{panel:"Panel",selected:"Selected",label:"Label",spacer:"Spacer"}},e[o].prototype={_init:function(t){t=t.not("."+i.nopanel),t=this._initPanels(t),t=this._initLinks(t),t=this._bindCustomEvents(t);for(var n=0;n<e[o].addons.length;n++)"function"==typeof this["_init_"+e[o].addons[n]]&&this["_init_"+e[o].addons[n]](t);this._update()},_initMenu:function(){this.opts.offCanvas&&this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("*")).filter("[id]").each(function(){e(this).attr("id",i.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$menu.parent().addClass(i.wrapper);var t=[i.menu];t.push(i.mm(this.opts.slidingSubmenus?"horizontal":"vertical")),this.opts.classes&&t.push(this.opts.classes),this.$menu.addClass(t.join(" "))},_initPanels:function(t){var n=this;this.__findAddBack(t,"ul, ol").not("."+i.nolist).addClass(i.list);var s=this.__findAddBack(t,"."+i.list).find("> li");this.__refactorClass(s,this.conf.classNames.selected,"selected"),this.__refactorClass(s,this.conf.classNames.label,"label"),this.__refactorClass(s,this.conf.classNames.spacer,"spacer"),s.off(l.setSelected).on(l.setSelected,function(t,n){t.stopPropagation(),s.removeClass(i.selected),"boolean"!=typeof n&&(n=!0),n&&e(this).addClass(i.selected)}),this.__refactorClass(this.__findAddBack(t,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel"),t.add(this.__findAddBack(t,"."+i.list).children().children().filter(this.conf.panelNodetype).not("."+i.nopanel)).addClass(i.panel);var o=this.__findAddBack(t,"."+i.panel),a=e("."+i.panel,this.$menu);o.each(function(){var t=e(this),s=t.attr("id")||n.__getUniqueId();t.attr("id",s)}),o.each(function(){var t=e(this),s=t.is("ul, ol")?t:t.find("ul ,ol").first(),o=t.parent(),a=o.find("> a, > span"),l=o.closest("."+i.panel);if(o.parent().is("."+i.list)){t.data(r.parent,o);var d=e('<a class="'+i.subopen+'" href="#'+t.attr("id")+'" />').insertBefore(a);a.is("a")||d.addClass(i.fullsubopen),n.opts.slidingSubmenus&&s.prepend('<li class="'+i.subtitle+'"><a class="'+i.subclose+'" href="#'+l.attr("id")+'">'+a.text()+"</a></li>")}});var d=this.opts.slidingSubmenus?l.open:l.toggle;if(a.each(function(){var t=e(this),n=t.attr("id");e('a[href="#'+n+'"]',a).off(l.click).on(l.click,function(e){e.preventDefault(),t.trigger(d)})}),this.opts.slidingSubmenus){var c=this.__findAddBack(t,"."+i.list).find("> li."+i.selected);c.parents("li").removeClass(i.selected).end().add(c.parents("li")).each(function(){var t=e(this),n=t.find("> ."+i.panel);n.length&&(t.parents("."+i.panel).addClass(i.subopened),n.addClass(i.opened))}).closest("."+i.panel).addClass(i.opened).parents("."+i.panel).addClass(i.subopened)}else{var c=e("li."+i.selected,a);c.parents("li").removeClass(i.selected).end().add(c.parents("li")).addClass(i.opened)}var p=a.filter("."+i.opened);return p.length||(p=o.first()),p.addClass(i.opened).last().addClass(i.current),this.opts.slidingSubmenus&&o.not(p.last()).addClass(i.hidden).end().appendTo(this.$menu),o},_initLinks:function(t){var n=this;return this.__findAddBack(t,"."+i.list).find("> li > a").not("."+i.subopen).not("."+i.subclose).not('[rel="external"]').not('[target="_blank"]').off(l.click).on(l.click,function(t){var s=e(this),o=s.attr("href")||"";n.__valueOrFn(n.opts.onClick.setSelected,s)&&s.parent().trigger(l.setSelected);var a=n.__valueOrFn(n.opts.onClick.preventDefault,s,"#"==o.slice(0,1));a&&t.preventDefault(),n.__valueOrFn(n.opts.onClick.blockUI,s,!a)&&c.$html.addClass(i.blocking),n.__valueOrFn(n.opts.onClick.close,s,a)&&n.$menu.triggerHandler(l.close)}),t},_bindCustomEvents:function(t){var n=this;return t.off(l.toggle+" "+l.open+" "+l.close).on(l.toggle+" "+l.open+" "+l.close,function(e){e.stopPropagation()}),this.opts.slidingSubmenus?t.on(l.open,function(){return n._openSubmenuHorizontal(e(this))}):t.on(l.toggle,function(){var t=e(this);return t.triggerHandler(t.parent().hasClass(i.opened)?l.close:l.open)}).on(l.open,function(){return e(this).parent().addClass(i.opened),"open"}).on(l.close,function(){return e(this).parent().removeClass(i.opened),"close"}),t},_openSubmenuHorizontal:function(t){if(t.hasClass(i.current))return!1;var n=e("."+i.panel,this.$menu),s=n.filter("."+i.current);return n.removeClass(i.highest).removeClass(i.current).not(t).not(s).addClass(i.hidden),t.hasClass(i.opened)?s.addClass(i.highest).removeClass(i.opened).removeClass(i.subopened):(t.addClass(i.highest),s.addClass(i.subopened)),t.removeClass(i.hidden).addClass(i.current),setTimeout(function(){t.removeClass(i.subopened).addClass(i.opened)},this.conf.openingInterval),"open"},_update:function(e){if(this.updates||(this.updates=[]),"function"==typeof e)this.updates.push(e);else for(var t=0,n=this.updates.length;n>t;t++)this.updates[t].call(this,e)},__valueOrFn:function(e,t,n){return"function"==typeof e?e.call(t[0]):"undefined"==typeof e&&"undefined"!=typeof n?n:e},__refactorClass:function(e,t,n){e.filter("."+t).removeClass(t).addClass(i[n])},__findAddBack:function(e,t){return e.find(t).add(e.filter(t))},__transitionend:function(e,t,n){var s=!1,o=function(){s||t.call(e[0]),s=!0};e.one(l.transitionend,o),e.one(l.webkitTransitionEnd,o),setTimeout(o,1.1*n)},__getUniqueId:function(){return i.mm(e[o].uniqueId++)}},e.fn[o]=function(a,i){return d||s(),a=t(a,i),i=n(i),this.each(function(){var t=e(this);t.data(o)||t.data(o,new e[o](t,a,i))})},e[o].support={touch:"ontouchstart"in window.document},e[o].debug=function(){},e[o].deprecated=function(e,t){"undefined"!=typeof console&&"undefined"!=typeof console.warn&&console.warn("MMENU: "+e+" is deprecated, use "+t+" instead.")}}}(jQuery),!function(e){function t(t){return("top"==t.position||"bottom"==t.position)&&("back"==t.zposition||"next"==t.zposition)&&(e[o].deprecated('Using position "'+t.position+'" in combination with zposition "'+t.zposition+'"','zposition "front"'),t.zposition="front"),t}function n(e){return"string"!=typeof e.pageSelector&&(e.pageSelector="> "+e.pageNodetype),e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("offcanvas modal background opening blocker page"),r.add("style"),l.add("opening opened closing closed setPage"),d=e[o].glbl,d.$allMenus=(d.$allMenus||e()).add(this.$menu),d.$wndw.on(l.keydown,function(e){return d.$html.hasClass(i.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0});var t=0;d.$wndw.on(l.resize,function(e,n){if(n||d.$html.hasClass(i.opened)){var s=d.$wndw.height();(n||s!=t)&&(t=s,d.$page.css("minHeight",s))}})}var o="mmenu",a="offCanvas";e[o].prototype["_init_"+a]=function(){if(this.opts[a]&&!this.vars[a+"_added"]){this.vars[a+"_added"]=!0,c||s(),this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]);var e=this.opts[a],o=this.conf[a],r=[i.offcanvas];"boolean"!=typeof this.vars.opened&&(this.vars.opened=!1),"left"!=e.position&&r.push(i.mm(e.position)),"back"!=e.zposition&&r.push(i.mm(e.zposition)),this.$menu.addClass(r.join(" ")).parent().removeClass(i.wrapper),this[a+"_initPage"](d.$page),this[a+"_initBlocker"](),this[a+"_initOpenClose"](),this[a+"_bindCustomEvents"](),this.$menu[o.menuInjectMethod+"To"](o.menuWrapperSelector)}},e[o].addons.push(a),e[o].defaults[a]={position:"left",zposition:"back",modal:!1,moveBackground:!0},e[o].configuration[a]={pageNodetype:"div",pageSelector:null,menuWrapperSelector:"body",menuInjectMethod:"prepend"},e[o].prototype.open=function(){if(this.vars.opened)return!1;var e=this;return this._openSetup(),setTimeout(function(){e._openFinish()},this.conf.openingInterval),"open"},e[o].prototype._openSetup=function(){d.$allMenus.not(this.$menu).trigger(l.close),d.$page.data(r.style,d.$page.attr("style")||""),d.$wndw.trigger(l.resize,[!0]);var e=[i.opened];this.opts[a].modal&&e.push(i.modal),this.opts[a].moveBackground&&e.push(i.background),"left"!=this.opts[a].position&&e.push(i.mm(this.opts[a].position)),"back"!=this.opts[a].zposition&&e.push(i.mm(this.opts[a].zposition)),this.opts.classes&&e.push(this.opts.classes),d.$html.addClass(e.join(" ")),this.vars.opened=!0,this.$menu.addClass(i.current+" "+i.opened)},e[o].prototype._openFinish=function(){var e=this;this.__transitionend(d.$page,function(){e.$menu.trigger(l.opened)},this.conf.transitionDuration),d.$html.addClass(i.opening),this.$menu.trigger(l.opening)},e[o].prototype.close=function(){if(!this.vars.opened)return!1;var e=this;return this.__transitionend(d.$page,function(){e.$menu.removeClass(i.current).removeClass(i.opened),d.$html.removeClass(i.opened).removeClass(i.modal).removeClass(i.background).removeClass(i.mm(e.opts[a].position)).removeClass(i.mm(e.opts[a].zposition)),e.opts.classes&&d.$html.removeClass(e.opts.classes),d.$page.attr("style",d.$page.data(r.style)),e.vars.opened=!1,e.$menu.trigger(l.closed)},this.conf.transitionDuration),d.$html.removeClass(i.opening),this.$menu.trigger(l.closing),"close"},e[o].prototype[a+"_initBlocker"]=function(){var t=this;d.$blck||(d.$blck=e('<div id="'+i.blocker+'" />').appendTo(d.$body)),d.$blck.off(l.touchstart).on(l.touchstart,function(e){e.preventDefault(),e.stopPropagation(),d.$blck.trigger(l.mousedown)}).on(l.mousedown,function(e){e.preventDefault(),d.$html.hasClass(i.modal)||t.close()})},e[o].prototype[a+"_initPage"]=function(t){t||(t=e(this.conf[a].pageSelector,d.$body),t.length>1&&(e[o].debug("Multiple nodes found for the page-node, all nodes are wrapped in one <"+this.conf[a].pageNodetype+">."),t=t.wrapAll("<"+this.conf[a].pageNodetype+" />").parent())),t.addClass(i.page),d.$page=t},e[o].prototype[a+"_initOpenClose"]=function(){var t=this,n=this.$menu.attr("id");n&&n.length&&(this.conf.clone&&(n=i.umm(n)),e('a[href="#'+n+'"]').off(l.click).on(l.click,function(e){e.preventDefault(),t.open()}));var n=d.$page.attr("id");n&&n.length&&e('a[href="#'+n+'"]').on(l.click,function(e){e.preventDefault(),t.close()})},e[o].prototype[a+"_bindCustomEvents"]=function(){var e=this,t=l.open+" "+l.opening+" "+l.opened+" "+l.close+" "+l.closing+" "+l.closed+" "+l.setPage;this.$menu.off(t).on(t,function(e){e.stopPropagation()}),this.$menu.on(l.open,function(){e.open()}).on(l.close,function(){e.close()}).on(l.setPage,function(t,n){e[a+"_initPage"](n),e[a+"_initOpenClose"]()})};var i,r,l,d,c=!1}(jQuery),!function(e){function t(e){return e}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("buttonbar"),d=e[o].glbl}var o="mmenu",a="buttonbars";e[o].prototype["_init_"+a]=function(o){c||s();var r=this.vars[a+"_added"];this.vars[a+"_added"]=!0,r||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a])),this.opts[a],this.conf[a],this.__refactorClass(e("div",o),this.conf.classNames[a].buttonbar,"buttonbar"),e("div."+i.buttonbar,o).each(function(){var t=e(this),n=t.children().not("input"),s=t.children().filter("input");t.addClass(i.buttonbar+"-"+n.length),s.each(function(){var t=e(this),s=n.filter('label[for="'+t.attr("id")+'"]');s.length&&t.insertBefore(s)})})},e[o].addons.push(a),e[o].defaults[a]={},e[o].configuration.classNames[a]={buttonbar:"Buttonbar"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(t){return"boolean"==typeof t&&(t={add:t,update:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[o].defaults[a],t)}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("counter search noresultsmsg"),r.add("updatecounter"),d=e[o].glbl}var o="mmenu",a="counters";e[o].prototype["_init_"+a]=function(o){c||s();var l=this.vars[a+"_added"];this.vars[a+"_added"]=!0,l||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]));var d=this,p=this.opts[a];this.conf[a],this.__refactorClass(e("em",o),this.conf.classNames[a].counter,"counter"),p.add&&o.each(function(){var t=e(this).data(r.parent);t&&(t.find("> em."+i.counter).length||t.prepend(e('<em class="'+i.counter+'" />')))}),p.update&&o.each(function(){var t=e(this),n=t.data(r.parent);if(n){var s=n.find("> em."+i.counter);s.length&&(t.is("."+i.list)||(t=t.find("> ."+i.list)),t.length&&!t.data(r.updatecounter)&&(t.data(r.updatecounter,!0),d._update(function(){var e=t.children().not("."+i.label).not("."+i.subtitle).not("."+i.hidden).not("."+i.search).not("."+i.noresultsmsg);s.html(e.length)})))}})},e[o].addons.push(a),e[o].defaults[a]={add:!1,update:!1},e[o].configuration.classNames[a]={counter:"Counter"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(e,t,n){return t>e&&(e=t),e>n&&(e=n),e}function n(t){return"boolean"==typeof t&&(t={open:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[a].defaults[i],t)}function s(e){return e}function o(){p=!0,r=e[a]._c,l=e[a]._d,d=e[a]._e,r.add("dragging"),c=e[a].glbl}var a="mmenu",i="dragOpen";e[a].prototype["_init_"+i]=function(){if("function"==typeof Hammer&&this.opts.offCanvas&&!this.vars[i+"_added"]){this.vars[i+"_added"]=!0,p||o(),this.opts[i]=n(this.opts[i]),this.conf[i]=s(this.conf[i]);var l=this,u=this.opts[i],h=this.conf[i];if(u.open){if(Hammer.VERSION<2)return e[a].deprecated("Older version of the Hammer library","version 2 or newer"),!1;var f,m,v,g,_={},b=0,C=!1,y=!1,$=0,k=0;switch(this.opts.offCanvas.position){case"left":case"right":_.events="panleft panright",_.typeLower="x",_.typeUpper="X",y="width";break;case"top":case"bottom":_.events="panup pandown",_.typeLower="y",_.typeUpper="Y",y="height"}switch(this.opts.offCanvas.position){case"left":case"top":_.negative=!1;break;case"right":case"bottom":_.negative=!0}switch(this.opts.offCanvas.position){case"left":_.open_dir="right",_.close_dir="left";break;case"right":_.open_dir="left",_.close_dir="right";break;case"top":_.open_dir="down",_.close_dir="up";break;case"bottom":_.open_dir="up",_.close_dir="down"}var w=this.__valueOrFn(u.pageNode,this.$menu,c.$page);"string"==typeof w&&(w=e(w));var N=c.$page;switch(this.opts.offCanvas.zposition){case"front":N=this.$menu;break;case"next":N=N.add(this.$menu)}var x=new Hammer(w[0]);x.on("panstart",function(e){switch(g=e.center[_.typeLower],l.opts.offCanvas.position){case"right":case"bottom":g>=c.$wndw[y]()-u.maxStartPos&&(b=1);break;default:g<=u.maxStartPos&&(b=1)}C=_.open_dir}).on(_.events+" panend",function(e){b>0&&e.preventDefault()}).on(_.events,function(e){if(f=e["delta"+_.typeUpper],_.negative&&(f=-f),f!=$&&(C=f>=$?_.open_dir:_.close_dir),$=f,$>u.threshold&&1==b){if(c.$html.hasClass(r.opened))return;b=2,l._openSetup(),l.$menu.trigger(d.opening),c.$html.addClass(r.dragging),k=t(c.$wndw[y]()*h[y].perc,h[y].min,h[y].max)}2==b&&(m=t($,10,k)-("front"==l.opts.offCanvas.zposition?k:0),_.negative&&(m=-m),v="translate"+_.typeUpper+"("+m+"px )",N.css({"-webkit-transform":"-webkit-"+v,transform:v}))}).on("panend",function(){2==b&&(c.$html.removeClass(r.dragging),N.css("transform",""),l[C==_.open_dir?"_openFinish":"close"]()),b=0})}}},e[a].addons.push(i),e[a].defaults[i]={open:!1,maxStartPos:100,threshold:50},e[a].configuration[i]={width:{perc:.8,min:140,max:440},height:{perc:.8,min:140,max:880}};var r,l,d,c,p=!1}(jQuery),!function(e){function t(e){return e}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("fixed-top fixed-bottom"),d=e[o].glbl}var o="mmenu",a="fixedElements";e[o].prototype["_init_"+a]=function(){if(this.opts.offCanvas){c||s();var o=this.vars[a+"_added"];if(this.vars[a+"_added"]=!0,o||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a])),this.opts[a],this.conf[a],this.__refactorClass(e("div, span, a",d.$page),this.conf.classNames[a].fixedTop,"fixed-top"),this.__refactorClass(e("div, span, a",d.$page),this.conf.classNames[a].fixedBottom,"fixed-bottom"),!o){var r,p;this.$menu.on(l.opening,function(){var t=e(window).scrollTop(),n=d.$page.height()-t-d.$wndw.height();r=e("."+i["fixed-top"]),p=e("."+i["fixed-bottom"]),r.css({"-webkit-transform":"translateY( "+t+"px )",transform:"translateY( "+t+"px )"}),p.css({"-webkit-transform":"translateY( -"+n+"px )",transform:"translateY( -"+n+"px )"})}).on(l.closed,function(){r.add(p).css({"-webkit-transform":"none",transform:"none"})})}}},e[o].addons.push(a),e[o].defaults[a]={},e[o].configuration.classNames[a]={fixedTop:"FixedTop",fixedBottom:"FixedBottom"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(t){return"boolean"==typeof t&&(t={add:t,update:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[o].defaults[a],t)}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("footer hasfooter"),d=e[o].glbl}var o="mmenu",a="footer";e[o].prototype["_init_"+a]=function(o){c||s();var r=this.vars[a+"_added"];this.vars[a+"_added"]=!0,r||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]));var d=this,p=this.opts[a];if(this.conf[a],!r&&p.add){var u=p.content?p.content:p.title;e('<div class="'+i.footer+'" />').appendTo(this.$menu).append(u)}var h=e("div."+i.footer,this.$menu);h.length&&(this.$menu.addClass(i.hasfooter),p.update&&o.each(function(){var t=e(this),n=e("."+d.conf.classNames[a].panelFooter,t),s=n.html();s||(s=p.title);var o=function(){h[s?"show":"hide"](),h.html(s)};t.on(l.open,o),t.hasClass(i.current)&&o()}),"function"==typeof this._init_buttonbars&&this._init_buttonbars(h))},e[o].addons.push(a),e[o].defaults[a]={add:!1,content:!1,title:"",update:!1},e[o].configuration.classNames[a]={panelFooter:"Footer"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(t){return"boolean"==typeof t&&(t={add:t,update:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[o].defaults[a],t)}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("header hasheader prev next title"),d=e[o].glbl}var o="mmenu",a="header";e[o].prototype["_init_"+a]=function(o){c||s();var r=this.vars[a+"_added"];this.vars[a+"_added"]=!0,r||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]));var p=this,u=this.opts[a];if(this.conf[a],!r&&u.add){var h=u.content?u.content:'<a class="'+i.prev+'" href="#"></a><span class="'+i.title+'"></span><a class="'+i.next+'" href="#"></a>';e('<div class="'+i.header+'" />').prependTo(this.$menu).append(h)}var f=e("div."+i.header,this.$menu);if(f.length){if(this.$menu.addClass(i.hasheader),u.update){var m=f.find("."+i.title),v=f.find("."+i.prev),g=f.find("."+i.next),_=!1;d.$page&&(_="#"+d.$page.attr("id")),r||v.add(g).off(l.click).on(l.click,function(t){t.preventDefault(),t.stopPropagation();var n=e(this).attr("href");"#"!==n&&(_&&n==_?p.$menu.trigger(l.close):e(n,p.$menu).trigger(l.open))}),o.each(function(){var t=e(this),n=e("."+p.conf.classNames[a].panelHeader,t),s=e("."+p.conf.classNames[a].panelPrev,t),o=e("."+p.conf.classNames[a].panelNext,t),r=n.html(),d=s.attr("href"),c=o.attr("href");r||(r=e("."+i.subclose,t).html()),r||(r=u.title),d||(d=e("."+i.subclose,t).attr("href"));var h=s.html(),f=o.html(),_=function(){m[r?"show":"hide"](),m.html(r),v[d?"attr":"removeAttr"]("href",d),v[d||h?"show":"hide"](),v.html(h),g[c?"attr":"removeAttr"]("href",c),g[c||f?"show":"hide"](),g.html(f)};t.on(l.open,_),t.hasClass(i.current)&&_()})}"function"==typeof this._init_buttonbars&&this._init_buttonbars(f)}},e[o].addons.push(a),e[o].defaults[a]={add:!1,content:!1,title:"Menu",update:!1},e[o].configuration.classNames[a]={panelHeader:"Header",panelNext:"Next",panelPrev:"Prev"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(t){return"boolean"==typeof t&&(t={collapse:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[o].defaults[a],t)}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("collapsed"),r.add("updatelabel"),d=e[o].glbl}var o="mmenu",a="labels";e[o].prototype["_init_"+a]=function(o){c||s();var d=this.vars[a+"_added"];this.vars[a+"_added"]=!0,d||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]));var p=this.opts[a];this.conf[a],p.collapse&&(this.__refactorClass(e("li",this.$menu),this.conf.classNames[a].collapsed,"collapsed"),e("."+i.label,o).each(function(){var t=e(this),n=t.nextUntil("."+i.label,"all"==p.collapse?null:"."+i.collapsed);"all"==p.collapse&&(t.addClass(i.opened),n.removeClass(i.collapsed)),n.length&&(t.data(r.updatelabel)||(t.data(r.updatelabel,!0),t.wrapInner("<span />"),t.prepend('<a href="#" class="'+i.subopen+" "+i.fullsubopen+'" />')),t.find("a."+i.subopen).off(l.click).on(l.click,function(e){e.preventDefault(),t.toggleClass(i.opened),n[t.hasClass(i.opened)?"removeClass":"addClass"](i.collapsed)}))}))},e[o].addons.push(a),e[o].defaults[a]={collapse:!1},e[o].configuration.classNames[a]={collapsed:"Collapsed"};var i,r,l,d,c=!1}(jQuery),!function(e){function t(e){switch(e){case 9:case 16:case 17:case 18:case 37:case 38:case 39:case 40:return!0}return!1}function n(t){return"boolean"==typeof t&&(t={add:t,search:t}),"object"!=typeof t&&(t={}),t=e.extend(!0,{},e[a].defaults[i],t),"boolean"!=typeof t.showLinksOnly&&(t.showLinksOnly="menu"==t.addTo),t}function s(e){return e}function o(){p=!0,r=e[a]._c,l=e[a]._d,d=e[a]._e,r.add("search hassearch noresultsmsg noresults nosubresults"),d.add("search reset change"),c=e[a].glbl}var a="mmenu",i="searchfield";e[a].prototype["_init_"+i]=function(a){p||o();var c=this.vars[i+"_added"];this.vars[i+"_added"]=!0,c||(this.opts[i]=n(this.opts[i]),this.conf[i]=s(this.conf[i]));var u=this,h=this.opts[i];if(this.conf[i],h.add){switch(h.addTo){case"menu":var f=this.$menu;break;case"panels":var f=a;break;default:var f=e(h.addTo,this.$menu).filter("."+r.panel)}f.length&&f.each(function(){var t=e(this),n=t.is("."+r.list)?"li":"div";if(!t.children(n+"."+r.search).length){if(t.is("."+r.menu))var s=u.$menu,o="prependTo";else var s=t.children().first(),o=s.is("."+r.subtitle)?"insertAfter":"insertBefore";e("<"+n+' class="'+r.search+'" />').append('<input placeholder="'+h.placeholder+'" type="text" autocomplete="off" />')[o](s)}h.noResults&&(t.is("."+r.menu)&&(t=t.children("."+r.panel).first()),n=t.is("."+r.list)?"li":"div",t.children(n+"."+r.noresultsmsg).length||e("<"+n+' class="'+r.noresultsmsg+'" />').html(h.noResults).appendTo(t))})}if(this.$menu.children("div."+r.search).length&&this.$menu.addClass(r.hassearch),h.search){var m=e("."+r.search,this.$menu);m.length&&m.each(function(){var n=e(this);if("menu"==h.addTo)var s=e("."+r.panel,u.$menu),o=u.$menu;else var s=n.closest("."+r.panel),o=s;var a=n.children("input"),i=u.__findAddBack(s,"."+r.list).children("li"),c=i.filter("."+r.label),p=i.not("."+r.subtitle).not("."+r.label).not("."+r.search).not("."+r.noresultsmsg),f="> a";h.showLinksOnly||(f+=", > span"),a.off(d.keyup+" "+d.change).on(d.keyup,function(e){t(e.keyCode)||n.trigger(d.search)}).on(d.change,function(){n.trigger(d.search)}),n.off(d.reset+" "+d.search).on(d.reset+" "+d.search,function(e){e.stopPropagation()}).on(d.reset,function(){n.trigger(d.search,[""])}).on(d.search,function(t,n){"string"==typeof n?a.val(n):n=a.val(),n=n.toLowerCase(),s.scrollTop(0),p.add(c).addClass(r.hidden),p.each(function(){var t=e(this);e(f,t).text().toLowerCase().indexOf(n)>-1&&t.add(t.prevAll("."+r.label).first()).removeClass(r.hidden)}),e(s.get().reverse()).each(function(t){var n=e(this),s=n.data(l.parent);if(s){var o=n.add(n.find("> ."+r.list)).find("> li").not("."+r.subtitle).not("."+r.search).not("."+r.noresultsmsg).not("."+r.label).not("."+r.hidden);o.length?s.removeClass(r.hidden).removeClass(r.nosubresults).prevAll("."+r.label).first().removeClass(r.hidden):"menu"==h.addTo&&(n.hasClass(r.opened)&&setTimeout(function(){s.trigger(d.open)},1.5*(t+1)*u.conf.openingInterval),s.addClass(r.nosubresults))}}),o[p.not("."+r.hidden).length?"removeClass":"addClass"](r.noresults),u._update()})})}},e[a].addons.push(i),e[a].defaults[i]={add:!1,addTo:"menu",search:!1,placeholder:"Search",noResults:"No results found."};var r,l,d,c,p=!1}(jQuery),!function(e){function t(e){return e}function n(e){return e}function s(){c=!0,i=e[o]._c,r=e[o]._d,l=e[o]._e,i.add("toggle check"),d=e[o].glbl}var o="mmenu",a="toggles";e[o].prototype["_init_"+a]=function(o){c||s();var r=this.vars[a+"_added"];this.vars[a+"_added"]=!0,r||(this.opts[a]=t(this.opts[a]),this.conf[a]=n(this.conf[a]));var l=this;this.opts[a],this.conf[a],this.__refactorClass(e("input",o),this.conf.classNames[a].toggle,"toggle"),this.__refactorClass(e("input",o),this.conf.classNames[a].check,"check"),e("input."+i.toggle,o).add("input."+i.check,o).each(function(){var t=e(this),n=t.closest("li"),s=t.hasClass(i.toggle)?"toggle":"check",o=t.attr("id")||l.__getUniqueId();n.children('label[for="'+o+'"]').length||(t.attr("id",o),n.prepend(t),e('<label for="'+o+'" class="'+i[s]+'"></label>').insertBefore(n.children("a, span").last()))})},e[o].addons.push(a),e[o].defaults[a]={},e[o].configuration.classNames[a]={toggle:"Toggle",check:"Check"};var i,r,l,d,c=!1}(jQuery);
MMore/cdnjs
ajax/libs/jQuery.mmenu/4.5.7/js/jquery.mmenu.min.all.min.js
JavaScript
mit
27,219
#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' describe 'validate_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do describe 'success' do it 'validates a single argument' do pp = <<-EOS $one = ['a', 'b'] validate_array($one) EOS apply_manifest(pp, :catch_failures => true) end it 'validates an multiple arguments' do pp = <<-EOS $one = ['a', 'b'] $two = [['c'], 'd'] validate_array($one,$two) EOS apply_manifest(pp, :catch_failures => true) end it 'validates a non-array' do { %{validate_array({'a' => 'hash' })} => "Hash", %{validate_array('string')} => "String", %{validate_array(false)} => "FalseClass", %{validate_array(undef)} => "String" }.each do |pp,type| expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/) end end end describe 'failure' do it 'handles improper number of arguments' end end
HACManchester/gibson
puphpet/puppet/modules/stdlib/spec/acceptance/validate_array_spec.rb
Ruby
mit
1,076
/* * Globalize Culture tk * * http://github.com/jquery/globalize * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * This file was generated by the Globalize Culture Generator * Translation: bugs found in this file need to be fixed in the generator */ (function( window, undefined ) { var Globalize; if ( typeof require !== "undefined" && typeof exports !== "undefined" && typeof module !== "undefined" ) { // Assume CommonJS Globalize = require( "globalize" ); } else { // Global variable Globalize = window.Globalize; } Globalize.addCultureInfo( "tk", "default", { name: "tk", englishName: "Turkmen", nativeName: "türkmençe", language: "tk", numberFormat: { ",": " ", ".": ",", negativeInfinity: "-üznüksizlik", positiveInfinity: "üznüksizlik", percent: { pattern: ["-n%","n%"], ",": " ", ".": "," }, currency: { pattern: ["-n$","n$"], ",": " ", ".": ",", symbol: "m." } }, calendars: { standard: { "/": ".", firstDay: 1, days: { names: ["Duşenbe","Sişenbe","Çarşenbe","Penşenbe","Anna","Şenbe","Ýekşenbe"], namesAbbr: ["Db","Sb","Çb","Pb","An","Şb","Ýb"], namesShort: ["D","S","Ç","P","A","Ş","Ý"] }, months: { names: ["Ýanwar","Fewral","Mart","Aprel","Maý","lýun","lýul","Awgust","Sentýabr","Oktýabr","Noýabr","Dekabr",""], namesAbbr: ["Ýan","Few","Mart","Apr","Maý","lýun","lýul","Awg","Sen","Okt","Not","Dek",""] }, AM: null, PM: null, patterns: { d: "dd.MM.yy", D: "yyyy 'ý.' MMMM d", t: "H:mm", T: "H:mm:ss", f: "yyyy 'ý.' MMMM d H:mm", F: "yyyy 'ý.' MMMM d H:mm:ss", Y: "yyyy 'ý.' MMMM" } } } }); }( this ));
rymarenkosuccess/schoolerp
assets/plugins/cultures/globalize.culture.tk.js
JavaScript
mit
1,791
/* * Globalize Culture nn-NO * * http://github.com/jquery/globalize * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * This file was generated by the Globalize Culture Generator * Translation: bugs found in this file need to be fixed in the generator */ (function( window, undefined ) { var Globalize; if ( typeof require !== "undefined" && typeof exports !== "undefined" && typeof module !== "undefined" ) { // Assume CommonJS Globalize = require( "globalize" ); } else { // Global variable Globalize = window.Globalize; } Globalize.addCultureInfo( "nn-NO", "default", { name: "nn-NO", englishName: "Norwegian, Nynorsk (Norway)", nativeName: "norsk, nynorsk (Noreg)", language: "nn", numberFormat: { ",": " ", ".": ",", negativeInfinity: "-INF", positiveInfinity: "INF", percent: { ",": " ", ".": "," }, currency: { pattern: ["$ -n","$ n"], ",": " ", ".": ",", symbol: "kr" } }, calendars: { standard: { "/": ".", firstDay: 1, days: { names: ["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"], namesAbbr: ["sø","må","ty","on","to","fr","la"], namesShort: ["sø","må","ty","on","to","fr","la"] }, months: { names: ["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""], namesAbbr: ["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""] }, AM: null, PM: null, patterns: { d: "dd.MM.yyyy", D: "d. MMMM yyyy", t: "HH:mm", T: "HH:mm:ss", f: "d. MMMM yyyy HH:mm", F: "d. MMMM yyyy HH:mm:ss", M: "d. MMMM", Y: "MMMM yyyy" } } } }); }( this ));
sky1086/feeljoyci
jui/js/globalize/cultures/globalize.culture.nn-NO.js
JavaScript
mit
1,778
'use strict'; var _ = require('lodash'); var rx = require('rx-lite'); var runAsync = require('run-async'); /** * Create an oversable returning the result of a function runned in sync or async mode. * @param {Function} func Function to run * @return {rx.Observable} Observable emitting when value is known */ exports.createObservableFromAsync = function (func) { return rx.Observable.defer(function () { return rx.Observable.create(function (obs) { runAsync(func, function (value) { obs.onNext(value); obs.onCompleted(); }); }); }); }; /** * Resolve a question property value if it is passed as a function. * This method will overwrite the property on the question object with the received value. * @param {Object} question - Question object * @param {String} prop - Property to fetch name * @param {Object} answers - Answers object * @...rest {Mixed} rest - Arguments to pass to `func` * @return {rx.Obsersable} - Observable emitting once value is known */ exports.fetchAsyncQuestionProperty = function (question, prop, answers) { if (!_.isFunction(question[prop])) { return rx.Observable.return(question); } return exports.createObservableFromAsync(function () { var done = this.async(); runAsync(question[prop], function (value) { question[prop] = value; done(question); }, answers); }); };
MichaelBowenSc/about-me
node_modules/typings/node_modules/inquirer/lib/utils/utils.js
JavaScript
mit
1,403
/************* jQuery UI Theme *************/ /* overall */ .tablesorter-jui { width: 100%; border-collapse: separate; border-spacing: 2px; /* adjust spacing between table cells */ margin: 10px 0 15px; padding: 5px; font-size: 0.8em; } /* header */ .tablesorter-jui th, .tablesorter-jui thead td { position: relative; background-repeat: no-repeat; background-position: right center; /* UI hover and active states make the font normal and the table resizes, this fixes it */ font-weight: bold !important; border-width: 1px !important; text-align: left; } .tablesorter-jui .header, .tablesorter-jui .tablesorter-header { cursor: pointer; white-space: normal; padding: 8px; /* wider than the icon */ } .tablesorter-jui .tablesorter-header-inner { padding-right: 20px; } .tablesorter-jui thead tr th .ui-icon { position: absolute; right: 3px; top: 50%; margin-top: -8px; /* half the icon height; older IE doesn't like this */ } .tablesorter-jui thead .sorter-false { cursor: default; } /* tfoot */ .tablesorter-jui tfoot th, .tablesorter-jui tfoot td { font-weight: normal !important; font-size: .9em; padding: 2px; } /* tbody */ .tablesorter-jui td { padding: 4px; vertical-align: top; } /* hovered row colors */ .tablesorter-jui tbody > tr:hover td { opacity: 0.7; filter: alpha(opacity=70); } /* table processing indicator */ .tablesorter-jui .tablesorter-processing .tablesorter-header-inner { background-position: center center !important; background-repeat: no-repeat !important; /* background-image: url(../addons/pager/icons/loading.gif) !important; */ background-image: url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=') !important; } /* Zebra widget - This allows you to use ui-state-default as the zebra stripe color */ .tablesorter-jui tr.ui-state-default { background-image: none; font-weight: normal; } /* processing background color */ .tablesorter-jui .tablesorter-processing { background-color: #ddd; /* older browsers that don't support rgba */ background-color: rgba(255,255,255,0.8); } /* caption */ .tablesorter-jui caption { border: 0; } /* filter widget */ .tablesorter-jui .tablesorter-filter-row td { background: transparent; line-height: normal; text-align: center; /* center the input */ -webkit-transition: line-height 0.1s ease; -moz-transition: line-height 0.1s ease; -o-transition: line-height 0.1s ease; transition: line-height 0.1s ease; } /* optional disabled input styling */ .tablesorter-jui .tablesorter-filter-row .disabled { opacity: 0.5; filter: alpha(opacity=50); cursor: not-allowed; } /* hidden filter row */ .tablesorter-jui .tablesorter-filter-row.hideme td { /*** *********************************************** ***/ /*** change this padding to modify the thickness ***/ /*** of the closed filter row (height = padding x 2) ***/ padding: 2px; /*** *********************************************** ***/ margin: 0; line-height: 0; cursor: pointer; } .tablesorter-jui .tablesorter-filter-row.hideme .tablesorter-filter { height: 1px; min-height: 0; border: 0; padding: 0; margin: 0; /* don't use visibility: hidden because it disables tabbing */ opacity: 0; filter: alpha(opacity=0); } /* filters */ .tablesorter-jui .tablesorter-filter { width: 98%; height: auto; margin: 0; padding: 4px; background-color: #fff; border: 1px solid #bbb; color: #333; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: height 0.1s ease; -moz-transition: height 0.1s ease; -o-transition: height 0.1s ease; transition: height 0.1s ease; } /* ajax error row */ .tablesorter .tablesorter-errorRow td { cursor: pointer; background-color: #e6bf99; }
djavaui/cdnjs
ajax/libs/jquery.tablesorter/2.14.3/css/theme.jui.css
CSS
mit
4,254
// Load modules var Utils = require('./utils'); // Declare internals var internals = { delimiter: '&', arrayPrefixGenerators: { brackets: function (prefix, key) { return prefix + '[]'; }, indices: function (prefix, key) { return prefix + '[' + key + ']'; }, repeat: function (prefix, key) { return prefix; } } }; internals.stringify = function (obj, prefix, generateArrayPrefix) { if (Utils.isBuffer(obj)) { obj = obj.toString(); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { obj = ''; } if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)]; } var values = []; if (typeof obj === 'undefined') { return values; } var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; if (Array.isArray(obj)) { values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix)); } else { values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix)); } } return values; }; module.exports = function (obj, options) { options = options || {}; var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; var keys = []; if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in internals.arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; } else { arrayFormat = 'indices'; } var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; var objKeys = Object.keys(obj); for (var i = 0, il = objKeys.length; i < il; ++i) { var key = objKeys[i]; keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix)); } return keys.join(delimiter); };
andrewwhipple/whippleghost
node_modules/request/node_modules/qs/lib/stringify.js
JavaScript
mit
2,322
'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": [ "domingo", "segunda-feira", "ter\u00e7a-feira", "quarta-feira", "quinta-feira", "sexta-feira", "s\u00e1bado" ], "MONTH": [ "janeiro", "fevereiro", "mar\u00e7o", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro" ], "SHORTDAY": [ "dom", "seg", "ter", "qua", "qui", "sex", "s\u00e1b" ], "SHORTMONTH": [ "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez" ], "fullDate": "EEEE, d 'de' MMMM 'de' y", "longDate": "d 'de' MMMM 'de' y", "medium": "d 'de' MMM 'de' y HH:mm:ss", "mediumDate": "d 'de' MMM 'de' y", "mediumTime": "HH:mm:ss", "short": "dd/MM/yy HH:mm", "shortDate": "dd/MM/yy", "shortTime": "HH:mm" }, "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": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "pt-br", "pluralCat": function(n, opt_precision) { if (n >= 0 && n <= 2 && n != 2) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
pzp1997/cdnjs
ajax/libs/angular.js/1.4.0-beta.1/i18n/angular-locale_pt-br.js
JavaScript
mit
1,988
module Faraday # Public: Connection objects manage the default properties and the middleware # stack for fulfilling an HTTP request. # # Examples # # conn = Faraday::Connection.new 'http://sushi.com' # # # GET http://sushi.com/nigiri # conn.get 'nigiri' # # => #<Faraday::Response> # class Connection # A Set of allowed HTTP verbs. METHODS = Set.new [:get, :post, :put, :delete, :head, :patch, :options] # Public: Returns a Hash of URI query unencoded key/value pairs. attr_reader :params # Public: Returns a Hash of unencoded HTTP header key/value pairs. attr_reader :headers # Public: Returns a URI with the prefix used for all requests from this # Connection. This includes a default host name, scheme, port, and path. attr_reader :url_prefix # Public: Returns the Faraday::Builder for this Connection. attr_reader :builder # Public: Returns a Hash of the request options. attr_reader :options # Public: Returns a Hash of the SSL options. attr_reader :ssl # Public: Returns the parallel manager for this Connection. attr_reader :parallel_manager # Public: Sets the default parallel manager for this connection. attr_writer :default_parallel_manager # Public: Initializes a new Faraday::Connection. # # url - URI or String base URL to use as a prefix for all # requests (optional). # options - Hash or Faraday::ConnectionOptions. # :url - URI or String base URL (default: "http:/"). # :params - Hash of URI query unencoded key/value pairs. # :headers - Hash of unencoded HTTP header key/value pairs. # :request - Hash of request options. # :ssl - Hash of SSL options. # :proxy - URI, String or Hash of HTTP proxy options # (default: "http_proxy" environment variable). # :uri - URI or String # :user - String (optional) # :password - String (optional) def initialize(url = nil, options = nil) if url.is_a?(Hash) options = ConnectionOptions.from(url) url = options.url else options = ConnectionOptions.from(options) end @parallel_manager = nil @headers = Utils::Headers.new @params = Utils::ParamsHash.new @options = options.request @ssl = options.ssl @default_parallel_manager = options.parallel_manager @builder = options.builder || begin # pass an empty block to Builder so it doesn't assume default middleware options.new_builder(block_given? ? Proc.new { |b| } : nil) end self.url_prefix = url || 'http:/' @params.update(options.params) if options.params @headers.update(options.headers) if options.headers @proxy = nil proxy(options.fetch(:proxy) { uri = ENV['http_proxy'] if uri && !uri.empty? uri = 'http://' + uri if uri !~ /^http/i uri end }) yield(self) if block_given? @headers[:user_agent] ||= "Faraday v#{VERSION}" end # Public: Sets the Hash of URI query unencoded key/value pairs. def params=(hash) @params.replace hash end # Public: Sets the Hash of unencoded HTTP header key/value pairs. def headers=(hash) @headers.replace hash end extend Forwardable def_delegators :builder, :build, :use, :request, :response, :adapter, :app # Public: Makes an HTTP request without a body. # # url - The optional String base URL to use as a prefix for all # requests. Can also be the options Hash. # params - Hash of URI query unencoded key/value pairs. # headers - Hash of unencoded HTTP header key/value pairs. # # Examples # # conn.get '/items', {:page => 1}, :accept => 'application/json' # conn.head '/items/1' # # # ElasticSearch example sending a body with GET. # conn.get '/twitter/tweet/_search' do |req| # req.headers[:content_type] = 'application/json' # req.params[:routing] = 'kimchy' # req.body = JSON.generate(:query => {...}) # end # # Yields a Faraday::Response for further request customizations. # Returns a Faraday::Response. # # Signature # # <verb>(url = nil, params = nil, headers = nil) # # verb - An HTTP verb: get, head, or delete. %w[get head delete].each do |method| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{method}(url = nil, params = nil, headers = nil) run_request(:#{method}, url, nil, headers) { |request| request.params.update(params) if params yield(request) if block_given? } end RUBY end # Public: Makes an HTTP request with a body. # # url - The optional String base URL to use as a prefix for all # requests. Can also be the options Hash. # body - The String body for the request. # headers - Hash of unencoded HTTP header key/value pairs. # # Examples # # conn.post '/items', data, :content_type => 'application/json' # # # Simple ElasticSearch indexing sample. # conn.post '/twitter/tweet' do |req| # req.headers[:content_type] = 'application/json' # req.params[:routing] = 'kimchy' # req.body = JSON.generate(:user => 'kimchy', ...) # end # # Yields a Faraday::Response for further request customizations. # Returns a Faraday::Response. # # Signature # # <verb>(url = nil, body = nil, headers = nil) # # verb - An HTTP verb: post, put, or patch. %w[post put patch].each do |method| class_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{method}(url = nil, body = nil, headers = nil, &block) run_request(:#{method}, url, body, headers, &block) end RUBY end # Public: Sets up the Authorization header with these credentials, encoded # with base64. # # login - The authentication login. # pass - The authentication password. # # Examples # # conn.basic_auth 'Aladdin', 'open sesame' # conn.headers['Authorization'] # # => "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" # # Returns nothing. def basic_auth(login, pass) set_authorization_header(:basic_auth, login, pass) end # Public: Sets up the Authorization header with the given token. # # token - The String token. # options - Optional Hash of extra token options. # # Examples # # conn.token_auth 'abcdef', :foo => 'bar' # conn.headers['Authorization'] # # => "Token token=\"abcdef\", # foo=\"bar\"" # # Returns nothing. def token_auth(token, options = nil) set_authorization_header(:token_auth, token, options) end # Public: Sets up a custom Authorization header. # # type - The String authorization type. # token - The String or Hash token. A String value is taken literally, and # a Hash is encoded into comma separated key/value pairs. # # Examples # # conn.authorization :Bearer, 'mF_9.B5f-4.1JqM' # conn.headers['Authorization'] # # => "Bearer mF_9.B5f-4.1JqM" # # conn.authorization :Token, :token => 'abcdef', :foo => 'bar' # conn.headers['Authorization'] # # => "Token token=\"abcdef\", # foo=\"bar\"" # # Returns nothing. def authorization(type, token) set_authorization_header(:authorization, type, token) end # Internal: Traverse the middleware stack in search of a # parallel-capable adapter. # # Yields in case of not found. # # Returns a parallel manager or nil if not found. def default_parallel_manager @default_parallel_manager ||= begin handler = @builder.handlers.detect do |h| h.klass.respond_to?(:supports_parallel?) and h.klass.supports_parallel? end if handler handler.klass.setup_parallel_manager elsif block_given? yield end end end # Public: Determine if this Faraday::Connection can make parallel requests. # # Returns true or false. def in_parallel? !!@parallel_manager end # Public: Sets up the parallel manager to make a set of requests. # # manager - The parallel manager that this Connection's Adapter uses. # # Yields a block to execute multiple requests. # Returns nothing. def in_parallel(manager = nil) @parallel_manager = manager || default_parallel_manager { warn "Warning: `in_parallel` called but no parallel-capable adapter on Faraday stack" warn caller[2,10].join("\n") nil } yield @parallel_manager && @parallel_manager.run ensure @parallel_manager = nil end # Public: Gets or Sets the Hash proxy options. def proxy(arg = nil) return @proxy if arg.nil? @proxy = ProxyOptions.from(arg) end def_delegators :url_prefix, :scheme, :scheme=, :host, :host=, :port, :port= def_delegator :url_prefix, :path, :path_prefix # Public: Parses the giving url with URI and stores the individual # components in this connection. These components serve as defaults for # requests made by this connection. # # url - A String or URI. # # Examples # # conn = Faraday::Connection.new { ... } # conn.url_prefix = "https://sushi.com/api" # conn.scheme # => https # conn.path_prefix # => "/api" # # conn.get("nigiri?page=2") # accesses https://sushi.com/api/nigiri # # Returns the parsed URI from teh given input.. def url_prefix=(url, encoder = nil) uri = @url_prefix = Utils.URI(url) self.path_prefix = uri.path params.merge_query(uri.query, encoder) uri.query = nil with_uri_credentials(uri) do |user, password| basic_auth user, password uri.user = uri.password = nil end uri end # Public: Sets the path prefix and ensures that it always has a leading # slash. # # value - A String. # # Returns the new String path prefix. def path_prefix=(value) url_prefix.path = if value value = '/' + value unless value[0,1] == '/' value end end # Public: Takes a relative url for a request and combines it with the defaults # set on the connection instance. # # conn = Faraday::Connection.new { ... } # conn.url_prefix = "https://sushi.com/api?token=abc" # conn.scheme # => https # conn.path_prefix # => "/api" # # conn.build_url("nigiri?page=2") # => https://sushi.com/api/nigiri?token=abc&page=2 # conn.build_url("nigiri", :page => 2) # => https://sushi.com/api/nigiri?token=abc&page=2 # def build_url(url = nil, extra_params = nil) uri = build_exclusive_url(url) query_values = params.dup.merge_query(uri.query, options.params_encoder) query_values.update extra_params if extra_params uri.query = query_values.empty? ? nil : query_values.to_query(options.params_encoder) uri end # Builds and runs the Faraday::Request. # # method - The Symbol HTTP method. # url - The String or URI to access. # body - The String body # headers - Hash of unencoded HTTP header key/value pairs. # # Returns a Faraday::Response. def run_request(method, url, body, headers) if !METHODS.include?(method) raise ArgumentError, "unknown http method: #{method}" end request = build_request(method) do |req| req.url(url) if url req.headers.update(headers) if headers req.body = body if body yield(req) if block_given? end builder.build_response(self, request) end # Creates and configures the request object. # # Returns the new Request. def build_request(method) Request.create(method) do |req| req.params = self.params.dup req.headers = self.headers.dup req.options = self.options.merge(:proxy => self.proxy) yield(req) if block_given? end end # Internal: Build an absolute URL based on url_prefix. # # url - A String or URI-like object # params - A Faraday::Utils::ParamsHash to replace the query values # of the resulting url (default: nil). # # Returns the resulting URI instance. def build_exclusive_url(url = nil, params = nil) url = nil if url.respond_to?(:empty?) and url.empty? base = url_prefix if url and base.path and base.path !~ /\/$/ base = base.dup base.path = base.path + '/' # ensure trailing slash end uri = url ? base + url : base uri.query = params.to_query(options.params_encoder) if params uri.query = nil if uri.query and uri.query.empty? uri end # Internal: Creates a duplicate of this Faraday::Connection. # # Returns a Faraday::Connection. def dup self.class.new(build_exclusive_url, :headers => headers.dup, :params => params.dup, :builder => builder.dup, :ssl => ssl.dup) end # Internal: Yields username and password extracted from a URI if they both exist. def with_uri_credentials(uri) if uri.user and uri.password yield(Utils.unescape(uri.user), Utils.unescape(uri.password)) end end def set_authorization_header(header_type, *args) header = Faraday::Request.lookup_middleware(header_type). header(*args) headers[Faraday::Request::Authorization::KEY] = header end end end
kieran-bamforth/our-boxen
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/connection.rb
Ruby
mit
13,912
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Class: FlexLayer</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/default.css"> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser API</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> <li class="class-depth-0"> <a href="PIXI.html">PIXI</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArraySet.html">ArraySet</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayUtils.html">ArrayUtils</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Angle.html">Angle</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Animation.html">Animation</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.AutoCull.html">AutoCull</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Bounds.html">Bounds</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.BringToTop.html">BringToTop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Core.html">Core</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Crop.html">Crop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Delta.html">Delta</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Destroy.html">Destroy</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Health.html">Health</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InCamera.html">InCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InputEnabled.html">InputEnabled</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InWorld.html">InWorld</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LifeSpan.html">LifeSpan</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LoadTexture.html">LoadTexture</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Overlap.html">Overlap</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Reset.html">Reset</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Smoothed.html">Smoothed</a> </li> <li class="class-depth-1"> <a href="Phaser.Create.html">Create</a> </li> <li class="class-depth-1"> <a href="Phaser.Creature.html">Creature</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.DeviceButton.html">DeviceButton</a> </li> <li class="class-depth-1"> <a href="Phaser.DOM.html">DOM</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.ImageCollection.html">ImageCollection</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Matrix.html">Matrix</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.TilemapCollision.html">TilemapCollision</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.RoundedRectangle.html">RoundedRectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenData.html">TweenData</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.Video.html">Video</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> <li class="class-depth-1"> <a href="PIXI.AbstractFilter.html">AbstractFilter</a> </li> <li class="class-depth-1"> <a href="PIXI.BaseTexture.html">BaseTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasBuffer.html">CanvasBuffer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasGraphics.html">CanvasGraphics</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasPool.html">CanvasPool</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasRenderer.html">CanvasRenderer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasTinter.html">CanvasTinter</a> </li> <li class="class-depth-1"> <a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObject.html">DisplayObject</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a> </li> <li class="class-depth-1"> <a href="PIXI.Event.html">Event</a> </li> <li class="class-depth-1"> <a href="PIXI.EventTarget.html">EventTarget</a> </li> <li class="class-depth-1"> <a href="PIXI.FilterTexture.html">FilterTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="PIXI.GraphicsData.html">GraphicsData</a> </li> <li class="class-depth-1"> <a href="PIXI.PIXI.html">PIXI</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiFastShader.html">PixiFastShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiShader.html">PixiShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PolyK.html">PolyK</a> </li> <li class="class-depth-1"> <a href="PIXI.PrimitiveShader.html">PrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="PIXI.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="PIXI.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="PIXI.Strip.html">Strip</a> </li> <li class="class-depth-1"> <a href="PIXI.StripShader.html">StripShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Texture.html">Texture</a> </li> <li class="class-depth-1"> <a href="PIXI.TilingSprite.html">TilingSprite</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLRenderer.html">WebGLRenderer</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="global.html#AUTO">AUTO</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPDATA">BITMAPDATA</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPTEXT">BITMAPTEXT</a> </li> <li class="class-depth-0"> <a href="global.html#blendModes">blendModes</a> </li> <li class="class-depth-0"> <a href="global.html#BUTTON">BUTTON</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS">CANVAS</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS_FILTER">CANVAS_FILTER</a> </li> <li class="class-depth-0"> <a href="global.html#CIRCLE">CIRCLE</a> </li> <li class="class-depth-0"> <a href="global.html#CREATURE">CREATURE</a> </li> <li class="class-depth-0"> <a href="global.html#DOWN">DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#ELLIPSE">ELLIPSE</a> </li> <li class="class-depth-0"> <a href="global.html#EMITTER">EMITTER</a> </li> <li class="class-depth-0"> <a href="global.html#GAMES">GAMES</a> </li> <li class="class-depth-0"> <a href="global.html#GRAPHICS">GRAPHICS</a> </li> <li class="class-depth-0"> <a href="global.html#GROUP">GROUP</a> </li> <li class="class-depth-0"> <a href="global.html#HEADLESS">HEADLESS</a> </li> <li class="class-depth-0"> <a href="global.html#IMAGE">IMAGE</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT">LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#LINE">LINE</a> </li> <li class="class-depth-0"> <a href="global.html#MATRIX">MATRIX</a> </li> <li class="class-depth-0"> <a href="global.html#NONE">NONE</a> </li> <li class="class-depth-0"> <a href="global.html#POINT">POINT</a> </li> <li class="class-depth-0"> <a href="global.html#POINTER">POINTER</a> </li> <li class="class-depth-0"> <a href="global.html#POLYGON">POLYGON</a> </li> <li class="class-depth-0"> <a href="global.html#RECTANGLE">RECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#RENDERTEXTURE">RENDERTEXTURE</a> </li> <li class="class-depth-0"> <a href="global.html#RETROFONT">RETROFONT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT">RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#ROPE">ROPE</a> </li> <li class="class-depth-0"> <a href="global.html#ROUNDEDRECTANGLE">ROUNDEDRECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#scaleModes">scaleModes</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITE">SPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITEBATCH">SPRITEBATCH</a> </li> <li class="class-depth-0"> <a href="global.html#TEXT">TEXT</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAP">TILEMAP</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAPLAYER">TILEMAPLAYER</a> </li> <li class="class-depth-0"> <a href="global.html#TILESPRITE">TILESPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#UP">UP</a> </li> <li class="class-depth-0"> <a href="global.html#VERSION">VERSION</a> </li> <li class="class-depth-0"> <a href="global.html#VIDEO">VIDEO</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL">WEBGL</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL_FILTER">WEBGL_FILTER</a> </li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li> <li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li> <li class="class-depth-1"><a href="Phaser.World.html">World</a></li> <li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li> <li class="class-depth-1"><a href="Phaser.Cache.html">Cache</a></li> <li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li> <li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li> <li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li> <li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li> <li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li> <li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li> <li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li> <li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li> <li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li> <li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li> <li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li> <li class="class-depth-1"><a href="Phaser.Video.html">Video</a></li> <li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li> <li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li> <li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li> <li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li> <li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li> <li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li> <li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li> <li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li> <li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li> <li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li> <li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li> <li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li> <li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li> <li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li> <li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li> <li class="class-depth-1"><a href="Phaser.Matrix.html">Matrix</a></li> <li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li> <li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li> <li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li> <li class="class-depth-1"><a href="Phaser.RoundedRectangle.html">Rounded Rectangle</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li> <li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li> <li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li> <li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li> <li class="class-depth-1"><a href="Phaser.DeviceButton.html">Device Button</a></li> <li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li> <li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li> <li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li> <li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li> <li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li> <li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li> <li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li> <li class="class-depth-1"><a href="http://phaser.io/learn">Tutorials</a></li> <li class="class-depth-1"><a href="https://confirmsubscription.com/h/r/369DE48E3E86AF1E">Newsletter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/irc">IRC</a></li> <li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span8"> <div id="main"> <!--<h1 class="page-title">Class: FlexLayer</h1>--> <section> <header> <h2> <span class="ancestors"><a href="Phaser.html">Phaser</a>.</span> FlexLayer </h2> </header> <article> <div class="container-overview"> <dt> <h4 class="name " id="FlexLayer"><span class="type-signature"></span>new FlexLayer<span class="signature">(manager, position, bounds, scale)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>WARNING: This is an EXPERIMENTAL class. The API will change significantly in the coming versions and is incomplete. Please try to avoid using in production games with a long time to build. This is also why the documentation is incomplete.</p> <p>A responsive grid layer.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>manager</code></td> <td class="type"> <span class="param-type"><a href="Phaser.FlexGrid.html">Phaser.FlexGrid</a></span> </td> <td class="description last"><p>The FlexGrid that owns this FlexLayer.</p></td> </tr> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span> </td> <td class="description last"><p>A reference to the Point object used for positioning.</p></td> </tr> <tr> <td class="name"><code>bounds</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span> </td> <td class="description last"><p>A reference to the Rectangle used for the layer bounds.</p></td> </tr> <tr> <td class="name"><code>scale</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span> </td> <td class="description last"><p>A reference to the Point object used for layer scaling.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-22">line 22</a> </dt> </dl> </dd> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="Phaser.Group.html">Phaser.Group</a></li> </ul> <h3 class="subsection-title">Members</h3> <dl> <dt> <h4 class="name " id="alive"><span class="type-signature"></span>alive<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>The alive property is useful for Groups that are children of other Groups and need to be included/excluded in checks like forEachAlive.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#alive">Phaser.Group#alive</a> </li></dd> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>true</li></ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-92">line 92</a> </dt> </dl> </dd> <dt> <h4 class="name " id="alpha"><span class="type-signature"></span>alpha<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The alpha value of the group container.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#alpha">Phaser.Group#alpha</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2212">line 2212</a> </dt> </dl> </dd> <dt> <h4 class="name " id="angle"><span class="type-signature"></span>angle<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The angle of rotation of the group container, in degrees.</p> <p>This adjusts the group itself by modifying its local rotation transform.</p> <p>This has no impact on the rotation/angle properties of the children, but it will update their worldTransform and on-screen orientation and position.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#angle">Phaser.Group#angle</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2144">line 2144</a> </dt> </dl> </dd> <dt> <h4 class="name " id="bottomLeft"><span class="type-signature"></span>bottomLeft<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-76">line 76</a> </dt> </dl> </dd> <dt> <h4 class="name " id="bottomMiddle"><span class="type-signature"></span>bottomMiddle<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-81">line 81</a> </dt> </dl> </dd> <dt> <h4 class="name " id="bottomRight"><span class="type-signature"></span>bottomRight<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-86">line 86</a> </dt> </dl> </dd> <dt> <h4 class="name " id="bounds"><span class="type-signature"></span>bounds<span class="type-signature"> :<a href="Phaser.Rectangle.html">Phaser.Rectangle</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-51">line 51</a> </dt> </dl> </dd> <dt> <h4 class="name " id="cacheAsBitmap"><span class="type-signature"></span>cacheAsBitmap<span class="type-signature"> :Boolean</span></h4> </dt> <dd> <div class="description"> <p>Set if this display object is cached as a bitmap. This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. To remove simply set this property to 'null'</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#cacheAsBitmap">PIXI.DisplayObject#cacheAsBitmap</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-376">line 376</a> </dt> </dl> </dd> <dt> <h4 class="name " id="cameraOffset"><span class="type-signature"></span>cameraOffset<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <div class="description"> <p>If this object is <a href="Phaser.Group.html#fixedToCamera">fixedToCamera</a> then this stores the x/y position offset relative to the top-left of the camera view. If the parent of this Group is also <code>fixedToCamera</code> then the offset here is in addition to that and should typically be disabled.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#cameraOffset">Phaser.Group#cameraOffset</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-209">line 209</a> </dt> </dl> </dd> <dt> <h4 class="name " id="children"><span class="type-signature">&lt;readonly> </span>children<span class="type-signature"> :Array.&lt;<a href="global.html#DisplayObject">DisplayObject</a>></span></h4> </dt> <dd> <div class="description"> <p>[read-only] The array of children of this container.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;<a href="global.html#DisplayObject">DisplayObject</a>></span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#children">PIXI.DisplayObjectContainer#children</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-17">line 17</a> </dt> </dl> </dd> <dt> <h4 class="name " id="classType"><span class="type-signature"></span>classType<span class="type-signature"> :object</span></h4> </dt> <dd> <div class="description"> <p>The type of objects that will be created when using <a href="Phaser.Group.html#create">create</a> or <a href="Phaser.Group.html#createMultiple">createMultiple</a>.</p> <p>Any object may be used but it should extend either Sprite or Image and accept the same constructor arguments: when a new object is created it is passed the following parameters to its constructor: <code>(game, x, y, key, frame)</code>.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#classType">Phaser.Group#classType</a> </li></dd> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li><a href="Phaser.Sprite.html">Phaser.Sprite</a></li></ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-129">line 129</a> </dt> </dl> </dd> <dt> <h4 class="name " id="cursor"><span class="type-signature"></span>cursor<span class="type-signature"> :<a href="global.html#DisplayObject">DisplayObject</a></span></h4> </dt> <dd> <div class="description"> <p>The current display object that the group cursor is pointing to, if any. (Can be set manually.)</p> <p>The cursor is a way to iterate through the children in a Group using <a href="Phaser.Group.html#next">next</a> and <a href="Phaser.Group.html#previous">previous</a>.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#cursor">Phaser.Group#cursor</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-137">line 137</a> </dt> </dl> </dd> <dt> <h4 class="name " id="cursorIndex"><span class="type-signature">&lt;readonly> </span>cursorIndex<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>The current index of the Group cursor. Advance it with Group.next.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#cursorIndex">Phaser.Group#cursorIndex</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-192">line 192</a> </dt> </dl> </dd> <dt> <h4 class="name " id="enableBody"><span class="type-signature"></span>enableBody<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>If true all Sprites created by, or added to this group, will have a physics body enabled on them.</p> <p>The default body type is controlled with <a href="Phaser.Group.html#physicsBodyType">physicsBodyType</a>.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#enableBody">Phaser.Group#enableBody</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-145">line 145</a> </dt> </dl> </dd> <dt> <h4 class="name " id="enableBodyDebug"><span class="type-signature"></span>enableBodyDebug<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>If true when a physics body is created (via <a href="Phaser.Group.html#enableBody">enableBody</a>) it will create a physics debug object as well.</p> <p>This only works for P2 bodies.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#enableBodyDebug">Phaser.Group#enableBodyDebug</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-154">line 154</a> </dt> </dl> </dd> <dt> <h4 class="name " id="exists"><span class="type-signature"></span>exists<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>If exists is true the group is updated, otherwise it is skipped.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#exists">Phaser.Group#exists</a> </li></dd> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"><li>true</li></ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-99">line 99</a> </dt> </dl> </dd> <dt> <h4 class="name " id="filterArea"><span class="type-signature"></span>filterArea<span class="type-signature"> :Rectangle</span></h4> </dt> <dd> <div class="description"> <p>The area the filter is applied to like the hitArea this is used as more of an optimisation rather than figuring out the dimensions of the displayObject each frame you can set this rectangle</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#filterArea">PIXI.DisplayObject#filterArea</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-183">line 183</a> </dt> </dl> </dd> <dt> <h4 class="name " id="filters"><span class="type-signature"></span>filters<span class="type-signature"> :Array.&lt;Filter></span></h4> </dt> <dd> <div class="description"> <p>Sets the filters for the displayObject. IMPORTANT: This is a webGL only feature and will be ignored by the Canvas renderer.</p> <p>To remove filters simply set this property to 'null'.</p> <p>You cannot have a filter and a multiply blend mode active at the same time. Setting a filter will reset this objects blend mode to NORMAL.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;Filter></span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#filters">PIXI.DisplayObject#filters</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-328">line 328</a> </dt> </dl> </dd> <dt> <h4 class="name " id="fixedToCamera"><span class="type-signature"></span>fixedToCamera<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>A Group that is fixed to the camera uses its x/y coordinates as offsets from the top left of the camera. These are stored in Group.cameraOffset.</p> <p>Note that the cameraOffset values are in addition to any parent in the display list. So if this Group was in a Group that has x: 200, then this will be added to the cameraOffset.x</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#fixedToCamera">Phaser.Group#fixedToCamera</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-202">line 202</a> </dt> </dl> </dd> <dt> <h4 class="name " id="game"><span class="type-signature">&lt;internal> </span>game<span class="type-signature"> :<a href="Phaser.Game.html">Phaser.Game</a></span></h4> </dt> <dd> <div class="description"> <p>A reference to the currently running Game.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#game">Phaser.Group#game</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-38">line 38</a> </dt> </dl> </dd> <dt> <h4 class="name " id="grid"><span class="type-signature"></span>grid<span class="type-signature"> :<a href="Phaser.FlexGrid.html">Phaser.FlexGrid</a></span></h4> </dt> <dd> <div class="description"> <p>A reference to the FlexGrid that owns this layer.</p> </div> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-34">line 34</a> </dt> </dl> </dd> <dt> <h4 class="name " id="hash"><span class="type-signature"></span>hash<span class="type-signature"> :array</span></h4> </dt> <dd> <div class="description"> <p>The hash array is an array belonging to this Group into which you can add any of its children via Group.addToHash and Group.removeFromHash.</p> <p>Only children of this Group can be added to and removed from the hash.</p> <p>This hash is used automatically by Phaser Arcade Physics in order to perform non z-index based destructive sorting. However if you don't use Arcade Physics, or this isn't a physics enabled Group, then you can use the hash to perform your own sorting and filtering of Group children without touching their z-index (and therefore display draw order)</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#hash">Phaser.Group#hash</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-222">line 222</a> </dt> </dl> </dd> <dt> <h4 class="name " id="height"><span class="type-signature"></span>height<span class="type-signature"> :Number</span></h4> </dt> <dd> <div class="description"> <p>The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#height">PIXI.DisplayObjectContainer#height</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-61">line 61</a> </dt> </dl> </dd> <dt> <h4 class="name " id="hitArea"><span class="type-signature"></span>hitArea<span class="type-signature"> :Rectangle|Circle|Ellipse|Polygon</span></h4> </dt> <dd> <div class="description"> <p>This is the defined area that will pick up mouse / touch events. It is null by default. Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Rectangle</span> | <span class="param-type">Circle</span> | <span class="param-type">Ellipse</span> | <span class="param-type">Polygon</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#hitArea">PIXI.DisplayObject#hitArea</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-81">line 81</a> </dt> </dl> </dd> <dt> <h4 class="name " id="ignoreDestroy"><span class="type-signature"></span>ignoreDestroy<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>A group with <code>ignoreDestroy</code> set to <code>true</code> ignores all calls to its <code>destroy</code> method.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#ignoreDestroy">Phaser.Group#ignoreDestroy</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-106">line 106</a> </dt> </dl> </dd> <dt> <h4 class="name " id="length"><span class="type-signature">&lt;readonly> </span>length<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>Total number of children in this group, regardless of exists/alive status.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#length">Phaser.Group#length</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2127">line 2127</a> </dt> </dl> </dd> <dt> <h4 class="name " id="manager"><span class="type-signature"></span>manager<span class="type-signature"></span></h4> </dt> <dd> <dl class="details"> <h5 class="subsection-title">Properties:</h5> <dl> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>scale</code></td> <td class="type"> <span class="param-type"><a href="Phaser.ScaleManager.html">Phaser.ScaleManager</a></span> </td> <td class="description last"><p>A reference to the ScaleManager.</p></td> </tr> </tbody> </table> </dl> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-29">line 29</a> </dt> </dl> </dd> <dt> <h4 class="name " id="mask"><span class="type-signature"></span>mask<span class="type-signature"> :<a href="PIXI.Graphics.html">PIXI.Graphics</a></span></h4> </dt> <dd> <div class="description"> <p>Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping. To remove a mask, set this property to null.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#mask">PIXI.DisplayObject#mask</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-303">line 303</a> </dt> </dl> </dd> <dt> <h4 class="name " id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4> </dt> <dd> <div class="description"> <p>A name for this group. Not used internally but useful for debugging.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#name">Phaser.Group#name</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-49">line 49</a> </dt> </dl> </dd> <dt> <h4 class="name " id="onDestroy"><span class="type-signature"></span>onDestroy<span class="type-signature"> :<a href="Phaser.Signal.html">Phaser.Signal</a></span></h4> </dt> <dd> <div class="description"> <p>This signal is dispatched when the group is destroyed.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#onDestroy">Phaser.Group#onDestroy</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-186">line 186</a> </dt> </dl> </dd> <dt> <h4 class="name " id="parent"><span class="type-signature">&lt;readonly> </span>parent<span class="type-signature"> :<a href="PIXI.DisplayObjectContainer.html">PIXI.DisplayObjectContainer</a></span></h4> </dt> <dd> <div class="description"> <p>[read-only] The display object container that contains this display object.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#parent">PIXI.DisplayObject#parent</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-98">line 98</a> </dt> </dl> </dd> <dt> <h4 class="name " id="pendingDestroy"><span class="type-signature"></span>pendingDestroy<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>A Group is that has <code>pendingDestroy</code> set to <code>true</code> is flagged to have its destroy method called on the next logic update. You can set it directly to flag the Group to be destroyed on its next update.</p> <p>This is extremely useful if you wish to destroy a Group from within one of its own callbacks or a callback of one of its children.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#pendingDestroy">Phaser.Group#pendingDestroy</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-118">line 118</a> </dt> </dl> </dd> <dt> <h4 class="name " id="persist"><span class="type-signature"></span>persist<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>Should the FlexLayer remain through a State swap?</p> </div> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-41">line 41</a> </dt> </dl> </dd> <dt> <h4 class="name " id="physicsBodyType"><span class="type-signature"></span>physicsBodyType<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>If <a href="Phaser.Group.html#enableBody">enableBody</a> is true this is the type of physics body that is created on new Sprites.</p> <p>The valid values are <a href="Phaser.Physics.html#.ARCADE">Phaser.Physics.ARCADE</a>, <a href="Phaser.Physics.P2.html">Phaser.Physics.P2</a>, <a href="Phaser.Physics.html#.NINJA">Phaser.Physics.NINJA</a>, etc.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#physicsBodyType">Phaser.Group#physicsBodyType</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-162">line 162</a> </dt> </dl> </dd> <dt> <h4 class="name " id="physicsSortDirection"><span class="type-signature"></span>physicsSortDirection<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>If this Group contains Arcade Physics Sprites you can set a custom sort direction via this property.</p> <p>It should be set to one of the Phaser.Physics.Arcade sort direction constants: </p> <p>Phaser.Physics.Arcade.SORT_NONE Phaser.Physics.Arcade.LEFT_RIGHT Phaser.Physics.Arcade.RIGHT_LEFT Phaser.Physics.Arcade.TOP_BOTTOM Phaser.Physics.Arcade.BOTTOM_TOP</p> <p>If set to <code>null</code> the Group will use whatever Phaser.Physics.Arcade.sortDirection is set to. This is the default behavior.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#physicsSortDirection">Phaser.Group#physicsSortDirection</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-180">line 180</a> </dt> </dl> </dd> <dt> <h4 class="name " id="physicsType"><span class="type-signature">&lt;readonly> </span>physicsType<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The const physics body type of this object.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#physicsType">Phaser.Group#physicsType</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-85">line 85</a> </dt> </dl> </dd> <dt> <h4 class="name " id="pivot"><span class="type-signature"></span>pivot<span class="type-signature"> :Point</span></h4> </dt> <dd> <div class="description"> <p>The pivot point of the displayObject that it rotates around</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#pivot">PIXI.DisplayObject#pivot</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-49">line 49</a> </dt> </dl> </dd> <dt> <h4 class="name " id="position"><span class="type-signature"></span>position<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-46">line 46</a> </dt> </dl> </dd> <dt> <h4 class="name " id="renderable"><span class="type-signature"></span>renderable<span class="type-signature"> :Boolean</span></h4> </dt> <dd> <div class="description"> <p>Can this object be rendered</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#renderable">PIXI.DisplayObject#renderable</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-90">line 90</a> </dt> </dl> </dd> <dt> <h4 class="name " id="rotation"><span class="type-signature"></span>rotation<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The angle of rotation of the group container, in radians.</p> <p>This will adjust the group container itself by modifying its rotation. This will have no impact on the rotation value of its children, but it will update their worldTransform and on-screen position.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#rotation">Phaser.Group#rotation</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2196">line 2196</a> </dt> </dl> </dd> <dt> <h4 class="name " id="scale"><span class="type-signature"></span>scale<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-56">line 56</a> </dt> </dl> </dd> <dt> <h4 class="name " id="stage"><span class="type-signature">&lt;readonly> </span>stage<span class="type-signature"> :<a href="PIXI.Stage.html">PIXI.Stage</a></span></h4> </dt> <dd> <div class="description"> <p>[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#stage">PIXI.DisplayObject#stage</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-107">line 107</a> </dt> </dl> </dd> <dt> <h4 class="name " id="topLeft"><span class="type-signature"></span>topLeft<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-61">line 61</a> </dt> </dl> </dd> <dt> <h4 class="name " id="topMiddle"><span class="type-signature"></span>topMiddle<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-66">line 66</a> </dt> </dl> </dd> <dt> <h4 class="name " id="topRight"><span class="type-signature"></span>topRight<span class="type-signature"> :<a href="Phaser.Point.html">Phaser.Point</a></span></h4> </dt> <dd> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-71">line 71</a> </dt> </dl> </dd> <dt> <h4 class="name " id="total"><span class="type-signature">&lt;readonly> </span>total<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>Total number of existing children in the group.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#total">Phaser.Group#total</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2110">line 2110</a> </dt> </dl> </dd> <dt> <h4 class="name " id="transformCallback"><span class="type-signature"></span>transformCallback<span class="type-signature"> :function</span></h4> </dt> <dd> <div class="description"> <p>The transform callback is an optional callback that if set will be called at the end of the updateTransform method and sent two parameters: This Display Objects worldTransform matrix and its parents transform matrix. Both are PIXI.Matrix object types. The matrix are passed by reference and can be modified directly without needing to return them. This ability allows you to check any of the matrix values and perform actions such as clamping scale or limiting rotation, regardless of the parent transforms.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#transformCallback">PIXI.DisplayObject#transformCallback</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-30">line 30</a> </dt> </dl> </dd> <dt> <h4 class="name " id="transformCallbackContext"><span class="type-signature"></span>transformCallbackContext<span class="type-signature"> :Object</span></h4> </dt> <dd> <div class="description"> <p>The context under which the transformCallback is invoked.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#transformCallbackContext">PIXI.DisplayObject#transformCallbackContext</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-41">line 41</a> </dt> </dl> </dd> <dt> <h4 class="name " id="type"><span class="type-signature">&lt;internal> </span>type<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>Internal Phaser Type value.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#type">Phaser.Group#type</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-79">line 79</a> </dt> </dl> </dd> <dt> <h4 class="name " id="visible"><span class="type-signature"></span>visible<span class="type-signature"> :boolean</span></h4> </dt> <dd> <div class="description"> <p>The visible state of the group. Non-visible Groups and all of their children are not rendered.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#visible">Phaser.Group#visible</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2205">line 2205</a> </dt> </dl> </dd> <dt> <h4 class="name " id="width"><span class="type-signature"></span>width<span class="type-signature"> :Number</span></h4> </dt> <dd> <div class="description"> <p>The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#width">PIXI.DisplayObjectContainer#width</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-32">line 32</a> </dt> </dl> </dd> <dt> <h4 class="name " id="worldAlpha"><span class="type-signature">&lt;readonly> </span>worldAlpha<span class="type-signature"> :Number</span></h4> </dt> <dd> <div class="description"> <p>[read-only] The multiplied alpha of the displayObject</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#worldAlpha">PIXI.DisplayObject#worldAlpha</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-116">line 116</a> </dt> </dl> </dd> <dt> <h4 class="name " id="worldPosition"><span class="type-signature">&lt;readonly> </span>worldPosition<span class="type-signature"> :Point</span></h4> </dt> <dd> <div class="description"> <p>The position of the Display Object based on the world transform. This value is updated at the end of updateTransform and takes all parent transforms into account.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#worldPosition">PIXI.DisplayObject#worldPosition</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-135">line 135</a> </dt> </dl> </dd> <dt> <h4 class="name " id="worldRotation"><span class="type-signature">&lt;readonly> </span>worldRotation<span class="type-signature"> :Number</span></h4> </dt> <dd> <div class="description"> <p>The rotation of the Display Object, in radians, based on the world transform. This value is updated at the end of updateTransform and takes all parent transforms into account.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#worldRotation">PIXI.DisplayObject#worldRotation</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-155">line 155</a> </dt> </dl> </dd> <dt> <h4 class="name " id="worldScale"><span class="type-signature">&lt;readonly> </span>worldScale<span class="type-signature"> :Point</span></h4> </dt> <dd> <div class="description"> <p>The scale of the Display Object based on the world transform. This value is updated at the end of updateTransform and takes all parent transforms into account.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#worldScale">PIXI.DisplayObject#worldScale</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-145">line 145</a> </dt> </dl> </dd> <dt> <h4 class="name " id="worldVisible"><span class="type-signature"></span>worldVisible<span class="type-signature"> :Boolean</span></h4> </dt> <dd> <div class="description"> <p>[read-only] Indicates if the sprite is globally visible.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#worldVisible">PIXI.DisplayObject#worldVisible</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-279">line 279</a> </dt> </dl> </dd> <dt> <h4 class="name " id="x"><span class="type-signature"></span>x<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The x coordinate of the group container.</p> <p>You can adjust the group container itself by modifying its coordinates. This will have no impact on the x/y coordinates of its children, but it will update their worldTransform and on-screen position.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#x">Phaser.Group#x</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2178">line 2178</a> </dt> </dl> </dd> <dt> <h4 class="name " id="y"><span class="type-signature"></span>y<span class="type-signature"> :number</span></h4> </dt> <dd> <div class="description"> <p>The y coordinate of the group container.</p> <p>You can adjust the group container itself by modifying its coordinates. This will have no impact on the x/y coordinates of its children, but it will update their worldTransform and on-screen position.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#y">Phaser.Group#y</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2187">line 2187</a> </dt> </dl> </dd> <dt> <h4 class="name " id="z"><span class="type-signature"></span>z<span class="type-signature"> :integer</span></h4> </dt> <dd> <div class="description"> <p>The z-depth value of this object within its parent container/Group - the World is a Group as well. This value must be unique for each child in a Group.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#z">Phaser.Group#z</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-56">line 56</a> </dt> </dl> </dd> </dl> <h3 class="subsection-title">Methods</h3> <dl> <dt> <h4 class="name " id="add"><span class="type-signature"></span>add<span class="signature">(child, <span class="optional">silent</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#DisplayObject">DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Adds an existing object as the top child in this group.</p> <p>The child is automatically added to the top of the group and is displayed on top of every previous child.</p> <p>If Group.enableBody is set then a physics body will be created on the object, so long as one does not already exist.</p> <p>Use <a href="Phaser.Group.html#addAt">addAt</a> to control where a child is added. Use <a href="Phaser.Group.html#create">create</a> to create and add a new child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The display object to add as a child.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the child will not dispatch the <code>onAddedToGroup</code> event.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was added to the group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#add">Phaser.Group#add</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-271">line 271</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addAll"><span class="type-signature"></span>addAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Adds the amount to the given property on all children in this group.</p> <p><code>Group.addAll('x', 10)</code> will add 10 to the child.x value for each child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>property</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The property to increment, for example 'body.velocity.x' or 'angle'.</p></td> </tr> <tr> <td class="name"><code>amount</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The amount to increment the property by. If child.x = 10 then addAll('x', 40) would make child.x = 50.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is alive.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is visible.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#addAll">Phaser.Group#addAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1108">line 1108</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addAt"><span class="type-signature"></span>addAt<span class="signature">(child, <span class="optional">index</span>, <span class="optional">silent</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#DisplayObject">DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Adds an existing object to this group.</p> <p>The child is added to the group at the location specified by the index value, this allows you to control child ordering.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The display object to add as a child.</p></td> </tr> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>The index within the group to insert the child to.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the child will not dispatch the <code>onAddedToGroup</code> event.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was added to the group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#addAt">Phaser.Group#addAt</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-400">line 400</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"> &rarr; {<a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Adds a child to the container.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>The DisplayObject to add to the container</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was added.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#addChild">PIXI.DisplayObjectContainer#addChild</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-91">line 91</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addChildAt"><span class="type-signature"></span>addChildAt<span class="signature">(child, index)</span><span class="type-signature"> &rarr; {<a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>The child to add</p></td> </tr> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The index to place the child in</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was added.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#addChildAt">PIXI.DisplayObjectContainer#addChildAt</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-103">line 103</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addMultiple"><span class="type-signature"></span>addMultiple<span class="signature">(children, <span class="optional">silent</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#DisplayObject">DisplayObject</a>>|<a href="Phaser.Group.html">Phaser.Group</a>}</span></h4> </dt> <dd> <div class="description"> <p>Adds an array of existing Display Objects to this Group.</p> <p>The Display Objects are automatically added to the top of this Group, and will render on-top of everything already in this Group.</p> <p>As well as an array you can also pass another Group as the first argument. In this case all of the children from that Group will be removed from it and added into this Group.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>children</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="global.html#DisplayObject">DisplayObject</a>></span> | <span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>An array of display objects or a Phaser.Group. If a Group is given then <em>all</em> children will be moved from it.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the children will not dispatch the <code>onAddedToGroup</code> event.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Array.&lt;<a href="global.html#DisplayObject">DisplayObject</a>></span> | <span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span> - </div> <div class="returns-desc param-desc"> <p>The array of children or Group of children that were added to this Group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#addMultiple">Phaser.Group#addMultiple</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-369">line 369</a> </dt> </dl> </dd> <dt> <h4 class="name " id="addToHash"><span class="type-signature"></span>addToHash<span class="signature">(child)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Adds a child of this Group into the hash array. This call will return false if the child is not a child of this Group, or is already in the hash.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> </td> <td class="description last"><p>The display object to add to this Groups hash. Must be a member of this Group already and not present in the hash.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the child was successfully added to the hash, otherwise false.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#addToHash">Phaser.Group#addToHash</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-319">line 319</a> </dt> </dl> </dd> <dt> <h4 class="name " id="ascendingSortHandler"><span class="type-signature">&lt;internal> </span>ascendingSortHandler<span class="signature">(a, b)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>An internal helper function for the sort process.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>a</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The first object being sorted.</p></td> </tr> <tr> <td class="name"><code>b</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The second object being sorted.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#ascendingSortHandler">Phaser.Group#ascendingSortHandler</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1644">line 1644</a> </dt> </dl> </dd> <dt> <h4 class="name " id="bringToTop"><span class="type-signature"></span>bringToTop<span class="signature">(child)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Brings the given child to the top of this group so it renders above all other children.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to bring to the top of this group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child that was moved.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#bringToTop">Phaser.Group#bringToTop</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-656">line 656</a> </dt> </dl> </dd> <dt> <h4 class="name " id="callAll"><span class="type-signature"></span>callAll<span class="signature">(method, <span class="optional">context</span>, args)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Calls a function, specified by name, on all on children.</p> <p>The function is called for all children regardless if they are dead or alive (see callAllExists for different options). After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>method</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>Name of the function on the child to call. Deep property lookup is supported.</p></td> </tr> <tr> <td class="name"><code>context</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"><p>A string containing the context under which the method will be executed. Set to null to default to the child.</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;repeatable><br> </td> <td class="default"> </td> <td class="description last"><p>Additional parameters that will be passed to the method.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#callAll">Phaser.Group#callAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1263">line 1263</a> </dt> </dl> </dd> <dt> <h4 class="name " id="callAllExists"><span class="type-signature"></span>callAllExists<span class="signature">(callback, existsValue, parameter)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Calls a function, specified by name, on all children in the group who exist (or do not exist).</p> <p>After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>Name of the function on the children to call.</p></td> </tr> <tr> <td class="name"><code>existsValue</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> </td> <td class="description last"><p>Only children with exists=existsValue will be called.</p></td> </tr> <tr> <td class="name"><code>parameter</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;repeatable><br> </td> <td class="description last"><p>Additional parameters that will be passed to the callback.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#callAllExists">Phaser.Group#callAllExists</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1176">line 1176</a> </dt> </dl> </dd> <dt> <h4 class="name " id="callbackFromArray"><span class="type-signature">&lt;internal> </span>callbackFromArray<span class="signature">(child, callback, length)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Returns a reference to a function that exists on a child of the group based on the given callback array.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The object to inspect.</p></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="description last"><p>The array of function names.</p></td> </tr> <tr> <td class="name"><code>length</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="description last"><p>The size of the array (pre-calculated in callAll).</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#callbackFromArray">Phaser.Group#callbackFromArray</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1210">line 1210</a> </dt> </dl> </dd> <dt> <h4 class="name " id="checkAll"><span class="type-signature"></span>checkAll<span class="signature">(key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">force</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Quickly check that the same property across all children of this group is equal to the given value.</p> <p>This call doesn't descend down children, so if you have a Group inside of this group, the property will be checked on the group but not its children.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The property, as a string, to be set. For example: 'body.velocity.x'</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be checked.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with alive=true will be checked. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with visible=true will be checked. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be checked on the child regardless if it already exists or not. If true and the property doesn't exist, false will be returned.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#checkAll">Phaser.Group#checkAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1075">line 1075</a> </dt> </dl> </dd> <dt> <h4 class="name " id="checkProperty"><span class="type-signature"></span>checkProperty<span class="signature">(child, key, value, <span class="optional">force</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Checks a property for the given value on the child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The child to check the property value on.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>An array of strings that make up the property that will be set.</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be checked.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be checked on the child regardless if it already exists or not. If true and the property doesn't exist, false will be returned.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the property was was equal to value, false if not.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#checkProperty">Phaser.Group#checkProperty</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-939">line 939</a> </dt> </dl> </dd> <dt> <h4 class="name " id="countDead"><span class="type-signature"></span>countDead<span class="signature">()</span><span class="type-signature"> &rarr; {integer}</span></h4> </dt> <dd> <div class="description"> <p>Get the number of dead children in this group.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">integer</span> - </div> <div class="returns-desc param-desc"> <p>The number of children flagged as dead.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#countDead">Phaser.Group#countDead</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1866">line 1866</a> </dt> </dl> </dd> <dt> <h4 class="name " id="countLiving"><span class="type-signature"></span>countLiving<span class="signature">()</span><span class="type-signature"> &rarr; {integer}</span></h4> </dt> <dd> <div class="description"> <p>Get the number of living children in this group.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">integer</span> - </div> <div class="returns-desc param-desc"> <p>The number of children flagged as alive.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#countLiving">Phaser.Group#countLiving</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1854">line 1854</a> </dt> </dl> </dd> <dt> <h4 class="name " id="create"><span class="type-signature"></span>create<span class="signature">(x, y, key, <span class="optional">frame</span>, <span class="optional">exists</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#DisplayObject">DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Creates a new Phaser.Sprite object and adds it to the top of this group.</p> <p>Use <a href="Phaser.Group.html#classType">classType</a> to change the type of object creaded.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>x</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The x coordinate to display the newly created Sprite at. The value is in relation to the group.x point.</p></td> </tr> <tr> <td class="name"><code>y</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The y coordinate to display the newly created Sprite at. The value is in relation to the group.y point.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The Game.cache key of the image that this Sprite will use.</p></td> </tr> <tr> <td class="name"><code>frame</code></td> <td class="type"> <span class="param-type">integer</span> | <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>If the Sprite image contains multiple frames you can specify which one to use here.</p></td> </tr> <tr> <td class="name"><code>exists</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> true </td> <td class="description last"><p>The default exists state of the Sprite.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was created: will be a <a href="Phaser.Sprite.html">Phaser.Sprite</a> unless #classType has been changed.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#create">Phaser.Group#create</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-465">line 465</a> </dt> </dl> </dd> <dt> <h4 class="name " id="createMultiple"><span class="type-signature"></span>createMultiple<span class="signature">(quantity, key, <span class="optional">frame</span>, <span class="optional">exists</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Creates multiple Phaser.Sprite objects and adds them to the top of this group.</p> <p>Useful if you need to quickly generate a pool of identical sprites, such as bullets.</p> <p>By default the sprites will be set to not exist and will be positioned at 0, 0 (relative to the group.x/y). Use <a href="Phaser.Group.html#classType">classType</a> to change the type of object created.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>quantity</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The number of Sprites to create.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The Game.cache key of the image that this Sprite will use.</p></td> </tr> <tr> <td class="name"><code>frame</code></td> <td class="type"> <span class="param-type">integer</span> | <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>If the Sprite image contains multiple frames you can specify which one to use here.</p></td> </tr> <tr> <td class="name"><code>exists</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>The default exists state of the Sprite.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#createMultiple">Phaser.Group#createMultiple</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-511">line 511</a> </dt> </dl> </dd> <dt> <h4 class="name " id="customSort"><span class="type-signature"></span>customSort<span class="signature">(sortHandler, <span class="optional">context</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Sort the children in the group according to custom sort function.</p> <p>The <code>sortHandler</code> is provided the two parameters: the two children involved in the comparison (a and b). It should return -1 if <code>a &gt; b</code>, 1 if <code>a &lt; b</code> or 0 if <code>a === b</code>.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>sortHandler</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="description last"><p>The custom sort function.</p></td> </tr> <tr> <td class="name"><code>context</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The context in which the sortHandler is called.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#customSort">Phaser.Group#customSort</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1620">line 1620</a> </dt> </dl> </dd> <dt> <h4 class="name " id="debug"><span class="type-signature"></span>debug<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Debug.</p> </div> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-101">line 101</a> </dt> </dl> </dd> <dt> <h4 class="name " id="descendingSortHandler"><span class="type-signature">&lt;internal> </span>descendingSortHandler<span class="signature">(a, b)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>An internal helper function for the sort process.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>a</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The first object being sorted.</p></td> </tr> <tr> <td class="name"><code>b</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>The second object being sorted.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#descendingSortHandler">Phaser.Group#descendingSortHandler</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1676">line 1676</a> </dt> </dl> </dd> <dt> <h4 class="name " id="destroy"><span class="type-signature"></span>destroy<span class="signature">(<span class="optional">destroyChildren</span>, <span class="optional">soft</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Destroys this group.</p> <p>Removes all children, then removes this group from its parent and nulls references.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>destroyChildren</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> true </td> <td class="description last"><p>If true <code>destroy</code> will be invoked on each removed child.</p></td> </tr> <tr> <td class="name"><code>soft</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>A 'soft destroy' (set to true) doesn't remove this group from its parent or null the game reference. Set to false and it does.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#destroy">Phaser.Group#destroy</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2073">line 2073</a> </dt> </dl> </dd> <dt> <h4 class="name " id="divideAll"><span class="type-signature"></span>divideAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Divides the given property by the amount on all children in this group.</p> <p><code>Group.divideAll('x', 2)</code> will half the child.x value for each child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>property</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The property to divide, for example 'body.velocity.x' or 'angle'.</p></td> </tr> <tr> <td class="name"><code>amount</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The amount to divide the property by. If child.x = 100 then divideAll('x', 2) would make child.x = 50.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is alive.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is visible.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#divideAll">Phaser.Group#divideAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1159">line 1159</a> </dt> </dl> </dd> <dt> <h4 class="name " id="filter"><span class="type-signature"></span>filter<span class="signature">(predicate, <span class="optional">checkExists</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.ArraySet.html">Phaser.ArraySet</a>}</span></h4> </dt> <dd> <div class="description"> <p>Find children matching a certain predicate.</p> <p>For example:</p> <pre class="prettyprint source"><code>var healthyList = Group.filter(function(child, index, children) { return child.health > 10 ? true : false; }, true); healthyList.callAll('attack');</code></pre><p>Note: Currently this will skip any children which are Groups themselves.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>predicate</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The function that each child will be evaluated against. Each child of the group will be passed to it as its first parameter, the index as the second, and the entire child array as the third</p></td> </tr> <tr> <td class="name"><code>checkExists</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true, only existing can be selected; otherwise all children can be selected and will be passed to the predicate.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="Phaser.ArraySet.html">Phaser.ArraySet</a></span> - </div> <div class="returns-desc param-desc"> <p>Returns an array list containing all the children that the predicate returned true for</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#filter">Phaser.Group#filter</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1406">line 1406</a> </dt> </dl> </dd> <dt> <h4 class="name " id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback, callbackContext, <span class="optional">checkExists</span>, <span class="optional">args</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Call a function on each child in this group.</p> <p>Additional arguments for the callback can be specified after the <code>checkExists</code> parameter. For example,</p> <pre class="prettyprint source"><code>Group.forEach(awardBonusGold, this, true, 100, 500)</code></pre><p>would invoke <code>awardBonusGold</code> function with the parameters <code>(child, 100, 500)</code>.</p> <p>Note: This check will skip any children which are Groups themselves.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The function that will be called for each applicable child. The child will be passed as the first argument.</p></td> </tr> <tr> <td class="name"><code>callbackContext</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The context in which the function should be called (usually 'this').</p></td> </tr> <tr> <td class="name"><code>checkExists</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set only children matching for which <code>exists</code> is true will be passed to the callback, otherwise all children will be passed.</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;optional><br> &lt;repeatable><br> </td> <td class="default"> (none) </td> <td class="description last"><p>Additional arguments to pass to the callback function, after the child item.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#forEach">Phaser.Group#forEach</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1446">line 1446</a> </dt> </dl> </dd> <dt> <h4 class="name " id="forEachAlive"><span class="type-signature"></span>forEachAlive<span class="signature">(callback, callbackContext, <span class="optional">args</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Call a function on each alive child in this group.</p> <p>See <a href="Phaser.Group.html#forEach">forEach</a> for details.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The function that will be called for each applicable child. The child will be passed as the first argument.</p></td> </tr> <tr> <td class="name"><code>callbackContext</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The context in which the function should be called (usually 'this').</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;optional><br> &lt;repeatable><br> </td> <td class="default"> (none) </td> <td class="description last"><p>Additional arguments to pass to the callback function, after the child item.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#forEachAlive">Phaser.Group#forEachAlive</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1528">line 1528</a> </dt> </dl> </dd> <dt> <h4 class="name " id="forEachDead"><span class="type-signature"></span>forEachDead<span class="signature">(callback, callbackContext, <span class="optional">args</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Call a function on each dead child in this group.</p> <p>See <a href="Phaser.Group.html#forEach">forEach</a> for details.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The function that will be called for each applicable child. The child will be passed as the first argument.</p></td> </tr> <tr> <td class="name"><code>callbackContext</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The context in which the function should be called (usually 'this').</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;optional><br> &lt;repeatable><br> </td> <td class="default"> (none) </td> <td class="description last"><p>Additional arguments to pass to the callback function, after the child item.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#forEachDead">Phaser.Group#forEachDead</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1556">line 1556</a> </dt> </dl> </dd> <dt> <h4 class="name " id="forEachExists"><span class="type-signature"></span>forEachExists<span class="signature">(callback, callbackContext, <span class="optional">args</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Call a function on each existing child in this group.</p> <p>See <a href="Phaser.Group.html#forEach">forEach</a> for details.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The function that will be called for each applicable child. The child will be passed as the first argument.</p></td> </tr> <tr> <td class="name"><code>callbackContext</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The context in which the function should be called (usually 'this').</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> &lt;optional><br> &lt;repeatable><br> </td> <td class="default"> (none) </td> <td class="description last"><p>Additional arguments to pass to the callback function, after the child item.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#forEachExists">Phaser.Group#forEachExists</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1500">line 1500</a> </dt> </dl> </dd> <dt> <h4 class="name " id="generateTexture"><span class="type-signature"></span>generateTexture<span class="signature">(resolution, scaleMode, renderer)</span><span class="type-signature"> &rarr; {<a href="PIXI.Texture.html">PIXI.Texture</a>}</span></h4> </dt> <dd> <div class="description"> <p>Useful function that returns a texture of the displayObject object that can then be used to create sprites This can be quite useful if your displayObject is static / complicated and needs to be reused multiple times.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>resolution</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The resolution of the texture being generated</p></td> </tr> <tr> <td class="name"><code>scaleMode</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>See {{#crossLink &quot;PIXI/scaleModes:property&quot;}}PIXI.scaleModes{{/crossLink}} for possible values</p></td> </tr> <tr> <td class="name"><code>renderer</code></td> <td class="type"> <span class="param-type"><a href="PIXI.CanvasRenderer.html">PIXI.CanvasRenderer</a></span> | <span class="param-type"><a href="PIXI.WebGLRenderer.html">PIXI.WebGLRenderer</a></span> </td> <td class="description last"><p>The renderer used to generate the texture.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.Texture.html">PIXI.Texture</a></span> - </div> <div class="returns-desc param-desc"> <p>a texture of the graphics object</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#generateTexture">PIXI.DisplayObject#generateTexture</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-563">line 563</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getAt"><span class="type-signature"></span>getAt<span class="signature">(index)</span><span class="type-signature"> &rarr; {<a href="global.html#DisplayObject">DisplayObject</a>|integer}</span></h4> </dt> <dd> <div class="description"> <p>Returns the child found at the given index within this group.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="description last"><p>The index to return the child from.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> | <span class="param-type">integer</span> - </div> <div class="returns-desc param-desc"> <p>The child that was found at the given index, or -1 for an invalid index.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getAt">Phaser.Group#getAt</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-445">line 445</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getBottom"><span class="type-signature"></span>getBottom<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Returns the child at the bottom of this group.</p> <p>The bottom child the child being displayed (rendered) below every other child.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child at the bottom of the Group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getBottom">Phaser.Group#getBottom</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1837">line 1837</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getBounds"><span class="type-signature"></span>getBounds<span class="signature">()</span><span class="type-signature"> &rarr; {Rectangle}</span></h4> </dt> <dd> <div class="description"> <p>Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Rectangle</span> - </div> <div class="returns-desc param-desc"> <p>The rectangular bounding area</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#getBounds">PIXI.DisplayObjectContainer#getBounds</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-307">line 307</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getChildAt"><span class="type-signature"></span>getChildAt<span class="signature">(index)</span><span class="type-signature"> &rarr; {<a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Returns the child at the specified index</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The index to get the child from</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child at the given index, if any.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#getChildAt">PIXI.DisplayObjectContainer#getChildAt</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-194">line 194</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getChildIndex"><span class="type-signature"></span>getChildIndex<span class="signature">(child)</span><span class="type-signature"> &rarr; {Number}</span></h4> </dt> <dd> <div class="description"> <p>Returns the index position of a child DisplayObject instance</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>The DisplayObject instance to identify</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Number</span> - </div> <div class="returns-desc param-desc"> <p>The index position of the child display object to identify</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#getChildIndex">PIXI.DisplayObjectContainer#getChildIndex</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-159">line 159</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getFirstAlive"><span class="type-signature"></span>getFirstAlive<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Get the first child that is alive (<code>child.alive === true</code>).</p> <p>This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The first alive child, or null if none found.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getFirstAlive">Phaser.Group#getFirstAlive</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1792">line 1792</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getFirstDead"><span class="type-signature"></span>getFirstDead<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Get the first child that is dead (<code>child.alive === false</code>).</p> <p>This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The first dead child, or null if none found.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getFirstDead">Phaser.Group#getFirstDead</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1806">line 1806</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getFirstExists"><span class="type-signature"></span>getFirstExists<span class="signature">(<span class="optional">exists</span>)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Get the first display object that exists, or doesn't exist.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>exists</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> true </td> <td class="description last"><p>If true, find the first existing child; otherwise find the first non-existing child.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The first child, or null if none found.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getFirstExists">Phaser.Group#getFirstExists</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1774">line 1774</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getIndex"><span class="type-signature"></span>getIndex<span class="signature">(child)</span><span class="type-signature"> &rarr; {integer}</span></h4> </dt> <dd> <div class="description"> <p>Get the index position of the given child in this group, which should match the child's <code>z</code> property.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to get the index for.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">integer</span> - </div> <div class="returns-desc param-desc"> <p>The index of the child or -1 if it's not a member of this group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getIndex">Phaser.Group#getIndex</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-778">line 778</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getLocalBounds"><span class="type-signature"></span>getLocalBounds<span class="signature">()</span><span class="type-signature"> &rarr; {Rectangle}</span></h4> </dt> <dd> <div class="description"> <p>Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Rectangle</span> - </div> <div class="returns-desc param-desc"> <p>The rectangular bounding area</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#getLocalBounds">PIXI.DisplayObjectContainer#getLocalBounds</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-367">line 367</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getRandom"><span class="type-signature"></span>getRandom<span class="signature">(<span class="optional">startIndex</span>, <span class="optional">length</span>)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Returns a random child from the group.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>startIndex</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Offset from the front of the front of the group (lowest child).</p></td> </tr> <tr> <td class="name"><code>length</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> (to top) </td> <td class="description last"><p>Restriction on the number of values you want to randomly select from.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>A random child of this Group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getRandom">Phaser.Group#getRandom</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1878">line 1878</a> </dt> </dl> </dd> <dt> <h4 class="name " id="getTop"><span class="type-signature"></span>getTop<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Return the child at the top of this group.</p> <p>The top child is the child displayed (rendered) above every other child.</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child at the top of the Group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#getTop">Phaser.Group#getTop</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1820">line 1820</a> </dt> </dl> </dd> <dt> <h4 class="name " id="hasProperty"><span class="type-signature"></span>hasProperty<span class="signature">(child, key)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Checks if the child has the given property.</p> <p>Will scan up to 4 levels deep only.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to check for the existance of the property on.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">Array.&lt;string></span> </td> <td class="description last"><p>An array of strings that make up the property.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the child has the property, otherwise false.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#hasProperty">Phaser.Group#hasProperty</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-826">line 826</a> </dt> </dl> </dd> <dt> <h4 class="name " id="iterate"><span class="type-signature"></span>iterate<span class="signature">(key, value, returnType, <span class="optional">callback</span>, <span class="optional">callbackContext</span>, <span class="optional">args</span>)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Iterates over the children of the group performing one of several actions for matched children.</p> <p>A child is considered a match when it has a property, named <code>key</code>, whose value is equal to <code>value</code> according to a strict equality comparison.</p> <p>The result depends on the <code>returnType</code>:</p> <ul> <li><a href="Phaser.Group.html#.RETURN_TOTAL">RETURN_TOTAL</a>: The callback, if any, is applied to all matching children. The number of matched children is returned.</li> <li><a href="Phaser.Group.html#.RETURN_NONE">RETURN_NONE</a>: The callback, if any, is applied to all matching children. No value is returned.</li> <li><a href="Phaser.Group.html#.RETURN_CHILD">RETURN_CHILD</a>: The callback, if any, is applied to the <em>first</em> matching child and the <em>first</em> matched child is returned. If there is no matching child then null is returned.</li> </ul> <p>If <code>args</code> is specified it must be an array. The matched child will be assigned to the first element and the entire array will be applied to the callback function.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The child property to check, i.e. 'exists', 'alive', 'health'</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>A child matches if <code>child[key] === value</code> is true.</p></td> </tr> <tr> <td class="name"><code>returnType</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>How to iterate the children and what to return.</p></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"><p>Optional function that will be called on each matching child. The matched child is supplied as the first argument.</p></td> </tr> <tr> <td class="name"><code>callbackContext</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>The context in which the function should be called (usually 'this').</p></td> </tr> <tr> <td class="name"><code>args</code></td> <td class="type"> <span class="param-type">Array.&lt;any></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> (none) </td> <td class="description last"><p>The arguments supplied to to the callback; the first array index (argument) will be replaced with the matched child.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>Returns either an integer (for RETURN_TOTAL), the first matched child (for RETURN_CHILD), or null.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#iterate">Phaser.Group#iterate</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1701">line 1701</a> </dt> </dl> </dd> <dt> <h4 class="name " id="moveAll"><span class="type-signature"></span>moveAll<span class="signature">(group, <span class="optional">silent</span>)</span><span class="type-signature"> &rarr; {<a href="Phaser.Group.html">Phaser.Group</a>}</span></h4> </dt> <dd> <div class="description"> <p>Moves all children from this Group to the Group given.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>group</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The new Group to which the children will be moved to.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the children will not dispatch the <code>onAddedToGroup</code> event for the new Group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="Phaser.Group.html">Phaser.Group</a></span> - </div> <div class="returns-desc param-desc"> <p>The Group to which all the children were moved.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#moveAll">Phaser.Group#moveAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1948">line 1948</a> </dt> </dl> </dd> <dt> <h4 class="name " id="moveDown"><span class="type-signature"></span>moveDown<span class="signature">(child)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Moves the given child down one place in this group unless it's already at the bottom.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to move down in the group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child that was moved.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#moveDown">Phaser.Group#moveDown</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-718">line 718</a> </dt> </dl> </dd> <dt> <h4 class="name " id="moveUp"><span class="type-signature"></span>moveUp<span class="signature">(child)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Moves the given child up one place in this group unless it's already at the top.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to move up in the group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child that was moved.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#moveUp">Phaser.Group#moveUp</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-694">line 694</a> </dt> </dl> </dd> <dt> <h4 class="name " id="multiplyAll"><span class="type-signature"></span>multiplyAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Multiplies the given property by the amount on all children in this group.</p> <p><code>Group.multiplyAll('x', 2)</code> will x2 the child.x value for each child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>property</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The property to multiply, for example 'body.velocity.x' or 'angle'.</p></td> </tr> <tr> <td class="name"><code>amount</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The amount to multiply the property by. If child.x = 10 then multiplyAll('x', 2) would make child.x = 20.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is alive.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is visible.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#multiplyAll">Phaser.Group#multiplyAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1142">line 1142</a> </dt> </dl> </dd> <dt> <h4 class="name " id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Advances the group cursor to the next (higher) object in the group.</p> <p>If the cursor is at the end of the group (top child) it is moved the start of the group (bottom child).</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child the cursor now points to.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#next">Phaser.Group#next</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-582">line 582</a> </dt> </dl> </dd> <dt> <h4 class="name " id="postUpdate"><span class="type-signature">&lt;internal> </span>postUpdate<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The core postUpdate - as called by World.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#postUpdate">Phaser.Group#postUpdate</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1382">line 1382</a> </dt> </dl> </dd> <dt> <h4 class="name " id="preUpdate"><span class="type-signature">&lt;internal> </span>preUpdate<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The core preUpdate - as called by World.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#preUpdate">Phaser.Group#preUpdate</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1336">line 1336</a> </dt> </dl> </dd> <dt> <h4 class="name " id="previous"><span class="type-signature"></span>previous<span class="signature">()</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Moves the group cursor to the previous (lower) child in the group.</p> <p>If the cursor is at the start of the group (bottom child) it is moved to the end (top child).</p> </div> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child the cursor now points to.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#previous">Phaser.Group#previous</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-611">line 611</a> </dt> </dl> </dd> <dt> <h4 class="name " id="remove"><span class="type-signature"></span>remove<span class="signature">(child, <span class="optional">destroy</span>, <span class="optional">silent</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Removes the given child from this group.</p> <p>This will dispatch an <code>onRemovedFromGroup</code> event from the child (if it has one), and optionally destroy the child.</p> <p>If the group cursor was referring to the removed child it is updated to refer to the next child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The child to remove.</p></td> </tr> <tr> <td class="name"><code>destroy</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true <code>destroy</code> will be invoked on the removed child.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the the child will not dispatch the <code>onRemovedFromGroup</code> event.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>true if the child was removed from this group, otherwise false.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#remove">Phaser.Group#remove</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1900">line 1900</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeAll"><span class="type-signature"></span>removeAll<span class="signature">(<span class="optional">destroy</span>, <span class="optional">silent</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Removes all children from this group, but does not remove the group from its parent.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>destroy</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true <code>destroy</code> will be invoked on each removed child.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the children will not dispatch their <code>onRemovedFromGroup</code> events.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#removeAll">Phaser.Group#removeAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1977">line 1977</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeBetween"><span class="type-signature"></span>removeBetween<span class="signature">(startIndex, <span class="optional">endIndex</span>, <span class="optional">destroy</span>, <span class="optional">silent</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Removes all children from this group whose index falls beteen the given startIndex and endIndex values.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>startIndex</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The index to start removing children from.</p></td> </tr> <tr> <td class="name"><code>endIndex</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>The index to stop removing children at. Must be higher than startIndex. If undefined this method will remove all children between startIndex and the end of the group.</p></td> </tr> <tr> <td class="name"><code>destroy</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true <code>destroy</code> will be invoked on each removed child.</p></td> </tr> <tr> <td class="name"><code>silent</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If true the children will not dispatch their <code>onRemovedFromGroup</code> events.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#removeBetween">Phaser.Group#removeBetween</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-2018">line 2018</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeChild"><span class="type-signature"></span>removeChild<span class="signature">(child)</span><span class="type-signature"> &rarr; {<a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Removes a child from the container.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>The DisplayObject to remove</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was removed.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#removeChild">PIXI.DisplayObjectContainer#removeChild</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-211">line 211</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeChildAt"><span class="type-signature"></span>removeChildAt<span class="signature">(index)</span><span class="type-signature"> &rarr; {<a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a>}</span></h4> </dt> <dd> <div class="description"> <p>Removes a child from the specified index position.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The index to get the child from</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> - </div> <div class="returns-desc param-desc"> <p>The child that was removed.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#removeChildAt">PIXI.DisplayObjectContainer#removeChildAt</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-226">line 226</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeChildren"><span class="type-signature"></span>removeChildren<span class="signature">(beginIndex, endIndex)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Removes all children from this container that are within the begin and end indexes.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>beginIndex</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The beginning position. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>endIndex</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The ending position. Default value is size of the container.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#removeChildren">PIXI.DisplayObjectContainer#removeChildren</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-244">line 244</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeFromHash"><span class="type-signature"></span>removeFromHash<span class="signature">(child)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Removes a child of this Group from the hash array. This call will return false if the child is not in the hash.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="global.html#DisplayObject">DisplayObject</a></span> </td> <td class="description last"><p>The display object to remove from this Groups hash. Must be a member of this Group and in the hash.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the child was successfully removed from the hash, otherwise false.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#removeFromHash">Phaser.Group#removeFromHash</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-344">line 344</a> </dt> </dl> </dd> <dt> <h4 class="name " id="removeStageReference"><span class="type-signature"></span>removeStageReference<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Removes the current stage reference from the container and all of its children.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#removeStageReference">PIXI.DisplayObjectContainer#removeStageReference</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-407">line 407</a> </dt> </dl> </dd> <dt> <h4 class="name " id="replace"><span class="type-signature"></span>replace<span class="signature">(oldChild, newChild)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Replaces a child of this group with the given newChild. The newChild cannot be a member of this group.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>oldChild</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child in this group that will be replaced.</p></td> </tr> <tr> <td class="name"><code>newChild</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to be inserted into this group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>Returns the oldChild that was replaced within this group.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#replace">Phaser.Group#replace</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-791">line 791</a> </dt> </dl> </dd> <dt> <h4 class="name " id="resetCursor"><span class="type-signature"></span>resetCursor<span class="signature">(<span class="optional">index</span>)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Sets the group cursor to the first child in the group.</p> <p>If the optional index parameter is given it sets the cursor to the object at that index instead.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Set the cursor to point to a specific index.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child the cursor now points to.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#resetCursor">Phaser.Group#resetCursor</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-555">line 555</a> </dt> </dl> </dd> <dt> <h4 class="name " id="resize"><span class="type-signature"></span>resize<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Resize.</p> </div> <dl class="details"> <dt class="tag-source">Source - <a href="src_core_FlexLayer.js.html">core/FlexLayer.js</a>, <a href="src_core_FlexLayer.js.html#sunlight-1-line-93">line 93</a> </dt> </dl> </dd> <dt> <h4 class="name " id="reverse"><span class="type-signature"></span>reverse<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Reverses all children in this group.</p> <p>This operaation applies only to immediate children and does not propagate to subgroups.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#reverse">Phaser.Group#reverse</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-764">line 764</a> </dt> </dl> </dd> <dt> <h4 class="name " id="sendToBack"><span class="type-signature"></span>sendToBack<span class="signature">(child)</span><span class="type-signature"> &rarr; {any}</span></h4> </dt> <dd> <div class="description"> <p>Sends the given child to the bottom of this group so it renders below all other children.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The child to send to the bottom of this group.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">any</span> - </div> <div class="returns-desc param-desc"> <p>The child that was moved.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#sendToBack">Phaser.Group#sendToBack</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-675">line 675</a> </dt> </dl> </dd> <dt> <h4 class="name " id="set"><span class="type-signature"></span>set<span class="signature">(child, key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">operation</span>, <span class="optional">force</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Quickly set a property on a single child of this group to a new value.</p> <p>The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The child to set the property on.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The property, as a string, to be set. For example: 'body.velocity.x'</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be set.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then the child will only be updated if alive=true.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then the child will only be updated if visible=true.</p></td> </tr> <tr> <td class="name"><code>operation</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be set on the child regardless if it already exists or not. If false and the property doesn't exist, nothing will be set.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the property was set, false if not.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#set">Phaser.Group#set</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-968">line 968</a> </dt> </dl> </dd> <dt> <h4 class="name " id="setAll"><span class="type-signature"></span>setAll<span class="signature">(key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">operation</span>, <span class="optional">force</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Quickly set the same property across all children of this group to a new value.</p> <p>This call doesn't descend down children, so if you have a Group inside of this group, the property will be set on the group but not its children. If you need that ability please see <code>Group.setAllChildren</code>.</p> <p>The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The property, as a string, to be set. For example: 'body.velocity.x'</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be set.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with alive=true will be updated. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with visible=true will be updated. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>operation</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be set on the child regardless if it already exists or not. If false and the property doesn't exist, nothing will be set.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#setAll">Phaser.Group#setAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-999">line 999</a> </dt> </dl> </dd> <dt> <h4 class="name " id="setAllChildren"><span class="type-signature"></span>setAllChildren<span class="signature">(key, value, <span class="optional">checkAlive</span>, <span class="optional">checkVisible</span>, <span class="optional">operation</span>, <span class="optional">force</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Quickly set the same property across all children of this group, and any child Groups, to a new value.</p> <p>If this group contains other Groups then the same property is set across their children as well, iterating down until it reaches the bottom. Unlike with <code>setAll</code> the property is NOT set on child Groups itself.</p> <p>The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The property, as a string, to be set. For example: 'body.velocity.x'</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be set.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with alive=true will be updated. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If set then only children with visible=true will be updated. This includes any Groups that are children.</p></td> </tr> <tr> <td class="name"><code>operation</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be set on the child regardless if it already exists or not. If false and the property doesn't exist, nothing will be set.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#setAllChildren">Phaser.Group#setAllChildren</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1034">line 1034</a> </dt> </dl> </dd> <dt> <h4 class="name " id="setChildIndex"><span class="type-signature"></span>setChildIndex<span class="signature">(child, index)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Changes the position of an existing child in the display object container</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>The child DisplayObject instance for which you want to change the index number</p></td> </tr> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The resulting index number for the child display object</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#setChildIndex">PIXI.DisplayObjectContainer#setChildIndex</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-176">line 176</a> </dt> </dl> </dd> <dt> <h4 class="name " id="setProperty"><span class="type-signature"></span>setProperty<span class="signature">(child, key, value, <span class="optional">operation</span>, <span class="optional">force</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4> </dt> <dd> <div class="description"> <p>Sets a property to the given value on the child. The operation parameter controls how the value is set.</p> <p>The operations are:</p> <ul> <li>0: set the existing value to the given value; if force is <code>true</code> a new property will be created if needed</li> <li>1: will add the given value to the value already present.</li> <li>2: will subtract the given value from the value already present.</li> <li>3: will multiply the value already present by the given value.</li> <li>4: will divide the value already present by the given value.</li> </ul> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The child to set the property value on.</p></td> </tr> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>An array of strings that make up the property that will be set.</p></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The value that will be set.</p></td> </tr> <tr> <td class="name"><code>operation</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.</p></td> </tr> <tr> <td class="name"><code>force</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>If <code>force</code> is true then the property will be set on the child regardless if it already exists or not. If false and the property doesn't exist, nothing will be set.</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">boolean</span> - </div> <div class="returns-desc param-desc"> <p>True if the property was set, false if not.</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#setProperty">Phaser.Group#setProperty</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-861">line 861</a> </dt> </dl> </dd> <dt> <h4 class="name " id="setStageReference"><span class="type-signature"></span>setStageReference<span class="signature">(stage)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>stage</code></td> <td class="type"> <span class="param-type"><a href="PIXI.Stage.html">PIXI.Stage</a></span> </td> <td class="description last"><p>the stage that the container will have as its current stage reference</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#setStageReference">PIXI.DisplayObjectContainer#setStageReference</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-391">line 391</a> </dt> </dl> </dd> <dt> <h4 class="name " id="sort"><span class="type-signature"></span>sort<span class="signature">(<span class="optional">key</span>, <span class="optional">order</span>)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Sort the children in the group according to a particular key and ordering.</p> <p>Call this function to sort the group according to a particular key value and order. For example to depth sort Sprites for Zelda-style game you might call <code>group.sort('y', Phaser.Group.SORT_ASCENDING)</code> at the bottom of your <code>State.update()</code>.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>key</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 'z' </td> <td class="description last"><p>The name of the property to sort on. Defaults to the objects z-depth value.</p></td> </tr> <tr> <td class="name"><code>order</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> Phaser.Group.SORT_ASCENDING </td> <td class="description last"><p>Order ascending (<a href="Phaser.Group.html#.SORT_ASCENDING">SORT_ASCENDING</a>) or descending (<a href="Phaser.Group.html#.SORT_DESCENDING">SORT_DESCENDING</a>).</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#sort">Phaser.Group#sort</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1584">line 1584</a> </dt> </dl> </dd> <dt> <h4 class="name " id="subAll"><span class="type-signature"></span>subAll<span class="signature">(property, amount, checkAlive, checkVisible)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Subtracts the amount from the given property on all children in this group.</p> <p><code>Group.subAll('x', 10)</code> will minus 10 from the child.x value for each child.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>property</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The property to decrement, for example 'body.velocity.x' or 'angle'.</p></td> </tr> <tr> <td class="name"><code>amount</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The amount to subtract from the property. If child.x = 50 then subAll('x', 40) would make child.x = 10.</p></td> </tr> <tr> <td class="name"><code>checkAlive</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is alive.</p></td> </tr> <tr> <td class="name"><code>checkVisible</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"><p>If true the property will only be changed if the child is visible.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#subAll">Phaser.Group#subAll</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1125">line 1125</a> </dt> </dl> </dd> <dt> <h4 class="name " id="swap"><span class="type-signature"></span>swap<span class="signature">(child1, child2)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Swaps the position of two children in this group.</p> <p>Both children must be in this group, a child cannot be swapped with itself, and unparented children cannot be swapped.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child1</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The first child to swap.</p></td> </tr> <tr> <td class="name"><code>child2</code></td> <td class="type"> <span class="param-type">any</span> </td> <td class="description last"><p>The second child to swap.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#swap">Phaser.Group#swap</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-640">line 640</a> </dt> </dl> </dd> <dt> <h4 class="name " id="swapChildren"><span class="type-signature"></span>swapChildren<span class="signature">(child, child2)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Swaps the position of 2 Display Objects within this container.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>child</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>-</p></td> </tr> <tr> <td class="name"><code>child2</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="description last"><p>-</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObjectContainer.html#swapChildren">PIXI.DisplayObjectContainer#swapChildren</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObjectContainer.js.html">pixi/display/DisplayObjectContainer.js</a>, <a href="src_pixi_display_DisplayObjectContainer.js.html#sunlight-1-line-134">line 134</a> </dt> </dl> </dd> <dt> <h4 class="name " id="toGlobal"><span class="type-signature"></span>toGlobal<span class="signature">(position)</span><span class="type-signature"> &rarr; {Point}</span></h4> </dt> <dd> <div class="description"> <p>Calculates the global position of the display object</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type">Point</span> </td> <td class="description last"><p>The world origin to calculate from</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Point</span> - </div> <div class="returns-desc param-desc"> <p>A point object representing the position of this object</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#toGlobal">PIXI.DisplayObject#toGlobal</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-597">line 597</a> </dt> </dl> </dd> <dt> <h4 class="name " id="toLocal"><span class="type-signature"></span>toLocal<span class="signature">(position, <span class="optional">from</span>)</span><span class="type-signature"> &rarr; {Point}</span></h4> </dt> <dd> <div class="description"> <p>Calculates the local position of the display object relative to another point</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type">Point</span> </td> <td class="attributes"> </td> <td class="description last"><p>The world origin to calculate from</p></td> </tr> <tr> <td class="name"><code>from</code></td> <td class="type"> <span class="param-type"><a href="PIXI.DisplayObject.html">PIXI.DisplayObject</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The DisplayObject to calculate the global position from</p></td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="returns"> <div class="returns-type"> <span class="param-type">Point</span> - </div> <div class="returns-desc param-desc"> <p>A point object representing the position of this object</p> </div> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#toLocal">PIXI.DisplayObject#toLocal</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-611">line 611</a> </dt> </dl> </dd> <dt> <h4 class="name " id="update"><span class="type-signature">&lt;internal> </span>update<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>The core update - as called by World.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#update">Phaser.Group#update</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-1366">line 1366</a> </dt> </dl> </dd> <dt> <h4 class="name " id="updateCache"><span class="type-signature"></span>updateCache<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Generates and updates the cached sprite for this object.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="PIXI.DisplayObject.html#updateCache">PIXI.DisplayObject#updateCache</a> </li></dd> <dt class="tag-source">Source - <a href="src_pixi_display_DisplayObject.js.html">pixi/display/DisplayObject.js</a>, <a href="src_pixi_display_DisplayObject.js.html#sunlight-1-line-587">line 587</a> </dt> </dl> </dd> <dt> <h4 class="name " id="updateZ"><span class="type-signature">&lt;internal> </span>updateZ<span class="signature">()</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Internal method that re-applies all of the children's Z values.</p> <p>This must be called whenever children ordering is altered so that their <code>z</code> indices are correctly updated.</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#updateZ">Phaser.Group#updateZ</a> </li></dd> <dt class="important tag-deprecated">Internal:</dt> <dd class="tag-deprecated"><ul> <li>This member is <em>internal (protected)</em> and may be modified or removed in the future.</li> </ul></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-536">line 536</a> </dt> </dl> </dd> <dt> <h4 class="name " id="xy"><span class="type-signature"></span>xy<span class="signature">(index, x, y)</span><span class="type-signature"></span></h4> </dt> <dd> <div class="description"> <p>Positions the child found at the given index within this group to the given x and y coordinates.</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type">integer</span> </td> <td class="description last"><p>The index of the child in the group to set the position of.</p></td> </tr> <tr> <td class="name"><code>x</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The new x position of the child.</p></td> </tr> <tr> <td class="name"><code>y</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>The new y position of the child.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Phaser.Group.html#xy">Phaser.Group#xy</a> </li></dd> <dt class="tag-source">Source - <a href="src_core_Group.js.html">core/Group.js</a>, <a href="src_core_Group.js.html#sunlight-1-line-742">line 742</a> </dt> </dl> </dd> </dl> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Phaser Copyright © 2012-2015 Photon Storm Ltd. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Mon Aug 24 2015 15:36:49 GMT+0100 (GMT Daylight Time) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <div class="span3"> <div id="toc"></div> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { anchorName : function(i, heading, prefix) { return $(heading).attr("id") || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>
Zowrer/phaser
docs/Phaser.FlexLayer.html
HTML
mit
303,509
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.Zooming=n()}(this,function(){"use strict";function e(e,n,t){return M(e,n,t)}function n(){P=L.getBoundingClientRect(),L.hasAttribute("data-original")&&(O=L.getAttribute("src"),e(L,{width:P.width+"px",height:P.height+"px"}),L.setAttribute("src",L.getAttribute("data-original"))),L.offsetWidth,z={position:"relative",zIndex:999,cursor:""+v+(p.enableGrab?"grab":"zoom-out"),transition:Y+"\n "+p.transitionDuration+"\n "+p.transitionTimingFunction,transform:t()},G=e(L,z,!0)}function t(){var e=P.width/2,n=P.height/2,t={x:P.left+e,y:P.top+n},o={x:window.innerWidth/2,y:window.innerHeight/2},r={x:o.x-e,y:o.y-n},i=r.x/e,a=r.y/n;return A={x:o.x-t.x,y:o.y-t.y},D=p.scaleBase+Math.min(i,a),"translate3d("+A.x+"px, "+A.y+"px, 0) scale("+D+")"}function o(e){e.addEventListener("mousedown",s),e.addEventListener("mousemove",u),e.addEventListener("mouseup",l),e.addEventListener("touchstart",c),e.addEventListener("touchmove",d),e.addEventListener("touchend",f)}function r(e){e.removeEventListener("mousedown",s),e.removeEventListener("mousemove",u),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",c),e.removeEventListener("touchmove",d),e.removeEventListener("touchend",f)}function i(){var e=window.pageYOffset||(document.documentElement||E.parentNode||E).scrollTop;null===k&&(k=e);var n=k-e;Math.abs(n)>=p.scrollThreshold&&(k=null,W.close())}function a(e){var n=e.key||e.code;"Escape"!==n&&27!==e.keyCode||W.close()}function s(e){e.preventDefault(),R=setTimeout(function(){C=!0,W.grab(e.clientX,e.clientY,!0)},m)}function u(e){C&&W.grab(e.clientX,e.clientY)}function l(){clearTimeout(R),C=!1,W.release()}function c(e){e.preventDefault(),R=setTimeout(function(){C=!0;var n=e.touches[0];W.grab(n.clientX,n.clientY,!0)},m)}function d(e){if(C){var n=e.touches[0];W.grab(n.clientX,n.clientY)}}function f(){clearTimeout(R),C=!1,B?W.release():W.close()}var v="WebkitAppearance"in document.documentElement.style?"-webkit-":"",m=200,p={defaultZoomable:'img[data-action="zoom"]',enableGrab:!0,transitionDuration:".4s",transitionTimingFunction:"cubic-bezier(.4,0,0,1)",bgColor:"#fff",bgOpacity:1,scaleBase:1,scaleExtra:.5,scrollThreshold:40,onOpen:null,onClose:null,onGrab:null,onRelease:null,onBeforeOpen:null,onBeforeClose:null,onBeforeGrab:null,onBeforeRelease:null},b=function(e){var n={},t=["webkitTransition","transition","mozTransition"],o=["webkitTransform","transform","mozTransform"],r={transition:"transitionend",mozTransition:"transitionend",webkitTransition:"webkitTransitionEnd"};return t.some(function(t){if(void 0!==e.style[t])return n.transitionProp=t,n.transEndEvent=r[t],!0}),o.some(function(t){if(void 0!==e.style[t])return n.transformProp=t,n.transformCssProp=t.replace(/(.*)Transform/,"-$1-transform"),!0}),n},g=function(e,n){return function(t,o,r){var i=void 0;o.transition&&(i=o.transition,delete o.transition,o[e]=i),o.transform&&(i=o.transform,delete o.transform,o[n]=i);var a=t.style,s={};for(var u in o)r&&(s[u]=a[u]||""),a[u]=o[u];return s}},h=void 0,E=document.body,y=document.createElement("div"),L=void 0,w=void 0,x=!1,T=!1,C=!1,B=!1,k=null,G=void 0,z=void 0,A=void 0,D=void 0,O=void 0,P=void 0,R=void 0,F=b(y),Y=F.transformCssProp,I=F.transEndEvent,M=g(F.transitionProp,F.transformProp),W={listen:function(e){return"string"==typeof e?(document.querySelectorAll(e).forEach(function(e){return W.listen(e)}),h):(e.style.cursor=v+"zoom-in",e.addEventListener("click",function(n){n.preventDefault(),x?W.close():W.open(e)}),h)},config:function(n){if(!n)return p;for(var t in n)p[t]=n[t];return e(y,{backgroundColor:p.bgColor,transition:"opacity\n "+p.transitionDuration+"\n "+p.transitionTimingFunction}),h},open:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.onOpen;if(!(x||T||B)&&(L="string"==typeof e?document.querySelector(e):e,"IMG"===L.tagName)){p.onBeforeOpen&&p.onBeforeOpen(L),x=!0,T=!0,w=L.parentNode;var r=new Image;return r.onload=n(),r.src=L.getAttribute("src"),w.appendChild(y),setTimeout(function(){return y.style.opacity=p.bgOpacity},30),document.addEventListener("scroll",i),document.addEventListener("keydown",a),L.addEventListener(I,function e(){L.removeEventListener(I,e),p.enableGrab&&o(L),T=!1,t&&t(L)}),h}},close:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.onClose;if(x&&!T&&!B)return T=!0,p.onBeforeClose&&p.onBeforeClose(L),y.style.opacity=0,L.style.transform="",document.removeEventListener("scroll",i),document.removeEventListener("keydown",a),L.addEventListener(I,function t(){L.removeEventListener(I,t),p.enableGrab&&r(L),x=!1,T=!1,B=!1,e(L,G),w.removeChild(y),L.hasAttribute("data-original")&&L.setAttribute("src",O),n&&n(L)}),h},grab:function(n,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p.onGrab;if(x&&!T){B=!0,p.onBeforeGrab&&p.onBeforeGrab(L);var i=n-window.innerWidth/2,a=t-window.innerHeight/2,s=L.style.transform.replace(/translate3d\(.*?\)/i,"translate3d("+(A.x+i)+"px, "+(A.y+a)+"px, 0)").replace(/scale\([0-9|\.]*\)/i,"scale("+(D+p.scaleExtra)+")");e(L,{cursor:v+" grabbing",transition:Y+" "+(o?p.transitionDuration+" "+p.transitionTimingFunction:"ease"),transform:s}),L.addEventListener(I,function e(){L.removeEventListener(I,e),r&&r(L)})}},release:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.onRelease;if(x&&!T&&B)return p.onBeforeRelease&&p.onBeforeRelease(L),e(L,z),L.addEventListener(I,function e(){L.removeEventListener(I,e),B=!1,n&&n(L)}),h}};return e(y,{zIndex:998,background:p.bgColor,position:"fixed",top:0,left:0,right:0,bottom:0,opacity:0,transition:"opacity\n "+p.transitionDuration+"\n "+p.transitionTimingFunction}),y.addEventListener("click",W.close),document.addEventListener("DOMContentLoaded",W.listen(p.defaultZoomable)),W});
holtkamp/cdnjs
ajax/libs/zooming/0.5.2/zooming.min.js
JavaScript
mit
5,890
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Menubar - jQuery EasyUI Mobile Demo</title> <link rel="stylesheet" type="text/css" href="../../themes/metro/easyui.css"> <link rel="stylesheet" type="text/css" href="../../themes/mobile.css"> <link rel="stylesheet" type="text/css" href="../../themes/icon.css"> <script type="text/javascript" src="../../jquery.min.js"></script> <script type="text/javascript" src="../../jquery.easyui.min.js"></script> <script type="text/javascript" src="../../jquery.easyui.mobile.js"></script> </head> <body> <div class="easyui-navpanel"> <header> <div class="m-toolbar"> <div class="m-title"> <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,outline:true" style="width:70px">Home</a> <a href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-edit',outline:true" style="width:70px">Edit</a> <a href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-help',outline:true" style="width:75px">Help</a> <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,outline:true" style="width:70px">About</a> </div> </div> </header> </div> <div id="mm1" class="easyui-menu" style="width:150px;"> <div data-options="iconCls:'icon-undo'">Undo</div> <div data-options="iconCls:'icon-redo'">Redo</div> <div class="menu-sep"></div> <div>Cut</div> <div>Copy</div> <div>Paste</div> <div class="menu-sep"></div> <div>Toolbar</div> <div data-options="iconCls:'icon-remove'">Delete</div> <div>Select All</div> </div> <div id="mm2" style="width:100px;"> <div>Help</div> <div>Update</div> <div>About</div> </div> </body> </html>
boyyb/ci_3.0
Public/js/jquery-easyui-1.4.5/demo-mobile/menu/menubar.html
HTML
mit
1,886
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)); INSERT INTO "country" ("id", "name") VALUES ('AF', 'Afghanistan'); INSERT INTO "country" ("id", "name") VALUES ('AL', 'Albania'); INSERT INTO "country" ("id", "name") VALUES ('DZ', 'Algeria'); INSERT INTO "country" ("id", "name") VALUES ('AD', 'Andorra'); INSERT INTO "country" ("id", "name") VALUES ('AO', 'Angola'); INSERT INTO "country" ("id", "name") VALUES ('AI', 'Anguilla'); INSERT INTO "country" ("id", "name") VALUES ('AQ', 'Antartide'); INSERT INTO "country" ("id", "name") VALUES ('AG', 'Antigua e Barbuda'); INSERT INTO "country" ("id", "name") VALUES ('AN', 'Antille Olandesi'); INSERT INTO "country" ("id", "name") VALUES ('SA', 'Arabia Saudita'); INSERT INTO "country" ("id", "name") VALUES ('AR', 'Argentina'); INSERT INTO "country" ("id", "name") VALUES ('AM', 'Armenia'); INSERT INTO "country" ("id", "name") VALUES ('AW', 'Aruba'); INSERT INTO "country" ("id", "name") VALUES ('AU', 'Australia'); INSERT INTO "country" ("id", "name") VALUES ('AT', 'Austria'); INSERT INTO "country" ("id", "name") VALUES ('AZ', 'Azerbaigian'); INSERT INTO "country" ("id", "name") VALUES ('BS', 'Bahamas'); INSERT INTO "country" ("id", "name") VALUES ('BH', 'Bahrein'); INSERT INTO "country" ("id", "name") VALUES ('BD', 'Bangladesh'); INSERT INTO "country" ("id", "name") VALUES ('BB', 'Barbados'); INSERT INTO "country" ("id", "name") VALUES ('BE', 'Belgio'); INSERT INTO "country" ("id", "name") VALUES ('BZ', 'Belize'); INSERT INTO "country" ("id", "name") VALUES ('BJ', 'Benin'); INSERT INTO "country" ("id", "name") VALUES ('BM', 'Bermuda'); INSERT INTO "country" ("id", "name") VALUES ('BT', 'Bhutan'); INSERT INTO "country" ("id", "name") VALUES ('BY', 'Bielorussia'); INSERT INTO "country" ("id", "name") VALUES ('BO', 'Bolivia'); INSERT INTO "country" ("id", "name") VALUES ('BA', 'Bosnia Erzegovina'); INSERT INTO "country" ("id", "name") VALUES ('BW', 'Botswana'); INSERT INTO "country" ("id", "name") VALUES ('BR', 'Brasile'); INSERT INTO "country" ("id", "name") VALUES ('BN', 'Brunei'); INSERT INTO "country" ("id", "name") VALUES ('BG', 'Bulgaria'); INSERT INTO "country" ("id", "name") VALUES ('BF', 'Burkina Faso'); INSERT INTO "country" ("id", "name") VALUES ('BI', 'Burundi'); INSERT INTO "country" ("id", "name") VALUES ('KH', 'Cambogia'); INSERT INTO "country" ("id", "name") VALUES ('CM', 'Camerun'); INSERT INTO "country" ("id", "name") VALUES ('CA', 'Canada'); INSERT INTO "country" ("id", "name") VALUES ('CV', 'Capo Verde'); INSERT INTO "country" ("id", "name") VALUES ('TD', 'Ciad'); INSERT INTO "country" ("id", "name") VALUES ('CL', 'Cile'); INSERT INTO "country" ("id", "name") VALUES ('CN', 'Cina'); INSERT INTO "country" ("id", "name") VALUES ('CY', 'Cipro'); INSERT INTO "country" ("id", "name") VALUES ('CO', 'Colombia'); INSERT INTO "country" ("id", "name") VALUES ('KM', 'Comore'); INSERT INTO "country" ("id", "name") VALUES ('CG', 'Congo'); INSERT INTO "country" ("id", "name") VALUES ('KP', 'Corea del Nord'); INSERT INTO "country" ("id", "name") VALUES ('KR', 'Corea del Sud'); INSERT INTO "country" ("id", "name") VALUES ('CR', 'Costa Rica'); INSERT INTO "country" ("id", "name") VALUES ('CI', 'Costa d’Avorio'); INSERT INTO "country" ("id", "name") VALUES ('HR', 'Croazia'); INSERT INTO "country" ("id", "name") VALUES ('CU', 'Cuba'); INSERT INTO "country" ("id", "name") VALUES ('DK', 'Danimarca'); INSERT INTO "country" ("id", "name") VALUES ('DM', 'Dominica'); INSERT INTO "country" ("id", "name") VALUES ('EC', 'Ecuador'); INSERT INTO "country" ("id", "name") VALUES ('EG', 'Egitto'); INSERT INTO "country" ("id", "name") VALUES ('SV', 'El Salvador'); INSERT INTO "country" ("id", "name") VALUES ('AE', 'Emirati Arabi Uniti'); INSERT INTO "country" ("id", "name") VALUES ('ER', 'Eritrea'); INSERT INTO "country" ("id", "name") VALUES ('EE', 'Estonia'); INSERT INTO "country" ("id", "name") VALUES ('ET', 'Etiopia'); INSERT INTO "country" ("id", "name") VALUES ('RU', 'Federazione Russa'); INSERT INTO "country" ("id", "name") VALUES ('FJ', 'Figi'); INSERT INTO "country" ("id", "name") VALUES ('PH', 'Filippine'); INSERT INTO "country" ("id", "name") VALUES ('FI', 'Finlandia'); INSERT INTO "country" ("id", "name") VALUES ('FR', 'Francia'); INSERT INTO "country" ("id", "name") VALUES ('GA', 'Gabon'); INSERT INTO "country" ("id", "name") VALUES ('GM', 'Gambia'); INSERT INTO "country" ("id", "name") VALUES ('GE', 'Georgia'); INSERT INTO "country" ("id", "name") VALUES ('GS', 'Georgia del Sud e Isole Sandwich del Sud'); INSERT INTO "country" ("id", "name") VALUES ('DE', 'Germania'); INSERT INTO "country" ("id", "name") VALUES ('GH', 'Ghana'); INSERT INTO "country" ("id", "name") VALUES ('JM', 'Giamaica'); INSERT INTO "country" ("id", "name") VALUES ('JP', 'Giappone'); INSERT INTO "country" ("id", "name") VALUES ('GI', 'Gibilterra'); INSERT INTO "country" ("id", "name") VALUES ('DJ', 'Gibuti'); INSERT INTO "country" ("id", "name") VALUES ('JO', 'Giordania'); INSERT INTO "country" ("id", "name") VALUES ('GR', 'Grecia'); INSERT INTO "country" ("id", "name") VALUES ('GD', 'Grenada'); INSERT INTO "country" ("id", "name") VALUES ('GL', 'Groenlandia'); INSERT INTO "country" ("id", "name") VALUES ('GP', 'Guadalupa'); INSERT INTO "country" ("id", "name") VALUES ('GU', 'Guam'); INSERT INTO "country" ("id", "name") VALUES ('GT', 'Guatemala'); INSERT INTO "country" ("id", "name") VALUES ('GG', 'Guernsey'); INSERT INTO "country" ("id", "name") VALUES ('GF', 'Guiana Francese'); INSERT INTO "country" ("id", "name") VALUES ('GN', 'Guinea'); INSERT INTO "country" ("id", "name") VALUES ('GQ', 'Guinea Equatoriale'); INSERT INTO "country" ("id", "name") VALUES ('GW', 'Guinea-Bissau'); INSERT INTO "country" ("id", "name") VALUES ('GY', 'Guyana'); INSERT INTO "country" ("id", "name") VALUES ('HT', 'Haiti'); INSERT INTO "country" ("id", "name") VALUES ('HN', 'Honduras'); INSERT INTO "country" ("id", "name") VALUES ('IN', 'India'); INSERT INTO "country" ("id", "name") VALUES ('ID', 'Indonesia'); INSERT INTO "country" ("id", "name") VALUES ('IR', 'Iran'); INSERT INTO "country" ("id", "name") VALUES ('IQ', 'Iraq'); INSERT INTO "country" ("id", "name") VALUES ('IE', 'Irlanda'); INSERT INTO "country" ("id", "name") VALUES ('IS', 'Islanda'); INSERT INTO "country" ("id", "name") VALUES ('BV', 'Isola Bouvet'); INSERT INTO "country" ("id", "name") VALUES ('NF', 'Isola Norfolk'); INSERT INTO "country" ("id", "name") VALUES ('CX', 'Isola di Christmas'); INSERT INTO "country" ("id", "name") VALUES ('IM', 'Isola di Man'); INSERT INTO "country" ("id", "name") VALUES ('AX', 'Isole Aland'); INSERT INTO "country" ("id", "name") VALUES ('KY', 'Isole Cayman'); INSERT INTO "country" ("id", "name") VALUES ('CC', 'Isole Cocos'); INSERT INTO "country" ("id", "name") VALUES ('CK', 'Isole Cook'); INSERT INTO "country" ("id", "name") VALUES ('FK', 'Isole Falkland'); INSERT INTO "country" ("id", "name") VALUES ('FO', 'Isole Faroe'); INSERT INTO "country" ("id", "name") VALUES ('HM', 'Isole Heard ed Isole McDonald'); INSERT INTO "country" ("id", "name") VALUES ('MP', 'Isole Marianne Settentrionali'); INSERT INTO "country" ("id", "name") VALUES ('MH', 'Isole Marshall'); INSERT INTO "country" ("id", "name") VALUES ('UM', 'Isole Minori lontane dagli Stati Uniti'); INSERT INTO "country" ("id", "name") VALUES ('SB', 'Isole Solomon'); INSERT INTO "country" ("id", "name") VALUES ('TC', 'Isole Turks e Caicos'); INSERT INTO "country" ("id", "name") VALUES ('VI', 'Isole Vergini Americane'); INSERT INTO "country" ("id", "name") VALUES ('VG', 'Isole Vergini Britanniche'); INSERT INTO "country" ("id", "name") VALUES ('IL', 'Israele'); INSERT INTO "country" ("id", "name") VALUES ('IT', 'Italia'); INSERT INTO "country" ("id", "name") VALUES ('JE', 'Jersey'); INSERT INTO "country" ("id", "name") VALUES ('KZ', 'Kazakistan'); INSERT INTO "country" ("id", "name") VALUES ('KE', 'Kenya'); INSERT INTO "country" ("id", "name") VALUES ('KG', 'Kirghizistan'); INSERT INTO "country" ("id", "name") VALUES ('KI', 'Kiribati'); INSERT INTO "country" ("id", "name") VALUES ('KW', 'Kuwait'); INSERT INTO "country" ("id", "name") VALUES ('LA', 'Laos'); INSERT INTO "country" ("id", "name") VALUES ('LS', 'Lesotho'); INSERT INTO "country" ("id", "name") VALUES ('LV', 'Lettonia'); INSERT INTO "country" ("id", "name") VALUES ('LB', 'Libano'); INSERT INTO "country" ("id", "name") VALUES ('LR', 'Liberia'); INSERT INTO "country" ("id", "name") VALUES ('LY', 'Libia'); INSERT INTO "country" ("id", "name") VALUES ('LI', 'Liechtenstein'); INSERT INTO "country" ("id", "name") VALUES ('LT', 'Lituania'); INSERT INTO "country" ("id", "name") VALUES ('LU', 'Lussemburgo'); INSERT INTO "country" ("id", "name") VALUES ('MG', 'Madagascar'); INSERT INTO "country" ("id", "name") VALUES ('MW', 'Malawi'); INSERT INTO "country" ("id", "name") VALUES ('MV', 'Maldive'); INSERT INTO "country" ("id", "name") VALUES ('MY', 'Malesia'); INSERT INTO "country" ("id", "name") VALUES ('ML', 'Mali'); INSERT INTO "country" ("id", "name") VALUES ('MT', 'Malta'); INSERT INTO "country" ("id", "name") VALUES ('MA', 'Marocco'); INSERT INTO "country" ("id", "name") VALUES ('MQ', 'Martinica'); INSERT INTO "country" ("id", "name") VALUES ('MR', 'Mauritania'); INSERT INTO "country" ("id", "name") VALUES ('MU', 'Mauritius'); INSERT INTO "country" ("id", "name") VALUES ('YT', 'Mayotte'); INSERT INTO "country" ("id", "name") VALUES ('MX', 'Messico'); INSERT INTO "country" ("id", "name") VALUES ('FM', 'Micronesia'); INSERT INTO "country" ("id", "name") VALUES ('MD', 'Moldavia'); INSERT INTO "country" ("id", "name") VALUES ('MC', 'Monaco'); INSERT INTO "country" ("id", "name") VALUES ('MN', 'Mongolia'); INSERT INTO "country" ("id", "name") VALUES ('ME', 'Montenegro'); INSERT INTO "country" ("id", "name") VALUES ('MS', 'Montserrat'); INSERT INTO "country" ("id", "name") VALUES ('MZ', 'Mozambico'); INSERT INTO "country" ("id", "name") VALUES ('MM', 'Myanmar'); INSERT INTO "country" ("id", "name") VALUES ('NA', 'Namibia'); INSERT INTO "country" ("id", "name") VALUES ('NR', 'Nauru'); INSERT INTO "country" ("id", "name") VALUES ('NP', 'Nepal'); INSERT INTO "country" ("id", "name") VALUES ('NI', 'Nicaragua'); INSERT INTO "country" ("id", "name") VALUES ('NE', 'Niger'); INSERT INTO "country" ("id", "name") VALUES ('NG', 'Nigeria'); INSERT INTO "country" ("id", "name") VALUES ('NU', 'Niue'); INSERT INTO "country" ("id", "name") VALUES ('NO', 'Norvegia'); INSERT INTO "country" ("id", "name") VALUES ('NC', 'Nuova Caledonia'); INSERT INTO "country" ("id", "name") VALUES ('NZ', 'Nuova Zelanda'); INSERT INTO "country" ("id", "name") VALUES ('OM', 'Oman'); INSERT INTO "country" ("id", "name") VALUES ('NL', 'Paesi Bassi'); INSERT INTO "country" ("id", "name") VALUES ('PK', 'Pakistan'); INSERT INTO "country" ("id", "name") VALUES ('PW', 'Palau'); INSERT INTO "country" ("id", "name") VALUES ('PS', 'Palestina'); INSERT INTO "country" ("id", "name") VALUES ('PA', 'Panama'); INSERT INTO "country" ("id", "name") VALUES ('PG', 'Papua Nuova Guinea'); INSERT INTO "country" ("id", "name") VALUES ('PY', 'Paraguay'); INSERT INTO "country" ("id", "name") VALUES ('PE', 'Perù'); INSERT INTO "country" ("id", "name") VALUES ('PN', 'Pitcairn'); INSERT INTO "country" ("id", "name") VALUES ('PF', 'Polinesia Francese'); INSERT INTO "country" ("id", "name") VALUES ('PL', 'Polonia'); INSERT INTO "country" ("id", "name") VALUES ('PT', 'Portogallo'); INSERT INTO "country" ("id", "name") VALUES ('PR', 'Portorico'); INSERT INTO "country" ("id", "name") VALUES ('QA', 'Qatar'); INSERT INTO "country" ("id", "name") VALUES ('HK', 'Regione Amministrativa Speciale di Hong Kong della Repubblica Popolare Cinese'); INSERT INTO "country" ("id", "name") VALUES ('MO', 'Regione Amministrativa Speciale di Macao della Repubblica Popolare Cinese'); INSERT INTO "country" ("id", "name") VALUES ('GB', 'Regno Unito'); INSERT INTO "country" ("id", "name") VALUES ('CZ', 'Repubblica Ceca'); INSERT INTO "country" ("id", "name") VALUES ('CF', 'Repubblica Centrafricana'); INSERT INTO "country" ("id", "name") VALUES ('CD', 'Repubblica Democratica del Congo'); INSERT INTO "country" ("id", "name") VALUES ('DO', 'Repubblica Dominicana'); INSERT INTO "country" ("id", "name") VALUES ('MK', 'Repubblica di Macedonia'); INSERT INTO "country" ("id", "name") VALUES ('RO', 'Romania'); INSERT INTO "country" ("id", "name") VALUES ('RW', 'Ruanda'); INSERT INTO "country" ("id", "name") VALUES ('RE', 'Réunion'); INSERT INTO "country" ("id", "name") VALUES ('EH', 'Sahara Occidentale'); INSERT INTO "country" ("id", "name") VALUES ('KN', 'Saint Kitts e Nevis'); INSERT INTO "country" ("id", "name") VALUES ('LC', 'Saint Lucia'); INSERT INTO "country" ("id", "name") VALUES ('PM', 'Saint Pierre e Miquelon'); INSERT INTO "country" ("id", "name") VALUES ('VC', 'Saint Vincent e Grenadines'); INSERT INTO "country" ("id", "name") VALUES ('WS', 'Samoa'); INSERT INTO "country" ("id", "name") VALUES ('AS', 'Samoa Americane'); INSERT INTO "country" ("id", "name") VALUES ('BL', 'San Bartolomeo'); INSERT INTO "country" ("id", "name") VALUES ('SM', 'San Marino'); INSERT INTO "country" ("id", "name") VALUES ('SH', 'Sant’Elena'); INSERT INTO "country" ("id", "name") VALUES ('ST', 'Sao Tomé e Príncipe'); INSERT INTO "country" ("id", "name") VALUES ('SN', 'Senegal'); INSERT INTO "country" ("id", "name") VALUES ('RS', 'Serbia'); INSERT INTO "country" ("id", "name") VALUES ('CS', 'Serbia e Montenegro'); INSERT INTO "country" ("id", "name") VALUES ('SC', 'Seychelles'); INSERT INTO "country" ("id", "name") VALUES ('SL', 'Sierra Leone'); INSERT INTO "country" ("id", "name") VALUES ('SG', 'Singapore'); INSERT INTO "country" ("id", "name") VALUES ('SY', 'Siria'); INSERT INTO "country" ("id", "name") VALUES ('SK', 'Slovacchia'); INSERT INTO "country" ("id", "name") VALUES ('SI', 'Slovenia'); INSERT INTO "country" ("id", "name") VALUES ('SO', 'Somalia'); INSERT INTO "country" ("id", "name") VALUES ('ES', 'Spagna'); INSERT INTO "country" ("id", "name") VALUES ('LK', 'Sri Lanka'); INSERT INTO "country" ("id", "name") VALUES ('US', 'Stati Uniti'); INSERT INTO "country" ("id", "name") VALUES ('ZA', 'Sudafrica'); INSERT INTO "country" ("id", "name") VALUES ('SD', 'Sudan'); INSERT INTO "country" ("id", "name") VALUES ('SR', 'Suriname'); INSERT INTO "country" ("id", "name") VALUES ('SJ', 'Svalbard e Jan Mayen'); INSERT INTO "country" ("id", "name") VALUES ('SE', 'Svezia'); INSERT INTO "country" ("id", "name") VALUES ('CH', 'Svizzera'); INSERT INTO "country" ("id", "name") VALUES ('SZ', 'Swaziland'); INSERT INTO "country" ("id", "name") VALUES ('TJ', 'Tagikistan'); INSERT INTO "country" ("id", "name") VALUES ('TH', 'Tailandia'); INSERT INTO "country" ("id", "name") VALUES ('TW', 'Taiwan'); INSERT INTO "country" ("id", "name") VALUES ('TZ', 'Tanzania'); INSERT INTO "country" ("id", "name") VALUES ('TF', 'Territori australi francesi'); INSERT INTO "country" ("id", "name") VALUES ('IO', 'Territorio Britannico dell’Oceano Indiano'); INSERT INTO "country" ("id", "name") VALUES ('TL', 'Timor Est'); INSERT INTO "country" ("id", "name") VALUES ('TG', 'Togo'); INSERT INTO "country" ("id", "name") VALUES ('TK', 'Tokelau'); INSERT INTO "country" ("id", "name") VALUES ('TO', 'Tonga'); INSERT INTO "country" ("id", "name") VALUES ('TT', 'Trinidad e Tobago'); INSERT INTO "country" ("id", "name") VALUES ('TN', 'Tunisia'); INSERT INTO "country" ("id", "name") VALUES ('TR', 'Turchia'); INSERT INTO "country" ("id", "name") VALUES ('TM', 'Turkmenistan'); INSERT INTO "country" ("id", "name") VALUES ('TV', 'Tuvalu'); INSERT INTO "country" ("id", "name") VALUES ('UA', 'Ucraina'); INSERT INTO "country" ("id", "name") VALUES ('UG', 'Uganda'); INSERT INTO "country" ("id", "name") VALUES ('HU', 'Ungheria'); INSERT INTO "country" ("id", "name") VALUES ('UY', 'Uruguay'); INSERT INTO "country" ("id", "name") VALUES ('UZ', 'Uzbekistan'); INSERT INTO "country" ("id", "name") VALUES ('VU', 'Vanuatu'); INSERT INTO "country" ("id", "name") VALUES ('VA', 'Vaticano'); INSERT INTO "country" ("id", "name") VALUES ('VE', 'Venezuela'); INSERT INTO "country" ("id", "name") VALUES ('VN', 'Vietnam'); INSERT INTO "country" ("id", "name") VALUES ('WF', 'Wallis e Futuna'); INSERT INTO "country" ("id", "name") VALUES ('YE', 'Yemen'); INSERT INTO "country" ("id", "name") VALUES ('ZM', 'Zambia'); INSERT INTO "country" ("id", "name") VALUES ('ZW', 'Zimbabwe'); INSERT INTO "country" ("id", "name") VALUES ('ZZ', 'regione non valida o sconosciuta');
firexam/country-list
country/cldr/it/country.sqlite.sql
SQL
mit
16,526
define( "dojox/grid/enhanced/nls/da/Filter", ({ "clearFilterDialogTitle": "Ryd filter", "filterDefDialogTitle": "Filter", "ruleTitleTemplate": "Regel ${0}", "conditionEqual": "er lig med", "conditionNotEqual": "er ikke lig med", "conditionLess": "er mindre end", "conditionLessEqual": "mindre end eller lig med", "conditionLarger": "er større end", "conditionLargerEqual": "større end eller lig med", "conditionContains": "indeholder", "conditionIs": "er", "conditionStartsWith": "begynder med", "conditionEndWith": "slutter med", "conditionNotContain": "indeholder ikke", "conditionIsNot": "er ikke", "conditionNotStartWith": "begynder ikke med", "conditionNotEndWith": "slutter ikke med", "conditionBefore": "før", "conditionAfter": "efter", "conditionRange": "område", "conditionIsEmpty": "er tom", "all": "alle", "any": "nogle af", "relationAll": "alle regler", "waiRelAll": "Matcher alle følgende regler:", "relationAny": "vilkårlige regler", "waiRelAny": "Matcher en eller flere af følgende regler:", "relationMsgFront": "Match:", "relationMsgTail": "", "and": "og", "or": "eller", "addRuleButton": "Tilføj regel", "waiAddRuleButton": "Tilføj en ny regel", "removeRuleButton": "Fjern regel", "waiRemoveRuleButtonTemplate": "Fjern reglen ${0}", "cancelButton": "Annullér", "waiCancelButton": "Annullér denne dialogboks", "clearButton": "Ryd", "waiClearButton": "Ryd filteret", "filterButton": "Filter", "waiFilterButton": "Send filteret", "columnSelectLabel": "Kolonne", "waiColumnSelectTemplate": "Kolonne for reglen ${0}", "conditionSelectLabel": "Betingelse", "waiConditionSelectTemplate": "Betingelse for reglen ${0}", "valueBoxLabel": "Værdi", "waiValueBoxTemplate": "Angiv værdi for filtrering for regel ${0}", "rangeTo": "til", "rangeTemplate": "fra ${0} til ${1}", "statusTipHeaderColumn": "Kolonne", "statusTipHeaderCondition": "Regler", "statusTipTitle": "Filterlinje", "statusTipMsg": "Klik på filterlinjen for at filtrere efter værdier i ${0}.", "anycolumn": "vilkårlig kolonne", "statusTipTitleNoFilter": "Filterlinje", "statusTipTitleHasFilter": "Filter", "statusTipRelAny": "Matcher en hvilken som helst regel.", "statusTipRelAll": "Matcher alle regler.", "defaultItemsName": "elementer", "filterBarMsgHasFilterTemplate": "${0} af ${1} ${2} vist.", "filterBarMsgNoFilterTemplate": "Intet filter anvendt", "filterBarDefButton": "Definér filter", "waiFilterBarDefButton": "Filtrér tabellen", "a11yFilterBarDefButton": "Filtrér...", "filterBarClearButton": "Ryd filter", "waiFilterBarClearButton": "Ryd filteret", "closeFilterBarBtn": "Luk filterlinje", "clearFilterMsg": "Denne funktion fjerner filteret og viser alle tilgængelige records.", "anyColumnOption": "Vilkårlig kolonne", "trueLabel": "Sand", "falseLabel": "Falsk" }) );
dmachi/p3_web
public/js/release/dojox/grid/enhanced/nls/da/Filter.js
JavaScript
mit
2,841
/*! PNotify dialog module (for jQuery Dirty Forms) | v2.0.0-beta00007 | github.com/snikch/jquery.dirtyforms (c) 2015 Shad Storhaug License MIT */ !function(t,e,i,o){var s,n,a="function"!=typeof PNotify;t.DirtyForms.dialog={title:"Are you sure you want to do that?","class":"dirty-dialog",proceedButtonText:"Leave This Page",stayButtonText:"Stay Here",styling:"bootstrap3",width:"330",open:function(r,d,c){var l=t.extend(!0,{},{title:this.title,hide:!1,styling:this.styling,width:this.width,confirm:{confirm:!0,align:"center",buttons:[{text:this.proceedButtonText,addClass:"dirty-proceed "+c},{text:this.stayButtonText,addClass:"dirty-stay "+c}]},history:{history:!1},addclass:"stack-modal "+this["class"],stack:{dir1:"down",dir2:"right",modal:!0},buttons:{closer:!1,sticker:!1},closer:!1,sticker:!1,animate:this.animate===o?o:this.animate,text:a?'<span class="'+this["class"]+'"><p>'+d+'</p><span style="display:block;text-align:center;"><button type="button" class="btn btn-default dirty-proceed '+c+'">'+this.proceedButtonText+'</button> <button type="button" class="btn btn-default dirty-stay '+c+'">'+this.stayButtonText+"</button></span></span>":d,before_open:function(i){a||i.get().css({top:t(e).height()/2-i.get().height()/2,left:t(e).width()/2-i.get().width()/2}),s?s.fadeIn("fast"):s=t("<div />",{"class":"ui-widget-overlay",css:{display:"none",position:"fixed",top:"0",bottom:"0",right:"0",left:"0"}}).appendTo("body").fadeIn("fast")}});if(n=a?t.pnotify(l):new PNotify(l),r.bindEnterKey=!0,r.proceedSelector="."+this["class"]+" .dirty-proceed",r.staySelector="."+this["class"]+" .dirty-stay,.ui-widget-overlay",r.isDF1){var y=function(t){return function(e){return"keydown"!==e.type||"keydown"===e.type&&(27==e.which||13==e.which)?(n.remove(),s&&s.fadeOut("fast"),t(e),!1):void 0}},u=t.DirtyForms.decidingCancel;t(i).keydown(y(u)),t(r.staySelector).click(y(u)),t(r.proceedSelector).click(y(t.DirtyForms.decidingContinue))}},close:function(){n.remove(),s&&s.fadeOut("fast")},fire:function(e,i){this.title=i,this.open({isDF1:!0},e,t.DirtyForms.ignoreClass)},bind:function(){},stash:function(){return!1},refire:function(){return!1},selector:"no-op"}}(jQuery,window,document); //# sourceMappingURL=jquery.dirtyforms.dialogs.pnotify.min.js.map
maruilian11/cdnjs
ajax/libs/jquery.dirtyforms.dialogs.pnotify/2.0.0-beta00007/jquery.dirtyforms.dialogs.pnotify.min.js
JavaScript
mit
2,248
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Source: src/pixi/display/DisplayObjectContainer.js</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/default.css"> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser API</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> <li class="class-depth-0"> <a href="PIXI.html">PIXI</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArraySet.html">ArraySet</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayUtils.html">ArrayUtils</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Angle.html">Angle</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Animation.html">Animation</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.AutoCull.html">AutoCull</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Bounds.html">Bounds</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.BringToTop.html">BringToTop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Core.html">Core</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Crop.html">Crop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Delta.html">Delta</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Destroy.html">Destroy</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Health.html">Health</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InCamera.html">InCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InputEnabled.html">InputEnabled</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InWorld.html">InWorld</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LifeSpan.html">LifeSpan</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LoadTexture.html">LoadTexture</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Overlap.html">Overlap</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Reset.html">Reset</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Smoothed.html">Smoothed</a> </li> <li class="class-depth-1"> <a href="Phaser.Create.html">Create</a> </li> <li class="class-depth-1"> <a href="Phaser.Creature.html">Creature</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.DeviceButton.html">DeviceButton</a> </li> <li class="class-depth-1"> <a href="Phaser.DOM.html">DOM</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.ImageCollection.html">ImageCollection</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Matrix.html">Matrix</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.TilemapCollision.html">TilemapCollision</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.RoundedRectangle.html">RoundedRectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenData.html">TweenData</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.Video.html">Video</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> <li class="class-depth-1"> <a href="PIXI.AbstractFilter.html">AbstractFilter</a> </li> <li class="class-depth-1"> <a href="PIXI.BaseTexture.html">BaseTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasBuffer.html">CanvasBuffer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasGraphics.html">CanvasGraphics</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasPool.html">CanvasPool</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasRenderer.html">CanvasRenderer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasTinter.html">CanvasTinter</a> </li> <li class="class-depth-1"> <a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObject.html">DisplayObject</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a> </li> <li class="class-depth-1"> <a href="PIXI.Event.html">Event</a> </li> <li class="class-depth-1"> <a href="PIXI.EventTarget.html">EventTarget</a> </li> <li class="class-depth-1"> <a href="PIXI.FilterTexture.html">FilterTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="PIXI.GraphicsData.html">GraphicsData</a> </li> <li class="class-depth-1"> <a href="PIXI.PIXI.html">PIXI</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiFastShader.html">PixiFastShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiShader.html">PixiShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PolyK.html">PolyK</a> </li> <li class="class-depth-1"> <a href="PIXI.PrimitiveShader.html">PrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="PIXI.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="PIXI.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="PIXI.Strip.html">Strip</a> </li> <li class="class-depth-1"> <a href="PIXI.StripShader.html">StripShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Texture.html">Texture</a> </li> <li class="class-depth-1"> <a href="PIXI.TilingSprite.html">TilingSprite</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLRenderer.html">WebGLRenderer</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="global.html#AUTO">AUTO</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPDATA">BITMAPDATA</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPTEXT">BITMAPTEXT</a> </li> <li class="class-depth-0"> <a href="global.html#blendModes">blendModes</a> </li> <li class="class-depth-0"> <a href="global.html#BUTTON">BUTTON</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS">CANVAS</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS_FILTER">CANVAS_FILTER</a> </li> <li class="class-depth-0"> <a href="global.html#CIRCLE">CIRCLE</a> </li> <li class="class-depth-0"> <a href="global.html#CREATURE">CREATURE</a> </li> <li class="class-depth-0"> <a href="global.html#DOWN">DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#ELLIPSE">ELLIPSE</a> </li> <li class="class-depth-0"> <a href="global.html#EMITTER">EMITTER</a> </li> <li class="class-depth-0"> <a href="global.html#GAMES">GAMES</a> </li> <li class="class-depth-0"> <a href="global.html#GRAPHICS">GRAPHICS</a> </li> <li class="class-depth-0"> <a href="global.html#GROUP">GROUP</a> </li> <li class="class-depth-0"> <a href="global.html#HEADLESS">HEADLESS</a> </li> <li class="class-depth-0"> <a href="global.html#IMAGE">IMAGE</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT">LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#LINE">LINE</a> </li> <li class="class-depth-0"> <a href="global.html#MATRIX">MATRIX</a> </li> <li class="class-depth-0"> <a href="global.html#NONE">NONE</a> </li> <li class="class-depth-0"> <a href="global.html#POINT">POINT</a> </li> <li class="class-depth-0"> <a href="global.html#POINTER">POINTER</a> </li> <li class="class-depth-0"> <a href="global.html#POLYGON">POLYGON</a> </li> <li class="class-depth-0"> <a href="global.html#RECTANGLE">RECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#RENDERTEXTURE">RENDERTEXTURE</a> </li> <li class="class-depth-0"> <a href="global.html#RETROFONT">RETROFONT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT">RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#ROPE">ROPE</a> </li> <li class="class-depth-0"> <a href="global.html#ROUNDEDRECTANGLE">ROUNDEDRECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#scaleModes">scaleModes</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITE">SPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITEBATCH">SPRITEBATCH</a> </li> <li class="class-depth-0"> <a href="global.html#TEXT">TEXT</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAP">TILEMAP</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAPLAYER">TILEMAPLAYER</a> </li> <li class="class-depth-0"> <a href="global.html#TILESPRITE">TILESPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#UP">UP</a> </li> <li class="class-depth-0"> <a href="global.html#VERSION">VERSION</a> </li> <li class="class-depth-0"> <a href="global.html#VIDEO">VIDEO</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL">WEBGL</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL_FILTER">WEBGL_FILTER</a> </li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li> <li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li> <li class="class-depth-1"><a href="Phaser.World.html">World</a></li> <li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li> <li class="class-depth-1"><a href="Phaser.Cache.html">Cache</a></li> <li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li> <li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li> <li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li> <li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li> <li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li> <li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li> <li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li> <li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li> <li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li> <li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li> <li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li> <li class="class-depth-1"><a href="Phaser.Video.html">Video</a></li> <li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li> <li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li> <li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li> <li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li> <li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li> <li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li> <li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li> <li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li> <li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li> <li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li> <li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li> <li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li> <li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li> <li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li> <li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li> <li class="class-depth-1"><a href="Phaser.Matrix.html">Matrix</a></li> <li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li> <li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li> <li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li> <li class="class-depth-1"><a href="Phaser.RoundedRectangle.html">Rounded Rectangle</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li> <li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li> <li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li> <li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li> <li class="class-depth-1"><a href="Phaser.DeviceButton.html">Device Button</a></li> <li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li> <li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li> <li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li> <li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li> <li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li> <li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li> <li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li> <li class="class-depth-1"><a href="http://phaser.io/learn">Tutorials</a></li> <li class="class-depth-1"><a href="https://confirmsubscription.com/h/r/369DE48E3E86AF1E">Newsletter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/irc">IRC</a></li> <li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span12"> <div id="main"> <h1 class="page-title">Source: src/pixi/display/DisplayObjectContainer.js</h1> <section> <article> <pre class="sunlight-highlight-javascript linenums">/** * @author Mat Groves http://matgroves.com/ @Doormat23 */ /** * A DisplayObjectContainer represents a collection of display objects. * It is the base class of all display objects that act as a container for other objects. * * @class DisplayObjectContainer * @extends DisplayObject * @constructor */ PIXI.DisplayObjectContainer = function() { PIXI.DisplayObject.call(this); /** * [read-only] The array of children of this container. * * @property children * @type Array(DisplayObject) * @readOnly */ this.children = []; }; // constructor PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype ); PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; /** * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set * * @property width * @type Number */ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { get: function() { return this.scale.x * this.getLocalBounds().width; }, set: function(value) { var width = this.getLocalBounds().width; if (width !== 0) { this.scale.x = value / width; } else { this.scale.x = 1; } this._width = value; } }); /** * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set * * @property height * @type Number */ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { get: function() { return this.scale.y * this.getLocalBounds().height; }, set: function(value) { var height = this.getLocalBounds().height; if (height !== 0) { this.scale.y = value / height; } else { this.scale.y = 1; } this._height = value; } }); /** * Adds a child to the container. * * @method addChild * @param child {DisplayObject} The DisplayObject to add to the container * @return {DisplayObject} The child that was added. */ PIXI.DisplayObjectContainer.prototype.addChild = function(child) { return this.addChildAt(child, this.children.length); }; /** * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * * @method addChildAt * @param child {DisplayObject} The child to add * @param index {Number} The index to place the child in * @return {DisplayObject} The child that was added. */ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index) { if(index >= 0 &amp;&amp; index &lt;= this.children.length) { if(child.parent) { child.parent.removeChild(child); } child.parent = this; this.children.splice(index, 0, child); if(this.stage)child.setStageReference(this.stage); return child; } else { throw new Error(child + 'addChildAt: The index '+ index +' supplied is out of bounds ' + this.children.length); } }; /** * Swaps the position of 2 Display Objects within this container. * * @method swapChildren * @param child {DisplayObject} * @param child2 {DisplayObject} */ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) { if(child === child2) { return; } var index1 = this.getChildIndex(child); var index2 = this.getChildIndex(child2); if(index1 &lt; 0 || index2 &lt; 0) { throw new Error('swapChildren: Both the supplied DisplayObjects must be a child of the caller.'); } this.children[index1] = child2; this.children[index2] = child; }; /** * Returns the index position of a child DisplayObject instance * * @method getChildIndex * @param child {DisplayObject} The DisplayObject instance to identify * @return {Number} The index position of the child display object to identify */ PIXI.DisplayObjectContainer.prototype.getChildIndex = function(child) { var index = this.children.indexOf(child); if (index === -1) { throw new Error('The supplied DisplayObject must be a child of the caller'); } return index; }; /** * Changes the position of an existing child in the display object container * * @method setChildIndex * @param child {DisplayObject} The child DisplayObject instance for which you want to change the index number * @param index {Number} The resulting index number for the child display object */ PIXI.DisplayObjectContainer.prototype.setChildIndex = function(child, index) { if (index &lt; 0 || index >= this.children.length) { throw new Error('The supplied index is out of bounds'); } var currentIndex = this.getChildIndex(child); this.children.splice(currentIndex, 1); //remove from old position this.children.splice(index, 0, child); //add at new position }; /** * Returns the child at the specified index * * @method getChildAt * @param index {Number} The index to get the child from * @return {DisplayObject} The child at the given index, if any. */ PIXI.DisplayObjectContainer.prototype.getChildAt = function(index) { if (index &lt; 0 || index >= this.children.length) { throw new Error('getChildAt: Supplied index '+ index +' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'); } return this.children[index]; }; /** * Removes a child from the container. * * @method removeChild * @param child {DisplayObject} The DisplayObject to remove * @return {DisplayObject} The child that was removed. */ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { var index = this.children.indexOf( child ); if(index === -1)return; return this.removeChildAt( index ); }; /** * Removes a child from the specified index position. * * @method removeChildAt * @param index {Number} The index to get the child from * @return {DisplayObject} The child that was removed. */ PIXI.DisplayObjectContainer.prototype.removeChildAt = function(index) { var child = this.getChildAt( index ); if(this.stage) child.removeStageReference(); child.parent = undefined; this.children.splice( index, 1 ); return child; }; /** * Removes all children from this container that are within the begin and end indexes. * * @method removeChildren * @param beginIndex {Number} The beginning position. Default value is 0. * @param endIndex {Number} The ending position. Default value is size of the container. */ PIXI.DisplayObjectContainer.prototype.removeChildren = function(beginIndex, endIndex) { var begin = beginIndex || 0; var end = typeof endIndex === 'number' ? endIndex : this.children.length; var range = end - begin; if (range > 0 &amp;&amp; range &lt;= end) { var removed = this.children.splice(begin, range); for (var i = 0; i &lt; removed.length; i++) { var child = removed[i]; if(this.stage) child.removeStageReference(); child.parent = undefined; } return removed; } else if (range === 0 &amp;&amp; this.children.length === 0) { return []; } else { throw new Error( 'removeChildren: Range Error, numeric values are outside the acceptable range' ); } }; /* * Updates the transform on all children of this container for rendering * * @method updateTransform * @private */ PIXI.DisplayObjectContainer.prototype.updateTransform = function() { if (!this.visible) { return; } this.displayObjectUpdateTransform(); if (this._cacheAsBitmap) { return; } for (var i = 0; i &lt; this.children.length; i++) { this.children[i].updateTransform(); } }; // performance increase to avoid using call.. (10x faster) PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform; /** * Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration. * * @method getBounds * @return {Rectangle} The rectangular bounding area */ PIXI.DisplayObjectContainer.prototype.getBounds = function() { if(this.children.length === 0)return PIXI.EmptyRectangle; // TODO the bounds have already been calculated this render session so return what we have var minX = Infinity; var minY = Infinity; var maxX = -Infinity; var maxY = -Infinity; var childBounds; var childMaxX; var childMaxY; var childVisible = false; for(var i=0,j=this.children.length; i&lt;j; i++) { var child = this.children[i]; if(!child.visible)continue; childVisible = true; childBounds = this.children[i].getBounds(); minX = minX &lt; childBounds.x ? minX : childBounds.x; minY = minY &lt; childBounds.y ? minY : childBounds.y; childMaxX = childBounds.width + childBounds.x; childMaxY = childBounds.height + childBounds.y; maxX = maxX > childMaxX ? maxX : childMaxX; maxY = maxY > childMaxY ? maxY : childMaxY; } if(!childVisible) return PIXI.EmptyRectangle; var bounds = this._bounds; bounds.x = minX; bounds.y = minY; bounds.width = maxX - minX; bounds.height = maxY - minY; // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate //this._currentBounds = bounds; return bounds; }; /** * Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration. * * @method getLocalBounds * @return {Rectangle} The rectangular bounding area */ PIXI.DisplayObjectContainer.prototype.getLocalBounds = function() { var matrixCache = this.worldTransform; this.worldTransform = PIXI.identityMatrix; for(var i=0,j=this.children.length; i&lt;j; i++) { this.children[i].updateTransform(); } var bounds = this.getBounds(); this.worldTransform = matrixCache; return bounds; }; /** * Sets the containers Stage reference. This is the Stage that this object, and all of its children, is connected to. * * @method setStageReference * @param stage {Stage} the stage that the container will have as its current stage reference */ PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage) { this.stage = stage; for (var i=0; i &lt; this.children.length; i++) { this.children[i].setStageReference(stage) } }; /** * Removes the current stage reference from the container and all of its children. * * @method removeStageReference */ PIXI.DisplayObjectContainer.prototype.removeStageReference = function() { for (var i = 0; i &lt; this.children.length; i++) { this.children[i].removeStageReference(); } this.stage = null; }; /** * Renders the object using the WebGL renderer * * @method _renderWebGL * @param renderSession {RenderSession} * @private */ PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession) { if (!this.visible || this.alpha &lt;= 0) return; if (this._cacheAsBitmap) { this._renderCachedSprite(renderSession); return; } var i; if (this._mask || this._filters) { // push filter first as we need to ensure the stencil buffer is correct for any masking if (this._filters) { renderSession.spriteBatch.flush(); renderSession.filterManager.pushFilter(this._filterBlock); } if (this._mask) { renderSession.spriteBatch.stop(); renderSession.maskManager.pushMask(this.mask, renderSession); renderSession.spriteBatch.start(); } // simple render children! for (i = 0; i &lt; this.children.length; i++) { this.children[i]._renderWebGL(renderSession); } renderSession.spriteBatch.stop(); if (this._mask) renderSession.maskManager.popMask(this._mask, renderSession); if (this._filters) renderSession.filterManager.popFilter(); renderSession.spriteBatch.start(); } else { // simple render children! for (i = 0; i &lt; this.children.length; i++) { this.children[i]._renderWebGL(renderSession); } } }; /** * Renders the object using the Canvas renderer * * @method _renderCanvas * @param renderSession {RenderSession} * @private */ PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession) { if (this.visible === false || this.alpha === 0) return; if (this._cacheAsBitmap) { this._renderCachedSprite(renderSession); return; } if (this._mask) { renderSession.maskManager.pushMask(this._mask, renderSession); } for (var i = 0; i &lt; this.children.length; i++) { this.children[i]._renderCanvas(renderSession); } if (this._mask) { renderSession.maskManager.popMask(renderSession); } }; </pre> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Phaser Copyright © 2012-2015 Photon Storm Ltd. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Mon Aug 24 2015 15:36:45 GMT+0100 (GMT Daylight Time) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { anchorName : function(i, heading, prefix) { return $(heading).attr("id") || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>
dakside/phaser
docs/src_pixi_display_DisplayObjectContainer.js.html
HTML
mit
47,903
<?php namespace GuzzleHttp\Test\Handler; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\Handler\Proxy; use GuzzleHttp\Psr7\Request; /** * @covers \GuzzleHttp\Handler\Proxy */ class ProxyTest extends \PHPUnit_Framework_TestCase { public function testSendsToSync() { $a = $b = null; $m1 = new MockHandler([function ($v) use (&$a) { $a = $v; }]); $m2 = new MockHandler([function ($v) use (&$b) { $b = $v; }]); $h = Proxy::wrapSync($m1, $m2); $h(new Request('GET', 'http://foo.com'), []); $this->assertNotNull($a); $this->assertNull($b); } public function testSendsToNonSync() { $a = $b = null; $m1 = new MockHandler([function ($v) use (&$a) { $a = $v; }]); $m2 = new MockHandler([function ($v) use (&$b) { $b = $v; }]); $h = Proxy::wrapSync($m1, $m2); $h(new Request('GET', 'http://foo.com'), ['sync' => true]); $this->assertNull($a); $this->assertNotNull($b); } public function testSendsToStreaming() { $a = $b = null; $m1 = new MockHandler([function ($v) use (&$a) { $a = $v; }]); $m2 = new MockHandler([function ($v) use (&$b) { $b = $v; }]); $h = Proxy::wrapStreaming($m1, $m2); $h(new Request('GET', 'http://foo.com'), []); $this->assertNotNull($a); $this->assertNull($b); } public function testSendsToNonStreaming() { $a = $b = null; $m1 = new MockHandler([function ($v) use (&$a) { $a = $v; }]); $m2 = new MockHandler([function ($v) use (&$b) { $b = $v; }]); $h = Proxy::wrapStreaming($m1, $m2); $h(new Request('GET', 'http://foo.com'), ['stream' => true]); $this->assertNull($a); $this->assertNotNull($b); } }
atrauzzi/guzzle
tests/Handler/ProxyTest.php
PHP
mit
1,798
/* build: `node build.js modules=ALL exclude=gestures,cufon,json minifier=uglifyjs` */ /*! Fabric.js Copyright 2008-2014, Printio (Juriy Zaytsev, Maxim Chernyak) */ var fabric = fabric || { version: "1.4.11" }; if (typeof exports !== 'undefined') { exports.fabric = fabric; } if (typeof document !== 'undefined' && typeof window !== 'undefined') { fabric.document = document; fabric.window = window; } else { // assume we're running under node.js when document/window are not present fabric.document = require("jsdom") .jsdom("<!DOCTYPE html><html><head></head><body></body></html>"); fabric.window = fabric.document.createWindow(); } /** * True when in environment that supports touch events * @type boolean */ fabric.isTouchSupported = "ontouchstart" in fabric.document.documentElement; /** * True when in environment that's probably Node.js * @type boolean */ fabric.isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined'; /** * Attributes parsed from all SVG elements * @type array */ fabric.SHARED_ATTRIBUTES = [ "display", "transform", "fill", "fill-opacity", "fill-rule", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width" ]; /** * Pixel per Inch as a default value set to 96. Can be changed for more realistic conversion. */ fabric.DPI = 96; (function(){ /** * @private * @param {String} eventName * @param {Function} handler */ function _removeEventListener(eventName, handler) { if (!this.__eventListeners[eventName]) { return; } if (handler) { fabric.util.removeFromArray(this.__eventListeners[eventName], handler); } else { this.__eventListeners[eventName].length = 0; } } /** * Observes specified event * @deprecated `observe` deprecated since 0.8.34 (use `on` instead) * @memberOf fabric.Observable * @alias on * @param {String|Object} eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param {Function} handler Function that receives a notification when an event of the specified type occurs * @return {Self} thisArg * @chainable */ function observe(eventName, handler) { if (!this.__eventListeners) { this.__eventListeners = { }; } // one object with key/value pairs was passed if (arguments.length === 1) { for (var prop in eventName) { this.on(prop, eventName[prop]); } } else { if (!this.__eventListeners[eventName]) { this.__eventListeners[eventName] = [ ]; } this.__eventListeners[eventName].push(handler); } return this; } /** * Stops event observing for a particular event handler. Calling this method * without arguments removes all handlers for all events * @deprecated `stopObserving` deprecated since 0.8.34 (use `off` instead) * @memberOf fabric.Observable * @alias off * @param {String|Object} eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param {Function} handler Function to be deleted from EventListeners * @return {Self} thisArg * @chainable */ function stopObserving(eventName, handler) { if (!this.__eventListeners) { return; } // remove all key/value pairs (event name -> event handler) if (arguments.length === 0) { this.__eventListeners = { }; } // one object with key/value pairs was passed else if (arguments.length === 1 && typeof arguments[0] === 'object') { for (var prop in eventName) { _removeEventListener.call(this, prop, eventName[prop]); } } else { _removeEventListener.call(this, eventName, handler); } return this; } /** * Fires event with an optional options object * @deprecated `fire` deprecated since 1.0.7 (use `trigger` instead) * @memberOf fabric.Observable * @alias trigger * @param {String} eventName Event name to fire * @param {Object} [options] Options object * @return {Self} thisArg * @chainable */ function fire(eventName, options) { if (!this.__eventListeners) { return; } var listenersForEvent = this.__eventListeners[eventName]; if (!listenersForEvent) { return; } for (var i = 0, len = listenersForEvent.length; i < len; i++) { // avoiding try/catch for perf. reasons listenersForEvent[i].call(this, options || { }); } return this; } /** * @namespace fabric.Observable * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#events} * @see {@link http://fabricjs.com/events/|Events demo} */ fabric.Observable = { observe: observe, stopObserving: stopObserving, fire: fire, on: observe, off: stopObserving, trigger: fire }; })(); /** * @namespace fabric.Collection */ fabric.Collection = { /** * Adds objects to collection, then renders canvas (if `renderOnAddRemove` is not `false`) * Objects should be instances of (or inherit from) fabric.Object * @param {...fabric.Object} object Zero or more fabric instances * @return {Self} thisArg */ add: function () { this._objects.push.apply(this._objects, arguments); for (var i = 0, length = arguments.length; i < length; i++) { this._onObjectAdded(arguments[i]); } this.renderOnAddRemove && this.renderAll(); return this; }, /** * Inserts an object into collection at specified index, then renders canvas (if `renderOnAddRemove` is not `false`) * An object should be an instance of (or inherit from) fabric.Object * @param {Object} object Object to insert * @param {Number} index Index to insert object at * @param {Boolean} nonSplicing When `true`, no splicing (shifting) of objects occurs * @return {Self} thisArg * @chainable */ insertAt: function (object, index, nonSplicing) { var objects = this.getObjects(); if (nonSplicing) { objects[index] = object; } else { objects.splice(index, 0, object); } this._onObjectAdded(object); this.renderOnAddRemove && this.renderAll(); return this; }, /** * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) * @param {...fabric.Object} object Zero or more fabric instances * @return {Self} thisArg * @chainable */ remove: function() { var objects = this.getObjects(), index; for (var i = 0, length = arguments.length; i < length; i++) { index = objects.indexOf(arguments[i]); // only call onObjectRemoved if an object was actually removed if (index !== -1) { objects.splice(index, 1); this._onObjectRemoved(arguments[i]); } } this.renderOnAddRemove && this.renderAll(); return this; }, /** * Executes given function for each object in this group * @param {Function} callback * Callback invoked with current object as first argument, * index - as second and an array of all objects - as third. * Iteration happens in reverse order (for performance reasons). * Callback is invoked in a context of Global Object (e.g. `window`) * when no `context` argument is given * * @param {Object} context Context (aka thisObject) * @return {Self} thisArg */ forEachObject: function(callback, context) { var objects = this.getObjects(), i = objects.length; while (i--) { callback.call(context, objects[i], i, objects); } return this; }, /** * Returns an array of children objects of this instance * Type parameter introduced in 1.3.10 * @param {String} [type] When specified, only objects of this type are returned * @return {Array} */ getObjects: function(type) { if (typeof type === 'undefined') { return this._objects; } return this._objects.filter(function(o) { return o.type === type; }); }, /** * Returns object at specified index * @param {Number} index * @return {Self} thisArg */ item: function (index) { return this.getObjects()[index]; }, /** * Returns true if collection contains no objects * @return {Boolean} true if collection is empty */ isEmpty: function () { return this.getObjects().length === 0; }, /** * Returns a size of a collection (i.e: length of an array containing its objects) * @return {Number} Collection size */ size: function() { return this.getObjects().length; }, /** * Returns true if collection contains an object * @param {Object} object Object to check against * @return {Boolean} `true` if collection contains an object */ contains: function(object) { return this.getObjects().indexOf(object) > -1; }, /** * Returns number representation of a collection complexity * @return {Number} complexity */ complexity: function () { return this.getObjects().reduce(function (memo, current) { memo += current.complexity ? current.complexity() : 0; return memo; }, 0); } }; (function(global) { var sqrt = Math.sqrt, atan2 = Math.atan2, PiBy180 = Math.PI / 180; /** * @namespace fabric.util */ fabric.util = { /** * Removes value from an array. * Presence of value (and its position in an array) is determined via `Array.prototype.indexOf` * @static * @memberOf fabric.util * @param {Array} array * @param {Any} value * @return {Array} original array */ removeFromArray: function(array, value) { var idx = array.indexOf(value); if (idx !== -1) { array.splice(idx, 1); } return array; }, /** * Returns random number between 2 specified ones. * @static * @memberOf fabric.util * @param {Number} min lower limit * @param {Number} max upper limit * @return {Number} random value (between min and max) */ getRandomInt: function(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }, /** * Transforms degrees to radians. * @static * @memberOf fabric.util * @param {Number} degrees value in degrees * @return {Number} value in radians */ degreesToRadians: function(degrees) { return degrees * PiBy180; }, /** * Transforms radians to degrees. * @static * @memberOf fabric.util * @param {Number} radians value in radians * @return {Number} value in degrees */ radiansToDegrees: function(radians) { return radians / PiBy180; }, /** * Rotates `point` around `origin` with `radians` * @static * @memberOf fabric.util * @param {fabric.Point} point The point to rotate * @param {fabric.Point} origin The origin of the rotation * @param {Number} radians The radians of the angle for the rotation * @return {fabric.Point} The new rotated point */ rotatePoint: function(point, origin, radians) { var sin = Math.sin(radians), cos = Math.cos(radians); point.subtractEquals(origin); var rx = point.x * cos - point.y * sin, ry = point.x * sin + point.y * cos; return new fabric.Point(rx, ry).addEquals(origin); }, /** * Apply transform t to point p * @static * @memberOf fabric.util * @param {fabric.Point} p The point to transform * @param {Array} t The transform * @param {Boolean} [ignoreOffset] Indicates that the offset should not be applied * @return {fabric.Point} The transformed point */ transformPoint: function(p, t, ignoreOffset) { if (ignoreOffset) { return new fabric.Point( t[0] * p.x + t[1] * p.y, t[2] * p.x + t[3] * p.y ); } return new fabric.Point( t[0] * p.x + t[1] * p.y + t[4], t[2] * p.x + t[3] * p.y + t[5] ); }, /** * Invert transformation t * @static * @memberOf fabric.util * @param {Array} t The transform * @return {Array} The inverted transform */ invertTransform: function(t) { var r = t.slice(), a = 1 / (t[0] * t[3] - t[1] * t[2]); r = [a * t[3], -a * t[1], -a * t[2], a * t[0], 0, 0]; var o = fabric.util.transformPoint({ x: t[4], y: t[5] }, r); r[4] = -o.x; r[5] = -o.y; return r; }, /** * A wrapper around Number#toFixed, which contrary to native method returns number, not string. * @static * @memberOf fabric.util * @param {Number|String} number number to operate on * @param {Number} fractionDigits number of fraction digits to "leave" * @return {Number} */ toFixed: function(number, fractionDigits) { return parseFloat(Number(number).toFixed(fractionDigits)); }, /** * Converts from attribute value to pixel value if applicable. * Returns converted pixels or original value not converted. * @param {Number|String} value number to operate on * @return {Number|String} */ parseUnit: function(value) { var unit = /\D{0,2}$/.exec(value), number = parseFloat(value); switch (unit[0]) { case 'mm': return number * fabric.DPI / 25.4; case 'cm': return number * fabric.DPI / 2.54; case 'in': return number * fabric.DPI; case 'pt': return number * fabric.DPI / 72; // or * 4 / 3 case 'pc': return number * fabric.DPI / 72 * 12; // or * 16 default: return number; } }, /** * Function which always returns `false`. * @static * @memberOf fabric.util * @return {Boolean} */ falseFunction: function() { return false; }, /** * Returns klass "Class" object of given namespace * @memberOf fabric.util * @param {String} type Type of object (eg. 'circle') * @param {String} namespace Namespace to get klass "Class" object from * @return {Object} klass "Class" */ getKlass: function(type, namespace) { // capitalize first letter only type = fabric.util.string.camelize(type.charAt(0).toUpperCase() + type.slice(1)); return fabric.util.resolveNamespace(namespace)[type]; }, /** * Returns object of given namespace * @memberOf fabric.util * @param {String} namespace Namespace string e.g. 'fabric.Image.filter' or 'fabric' * @return {Object} Object for given namespace (default fabric) */ resolveNamespace: function(namespace) { if (!namespace) { return fabric; } var parts = namespace.split('.'), len = parts.length, obj = global || fabric.window; for (var i = 0; i < len; ++i) { obj = obj[parts[i]]; } return obj; }, /** * Loads image element from given url and passes it to a callback * @memberOf fabric.util * @param {String} url URL representing an image * @param {Function} callback Callback; invoked with loaded image * @param {Any} [context] Context to invoke callback in * @param {Object} [crossOrigin] crossOrigin value to set image element to */ loadImage: function(url, callback, context, crossOrigin) { if (!url) { callback && callback.call(context, url); return; } var img = fabric.util.createImage(); /** @ignore */ img.onload = function () { callback && callback.call(context, img); img = img.onload = img.onerror = null; }; /** @ignore */ img.onerror = function() { fabric.log('Error loading ' + img.src); callback && callback.call(context, null, true); img = img.onload = img.onerror = null; }; // data-urls appear to be buggy with crossOrigin // https://github.com/kangax/fabric.js/commit/d0abb90f1cd5c5ef9d2a94d3fb21a22330da3e0a#commitcomment-4513767 // see https://code.google.com/p/chromium/issues/detail?id=315152 // https://bugzilla.mozilla.org/show_bug.cgi?id=935069 if (url.indexOf('data') !== 0 && typeof crossOrigin !== 'undefined') { img.crossOrigin = crossOrigin; } img.src = url; }, /** * Creates corresponding fabric instances from their object representations * @static * @memberOf fabric.util * @param {Array} objects Objects to enliven * @param {Function} callback Callback to invoke when all objects are created * @param {String} namespace Namespace to get klass "Class" object from * @param {Function} reviver Method for further parsing of object elements, * called after each fabric object created. */ enlivenObjects: function(objects, callback, namespace, reviver) { objects = objects || [ ]; function onLoaded() { if (++numLoadedObjects === numTotalObjects) { callback && callback(enlivenedObjects); } } var enlivenedObjects = [ ], numLoadedObjects = 0, numTotalObjects = objects.length; if (!numTotalObjects) { callback && callback(enlivenedObjects); return; } objects.forEach(function (o, index) { // if sparse array if (!o || !o.type) { onLoaded(); return; } var klass = fabric.util.getKlass(o.type, namespace); if (klass.async) { klass.fromObject(o, function (obj, error) { if (!error) { enlivenedObjects[index] = obj; reviver && reviver(o, enlivenedObjects[index]); } onLoaded(); }); } else { enlivenedObjects[index] = klass.fromObject(o); reviver && reviver(o, enlivenedObjects[index]); onLoaded(); } }); }, /** * Groups SVG elements (usually those retrieved from SVG document) * @static * @memberOf fabric.util * @param {Array} elements SVG elements to group * @param {Object} [options] Options object * @return {fabric.Object|fabric.PathGroup} */ groupSVGElements: function(elements, options, path) { var object; object = new fabric.PathGroup(elements, options); if (typeof path !== 'undefined') { object.setSourcePath(path); } return object; }, /** * Populates an object with properties of another object * @static * @memberOf fabric.util * @param {Object} source Source object * @param {Object} destination Destination object * @return {Array} properties Propertie names to include */ populateWithProperties: function(source, destination, properties) { if (properties && Object.prototype.toString.call(properties) === '[object Array]') { for (var i = 0, len = properties.length; i < len; i++) { if (properties[i] in source) { destination[properties[i]] = source[properties[i]]; } } } }, /** * Draws a dashed line between two points * * This method is used to draw dashed line around selection area. * See <a href="http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas">dotted stroke in canvas</a> * * @param {CanvasRenderingContext2D} ctx context * @param {Number} x start x coordinate * @param {Number} y start y coordinate * @param {Number} x2 end x coordinate * @param {Number} y2 end y coordinate * @param {Array} da dash array pattern */ drawDashedLine: function(ctx, x, y, x2, y2, da) { var dx = x2 - x, dy = y2 - y, len = sqrt(dx * dx + dy * dy), rot = atan2(dy, dx), dc = da.length, di = 0, draw = true; ctx.save(); ctx.translate(x, y); ctx.moveTo(0, 0); ctx.rotate(rot); x = 0; while (len > x) { x += da[di++ % dc]; if (x > len) { x = len; } ctx[draw ? 'lineTo' : 'moveTo'](x, 0); draw = !draw; } ctx.restore(); }, /** * Creates canvas element and initializes it via excanvas if necessary * @static * @memberOf fabric.util * @param {CanvasElement} [canvasEl] optional canvas element to initialize; * when not given, element is created implicitly * @return {CanvasElement} initialized canvas element */ createCanvasElement: function(canvasEl) { canvasEl || (canvasEl = fabric.document.createElement('canvas')); //jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (!canvasEl.getContext && typeof G_vmlCanvasManager !== 'undefined') { G_vmlCanvasManager.initElement(canvasEl); } //jscs:enable requireCamelCaseOrUpperCaseIdentifiers return canvasEl; }, /** * Creates image element (works on client and node) * @static * @memberOf fabric.util * @return {HTMLImageElement} HTML image element */ createImage: function() { return fabric.isLikelyNode ? new (require('canvas').Image)() : fabric.document.createElement('img'); }, /** * Creates accessors (getXXX, setXXX) for a "class", based on "stateProperties" array * @static * @memberOf fabric.util * @param {Object} klass "Class" to create accessors for */ createAccessors: function(klass) { var proto = klass.prototype; for (var i = proto.stateProperties.length; i--; ) { var propName = proto.stateProperties[i], capitalizedPropName = propName.charAt(0).toUpperCase() + propName.slice(1), setterName = 'set' + capitalizedPropName, getterName = 'get' + capitalizedPropName; // using `new Function` for better introspection if (!proto[getterName]) { proto[getterName] = (function(property) { return new Function('return this.get("' + property + '")'); })(propName); } if (!proto[setterName]) { proto[setterName] = (function(property) { return new Function('value', 'return this.set("' + property + '", value)'); })(propName); } } }, /** * @static * @memberOf fabric.util * @param {fabric.Object} receiver Object implementing `clipTo` method * @param {CanvasRenderingContext2D} ctx Context to clip */ clipContext: function(receiver, ctx) { ctx.save(); ctx.beginPath(); receiver.clipTo(ctx); ctx.clip(); }, /** * Multiply matrix A by matrix B to nest transformations * @static * @memberOf fabric.util * @param {Array} matrixA First transformMatrix * @param {Array} matrixB Second transformMatrix * @return {Array} The product of the two transform matrices */ multiplyTransformMatrices: function(matrixA, matrixB) { // Matrix multiply matrixA * matrixB var a = [ [matrixA[0], matrixA[2], matrixA[4]], [matrixA[1], matrixA[3], matrixA[5]], [0, 0, 1 ] ], b = [ [matrixB[0], matrixB[2], matrixB[4]], [matrixB[1], matrixB[3], matrixB[5]], [0, 0, 1 ] ], result = []; for (var r = 0; r < 3; r++) { result[r] = []; for (var c = 0; c < 3; c++) { var sum = 0; for (var k = 0; k < 3; k++) { sum += a[r][k] * b[k][c]; } result[r][c] = sum; } } return [ result[0][0], result[1][0], result[0][1], result[1][1], result[0][2], result[1][2] ]; }, /** * Returns string representation of function body * @param {Function} fn Function to get body of * @return {String} Function body */ getFunctionBody: function(fn) { return (String(fn).match(/function[^{]*\{([\s\S]*)\}/) || {})[1]; }, /** * Returns true if context has transparent pixel * at specified location (taking tolerance into account) * @param {CanvasRenderingContext2D} ctx context * @param {Number} x x coordinate * @param {Number} y y coordinate * @param {Number} tolerance Tolerance */ isTransparent: function(ctx, x, y, tolerance) { // If tolerance is > 0 adjust start coords to take into account. // If moves off Canvas fix to 0 if (tolerance > 0) { if (x > tolerance) { x -= tolerance; } else { x = 0; } if (y > tolerance) { y -= tolerance; } else { y = 0; } } var _isTransparent = true, imageData = ctx.getImageData(x, y, (tolerance * 2) || 1, (tolerance * 2) || 1); // Split image data - for tolerance > 1, pixelDataSize = 4; for (var i = 3, l = imageData.data.length; i < l; i += 4) { var temp = imageData.data[i]; _isTransparent = temp <= 0; if (_isTransparent === false) { break; // Stop if colour found } } imageData = null; return _isTransparent; } }; })(typeof exports !== 'undefined' ? exports : this); (function() { var arcToSegmentsCache = { }, segmentToBezierCache = { }, _join = Array.prototype.join; /* Adapted from http://dxr.mozilla.org/mozilla-central/source/content/svg/content/src/nsSVGPathDataParser.cpp * by Andrea Bogazzi code is under MPL. if you don't have a copy of the license you can take it here * http://mozilla.org/MPL/2.0/ */ function arcToSegments(toX, toY, rx, ry, large, sweep, rotateX) { var argsString = _join.call(arguments); if (arcToSegmentsCache[argsString]) { return arcToSegmentsCache[argsString]; } var PI = Math.PI, th = rotateX * (PI / 180), sinTh = Math.sin(th), cosTh = Math.cos(th), fromX = 0, fromY = 0; rx = Math.abs(rx); ry = Math.abs(ry); var px = -cosTh * toX - sinTh * toY, py = -cosTh * toY + sinTh * toX, rx2 = rx * rx, ry2 = ry * ry, py2 = py * py, px2 = px * px, pl = 4 * rx2 * ry2 - rx2 * py2 - ry2 * px2, root = 0; if (pl < 0) { var s = Math.sqrt(1 - 0.25 * pl/(rx2 * ry2)); rx *= s; ry *= s; } else { root = (large === sweep ? -0.5 : 0.5) * Math.sqrt( pl /(rx2 * py2 + ry2 * px2)); } var cx = root * rx * py / ry, cy = -root * ry * px / rx, cx1 = cosTh * cx - sinTh * cy + toX / 2, cy1 = sinTh * cx + cosTh * cy + toY / 2, mTheta = calcVectorAngle(1, 0, (px - cx) / rx, (py - cy) / ry), dtheta = calcVectorAngle((px - cx) / rx, (py - cy) / ry, (-px -cx) / rx, (-py -cy) / ry); if (sweep === 0 && dtheta > 0) { dtheta -= 2 * PI; } else if (sweep === 1 && dtheta < 0) { dtheta += 2 * PI; } // Convert into cubic bezier segments <= 90deg var segments = Math.ceil(Math.abs(dtheta / (PI * 0.5))), result = [], mDelta = dtheta / segments, mT = 8 / 3 * Math.sin(mDelta / 4) * Math.sin(mDelta / 4) / Math.sin(mDelta / 2), th3 = mTheta + mDelta; for (var i = 0; i < segments; i++) { result[i] = segmentToBezier(mTheta, th3, cosTh, sinTh, rx, ry, cx1, cy1, mT, fromX, fromY); fromX = result[i][4]; fromY = result[i][5]; mTheta += mDelta; th3 += mDelta; } arcToSegmentsCache[argsString] = result; return result; } function segmentToBezier(th2, th3, cosTh, sinTh, rx, ry, cx1, cy1, mT, fromX, fromY) { var argsString2 = _join.call(arguments); if (segmentToBezierCache[argsString2]) { return segmentToBezierCache[argsString2]; } var costh2 = Math.cos(th2), sinth2 = Math.sin(th2), costh3 = Math.cos(th3), sinth3 = Math.sin(th3), toX = cosTh * rx * costh3 - sinTh * ry * sinth3 + cx1, toY = sinTh * rx * costh3 + cosTh * ry * sinth3 + cy1, cp1X = fromX + mT * ( - cosTh * rx * sinth2 - sinTh * ry * costh2), cp1Y = fromY + mT * ( - sinTh * rx * sinth2 + cosTh * ry * costh2), cp2X = toX + mT * ( cosTh * rx * sinth3 + sinTh * ry * costh3), cp2Y = toY + mT * ( sinTh * rx * sinth3 - cosTh * ry * costh3); segmentToBezierCache[argsString2] = [ cp1X, cp1Y, cp2X, cp2Y, toX, toY ]; return segmentToBezierCache[argsString2]; } /* * Private */ function calcVectorAngle(ux, uy, vx, vy) { var ta = Math.atan2(uy, ux), tb = Math.atan2(vy, vx); if (tb >= ta) { return tb - ta; } else { return 2 * Math.PI - (ta - tb); } } /** * Draws arc * @param {CanvasRenderingContext2D} ctx * @param {Number} x * @param {Number} y * @param {Array} coords */ fabric.util.drawArc = function(ctx, fx, fy, coords) { var rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], tx = coords[5], ty = coords[6], segs = [[ ], [ ], [ ], [ ]], segs_norm = arcToSegments(tx - fx, ty - fy, rx, ry, large, sweep, rot); for (var i = 0; i < segs_norm.length; i++) { segs[i][0] = segs_norm[i][0] + fx; segs[i][1] = segs_norm[i][1] + fy; segs[i][2] = segs_norm[i][2] + fx; segs[i][3] = segs_norm[i][3] + fy; segs[i][4] = segs_norm[i][4] + fx; segs[i][5] = segs_norm[i][5] + fy; ctx.bezierCurveTo.apply(ctx, segs[i]); } }; })(); (function() { var slice = Array.prototype.slice; /* _ES5_COMPAT_START_ */ if (!Array.prototype.indexOf) { /** * Finds index of an element in an array * @param {Any} searchElement * @param {Number} [fromIndex] * @return {Number} */ Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { if (this === void 0 || this === null) { throw new TypeError(); } var t = Object(this), len = t.length >>> 0; if (len === 0) { return -1; } var n = 0; if (arguments.length > 0) { n = Number(arguments[1]); if (n !== n) { // shortcut for verifying if it's NaN n = 0; } else if (n !== 0 && n !== Number.POSITIVE_INFINITY && n !== Number.NEGATIVE_INFINITY) { n = (n > 0 || -1) * Math.floor(Math.abs(n)); } } if (n >= len) { return -1; } var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); for (; k < len; k++) { if (k in t && t[k] === searchElement) { return k; } } return -1; }; } if (!Array.prototype.forEach) { /** * Iterates an array, invoking callback for each element * @param {Function} fn Callback to invoke for each element * @param {Object} [context] Context to invoke callback in * @return {Array} */ Array.prototype.forEach = function(fn, context) { for (var i = 0, len = this.length >>> 0; i < len; i++) { if (i in this) { fn.call(context, this[i], i, this); } } }; } if (!Array.prototype.map) { /** * Returns a result of iterating over an array, invoking callback for each element * @param {Function} fn Callback to invoke for each element * @param {Object} [context] Context to invoke callback in * @return {Array} */ Array.prototype.map = function(fn, context) { var result = [ ]; for (var i = 0, len = this.length >>> 0; i < len; i++) { if (i in this) { result[i] = fn.call(context, this[i], i, this); } } return result; }; } if (!Array.prototype.every) { /** * Returns true if a callback returns truthy value for all elements in an array * @param {Function} fn Callback to invoke for each element * @param {Object} [context] Context to invoke callback in * @return {Boolean} */ Array.prototype.every = function(fn, context) { for (var i = 0, len = this.length >>> 0; i < len; i++) { if (i in this && !fn.call(context, this[i], i, this)) { return false; } } return true; }; } if (!Array.prototype.some) { /** * Returns true if a callback returns truthy value for at least one element in an array * @param {Function} fn Callback to invoke for each element * @param {Object} [context] Context to invoke callback in * @return {Boolean} */ Array.prototype.some = function(fn, context) { for (var i = 0, len = this.length >>> 0; i < len; i++) { if (i in this && fn.call(context, this[i], i, this)) { return true; } } return false; }; } if (!Array.prototype.filter) { /** * Returns the result of iterating over elements in an array * @param {Function} fn Callback to invoke for each element * @param {Object} [context] Context to invoke callback in * @return {Array} */ Array.prototype.filter = function(fn, context) { var result = [ ], val; for (var i = 0, len = this.length >>> 0; i < len; i++) { if (i in this) { val = this[i]; // in case fn mutates this if (fn.call(context, val, i, this)) { result.push(val); } } } return result; }; } if (!Array.prototype.reduce) { /** * Returns "folded" (reduced) result of iterating over elements in an array * @param {Function} fn Callback to invoke for each element * @param {Object} [initial] Object to use as the first argument to the first call of the callback * @return {Any} */ Array.prototype.reduce = function(fn /*, initial*/) { var len = this.length >>> 0, i = 0, rv; if (arguments.length > 1) { rv = arguments[1]; } else { do { if (i in this) { rv = this[i++]; break; } // if array contains no values, no initial value to return if (++i >= len) { throw new TypeError(); } } while (true); } for (; i < len; i++) { if (i in this) { rv = fn.call(null, rv, this[i], i, this); } } return rv; }; } /* _ES5_COMPAT_END_ */ /** * Invokes method on all items in a given array * @memberOf fabric.util.array * @param {Array} array Array to iterate over * @param {String} method Name of a method to invoke * @return {Array} */ function invoke(array, method) { var args = slice.call(arguments, 2), result = [ ]; for (var i = 0, len = array.length; i < len; i++) { result[i] = args.length ? array[i][method].apply(array[i], args) : array[i][method].call(array[i]); } return result; } /** * Finds maximum value in array (not necessarily "first" one) * @memberOf fabric.util.array * @param {Array} array Array to iterate over * @param {String} byProperty * @return {Any} */ function max(array, byProperty) { return find(array, byProperty, function(value1, value2) { return value1 >= value2; }); } /** * Finds minimum value in array (not necessarily "first" one) * @memberOf fabric.util.array * @param {Array} array Array to iterate over * @param {String} byProperty * @return {Any} */ function min(array, byProperty) { return find(array, byProperty, function(value1, value2) { return value1 < value2; }); } /** * @private */ function find(array, byProperty, condition) { if (!array || array.length === 0) { return; } var i = array.length - 1, result = byProperty ? array[i][byProperty] : array[i]; if (byProperty) { while (i--) { if (condition(array[i][byProperty], result)) { result = array[i][byProperty]; } } } else { while (i--) { if (condition(array[i], result)) { result = array[i]; } } } return result; } /** * @namespace fabric.util.array */ fabric.util.array = { invoke: invoke, min: min, max: max }; })(); (function(){ /** * Copies all enumerable properties of one object to another * @memberOf fabric.util.object * @param {Object} destination Where to copy to * @param {Object} source Where to copy from * @return {Object} */ function extend(destination, source) { // JScript DontEnum bug is not taken care of for (var property in source) { destination[property] = source[property]; } return destination; } /** * Creates an empty object and copies all enumerable properties of another object to it * @memberOf fabric.util.object * @param {Object} object Object to clone * @return {Object} */ function clone(object) { return extend({ }, object); } /** @namespace fabric.util.object */ fabric.util.object = { extend: extend, clone: clone }; })(); (function() { /* _ES5_COMPAT_START_ */ if (!String.prototype.trim) { /** * Trims a string (removing whitespace from the beginning and the end) * @function external:String#trim * @see <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/Trim">String#trim on MDN</a> */ String.prototype.trim = function () { // this trim is not fully ES3 or ES5 compliant, but it should cover most cases for now return this.replace(/^[\s\xA0]+/, '').replace(/[\s\xA0]+$/, ''); }; } /* _ES5_COMPAT_END_ */ /** * Camelizes a string * @memberOf fabric.util.string * @param {String} string String to camelize * @return {String} Camelized version of a string */ function camelize(string) { return string.replace(/-+(.)?/g, function(match, character) { return character ? character.toUpperCase() : ''; }); } /** * Capitalizes a string * @memberOf fabric.util.string * @param {String} string String to capitalize * @param {Boolean} [firstLetterOnly] If true only first letter is capitalized * and other letters stay untouched, if false first letter is capitalized * and other letters are converted to lowercase. * @return {String} Capitalized version of a string */ function capitalize(string, firstLetterOnly) { return string.charAt(0).toUpperCase() + (firstLetterOnly ? string.slice(1) : string.slice(1).toLowerCase()); } /** * Escapes XML in a string * @memberOf fabric.util.string * @param {String} string String to escape * @return {String} Escaped version of a string */ function escapeXml(string) { return string.replace(/&/g, '&amp;') .replace(/"/g, '&quot;') .replace(/'/g, '&apos;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;'); } /** * String utilities * @namespace fabric.util.string */ fabric.util.string = { camelize: camelize, capitalize: capitalize, escapeXml: escapeXml }; }()); /* _ES5_COMPAT_START_ */ (function() { var slice = Array.prototype.slice, apply = Function.prototype.apply, Dummy = function() { }; if (!Function.prototype.bind) { /** * Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming) * @see <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind">Function#bind on MDN</a> * @param {Object} thisArg Object to bind function to * @param {Any[]} [...] Values to pass to a bound function * @return {Function} */ Function.prototype.bind = function(thisArg) { var _this = this, args = slice.call(arguments, 1), bound; if (args.length) { bound = function() { return apply.call(_this, this instanceof Dummy ? this : thisArg, args.concat(slice.call(arguments))); }; } else { /** @ignore */ bound = function() { return apply.call(_this, this instanceof Dummy ? this : thisArg, arguments); }; } Dummy.prototype = this.prototype; bound.prototype = new Dummy(); return bound; }; } })(); /* _ES5_COMPAT_END_ */ (function() { var slice = Array.prototype.slice, emptyFunction = function() { }, IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') { return false; } } return true; })(), /** @ignore */ addMethods = function(klass, source, parent) { for (var property in source) { if (property in klass.prototype && typeof klass.prototype[property] === 'function' && (source[property] + '').indexOf('callSuper') > -1) { klass.prototype[property] = (function(property) { return function() { var superclass = this.constructor.superclass; this.constructor.superclass = parent; var returnValue = source[property].apply(this, arguments); this.constructor.superclass = superclass; if (property !== 'initialize') { return returnValue; } }; })(property); } else { klass.prototype[property] = source[property]; } if (IS_DONTENUM_BUGGY) { if (source.toString !== Object.prototype.toString) { klass.prototype.toString = source.toString; } if (source.valueOf !== Object.prototype.valueOf) { klass.prototype.valueOf = source.valueOf; } } } }; function Subclass() { } function callSuper(methodName) { var fn = this.constructor.superclass.prototype[methodName]; return (arguments.length > 1) ? fn.apply(this, slice.call(arguments, 1)) : fn.call(this); } /** * Helper for creation of "classes". * @memberOf fabric.util * @param {Function} [parent] optional "Class" to inherit from * @param {Object} [properties] Properties shared by all instances of this class * (be careful modifying objects defined here as this would affect all instances) */ function createClass() { var parent = null, properties = slice.call(arguments, 0); if (typeof properties[0] === 'function') { parent = properties.shift(); } function klass() { this.initialize.apply(this, arguments); } klass.superclass = parent; klass.subclasses = [ ]; if (parent) { Subclass.prototype = parent.prototype; klass.prototype = new Subclass(); parent.subclasses.push(klass); } for (var i = 0, length = properties.length; i < length; i++) { addMethods(klass, properties[i], parent); } if (!klass.prototype.initialize) { klass.prototype.initialize = emptyFunction; } klass.prototype.constructor = klass; klass.prototype.callSuper = callSuper; return klass; } fabric.util.createClass = createClass; })(); (function () { var unknown = 'unknown'; /* EVENT HANDLING */ function areHostMethods(object) { var methodNames = Array.prototype.slice.call(arguments, 1), t, i, len = methodNames.length; for (i = 0; i < len; i++) { t = typeof object[methodNames[i]]; if (!(/^(?:function|object|unknown)$/).test(t)) { return false; } } return true; } /** @ignore */ var getElement, setElement, getUniqueId = (function () { var uid = 0; return function (element) { return element.__uniqueID || (element.__uniqueID = 'uniqueID__' + uid++); }; })(); (function () { var elements = { }; /** @ignore */ getElement = function (uid) { return elements[uid]; }; /** @ignore */ setElement = function (uid, element) { elements[uid] = element; }; })(); function createListener(uid, handler) { return { handler: handler, wrappedHandler: createWrappedHandler(uid, handler) }; } function createWrappedHandler(uid, handler) { return function (e) { handler.call(getElement(uid), e || fabric.window.event); }; } function createDispatcher(uid, eventName) { return function (e) { if (handlers[uid] && handlers[uid][eventName]) { var handlersForEvent = handlers[uid][eventName]; for (var i = 0, len = handlersForEvent.length; i < len; i++) { handlersForEvent[i].call(this, e || fabric.window.event); } } }; } var shouldUseAddListenerRemoveListener = ( areHostMethods(fabric.document.documentElement, 'addEventListener', 'removeEventListener') && areHostMethods(fabric.window, 'addEventListener', 'removeEventListener')), shouldUseAttachEventDetachEvent = ( areHostMethods(fabric.document.documentElement, 'attachEvent', 'detachEvent') && areHostMethods(fabric.window, 'attachEvent', 'detachEvent')), // IE branch listeners = { }, // DOM L0 branch handlers = { }, addListener, removeListener; if (shouldUseAddListenerRemoveListener) { /** @ignore */ addListener = function (element, eventName, handler) { element.addEventListener(eventName, handler, false); }; /** @ignore */ removeListener = function (element, eventName, handler) { element.removeEventListener(eventName, handler, false); }; } else if (shouldUseAttachEventDetachEvent) { /** @ignore */ addListener = function (element, eventName, handler) { var uid = getUniqueId(element); setElement(uid, element); if (!listeners[uid]) { listeners[uid] = { }; } if (!listeners[uid][eventName]) { listeners[uid][eventName] = [ ]; } var listener = createListener(uid, handler); listeners[uid][eventName].push(listener); element.attachEvent('on' + eventName, listener.wrappedHandler); }; /** @ignore */ removeListener = function (element, eventName, handler) { var uid = getUniqueId(element), listener; if (listeners[uid] && listeners[uid][eventName]) { for (var i = 0, len = listeners[uid][eventName].length; i < len; i++) { listener = listeners[uid][eventName][i]; if (listener && listener.handler === handler) { element.detachEvent('on' + eventName, listener.wrappedHandler); listeners[uid][eventName][i] = null; } } } }; } else { /** @ignore */ addListener = function (element, eventName, handler) { var uid = getUniqueId(element); if (!handlers[uid]) { handlers[uid] = { }; } if (!handlers[uid][eventName]) { handlers[uid][eventName] = [ ]; var existingHandler = element['on' + eventName]; if (existingHandler) { handlers[uid][eventName].push(existingHandler); } element['on' + eventName] = createDispatcher(uid, eventName); } handlers[uid][eventName].push(handler); }; /** @ignore */ removeListener = function (element, eventName, handler) { var uid = getUniqueId(element); if (handlers[uid] && handlers[uid][eventName]) { var handlersForEvent = handlers[uid][eventName]; for (var i = 0, len = handlersForEvent.length; i < len; i++) { if (handlersForEvent[i] === handler) { handlersForEvent.splice(i, 1); } } } }; } /** * Adds an event listener to an element * @function * @memberOf fabric.util * @param {HTMLElement} element * @param {String} eventName * @param {Function} handler */ fabric.util.addListener = addListener; /** * Removes an event listener from an element * @function * @memberOf fabric.util * @param {HTMLElement} element * @param {String} eventName * @param {Function} handler */ fabric.util.removeListener = removeListener; /** * Cross-browser wrapper for getting event's coordinates * @memberOf fabric.util * @param {Event} event Event object * @param {HTMLCanvasElement} upperCanvasEl &lt;canvas> element on which object selection is drawn */ function getPointer(event, upperCanvasEl) { event || (event = fabric.window.event); var element = event.target || (typeof event.srcElement !== unknown ? event.srcElement : null), scroll = fabric.util.getScrollLeftTop(element, upperCanvasEl); return { x: pointerX(event) + scroll.left, y: pointerY(event) + scroll.top }; } var pointerX = function(event) { // looks like in IE (<9) clientX at certain point (apparently when mouseup fires on VML element) // is represented as COM object, with all the consequences, like "unknown" type and error on [[Get]] // need to investigate later return (typeof event.clientX !== unknown ? event.clientX : 0); }, pointerY = function(event) { return (typeof event.clientY !== unknown ? event.clientY : 0); }; function _getPointer(event, pageProp, clientProp) { var touchProp = event.type === 'touchend' ? 'changedTouches' : 'touches'; return (event[touchProp] && event[touchProp][0] ? (event[touchProp][0][pageProp] - (event[touchProp][0][pageProp] - event[touchProp][0][clientProp])) || event[clientProp] : event[clientProp]); } if (fabric.isTouchSupported) { pointerX = function(event) { return _getPointer(event, 'pageX', 'clientX'); }; pointerY = function(event) { return _getPointer(event, 'pageY', 'clientY'); }; } fabric.util.getPointer = getPointer; fabric.util.object.extend(fabric.util, fabric.Observable); })(); (function () { /** * Cross-browser wrapper for setting element's style * @memberOf fabric.util * @param {HTMLElement} element * @param {Object} styles * @return {HTMLElement} Element that was passed as a first argument */ function setStyle(element, styles) { var elementStyle = element.style; if (!elementStyle) { return element; } if (typeof styles === 'string') { element.style.cssText += ';' + styles; return styles.indexOf('opacity') > -1 ? setOpacity(element, styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) { if (property === 'opacity') { setOpacity(element, styles[property]); } else { var normalizedProperty = (property === 'float' || property === 'cssFloat') ? (typeof elementStyle.styleFloat === 'undefined' ? 'cssFloat' : 'styleFloat') : property; elementStyle[normalizedProperty] = styles[property]; } } return element; } var parseEl = fabric.document.createElement('div'), supportsOpacity = typeof parseEl.style.opacity === 'string', supportsFilters = typeof parseEl.style.filter === 'string', reOpacity = /alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/, /** @ignore */ setOpacity = function (element) { return element; }; if (supportsOpacity) { /** @ignore */ setOpacity = function(element, value) { element.style.opacity = value; return element; }; } else if (supportsFilters) { /** @ignore */ setOpacity = function(element, value) { var es = element.style; if (element.currentStyle && !element.currentStyle.hasLayout) { es.zoom = 1; } if (reOpacity.test(es.filter)) { value = value >= 0.9999 ? '' : ('alpha(opacity=' + (value * 100) + ')'); es.filter = es.filter.replace(reOpacity, value); } else { es.filter += ' alpha(opacity=' + (value * 100) + ')'; } return element; }; } fabric.util.setStyle = setStyle; })(); (function() { var _slice = Array.prototype.slice; /** * Takes id and returns an element with that id (if one exists in a document) * @memberOf fabric.util * @param {String|HTMLElement} id * @return {HTMLElement|null} */ function getById(id) { return typeof id === 'string' ? fabric.document.getElementById(id) : id; } var sliceCanConvertNodelists, /** * Converts an array-like object (e.g. arguments or NodeList) to an array * @memberOf fabric.util * @param {Object} arrayLike * @return {Array} */ toArray = function(arrayLike) { return _slice.call(arrayLike, 0); }; try { sliceCanConvertNodelists = toArray(fabric.document.childNodes) instanceof Array; } catch (err) { } if (!sliceCanConvertNodelists) { toArray = function(arrayLike) { var arr = new Array(arrayLike.length), i = arrayLike.length; while (i--) { arr[i] = arrayLike[i]; } return arr; }; } /** * Creates specified element with specified attributes * @memberOf fabric.util * @param {String} tagName Type of an element to create * @param {Object} [attributes] Attributes to set on an element * @return {HTMLElement} Newly created element */ function makeElement(tagName, attributes) { var el = fabric.document.createElement(tagName); for (var prop in attributes) { if (prop === 'class') { el.className = attributes[prop]; } else if (prop === 'for') { el.htmlFor = attributes[prop]; } else { el.setAttribute(prop, attributes[prop]); } } return el; } /** * Adds class to an element * @memberOf fabric.util * @param {HTMLElement} element Element to add class to * @param {String} className Class to add to an element */ function addClass(element, className) { if (element && (' ' + element.className + ' ').indexOf(' ' + className + ' ') === -1) { element.className += (element.className ? ' ' : '') + className; } } /** * Wraps element with another element * @memberOf fabric.util * @param {HTMLElement} element Element to wrap * @param {HTMLElement|String} wrapper Element to wrap with * @param {Object} [attributes] Attributes to set on a wrapper * @return {HTMLElement} wrapper */ function wrapElement(element, wrapper, attributes) { if (typeof wrapper === 'string') { wrapper = makeElement(wrapper, attributes); } if (element.parentNode) { element.parentNode.replaceChild(wrapper, element); } wrapper.appendChild(element); return wrapper; } /** * Returns element scroll offsets * @memberOf fabric.util * @param {HTMLElement} element Element to operate on * @param {HTMLElement} upperCanvasEl Upper canvas element * @return {Object} Object with left/top values */ function getScrollLeftTop(element, upperCanvasEl) { var firstFixedAncestor, origElement, left = 0, top = 0, docElement = fabric.document.documentElement, body = fabric.document.body || { scrollLeft: 0, scrollTop: 0 }; origElement = element; while (element && element.parentNode && !firstFixedAncestor) { element = element.parentNode; if (element !== fabric.document && fabric.util.getElementStyle(element, 'position') === 'fixed') { firstFixedAncestor = element; } if (element !== fabric.document && origElement !== upperCanvasEl && fabric.util.getElementStyle(element, 'position') === 'absolute') { left = 0; top = 0; } else if (element === fabric.document) { left = body.scrollLeft || docElement.scrollLeft || 0; top = body.scrollTop || docElement.scrollTop || 0; } else { left += element.scrollLeft || 0; top += element.scrollTop || 0; } } return { left: left, top: top }; } /** * Returns offset for a given element * @function * @memberOf fabric.util * @param {HTMLElement} element Element to get offset for * @return {Object} Object with "left" and "top" properties */ function getElementOffset(element) { var docElem, doc = element && element.ownerDocument, box = { left: 0, top: 0 }, offset = { left: 0, top: 0 }, scrollLeftTop, offsetAttributes = { borderLeftWidth: 'left', borderTopWidth: 'top', paddingLeft: 'left', paddingTop: 'top' }; if (!doc) { return { left: 0, top: 0 }; } for (var attr in offsetAttributes) { offset[offsetAttributes[attr]] += parseInt(getElementStyle(element, attr), 10) || 0; } docElem = doc.documentElement; if ( typeof element.getBoundingClientRect !== 'undefined' ) { box = element.getBoundingClientRect(); } scrollLeftTop = fabric.util.getScrollLeftTop(element, null); return { left: box.left + scrollLeftTop.left - (docElem.clientLeft || 0) + offset.left, top: box.top + scrollLeftTop.top - (docElem.clientTop || 0) + offset.top }; } /** * Returns style attribute value of a given element * @memberOf fabric.util * @param {HTMLElement} element Element to get style attribute for * @param {String} attr Style attribute to get for element * @return {String} Style attribute value of the given element. */ var getElementStyle; if (fabric.document.defaultView && fabric.document.defaultView.getComputedStyle) { getElementStyle = function(element, attr) { return fabric.document.defaultView.getComputedStyle(element, null)[attr]; }; } else { getElementStyle = function(element, attr) { var value = element.style[attr]; if (!value && element.currentStyle) { value = element.currentStyle[attr]; } return value; }; } (function () { var style = fabric.document.documentElement.style, selectProp = 'userSelect' in style ? 'userSelect' : 'MozUserSelect' in style ? 'MozUserSelect' : 'WebkitUserSelect' in style ? 'WebkitUserSelect' : 'KhtmlUserSelect' in style ? 'KhtmlUserSelect' : ''; /** * Makes element unselectable * @memberOf fabric.util * @param {HTMLElement} element Element to make unselectable * @return {HTMLElement} Element that was passed in */ function makeElementUnselectable(element) { if (typeof element.onselectstart !== 'undefined') { element.onselectstart = fabric.util.falseFunction; } if (selectProp) { element.style[selectProp] = 'none'; } else if (typeof element.unselectable === 'string') { element.unselectable = 'on'; } return element; } /** * Makes element selectable * @memberOf fabric.util * @param {HTMLElement} element Element to make selectable * @return {HTMLElement} Element that was passed in */ function makeElementSelectable(element) { if (typeof element.onselectstart !== 'undefined') { element.onselectstart = null; } if (selectProp) { element.style[selectProp] = ''; } else if (typeof element.unselectable === 'string') { element.unselectable = ''; } return element; } fabric.util.makeElementUnselectable = makeElementUnselectable; fabric.util.makeElementSelectable = makeElementSelectable; })(); (function() { /** * Inserts a script element with a given url into a document; invokes callback, when that script is finished loading * @memberOf fabric.util * @param {String} url URL of a script to load * @param {Function} callback Callback to execute when script is finished loading */ function getScript(url, callback) { var headEl = fabric.document.getElementsByTagName('head')[0], scriptEl = fabric.document.createElement('script'), loading = true; /** @ignore */ scriptEl.onload = /** @ignore */ scriptEl.onreadystatechange = function(e) { if (loading) { if (typeof this.readyState === 'string' && this.readyState !== 'loaded' && this.readyState !== 'complete') { return; } loading = false; callback(e || fabric.window.event); scriptEl = scriptEl.onload = scriptEl.onreadystatechange = null; } }; scriptEl.src = url; headEl.appendChild(scriptEl); // causes issue in Opera // headEl.removeChild(scriptEl); } fabric.util.getScript = getScript; })(); fabric.util.getById = getById; fabric.util.toArray = toArray; fabric.util.makeElement = makeElement; fabric.util.addClass = addClass; fabric.util.wrapElement = wrapElement; fabric.util.getScrollLeftTop = getScrollLeftTop; fabric.util.getElementOffset = getElementOffset; fabric.util.getElementStyle = getElementStyle; })(); (function(){ function addParamToUrl(url, param) { return url + (/\?/.test(url) ? '&' : '?') + param; } var makeXHR = (function() { var factories = [ function() { return new ActiveXObject('Microsoft.XMLHTTP'); }, function() { return new ActiveXObject('Msxml2.XMLHTTP'); }, function() { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); }, function() { return new XMLHttpRequest(); } ]; for (var i = factories.length; i--; ) { try { var req = factories[i](); if (req) { return factories[i]; } } catch (err) { } } })(); function emptyFn() { } /** * Cross-browser abstraction for sending XMLHttpRequest * @memberOf fabric.util * @param {String} url URL to send XMLHttpRequest to * @param {Object} [options] Options object * @param {String} [options.method="GET"] * @param {Function} options.onComplete Callback to invoke when request is completed * @return {XMLHttpRequest} request */ function request(url, options) { options || (options = { }); var method = options.method ? options.method.toUpperCase() : 'GET', onComplete = options.onComplete || function() { }, xhr = makeXHR(), body; /** @ignore */ xhr.onreadystatechange = function() { if (xhr.readyState === 4) { onComplete(xhr); xhr.onreadystatechange = emptyFn; } }; if (method === 'GET') { body = null; if (typeof options.parameters === 'string') { url = addParamToUrl(url, options.parameters); } } xhr.open(method, url, true); if (method === 'POST' || method === 'PUT') { xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); } xhr.send(body); return xhr; } fabric.util.request = request; })(); /** * Wrapper around `console.log` (when available) * @param {Any} [values] Values to log */ fabric.log = function() { }; /** * Wrapper around `console.warn` (when available) * @param {Any} [values] Values to log as a warning */ fabric.warn = function() { }; if (typeof console !== 'undefined') { ['log', 'warn'].forEach(function(methodName) { if (typeof console[methodName] !== 'undefined' && console[methodName].apply) { fabric[methodName] = function() { return console[methodName].apply(console, arguments); }; } }); } (function() { /** * Changes value from one to another within certain period of time, invoking callbacks as value is being changed. * @memberOf fabric.util * @param {Object} [options] Animation options * @param {Function} [options.onChange] Callback; invoked on every value change * @param {Function} [options.onComplete] Callback; invoked when value change is completed * @param {Number} [options.startValue=0] Starting value * @param {Number} [options.endValue=100] Ending value * @param {Number} [options.byValue=100] Value to modify the property by * @param {Function} [options.easing] Easing function * @param {Number} [options.duration=500] Duration of change (in ms) */ function animate(options) { requestAnimFrame(function(timestamp) { options || (options = { }); var start = timestamp || +new Date(), duration = options.duration || 500, finish = start + duration, time, onChange = options.onChange || function() { }, abort = options.abort || function() { return false; }, easing = options.easing || function(t, b, c, d) {return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;}, startValue = 'startValue' in options ? options.startValue : 0, endValue = 'endValue' in options ? options.endValue : 100, byValue = options.byValue || endValue - startValue; options.onStart && options.onStart(); (function tick(ticktime) { time = ticktime || +new Date(); var currentTime = time > finish ? duration : (time - start); if (abort()) { options.onComplete && options.onComplete(); return; } onChange(easing(currentTime, startValue, byValue, duration)); if (time > finish) { options.onComplete && options.onComplete(); return; } requestAnimFrame(tick); })(start); }); } var _requestAnimFrame = fabric.window.requestAnimationFrame || fabric.window.webkitRequestAnimationFrame || fabric.window.mozRequestAnimationFrame || fabric.window.oRequestAnimationFrame || fabric.window.msRequestAnimationFrame || function(callback) { fabric.window.setTimeout(callback, 1000 / 60); }; /** * requestAnimationFrame polyfill based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ * In order to get a precise start time, `requestAnimFrame` should be called as an entry into the method * @memberOf fabric.util * @param {Function} callback Callback to invoke * @param {DOMElement} element optional Element to associate with animation */ function requestAnimFrame() { return _requestAnimFrame.apply(fabric.window, arguments); } fabric.util.animate = animate; fabric.util.requestAnimFrame = requestAnimFrame; })(); (function() { function normalize(a, c, p, s) { if (a < Math.abs(c)) { a = c; s = p / 4; } else { s = p / (2 * Math.PI) * Math.asin(c / a); } return { a: a, c: c, p: p, s: s }; } function elastic(opts, t, d) { return opts.a * Math.pow(2, 10 * (t -= 1)) * Math.sin( (t * d - opts.s) * (2 * Math.PI) / opts.p ); } /** * Cubic easing out * @memberOf fabric.util.ease */ function easeOutCubic(t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; } /** * Cubic easing in and out * @memberOf fabric.util.ease */ function easeInOutCubic(t, b, c, d) { t /= d/2; if (t < 1) { return c / 2 * t * t * t + b; } return c / 2 * ((t -= 2) * t * t + 2) + b; } /** * Quartic easing in * @memberOf fabric.util.ease */ function easeInQuart(t, b, c, d) { return c * (t /= d) * t * t * t + b; } /** * Quartic easing out * @memberOf fabric.util.ease */ function easeOutQuart(t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; } /** * Quartic easing in and out * @memberOf fabric.util.ease */ function easeInOutQuart(t, b, c, d) { t /= d / 2; if (t < 1) { return c / 2 * t * t * t * t + b; } return -c / 2 * ((t -= 2) * t * t * t - 2) + b; } /** * Quintic easing in * @memberOf fabric.util.ease */ function easeInQuint(t, b, c, d) { return c * (t /= d) * t * t * t * t + b; } /** * Quintic easing out * @memberOf fabric.util.ease */ function easeOutQuint(t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; } /** * Quintic easing in and out * @memberOf fabric.util.ease */ function easeInOutQuint(t, b, c, d) { t /= d / 2; if (t < 1) { return c / 2 * t * t * t * t * t + b; } return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; } /** * Sinusoidal easing in * @memberOf fabric.util.ease */ function easeInSine(t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; } /** * Sinusoidal easing out * @memberOf fabric.util.ease */ function easeOutSine(t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b; } /** * Sinusoidal easing in and out * @memberOf fabric.util.ease */ function easeInOutSine(t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; } /** * Exponential easing in * @memberOf fabric.util.ease */ function easeInExpo(t, b, c, d) { return (t === 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; } /** * Exponential easing out * @memberOf fabric.util.ease */ function easeOutExpo(t, b, c, d) { return (t === d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; } /** * Exponential easing in and out * @memberOf fabric.util.ease */ function easeInOutExpo(t, b, c, d) { if (t === 0) { return b; } if (t === d) { return b + c; } t /= d / 2; if (t < 1) { return c / 2 * Math.pow(2, 10 * (t - 1)) + b; } return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; } /** * Circular easing in * @memberOf fabric.util.ease */ function easeInCirc(t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; } /** * Circular easing out * @memberOf fabric.util.ease */ function easeOutCirc(t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; } /** * Circular easing in and out * @memberOf fabric.util.ease */ function easeInOutCirc(t, b, c, d) { t /= d / 2; if (t < 1) { return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; } return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; } /** * Elastic easing in * @memberOf fabric.util.ease */ function easeInElastic(t, b, c, d) { var s = 1.70158, p = 0, a = c; if (t === 0) { return b; } t /= d; if (t === 1) { return b + c; } if (!p) { p = d * 0.3; } var opts = normalize(a, c, p, s); return -elastic(opts, t, d) + b; } /** * Elastic easing out * @memberOf fabric.util.ease */ function easeOutElastic(t, b, c, d) { var s = 1.70158, p = 0, a = c; if (t === 0) { return b; } t /= d; if (t === 1) { return b + c; } if (!p) { p = d * 0.3; } var opts = normalize(a, c, p, s); return opts.a * Math.pow(2, -10 * t) * Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) + opts.c + b; } /** * Elastic easing in and out * @memberOf fabric.util.ease */ function easeInOutElastic(t, b, c, d) { var s = 1.70158, p = 0, a = c; if (t === 0) { return b; } t /= d / 2; if (t === 2) { return b + c; } if (!p) { p = d * (0.3 * 1.5); } var opts = normalize(a, c, p, s); if (t < 1) { return -0.5 * elastic(opts, t, d) + b; } return opts.a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - opts.s) * (2 * Math.PI) / opts.p ) * 0.5 + opts.c + b; } /** * Backwards easing in * @memberOf fabric.util.ease */ function easeInBack(t, b, c, d, s) { if (s === undefined) { s = 1.70158; } return c * (t /= d) * t * ((s + 1) * t - s) + b; } /** * Backwards easing out * @memberOf fabric.util.ease */ function easeOutBack(t, b, c, d, s) { if (s === undefined) { s = 1.70158; } return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; } /** * Backwards easing in and out * @memberOf fabric.util.ease */ function easeInOutBack(t, b, c, d, s) { if (s === undefined) { s = 1.70158; } t /= d / 2; if (t < 1) { return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; } return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; } /** * Bouncing easing in * @memberOf fabric.util.ease */ function easeInBounce(t, b, c, d) { return c - easeOutBounce (d - t, 0, c, d) + b; } /** * Bouncing easing out * @memberOf fabric.util.ease */ function easeOutBounce(t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2/2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b; } else if (t < (2.5/2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b; } } /** * Bouncing easing in and out * @memberOf fabric.util.ease */ function easeInOutBounce(t, b, c, d) { if (t < d / 2) { return easeInBounce (t * 2, 0, c, d) * 0.5 + b; } return easeOutBounce(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b; } /** * Easing functions * See <a href="http://gizma.com/easing/">Easing Equations by Robert Penner</a> * @namespace fabric.util.ease */ fabric.util.ease = { /** * Quadratic easing in * @memberOf fabric.util.ease */ easeInQuad: function(t, b, c, d) { return c * (t /= d) * t + b; }, /** * Quadratic easing out * @memberOf fabric.util.ease */ easeOutQuad: function(t, b, c, d) { return -c * (t /= d) * (t - 2) + b; }, /** * Quadratic easing in and out * @memberOf fabric.util.ease */ easeInOutQuad: function(t, b, c, d) { t /= (d / 2); if (t < 1) { return c / 2 * t * t + b; } return -c / 2 * ((--t) * (t - 2) - 1) + b; }, /** * Cubic easing in * @memberOf fabric.util.ease */ easeInCubic: function(t, b, c, d) { return c * (t /= d) * t * t + b; }, easeOutCubic: easeOutCubic, easeInOutCubic: easeInOutCubic, easeInQuart: easeInQuart, easeOutQuart: easeOutQuart, easeInOutQuart: easeInOutQuart, easeInQuint: easeInQuint, easeOutQuint: easeOutQuint, easeInOutQuint: easeInOutQuint, easeInSine: easeInSine, easeOutSine: easeOutSine, easeInOutSine: easeInOutSine, easeInExpo: easeInExpo, easeOutExpo: easeOutExpo, easeInOutExpo: easeInOutExpo, easeInCirc: easeInCirc, easeOutCirc: easeOutCirc, easeInOutCirc: easeInOutCirc, easeInElastic: easeInElastic, easeOutElastic: easeOutElastic, easeInOutElastic: easeInOutElastic, easeInBack: easeInBack, easeOutBack: easeOutBack, easeInOutBack: easeInOutBack, easeInBounce: easeInBounce, easeOutBounce: easeOutBounce, easeInOutBounce: easeInOutBounce }; }()); (function(global) { 'use strict'; /** * @name fabric * @namespace */ var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, capitalize = fabric.util.string.capitalize, clone = fabric.util.object.clone, toFixed = fabric.util.toFixed, parseUnit = fabric.util.parseUnit, multiplyTransformMatrices = fabric.util.multiplyTransformMatrices, attributesMap = { cx: 'left', x: 'left', r: 'radius', cy: 'top', y: 'top', display: 'visible', visibility: 'visible', transform: 'transformMatrix', 'fill-opacity': 'fillOpacity', 'fill-rule': 'fillRule', 'font-family': 'fontFamily', 'font-size': 'fontSize', 'font-style': 'fontStyle', 'font-weight': 'fontWeight', 'stroke-dasharray': 'strokeDashArray', 'stroke-linecap': 'strokeLineCap', 'stroke-linejoin': 'strokeLineJoin', 'stroke-miterlimit': 'strokeMiterLimit', 'stroke-opacity': 'strokeOpacity', 'stroke-width': 'strokeWidth', 'text-decoration': 'textDecoration', 'text-anchor': 'originX' }, colorAttributes = { stroke: 'strokeOpacity', fill: 'fillOpacity' }; function normalizeAttr(attr) { // transform attribute names if (attr in attributesMap) { return attributesMap[attr]; } return attr; } function normalizeValue(attr, value, parentAttributes) { var isArray = Object.prototype.toString.call(value) === '[object Array]', parsed; if ((attr === 'fill' || attr === 'stroke') && value === 'none') { value = ''; } else if (attr === 'fillRule') { value = (value === 'evenodd') ? 'destination-over' : value; } else if (attr === 'strokeDashArray') { value = value.replace(/,/g, ' ').split(/\s+/).map(function(n) { return parseInt(n); }); } else if (attr === 'transformMatrix') { if (parentAttributes && parentAttributes.transformMatrix) { value = multiplyTransformMatrices( parentAttributes.transformMatrix, fabric.parseTransformAttribute(value)); } else { value = fabric.parseTransformAttribute(value); } } else if (attr === 'visible') { value = (value === 'none' || value === 'hidden') ? false : true; // display=none on parent element always takes precedence over child element if (parentAttributes && parentAttributes.visible === false) { value = false; } } else if (attr === 'originX' /* text-anchor */) { value = value === 'start' ? 'left' : value === 'end' ? 'right' : 'center'; } else { parsed = isArray ? value.map(parseUnit) : parseUnit(value); } return (!isArray && isNaN(parsed) ? value : parsed); } /** * @private * @param {Object} attributes Array of attributes to parse */ function _setStrokeFillOpacity(attributes) { for (var attr in colorAttributes) { if (!attributes[attr] || typeof attributes[colorAttributes[attr]] === 'undefined') { continue; } if (attributes[attr].indexOf('url(') === 0) { continue; } var color = new fabric.Color(attributes[attr]); attributes[attr] = color.setAlpha(toFixed(color.getAlpha() * attributes[colorAttributes[attr]], 2)).toRgba(); } return attributes; } /** * Parses "transform" attribute, returning an array of values * @static * @function * @memberOf fabric * @param {String} attributeValue String containing attribute value * @return {Array} Array of 6 elements representing transformation matrix */ fabric.parseTransformAttribute = (function() { function rotateMatrix(matrix, args) { var angle = args[0]; matrix[0] = Math.cos(angle); matrix[1] = Math.sin(angle); matrix[2] = -Math.sin(angle); matrix[3] = Math.cos(angle); } function scaleMatrix(matrix, args) { var multiplierX = args[0], multiplierY = (args.length === 2) ? args[1] : args[0]; matrix[0] = multiplierX; matrix[3] = multiplierY; } function skewXMatrix(matrix, args) { matrix[2] = args[0]; } function skewYMatrix(matrix, args) { matrix[1] = args[0]; } function translateMatrix(matrix, args) { matrix[4] = args[0]; if (args.length === 2) { matrix[5] = args[1]; } } // identity matrix var iMatrix = [ 1, // a 0, // b 0, // c 1, // d 0, // e 0 // f ], // == begin transform regexp number = '(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)', commaWsp = '(?:\\s+,?\\s*|,\\s*)', skewX = '(?:(skewX)\\s*\\(\\s*(' + number + ')\\s*\\))', skewY = '(?:(skewY)\\s*\\(\\s*(' + number + ')\\s*\\))', rotate = '(?:(rotate)\\s*\\(\\s*(' + number + ')(?:' + commaWsp + '(' + number + ')' + commaWsp + '(' + number + '))?\\s*\\))', scale = '(?:(scale)\\s*\\(\\s*(' + number + ')(?:' + commaWsp + '(' + number + '))?\\s*\\))', translate = '(?:(translate)\\s*\\(\\s*(' + number + ')(?:' + commaWsp + '(' + number + '))?\\s*\\))', matrix = '(?:(matrix)\\s*\\(\\s*' + '(' + number + ')' + commaWsp + '(' + number + ')' + commaWsp + '(' + number + ')' + commaWsp + '(' + number + ')' + commaWsp + '(' + number + ')' + commaWsp + '(' + number + ')' + '\\s*\\))', transform = '(?:' + matrix + '|' + translate + '|' + scale + '|' + rotate + '|' + skewX + '|' + skewY + ')', transforms = '(?:' + transform + '(?:' + commaWsp + transform + ')*' + ')', transformList = '^\\s*(?:' + transforms + '?)\\s*$', // http://www.w3.org/TR/SVG/coords.html#TransformAttribute reTransformList = new RegExp(transformList), // == end transform regexp reTransform = new RegExp(transform, 'g'); return function(attributeValue) { // start with identity matrix var matrix = iMatrix.concat(), matrices = [ ]; // return if no argument was given or // an argument does not match transform attribute regexp if (!attributeValue || (attributeValue && !reTransformList.test(attributeValue))) { return matrix; } attributeValue.replace(reTransform, function(match) { var m = new RegExp(transform).exec(match).filter(function (match) { return (match !== '' && match != null); }), operation = m[1], args = m.slice(2).map(parseFloat); switch (operation) { case 'translate': translateMatrix(matrix, args); break; case 'rotate': args[0] = fabric.util.degreesToRadians(args[0]); rotateMatrix(matrix, args); break; case 'scale': scaleMatrix(matrix, args); break; case 'skewX': skewXMatrix(matrix, args); break; case 'skewY': skewYMatrix(matrix, args); break; case 'matrix': matrix = args; break; } // snapshot current matrix into matrices array matrices.push(matrix.concat()); // reset matrix = iMatrix.concat(); }); var combinedMatrix = matrices[0]; while (matrices.length > 1) { matrices.shift(); combinedMatrix = fabric.util.multiplyTransformMatrices(combinedMatrix, matrices[0]); } return combinedMatrix; }; })(); function parseFontDeclaration(value, oStyle) { // TODO: support non-px font size var match = value.match(/(normal|italic)?\s*(normal|small-caps)?\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\s*(\d+)px(?:\/(normal|[\d\.]+))?\s+(.*)/); if (!match) { return; } var fontStyle = match[1], // font variant is not used // fontVariant = match[2], fontWeight = match[3], fontSize = match[4], lineHeight = match[5], fontFamily = match[6]; if (fontStyle) { oStyle.fontStyle = fontStyle; } if (fontWeight) { oStyle.fontWeight = isNaN(parseFloat(fontWeight)) ? fontWeight : parseFloat(fontWeight); } if (fontSize) { oStyle.fontSize = parseFloat(fontSize); } if (fontFamily) { oStyle.fontFamily = fontFamily; } if (lineHeight) { oStyle.lineHeight = lineHeight === 'normal' ? 1 : lineHeight; } } /** * @private */ function parseStyleString(style, oStyle) { var attr, value; style.replace(/;$/, '').split(';').forEach(function (chunk) { var pair = chunk.split(':'); attr = normalizeAttr(pair[0].trim().toLowerCase()); value = normalizeValue(attr, pair[1].trim()); if (attr === 'font') { parseFontDeclaration(value, oStyle); } else { oStyle[attr] = value; } }); } /** * @private */ function parseStyleObject(style, oStyle) { var attr, value; for (var prop in style) { if (typeof style[prop] === 'undefined') { continue; } attr = normalizeAttr(prop.toLowerCase()); value = normalizeValue(attr, style[prop]); if (attr === 'font') { parseFontDeclaration(value, oStyle); } else { oStyle[attr] = value; } } } /** * @private */ function getGlobalStylesForElement(element) { var styles = { }; for (var rule in fabric.cssRules) { if (elementMatchesRule(element, rule.split(' '))) { for (var property in fabric.cssRules[rule]) { styles[property] = fabric.cssRules[rule][property]; } } } return styles; } /** * @private */ function elementMatchesRule(element, selectors) { var firstMatching, parentMatching = true; //start from rightmost selector. firstMatching = selectorMatches(element, selectors.pop()); if (firstMatching && selectors.length) { parentMatching = doesSomeParentMatch(element, selectors); } return firstMatching && parentMatching && (selectors.length === 0); } function doesSomeParentMatch(element, selectors) { var selector, parentMatching = true; while (element.parentNode && element.parentNode.nodeType === 1 && selectors.length) { if (parentMatching) { selector = selectors.pop(); } element = element.parentNode; parentMatching = selectorMatches(element, selector); } return selectors.length === 0; } /** * @private */ function selectorMatches(element, selector) { var nodeName = element.nodeName, classNames = element.getAttribute('class'), id = element.getAttribute('id'), matcher; // i check if a selector matches slicing away part from it. // if i get empty string i should match matcher = new RegExp('^' + nodeName, 'i'); selector = selector.replace(matcher, ''); if (id && selector.length) { matcher = new RegExp('#' + id + '(?![a-zA-Z\\-]+)', 'i'); selector = selector.replace(matcher, ''); } if (classNames && selector.length) { classNames = classNames.split(' '); for (var i = classNames.length; i--;) { matcher = new RegExp('\\.' + classNames[i] + '(?![a-zA-Z\\-]+)', 'i'); selector = selector.replace(matcher, ''); } } return selector.length === 0; } /** * @private */ function parseUseDirectives(doc) { var nodelist = doc.getElementsByTagName('use'); while (nodelist.length) { var el = nodelist[0], xlink = el.getAttribute('xlink:href').substr(1), x = el.getAttribute('x') || 0, y = el.getAttribute('y') || 0, el2 = doc.getElementById(xlink).cloneNode(true), currentTrans = (el.getAttribute('transform') || '') + ' translate(' + x + ', ' + y + ')', parentNode; for (var j = 0, attrs = el.attributes, l = attrs.length; j < l; j++) { var attr = attrs.item(j); if (attr.nodeName === 'x' || attr.nodeName === 'y' || attr.nodeName === 'xlink:href') { continue; } if (attr.nodeName === 'transform') { currentTrans = currentTrans + ' ' + attr.nodeValue; } else { el2.setAttribute(attr.nodeName, attr.nodeValue); } } el2.setAttribute('transform', currentTrans); el2.removeAttribute('id'); parentNode = el.parentNode; parentNode.replaceChild(el2, el); } } /** * Add a <g> element that envelop all SCG elements and makes the viewbox transformMatrix descend on all elements */ function addSvgTransform(doc, matrix) { matrix[3] = matrix[0] = (matrix[0] > matrix[3] ? matrix[3] : matrix[0]); if (!(matrix[0] !== 1 || matrix[3] !== 1 || matrix[4] !== 0 || matrix[5] !== 0)) { return; } // default is to preserve aspect ratio // preserveAspectRatio attribute to be implemented var el = doc.ownerDocument.createElement('g'); while (doc.firstChild != null) { el.appendChild(doc.firstChild); } el.setAttribute('transform','matrix(' + matrix[0] + ' ' + matrix[1] + ' ' + matrix[2] + ' ' + matrix[3] + ' ' + matrix[4] + ' ' + matrix[5] + ')'); doc.appendChild(el); } /** * Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback * @static * @function * @memberOf fabric * @param {SVGDocument} doc SVG document to parse * @param {Function} callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document). * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ fabric.parseSVGDocument = (function() { var reAllowedSVGTagNames = /^(path|circle|polygon|polyline|ellipse|rect|line|image|text)$/, // http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute // \d doesn't quite cut it (as we need to match an actual float number) // matches, e.g.: +14.56e-12, etc. reNum = '(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)', reViewBoxAttrValue = new RegExp( '^' + '\\s*(' + reNum + '+)\\s*,?' + '\\s*(' + reNum + '+)\\s*,?' + '\\s*(' + reNum + '+)\\s*,?' + '\\s*(' + reNum + '+)\\s*' + '$' ); function hasAncestorWithNodeName(element, nodeName) { while (element && (element = element.parentNode)) { if (nodeName.test(element.nodeName)) { return true; } } return false; } return function(doc, callback, reviver) { if (!doc) { return; } var startTime = new Date(); parseUseDirectives(doc); var viewBoxAttr = doc.getAttribute('viewBox'), widthAttr = parseUnit(doc.getAttribute('width')), heightAttr = parseUnit(doc.getAttribute('height')), viewBoxWidth, viewBoxHeight; if (viewBoxAttr && (viewBoxAttr = viewBoxAttr.match(reViewBoxAttrValue))) { var minX = parseFloat(viewBoxAttr[1]), minY = parseFloat(viewBoxAttr[2]), scaleX = 1, scaleY = 1; viewBoxWidth = parseFloat(viewBoxAttr[3]); viewBoxHeight = parseFloat(viewBoxAttr[4]); if (widthAttr && widthAttr !== viewBoxWidth ) { scaleX = widthAttr / viewBoxWidth; } if (heightAttr && heightAttr !== viewBoxHeight) { scaleY = heightAttr / viewBoxHeight; } addSvgTransform(doc, [scaleX, 0, 0, scaleY, scaleX * -minX, scaleY * -minY]); } var descendants = fabric.util.toArray(doc.getElementsByTagName('*')); if (descendants.length === 0 && fabric.isLikelyNode) { // we're likely in node, where "o3-xml" library fails to gEBTN("*") // https://github.com/ajaxorg/node-o3-xml/issues/21 descendants = doc.selectNodes('//*[name(.)!="svg"]'); var arr = [ ]; for (var i = 0, len = descendants.length; i < len; i++) { arr[i] = descendants[i]; } descendants = arr; } var elements = descendants.filter(function(el) { return reAllowedSVGTagNames.test(el.tagName) && !hasAncestorWithNodeName(el, /^(?:pattern|defs)$/); // http://www.w3.org/TR/SVG/struct.html#DefsElement }); if (!elements || (elements && !elements.length)) { callback && callback([], {}); return; } var options = { width: widthAttr ? widthAttr : viewBoxWidth, height: heightAttr ? heightAttr : viewBoxHeight, widthAttr: widthAttr, heightAttr: heightAttr }; fabric.gradientDefs = fabric.getGradientDefs(doc); fabric.cssRules = fabric.getCSSRules(doc); // Precedence of rules: style > class > attribute fabric.parseElements(elements, function(instances) { fabric.documentParsingTime = new Date() - startTime; if (callback) { callback(instances, options); } }, clone(options), reviver); }; })(); /** * Used for caching SVG documents (loaded via `fabric.Canvas#loadSVGFromURL`) * @namespace */ var svgCache = { /** * @param {String} name * @param {Function} callback */ has: function (name, callback) { callback(false); }, get: function () { /* NOOP */ }, set: function () { /* NOOP */ } }; /** * @private */ function _enlivenCachedObject(cachedObject) { var objects = cachedObject.objects, options = cachedObject.options; objects = objects.map(function (o) { return fabric[capitalize(o.type)].fromObject(o); }); return ({ objects: objects, options: options }); } /** * @private */ function _createSVGPattern(markup, canvas, property) { if (canvas[property] && canvas[property].toSVG) { markup.push( '<pattern x="0" y="0" id="', property, 'Pattern" ', 'width="', canvas[property].source.width, '" height="', canvas[property].source.height, '" patternUnits="userSpaceOnUse">', '<image x="0" y="0" ', 'width="', canvas[property].source.width, '" height="', canvas[property].source.height, '" xlink:href="', canvas[property].source.src, '"></image></pattern>' ); } } extend(fabric, { /** * Parses an SVG document, returning all of the gradient declarations found in it * @static * @function * @memberOf fabric * @param {SVGDocument} doc SVG document to parse * @return {Object} Gradient definitions; key corresponds to element id, value -- to gradient definition element */ getGradientDefs: function(doc) { var linearGradientEls = doc.getElementsByTagName('linearGradient'), radialGradientEls = doc.getElementsByTagName('radialGradient'), el, i, j = 0, id, xlink, elList = [ ], gradientDefs = { }, idsToXlinkMap = { }; elList.length = linearGradientEls.length + radialGradientEls.length; i = linearGradientEls.length; while (i--) { elList[j++] = linearGradientEls[i]; } i = radialGradientEls.length; while (i--) { elList[j++] = radialGradientEls[i]; } while (j--) { el = elList[j]; xlink = el.getAttribute('xlink:href'); id = el.getAttribute('id'); if (xlink) { idsToXlinkMap[id] = xlink.substr(1); } gradientDefs[id] = el; } for (id in idsToXlinkMap) { var el2 = gradientDefs[idsToXlinkMap[id]].cloneNode(true); el = gradientDefs[id]; while (el2.firstChild) { el.appendChild(el2.firstChild); } } return gradientDefs; }, /** * Returns an object of attributes' name/value, given element and an array of attribute names; * Parses parent "g" nodes recursively upwards. * @static * @memberOf fabric * @param {DOMElement} element Element to parse * @param {Array} attributes Array of attributes to parse * @return {Object} object containing parsed attributes' names/values */ parseAttributes: function(element, attributes) { if (!element) { return; } var value, parentAttributes = { }; // if there's a parent container (`g` or `a` or `symbol` node), parse its attributes recursively upwards if (element.parentNode && /^symbol|[g|a]$/i.test(element.parentNode.nodeName)) { parentAttributes = fabric.parseAttributes(element.parentNode, attributes); } var ownAttributes = attributes.reduce(function(memo, attr) { value = element.getAttribute(attr); if (value) { attr = normalizeAttr(attr); value = normalizeValue(attr, value, parentAttributes); memo[attr] = value; } return memo; }, { }); // add values parsed from style, which take precedence over attributes // (see: http://www.w3.org/TR/SVG/styling.html#UsingPresentationAttributes) ownAttributes = extend(ownAttributes, extend(getGlobalStylesForElement(element), fabric.parseStyleAttribute(element))); return _setStrokeFillOpacity(extend(parentAttributes, ownAttributes)); }, /** * Transforms an array of svg elements to corresponding fabric.* instances * @static * @memberOf fabric * @param {Array} elements Array of elements to parse * @param {Function} callback Being passed an array of fabric instances (transformed from SVG elements) * @param {Object} [options] Options object * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ parseElements: function(elements, callback, options, reviver) { new fabric.ElementsParser(elements, callback, options, reviver).parse(); }, /** * Parses "style" attribute, retuning an object with values * @static * @memberOf fabric * @param {SVGElement} element Element to parse * @return {Object} Objects with values parsed from style attribute of an element */ parseStyleAttribute: function(element) { var oStyle = { }, style = element.getAttribute('style'); if (!style) { return oStyle; } if (typeof style === 'string') { parseStyleString(style, oStyle); } else { parseStyleObject(style, oStyle); } return oStyle; }, /** * Parses "points" attribute, returning an array of values * @static * @memberOf fabric * @param {String} points points attribute string * @return {Array} array of points */ parsePointsAttribute: function(points) { // points attribute is required and must not be empty if (!points) { return null; } // replace commas with whitespace and remove bookending whitespace points = points.replace(/,/g, ' ').trim(); points = points.split(/\s+/); var parsedPoints = [ ], i, len; i = 0; len = points.length; for (; i < len; i+=2) { parsedPoints.push({ x: parseFloat(points[i]), y: parseFloat(points[i + 1]) }); } // odd number of points is an error // if (parsedPoints.length % 2 !== 0) { // return null; // } return parsedPoints; }, /** * Returns CSS rules for a given SVG document * @static * @function * @memberOf fabric * @param {SVGDocument} doc SVG document to parse * @return {Object} CSS rules of this document */ getCSSRules: function(doc) { var styles = doc.getElementsByTagName('style'), allRules = { }, rules; // very crude parsing of style contents for (var i = 0, len = styles.length; i < len; i++) { var styleContents = styles[0].textContent; // remove comments styleContents = styleContents.replace(/\/\*[\s\S]*?\*\//g, ''); rules = styleContents.match(/[^{]*\{[\s\S]*?\}/g); rules = rules.map(function(rule) { return rule.trim(); }); rules.forEach(function(rule) { var match = rule.match(/([\s\S]*?)\s*\{([^}]*)\}/), ruleObj = { }, declaration = match[2].trim(), propertyValuePairs = declaration.replace(/;$/, '').split(/\s*;\s*/); for (var i = 0, len = propertyValuePairs.length; i < len; i++) { var pair = propertyValuePairs[i].split(/\s*:\s*/), property = normalizeAttr(pair[0]), value = normalizeValue(property,pair[1],pair[0]); ruleObj[property] = value; } rule = match[1]; rule.split(',').forEach(function(_rule) { allRules[_rule.trim()] = fabric.util.object.clone(ruleObj); }); }); } return allRules; }, /** * Takes url corresponding to an SVG document, and parses it into a set of fabric objects. Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy) * @memberof fabric * @param {String} url * @param {Function} callback * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ loadSVGFromURL: function(url, callback, reviver) { url = url.replace(/^\n\s*/, '').trim(); svgCache.has(url, function (hasUrl) { if (hasUrl) { svgCache.get(url, function (value) { var enlivedRecord = _enlivenCachedObject(value); callback(enlivedRecord.objects, enlivedRecord.options); }); } else { new fabric.util.request(url, { method: 'get', onComplete: onComplete }); } }); function onComplete(r) { var xml = r.responseXML; if (xml && !xml.documentElement && fabric.window.ActiveXObject && r.responseText) { xml = new ActiveXObject('Microsoft.XMLDOM'); xml.async = 'false'; //IE chokes on DOCTYPE xml.loadXML(r.responseText.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i,'')); } if (!xml || !xml.documentElement) { return; } fabric.parseSVGDocument(xml.documentElement, function (results, options) { svgCache.set(url, { objects: fabric.util.array.invoke(results, 'toObject'), options: options }); callback(results, options); }, reviver); } }, /** * Takes string corresponding to an SVG document, and parses it into a set of fabric objects * @memberof fabric * @param {String} string * @param {Function} callback * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ loadSVGFromString: function(string, callback, reviver) { string = string.trim(); var doc; if (typeof DOMParser !== 'undefined') { var parser = new DOMParser(); if (parser && parser.parseFromString) { doc = parser.parseFromString(string, 'text/xml'); } } else if (fabric.window.ActiveXObject) { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; //IE chokes on DOCTYPE doc.loadXML(string.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i,'')); } fabric.parseSVGDocument(doc.documentElement, function (results, options) { callback(results, options); }, reviver); }, /** * Creates markup containing SVG font faces * @param {Array} objects Array of fabric objects * @return {String} */ createSVGFontFacesMarkup: function(objects) { var markup = ''; for (var i = 0, len = objects.length; i < len; i++) { if (objects[i].type !== 'text' || !objects[i].path) { continue; } markup += [ //jscs:disable validateIndentation '@font-face {', 'font-family: ', objects[i].fontFamily, '; ', 'src: url(\'', objects[i].path, '\')', '}' //jscs:enable validateIndentation ].join(''); } if (markup) { markup = [ //jscs:disable validateIndentation '<style type="text/css">', '<![CDATA[', markup, ']]>', '</style>' //jscs:enable validateIndentation ].join(''); } return markup; }, /** * Creates markup containing SVG referenced elements like patterns, gradients etc. * @param {fabric.Canvas} canvas instance of fabric.Canvas * @return {String} */ createSVGRefElementsMarkup: function(canvas) { var markup = [ ]; _createSVGPattern(markup, canvas, 'backgroundColor'); _createSVGPattern(markup, canvas, 'overlayColor'); return markup.join(''); } }); })(typeof exports !== 'undefined' ? exports : this); fabric.ElementsParser = function(elements, callback, options, reviver) { this.elements = elements; this.callback = callback; this.options = options; this.reviver = reviver; }; fabric.ElementsParser.prototype.parse = function() { this.instances = new Array(this.elements.length); this.numElements = this.elements.length; this.createObjects(); }; fabric.ElementsParser.prototype.createObjects = function() { for (var i = 0, len = this.elements.length; i < len; i++) { (function(_this, i) { setTimeout(function() { _this.createObject(_this.elements[i], i); }, 0); })(this, i); } }; fabric.ElementsParser.prototype.createObject = function(el, index) { var klass = fabric[fabric.util.string.capitalize(el.tagName)]; if (klass && klass.fromElement) { try { this._createObject(klass, el, index); } catch (err) { fabric.log(err); } } else { this.checkIfDone(); } }; fabric.ElementsParser.prototype._createObject = function(klass, el, index) { if (klass.async) { klass.fromElement(el, this.createCallback(index, el), this.options); } else { var obj = klass.fromElement(el, this.options); this.resolveGradient(obj, 'fill'); this.resolveGradient(obj, 'stroke'); this.reviver && this.reviver(el, obj); this.instances[index] = obj; this.checkIfDone(); } }; fabric.ElementsParser.prototype.createCallback = function(index, el) { var _this = this; return function(obj) { _this.resolveGradient(obj, 'fill'); _this.resolveGradient(obj, 'stroke'); _this.reviver && _this.reviver(el, obj); _this.instances[index] = obj; _this.checkIfDone(); }; }; fabric.ElementsParser.prototype.resolveGradient = function(obj, property) { var instanceFillValue = obj.get(property); if (!(/^url\(/).test(instanceFillValue)) { return; } var gradientId = instanceFillValue.slice(5, instanceFillValue.length - 1); if (fabric.gradientDefs[gradientId]) { obj.set(property, fabric.Gradient.fromElement(fabric.gradientDefs[gradientId], obj)); } }; fabric.ElementsParser.prototype.checkIfDone = function() { if (--this.numElements === 0) { this.instances = this.instances.filter(function(el) { return el != null; }); this.callback(this.instances); } }; (function(global) { 'use strict'; /* Adaptation of work of Kevin Lindsey (kevin@kevlindev.com) */ var fabric = global.fabric || (global.fabric = { }); if (fabric.Point) { fabric.warn('fabric.Point is already defined'); return; } fabric.Point = Point; /** * Point class * @class fabric.Point * @memberOf fabric * @constructor * @param {Number} x * @param {Number} y * @return {fabric.Point} thisArg */ function Point(x, y) { this.x = x; this.y = y; } Point.prototype = /** @lends fabric.Point.prototype */ { constructor: Point, /** * Adds another point to this one and returns another one * @param {fabric.Point} that * @return {fabric.Point} new Point instance with added values */ add: function (that) { return new Point(this.x + that.x, this.y + that.y); }, /** * Adds another point to this one * @param {fabric.Point} that * @return {fabric.Point} thisArg */ addEquals: function (that) { this.x += that.x; this.y += that.y; return this; }, /** * Adds value to this point and returns a new one * @param {Number} scalar * @return {fabric.Point} new Point with added value */ scalarAdd: function (scalar) { return new Point(this.x + scalar, this.y + scalar); }, /** * Adds value to this point * @param {Number} scalar * @return {fabric.Point} thisArg */ scalarAddEquals: function (scalar) { this.x += scalar; this.y += scalar; return this; }, /** * Subtracts another point from this point and returns a new one * @param {fabric.Point} that * @return {fabric.Point} new Point object with subtracted values */ subtract: function (that) { return new Point(this.x - that.x, this.y - that.y); }, /** * Subtracts another point from this point * @param {fabric.Point} that * @return {fabric.Point} thisArg */ subtractEquals: function (that) { this.x -= that.x; this.y -= that.y; return this; }, /** * Subtracts value from this point and returns a new one * @param {Number} scalar * @return {fabric.Point} */ scalarSubtract: function (scalar) { return new Point(this.x - scalar, this.y - scalar); }, /** * Subtracts value from this point * @param {Number} scalar * @return {fabric.Point} thisArg */ scalarSubtractEquals: function (scalar) { this.x -= scalar; this.y -= scalar; return this; }, /** * Miltiplies this point by a value and returns a new one * @param {Number} scalar * @return {fabric.Point} */ multiply: function (scalar) { return new Point(this.x * scalar, this.y * scalar); }, /** * Miltiplies this point by a value * @param {Number} scalar * @return {fabric.Point} thisArg */ multiplyEquals: function (scalar) { this.x *= scalar; this.y *= scalar; return this; }, /** * Divides this point by a value and returns a new one * @param {Number} scalar * @return {fabric.Point} */ divide: function (scalar) { return new Point(this.x / scalar, this.y / scalar); }, /** * Divides this point by a value * @param {Number} scalar * @return {fabric.Point} thisArg */ divideEquals: function (scalar) { this.x /= scalar; this.y /= scalar; return this; }, /** * Returns true if this point is equal to another one * @param {fabric.Point} that * @return {Boolean} */ eq: function (that) { return (this.x === that.x && this.y === that.y); }, /** * Returns true if this point is less than another one * @param {fabric.Point} that * @return {Boolean} */ lt: function (that) { return (this.x < that.x && this.y < that.y); }, /** * Returns true if this point is less than or equal to another one * @param {fabric.Point} that * @return {Boolean} */ lte: function (that) { return (this.x <= that.x && this.y <= that.y); }, /** * Returns true if this point is greater another one * @param {fabric.Point} that * @return {Boolean} */ gt: function (that) { return (this.x > that.x && this.y > that.y); }, /** * Returns true if this point is greater than or equal to another one * @param {fabric.Point} that * @return {Boolean} */ gte: function (that) { return (this.x >= that.x && this.y >= that.y); }, /** * Returns new point which is the result of linear interpolation with this one and another one * @param {fabric.Point} that * @param {Number} t * @return {fabric.Point} */ lerp: function (that, t) { return new Point(this.x + (that.x - this.x) * t, this.y + (that.y - this.y) * t); }, /** * Returns distance from this point and another one * @param {fabric.Point} that * @return {Number} */ distanceFrom: function (that) { var dx = this.x - that.x, dy = this.y - that.y; return Math.sqrt(dx * dx + dy * dy); }, /** * Returns the point between this point and another one * @param {fabric.Point} that * @return {fabric.Point} */ midPointFrom: function (that) { return new Point(this.x + (that.x - this.x)/2, this.y + (that.y - this.y)/2); }, /** * Returns a new point which is the min of this and another one * @param {fabric.Point} that * @return {fabric.Point} */ min: function (that) { return new Point(Math.min(this.x, that.x), Math.min(this.y, that.y)); }, /** * Returns a new point which is the max of this and another one * @param {fabric.Point} that * @return {fabric.Point} */ max: function (that) { return new Point(Math.max(this.x, that.x), Math.max(this.y, that.y)); }, /** * Returns string representation of this point * @return {String} */ toString: function () { return this.x + ',' + this.y; }, /** * Sets x/y of this point * @param {Number} x * @return {Number} y */ setXY: function (x, y) { this.x = x; this.y = y; }, /** * Sets x/y of this point from another point * @param {fabric.Point} that */ setFromPoint: function (that) { this.x = that.x; this.y = that.y; }, /** * Swaps x/y of this point and another point * @param {fabric.Point} that */ swap: function (that) { var x = this.x, y = this.y; this.x = that.x; this.y = that.y; that.x = x; that.y = y; } }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; /* Adaptation of work of Kevin Lindsey (kevin@kevlindev.com) */ var fabric = global.fabric || (global.fabric = { }); if (fabric.Intersection) { fabric.warn('fabric.Intersection is already defined'); return; } /** * Intersection class * @class fabric.Intersection * @memberOf fabric * @constructor */ function Intersection(status) { this.status = status; this.points = []; } fabric.Intersection = Intersection; fabric.Intersection.prototype = /** @lends fabric.Intersection.prototype */ { /** * Appends a point to intersection * @param {fabric.Point} point */ appendPoint: function (point) { this.points.push(point); }, /** * Appends points to intersection * @param {Array} points */ appendPoints: function (points) { this.points = this.points.concat(points); } }; /** * Checks if one line intersects another * @static * @param {fabric.Point} a1 * @param {fabric.Point} a2 * @param {fabric.Point} b1 * @param {fabric.Point} b2 * @return {fabric.Intersection} */ fabric.Intersection.intersectLineLine = function (a1, a2, b1, b2) { var result, uaT = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x), ubT = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x), uB = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); if (uB !== 0) { var ua = uaT / uB, ub = ubT / uB; if (0 <= ua && ua <= 1 && 0 <= ub && ub <= 1) { result = new Intersection('Intersection'); result.points.push(new fabric.Point(a1.x + ua * (a2.x - a1.x), a1.y + ua * (a2.y - a1.y))); } else { result = new Intersection(); } } else { if (uaT === 0 || ubT === 0) { result = new Intersection('Coincident'); } else { result = new Intersection('Parallel'); } } return result; }; /** * Checks if line intersects polygon * @static * @param {fabric.Point} a1 * @param {fabric.Point} a2 * @param {Array} points * @return {fabric.Intersection} */ fabric.Intersection.intersectLinePolygon = function(a1,a2,points){ var result = new Intersection(), length = points.length; for (var i = 0; i < length; i++) { var b1 = points[i], b2 = points[(i + 1) % length], inter = Intersection.intersectLineLine(a1, a2, b1, b2); result.appendPoints(inter.points); } if (result.points.length > 0) { result.status = 'Intersection'; } return result; }; /** * Checks if polygon intersects another polygon * @static * @param {Array} points1 * @param {Array} points2 * @return {fabric.Intersection} */ fabric.Intersection.intersectPolygonPolygon = function (points1, points2) { var result = new Intersection(), length = points1.length; for (var i = 0; i < length; i++) { var a1 = points1[i], a2 = points1[(i + 1) % length], inter = Intersection.intersectLinePolygon(a1, a2, points2); result.appendPoints(inter.points); } if (result.points.length > 0) { result.status = 'Intersection'; } return result; }; /** * Checks if polygon intersects rectangle * @static * @param {Array} points * @param {Number} r1 * @param {Number} r2 * @return {fabric.Intersection} */ fabric.Intersection.intersectPolygonRectangle = function (points, r1, r2) { var min = r1.min(r2), max = r1.max(r2), topRight = new fabric.Point(max.x, min.y), bottomLeft = new fabric.Point(min.x, max.y), inter1 = Intersection.intersectLinePolygon(min, topRight, points), inter2 = Intersection.intersectLinePolygon(topRight, max, points), inter3 = Intersection.intersectLinePolygon(max, bottomLeft, points), inter4 = Intersection.intersectLinePolygon(bottomLeft, min, points), result = new Intersection(); result.appendPoints(inter1.points); result.appendPoints(inter2.points); result.appendPoints(inter3.points); result.appendPoints(inter4.points); if (result.points.length > 0) { result.status = 'Intersection'; } return result; }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); if (fabric.Color) { fabric.warn('fabric.Color is already defined.'); return; } /** * Color class * The purpose of {@link fabric.Color} is to abstract and encapsulate common color operations; * {@link fabric.Color} is a constructor and creates instances of {@link fabric.Color} objects. * * @class fabric.Color * @param {String} color optional in hex or rgb(a) format * @return {fabric.Color} thisArg * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#colors} */ function Color(color) { if (!color) { this.setSource([0, 0, 0, 1]); } else { this._tryParsingColor(color); } } fabric.Color = Color; fabric.Color.prototype = /** @lends fabric.Color.prototype */ { /** * @private * @param {String|Array} color Color value to parse */ _tryParsingColor: function(color) { var source; if (color in Color.colorNameMap) { color = Color.colorNameMap[color]; } if (color === 'transparent') { this.setSource([255,255,255,0]); return; } source = Color.sourceFromHex(color); if (!source) { source = Color.sourceFromRgb(color); } if (!source) { source = Color.sourceFromHsl(color); } if (source) { this.setSource(source); } }, /** * Adapted from <a href="https://rawgithub.com/mjijackson/mjijackson.github.com/master/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript.html">https://github.com/mjijackson</a> * @private * @param {Number} r Red color value * @param {Number} g Green color value * @param {Number} b Blue color value * @return {Array} Hsl color */ _rgbToHsl: function(r, g, b) { r /= 255, g /= 255, b /= 255; var h, s, l, max = fabric.util.array.max([r, g, b]), min = fabric.util.array.min([r, g, b]); l = (max + min) / 2; if (max === min) { h = s = 0; // achromatic } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return [ Math.round(h * 360), Math.round(s * 100), Math.round(l * 100) ]; }, /** * Returns source of this color (where source is an array representation; ex: [200, 200, 100, 1]) * @return {Array} */ getSource: function() { return this._source; }, /** * Sets source of this color (where source is an array representation; ex: [200, 200, 100, 1]) * @param {Array} source */ setSource: function(source) { this._source = source; }, /** * Returns color represenation in RGB format * @return {String} ex: rgb(0-255,0-255,0-255) */ toRgb: function() { var source = this.getSource(); return 'rgb(' + source[0] + ',' + source[1] + ',' + source[2] + ')'; }, /** * Returns color represenation in RGBA format * @return {String} ex: rgba(0-255,0-255,0-255,0-1) */ toRgba: function() { var source = this.getSource(); return 'rgba(' + source[0] + ',' + source[1] + ',' + source[2] + ',' + source[3] + ')'; }, /** * Returns color represenation in HSL format * @return {String} ex: hsl(0-360,0%-100%,0%-100%) */ toHsl: function() { var source = this.getSource(), hsl = this._rgbToHsl(source[0], source[1], source[2]); return 'hsl(' + hsl[0] + ',' + hsl[1] + '%,' + hsl[2] + '%)'; }, /** * Returns color represenation in HSLA format * @return {String} ex: hsla(0-360,0%-100%,0%-100%,0-1) */ toHsla: function() { var source = this.getSource(), hsl = this._rgbToHsl(source[0], source[1], source[2]); return 'hsla(' + hsl[0] + ',' + hsl[1] + '%,' + hsl[2] + '%,' + source[3] + ')'; }, /** * Returns color represenation in HEX format * @return {String} ex: FF5555 */ toHex: function() { var source = this.getSource(), r, g, b; r = source[0].toString(16); r = (r.length === 1) ? ('0' + r) : r; g = source[1].toString(16); g = (g.length === 1) ? ('0' + g) : g; b = source[2].toString(16); b = (b.length === 1) ? ('0' + b) : b; return r.toUpperCase() + g.toUpperCase() + b.toUpperCase(); }, /** * Gets value of alpha channel for this color * @return {Number} 0-1 */ getAlpha: function() { return this.getSource()[3]; }, /** * Sets value of alpha channel for this color * @param {Number} alpha Alpha value 0-1 * @return {fabric.Color} thisArg */ setAlpha: function(alpha) { var source = this.getSource(); source[3] = alpha; this.setSource(source); return this; }, /** * Transforms color to its grayscale representation * @return {fabric.Color} thisArg */ toGrayscale: function() { var source = this.getSource(), average = parseInt((source[0] * 0.3 + source[1] * 0.59 + source[2] * 0.11).toFixed(0), 10), currentAlpha = source[3]; this.setSource([average, average, average, currentAlpha]); return this; }, /** * Transforms color to its black and white representation * @param {Number} threshold * @return {fabric.Color} thisArg */ toBlackWhite: function(threshold) { var source = this.getSource(), average = (source[0] * 0.3 + source[1] * 0.59 + source[2] * 0.11).toFixed(0), currentAlpha = source[3]; threshold = threshold || 127; average = (Number(average) < Number(threshold)) ? 0 : 255; this.setSource([average, average, average, currentAlpha]); return this; }, /** * Overlays color with another color * @param {String|fabric.Color} otherColor * @return {fabric.Color} thisArg */ overlayWith: function(otherColor) { if (!(otherColor instanceof Color)) { otherColor = new Color(otherColor); } var result = [], alpha = this.getAlpha(), otherAlpha = 0.5, source = this.getSource(), otherSource = otherColor.getSource(); for (var i = 0; i < 3; i++) { result.push(Math.round((source[i] * (1 - otherAlpha)) + (otherSource[i] * otherAlpha))); } result[3] = alpha; this.setSource(result); return this; } }; /** * Regex matching color in RGB or RGBA formats (ex: rgb(0, 0, 0), rgba(255, 100, 10, 0.5), rgba( 255 , 100 , 10 , 0.5 ), rgb(1,1,1), rgba(100%, 60%, 10%, 0.5)) * @static * @field * @memberOf fabric.Color */ fabric.Color.reRGBa = /^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/; /** * Regex matching color in HSL or HSLA formats (ex: hsl(200, 80%, 10%), hsla(300, 50%, 80%, 0.5), hsla( 300 , 50% , 80% , 0.5 )) * @static * @field * @memberOf fabric.Color */ fabric.Color.reHSLa = /^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/; /** * Regex matching color in HEX format (ex: #FF5555, 010155, aff) * @static * @field * @memberOf fabric.Color */ fabric.Color.reHex = /^#?([0-9a-f]{6}|[0-9a-f]{3})$/i; /** * Map of the 17 basic color names with HEX code * @static * @field * @memberOf fabric.Color * @see: http://www.w3.org/TR/CSS2/syndata.html#color-units */ fabric.Color.colorNameMap = { aqua: '#00FFFF', black: '#000000', blue: '#0000FF', fuchsia: '#FF00FF', gray: '#808080', green: '#008000', lime: '#00FF00', maroon: '#800000', navy: '#000080', olive: '#808000', orange: '#FFA500', purple: '#800080', red: '#FF0000', silver: '#C0C0C0', teal: '#008080', white: '#FFFFFF', yellow: '#FFFF00' }; /** * @private * @param {Number} p * @param {Number} q * @param {Number} t * @return {Number} */ function hue2rgb(p, q, t){ if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1/6) { return p + (q - p) * 6 * t; } if (t < 1/2) { return q; } if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; } return p; } /** * Returns new color object, when given a color in RGB format * @memberOf fabric.Color * @param {String} color Color value ex: rgb(0-255,0-255,0-255) * @return {fabric.Color} */ fabric.Color.fromRgb = function(color) { return Color.fromSource(Color.sourceFromRgb(color)); }; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in RGB or RGBA format * @memberOf fabric.Color * @param {String} color Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%) * @return {Array} source */ fabric.Color.sourceFromRgb = function(color) { var match = color.match(Color.reRGBa); if (match) { var r = parseInt(match[1], 10) / (/%$/.test(match[1]) ? 100 : 1) * (/%$/.test(match[1]) ? 255 : 1), g = parseInt(match[2], 10) / (/%$/.test(match[2]) ? 100 : 1) * (/%$/.test(match[2]) ? 255 : 1), b = parseInt(match[3], 10) / (/%$/.test(match[3]) ? 100 : 1) * (/%$/.test(match[3]) ? 255 : 1); return [ parseInt(r, 10), parseInt(g, 10), parseInt(b, 10), match[4] ? parseFloat(match[4]) : 1 ]; } }; /** * Returns new color object, when given a color in RGBA format * @static * @function * @memberOf fabric.Color * @param {String} color * @return {fabric.Color} */ fabric.Color.fromRgba = Color.fromRgb; /** * Returns new color object, when given a color in HSL format * @param {String} color Color value ex: hsl(0-260,0%-100%,0%-100%) * @memberOf fabric.Color * @return {fabric.Color} */ fabric.Color.fromHsl = function(color) { return Color.fromSource(Color.sourceFromHsl(color)); }; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HSL or HSLA format. * Adapted from <a href="https://rawgithub.com/mjijackson/mjijackson.github.com/master/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript.html">https://github.com/mjijackson</a> * @memberOf fabric.Color * @param {String} color Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1) * @return {Array} source * @see http://http://www.w3.org/TR/css3-color/#hsl-color */ fabric.Color.sourceFromHsl = function(color) { var match = color.match(Color.reHSLa); if (!match) { return; } var h = (((parseFloat(match[1]) % 360) + 360) % 360) / 360, s = parseFloat(match[2]) / (/%$/.test(match[2]) ? 100 : 1), l = parseFloat(match[3]) / (/%$/.test(match[3]) ? 100 : 1), r, g, b; if (s === 0) { r = g = b = l; } else { var q = l <= 0.5 ? l * (s + 1) : l + s - l * s, p = l * 2 - q; r = hue2rgb(p, q, h + 1/3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1/3); } return [ Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), match[4] ? parseFloat(match[4]) : 1 ]; }; /** * Returns new color object, when given a color in HSLA format * @static * @function * @memberOf fabric.Color * @param {String} color * @return {fabric.Color} */ fabric.Color.fromHsla = Color.fromHsl; /** * Returns new color object, when given a color in HEX format * @static * @memberOf fabric.Color * @param {String} color Color value ex: FF5555 * @return {fabric.Color} */ fabric.Color.fromHex = function(color) { return Color.fromSource(Color.sourceFromHex(color)); }; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HEX format * @static * @memberOf fabric.Color * @param {String} color ex: FF5555 * @return {Array} source */ fabric.Color.sourceFromHex = function(color) { if (color.match(Color.reHex)) { var value = color.slice(color.indexOf('#') + 1), isShortNotation = (value.length === 3), r = isShortNotation ? (value.charAt(0) + value.charAt(0)) : value.substring(0, 2), g = isShortNotation ? (value.charAt(1) + value.charAt(1)) : value.substring(2, 4), b = isShortNotation ? (value.charAt(2) + value.charAt(2)) : value.substring(4, 6); return [ parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1 ]; } }; /** * Returns new color object, when given color in array representation (ex: [200, 100, 100, 0.5]) * @static * @memberOf fabric.Color * @param {Array} source * @return {fabric.Color} */ fabric.Color.fromSource = function(source) { var oColor = new Color(); oColor.setSource(source); return oColor; }; })(typeof exports !== 'undefined' ? exports : this); (function() { /* _FROM_SVG_START_ */ function getColorStop(el) { var style = el.getAttribute('style'), offset = el.getAttribute('offset'), color, colorAlpha, opacity; // convert percents to absolute values offset = parseFloat(offset) / (/%$/.test(offset) ? 100 : 1); if (style) { var keyValuePairs = style.split(/\s*;\s*/); if (keyValuePairs[keyValuePairs.length - 1] === '') { keyValuePairs.pop(); } for (var i = keyValuePairs.length; i--; ) { var split = keyValuePairs[i].split(/\s*:\s*/), key = split[0].trim(), value = split[1].trim(); if (key === 'stop-color') { color = value; } else if (key === 'stop-opacity') { opacity = value; } } } if (!color) { color = el.getAttribute('stop-color') || 'rgb(0,0,0)'; } if (!opacity) { opacity = el.getAttribute('stop-opacity'); } color = new fabric.Color(color); colorAlpha = color.getAlpha(); opacity = isNaN(parseFloat(opacity)) ? 1 : parseFloat(opacity); opacity *= colorAlpha; return { offset: offset, color: color.toRgb(), opacity: opacity }; } function getLinearCoords(el) { return { x1: el.getAttribute('x1') || 0, y1: el.getAttribute('y1') || 0, x2: el.getAttribute('x2') || '100%', y2: el.getAttribute('y2') || 0 }; } function getRadialCoords(el) { return { x1: el.getAttribute('fx') || el.getAttribute('cx') || '50%', y1: el.getAttribute('fy') || el.getAttribute('cy') || '50%', r1: 0, x2: el.getAttribute('cx') || '50%', y2: el.getAttribute('cy') || '50%', r2: el.getAttribute('r') || '50%' }; } /* _FROM_SVG_END_ */ /** * Gradient class * @class fabric.Gradient * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#gradients} * @see {@link fabric.Gradient#initialize} for constructor definition */ fabric.Gradient = fabric.util.createClass(/** @lends fabric.Gradient.prototype */ { /* * Stores the original position of the gradient when we convert from % to fixed values, for objectBoundingBox case. * @type Number * @default 0 */ origX: 0, /* * Stores the original position of the gradient when we convert from % to fixed values, for objectBoundingBox case. * @type Number * @default 0 */ origY: 0, /** * Constructor * @param {Object} [options] Options object with type, coords, gradientUnits and colorStops * @return {fabric.Gradient} thisArg */ initialize: function(options) { options || (options = { }); var coords = { }; this.id = fabric.Object.__uid++; this.type = options.type || 'linear'; coords = { x1: options.coords.x1 || 0, y1: options.coords.y1 || 0, x2: options.coords.x2 || 0, y2: options.coords.y2 || 0 }; if (this.type === 'radial') { coords.r1 = options.coords.r1 || 0; coords.r2 = options.coords.r2 || 0; } this.coords = coords; this.gradientUnits = options.gradientUnits || 'objectBoundingBox'; this.colorStops = options.colorStops.slice(); if (options.gradientTransform) { this.gradientTransform = options.gradientTransform; } this.origX = options.left || this.origX; this.origY = options.top || this.origY; }, /** * Adds another colorStop * @param {Object} colorStop Object with offset and color * @return {fabric.Gradient} thisArg */ addColorStop: function(colorStop) { for (var position in colorStop) { var color = new fabric.Color(colorStop[position]); this.colorStops.push({ offset: position, color: color.toRgb(), opacity: color.getAlpha() }); } return this; }, /** * Returns object representation of a gradient * @return {Object} */ toObject: function() { return { type: this.type, coords: this.coords, gradientUnits: this.gradientUnits, colorStops: this.colorStops }; }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an gradient * @param {Object} object Object to create a gradient for * @param {Boolean} normalize Whether coords should be normalized * @return {String} SVG representation of an gradient (linear/radial) */ toSVG: function(object, normalize) { var coords = fabric.util.object.clone(this.coords), markup, commonAttributes; // colorStops must be sorted ascending this.colorStops.sort(function(a, b) { return a.offset - b.offset; }); if (normalize && this.gradientUnits === 'userSpaceOnUse') { coords.x1 += object.width / 2; coords.y1 += object.height / 2; coords.x2 += object.width / 2; coords.y2 += object.height / 2; } else if (this.gradientUnits === 'objectBoundingBox') { _convertValuesToPercentUnits(object, coords); } commonAttributes = 'id="SVGID_' + this.id + '" gradientUnits="' + this.gradientUnits + '"'; if (this.gradientTransform) { commonAttributes += ' gradientTransform="matrix(' + this.gradientTransform.join(' ') + ')" '; } if (this.type === 'linear') { markup = [ //jscs:disable validateIndentation '<linearGradient ', commonAttributes, ' x1="', coords.x1, '" y1="', coords.y1, '" x2="', coords.x2, '" y2="', coords.y2, '">\n' //jscs:enable validateIndentation ]; } else if (this.type === 'radial') { markup = [ //jscs:disable validateIndentation '<radialGradient ', commonAttributes, ' cx="', coords.x2, '" cy="', coords.y2, '" r="', coords.r2, '" fx="', coords.x1, '" fy="', coords.y1, '">\n' //jscs:enable validateIndentation ]; } for (var i = 0; i < this.colorStops.length; i++) { markup.push( //jscs:disable validateIndentation '<stop ', 'offset="', (this.colorStops[i].offset * 100) + '%', '" style="stop-color:', this.colorStops[i].color, (this.colorStops[i].opacity != null ? ';stop-opacity: ' + this.colorStops[i].opacity : ';'), '"/>\n' //jscs:enable validateIndentation ); } markup.push((this.type === 'linear' ? '</linearGradient>\n' : '</radialGradient>\n')); return markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns an instance of CanvasGradient * @param {CanvasRenderingContext2D} ctx Context to render on * @return {CanvasGradient} */ toLive: function(ctx) { var gradient; if (!this.type) { return; } if (this.type === 'linear') { gradient = ctx.createLinearGradient( this.coords.x1, this.coords.y1, this.coords.x2, this.coords.y2); } else if (this.type === 'radial') { gradient = ctx.createRadialGradient( this.coords.x1, this.coords.y1, this.coords.r1, this.coords.x2, this.coords.y2, this.coords.r2); } for (var i = 0, len = this.colorStops.length; i < len; i++) { var color = this.colorStops[i].color, opacity = this.colorStops[i].opacity, offset = this.colorStops[i].offset; if (typeof opacity !== 'undefined') { color = new fabric.Color(color).setAlpha(opacity).toRgba(); } gradient.addColorStop(parseFloat(offset), color); } return gradient; } }); fabric.util.object.extend(fabric.Gradient, { /* _FROM_SVG_START_ */ /** * Returns {@link fabric.Gradient} instance from an SVG element * @static * @memberof fabric.Gradient * @param {SVGGradientElement} el SVG gradient element * @param {fabric.Object} instance * @return {fabric.Gradient} Gradient instance * @see http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement * @see http://www.w3.org/TR/SVG/pservers.html#RadialGradientElement */ fromElement: function(el, instance) { /** * @example: * * <linearGradient id="linearGrad1"> * <stop offset="0%" stop-color="white"/> * <stop offset="100%" stop-color="black"/> * </linearGradient> * * OR * * <linearGradient id="linearGrad2"> * <stop offset="0" style="stop-color:rgb(255,255,255)"/> * <stop offset="1" style="stop-color:rgb(0,0,0)"/> * </linearGradient> * * OR * * <radialGradient id="radialGrad1"> * <stop offset="0%" stop-color="white" stop-opacity="1" /> * <stop offset="50%" stop-color="black" stop-opacity="0.5" /> * <stop offset="100%" stop-color="white" stop-opacity="1" /> * </radialGradient> * * OR * * <radialGradient id="radialGrad2"> * <stop offset="0" stop-color="rgb(255,255,255)" /> * <stop offset="0.5" stop-color="rgb(0,0,0)" /> * <stop offset="1" stop-color="rgb(255,255,255)" /> * </radialGradient> * */ var colorStopEls = el.getElementsByTagName('stop'), type = (el.nodeName === 'linearGradient' ? 'linear' : 'radial'), gradientUnits = el.getAttribute('gradientUnits') || 'objectBoundingBox', gradientTransform = el.getAttribute('gradientTransform'), colorStops = [], coords = { }; if (type === 'linear') { coords = getLinearCoords(el); } else if (type === 'radial') { coords = getRadialCoords(el); } for (var i = colorStopEls.length; i--; ) { colorStops.push(getColorStop(colorStopEls[i])); } _convertPercentUnitsToValues(instance, coords); var gradient = new fabric.Gradient({ type: type, coords: coords, gradientUnits: gradientUnits, colorStops: colorStops }); if (gradientTransform) { gradient.gradientTransform = fabric.parseTransformAttribute(gradientTransform); } return gradient; }, /* _FROM_SVG_END_ */ /** * Returns {@link fabric.Gradient} instance from its object representation * @static * @memberof fabric.Gradient * @param {Object} obj * @param {Object} [options] Options object */ forObject: function(obj, options) { options || (options = { }); _convertPercentUnitsToValues(obj, options); return new fabric.Gradient(options); } }); /** * @private */ function _convertPercentUnitsToValues(object, options) { for (var prop in options) { if (typeof options[prop] === 'string' && /^\d+%$/.test(options[prop])) { var percents = parseFloat(options[prop], 10); if (prop === 'x1' || prop === 'x2' || prop === 'r2') { options[prop] = fabric.util.toFixed(object.width * percents / 100, 2) + object.left; } else if (prop === 'y1' || prop === 'y2') { options[prop] = fabric.util.toFixed(object.height * percents / 100, 2) + object.top; } } } } /* _TO_SVG_START_ */ /** * @private */ function _convertValuesToPercentUnits(object, options) { for (var prop in options) { //convert to percent units if (prop === 'x1' || prop === 'x2' || prop === 'r2') { options[prop] = fabric.util.toFixed((options[prop] - object.fill.origX) / object.width * 100, 2) + '%'; } else if (prop === 'y1' || prop === 'y2') { options[prop] = fabric.util.toFixed((options[prop] - object.fill.origY) / object.height * 100, 2) + '%'; } } } /* _TO_SVG_END_ */ })(); /** * Pattern class * @class fabric.Pattern * @see {@link http://fabricjs.com/patterns/|Pattern demo} * @see {@link http://fabricjs.com/dynamic-patterns/|DynamicPattern demo} * @see {@link fabric.Pattern#initialize} for constructor definition */ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */ { /** * Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat) * @type String * @default */ repeat: 'repeat', /** * Pattern horizontal offset from object's left/top corner * @type Number * @default */ offsetX: 0, /** * Pattern vertical offset from object's left/top corner * @type Number * @default */ offsetY: 0, /** * Constructor * @param {Object} [options] Options object * @return {fabric.Pattern} thisArg */ initialize: function(options) { options || (options = { }); this.id = fabric.Object.__uid++; if (options.source) { if (typeof options.source === 'string') { // function string if (typeof fabric.util.getFunctionBody(options.source) !== 'undefined') { this.source = new Function(fabric.util.getFunctionBody(options.source)); } else { // img src string var _this = this; this.source = fabric.util.createImage(); fabric.util.loadImage(options.source, function(img) { _this.source = img; }); } } else { // img element this.source = options.source; } } if (options.repeat) { this.repeat = options.repeat; } if (options.offsetX) { this.offsetX = options.offsetX; } if (options.offsetY) { this.offsetY = options.offsetY; } }, /** * Returns object representation of a pattern * @return {Object} Object representation of a pattern instance */ toObject: function() { var source; // callback if (typeof this.source === 'function') { source = String(this.source); } // <img> element else if (typeof this.source.src === 'string') { source = this.source.src; } return { source: source, repeat: this.repeat, offsetX: this.offsetX, offsetY: this.offsetY }; }, /* _TO_SVG_START_ */ /** * Returns SVG representation of a pattern * @param {fabric.Object} object * @return {String} SVG representation of a pattern */ toSVG: function(object) { var patternSource = typeof this.source === 'function' ? this.source() : this.source, patternWidth = patternSource.width / object.getWidth(), patternHeight = patternSource.height / object.getHeight(), patternImgSrc = ''; if (patternSource.src) { patternImgSrc = patternSource.src; } else if (patternSource.toDataURL) { patternImgSrc = patternSource.toDataURL(); } return '<pattern id="SVGID_' + this.id + '" x="' + this.offsetX + '" y="' + this.offsetY + '" width="' + patternWidth + '" height="' + patternHeight + '">' + '<image x="0" y="0"' + ' width="' + patternSource.width + '" height="' + patternSource.height + '" xlink:href="' + patternImgSrc + '"></image>' + '</pattern>'; }, /* _TO_SVG_END_ */ /** * Returns an instance of CanvasPattern * @param {CanvasRenderingContext2D} ctx Context to create pattern * @return {CanvasPattern} */ toLive: function(ctx) { var source = typeof this.source === 'function' ? this.source() : this.source; // if the image failed to load, return, and allow rest to continue loading if (!source) { return ''; } // if an image if (typeof source.src !== 'undefined') { if (!source.complete) { return ''; } if (source.naturalWidth === 0 || source.naturalHeight === 0) { return ''; } } return ctx.createPattern(source, this.repeat); } }); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); if (fabric.Shadow) { fabric.warn('fabric.Shadow is already defined.'); return; } /** * Shadow class * @class fabric.Shadow * @see {@link http://fabricjs.com/shadows/|Shadow demo} * @see {@link fabric.Shadow#initialize} for constructor definition */ fabric.Shadow = fabric.util.createClass(/** @lends fabric.Shadow.prototype */ { /** * Shadow color * @type String * @default */ color: 'rgb(0,0,0)', /** * Shadow blur * @type Number */ blur: 0, /** * Shadow horizontal offset * @type Number * @default */ offsetX: 0, /** * Shadow vertical offset * @type Number * @default */ offsetY: 0, /** * Whether the shadow should affect stroke operations * @type Boolean * @default */ affectStroke: false, /** * Indicates whether toObject should include default values * @type Boolean * @default */ includeDefaultValues: true, /** * Constructor * @param {Object|String} [options] Options object with any of color, blur, offsetX, offsetX properties or string (e.g. "rgba(0,0,0,0.2) 2px 2px 10px, "2px 2px 10px rgba(0,0,0,0.2)") * @return {fabric.Shadow} thisArg */ initialize: function(options) { if (typeof options === 'string') { options = this._parseShadow(options); } for (var prop in options) { this[prop] = options[prop]; } this.id = fabric.Object.__uid++; }, /** * @private * @param {String} shadow Shadow value to parse * @return {Object} Shadow object with color, offsetX, offsetY and blur */ _parseShadow: function(shadow) { var shadowStr = shadow.trim(), offsetsAndBlur = fabric.Shadow.reOffsetsAndBlur.exec(shadowStr) || [ ], color = shadowStr.replace(fabric.Shadow.reOffsetsAndBlur, '') || 'rgb(0,0,0)'; return { color: color.trim(), offsetX: parseInt(offsetsAndBlur[1], 10) || 0, offsetY: parseInt(offsetsAndBlur[2], 10) || 0, blur: parseInt(offsetsAndBlur[3], 10) || 0 }; }, /** * Returns a string representation of an instance * @see http://www.w3.org/TR/css-text-decor-3/#text-shadow * @return {String} Returns CSS3 text-shadow declaration */ toString: function() { return [this.offsetX, this.offsetY, this.blur, this.color].join('px '); }, /* _TO_SVG_START_ */ /** * Returns SVG representation of a shadow * @param {fabric.Object} object * @return {String} SVG representation of a shadow */ toSVG: function(object) { var mode = 'SourceAlpha'; if (object && (object.fill === this.color || object.stroke === this.color)) { mode = 'SourceGraphic'; } return ( '<filter id="SVGID_' + this.id + '" y="-40%" height="180%">' + '<feGaussianBlur in="' + mode + '" stdDeviation="' + (this.blur ? this.blur / 3 : 0) + '"></feGaussianBlur>' + '<feOffset dx="' + this.offsetX + '" dy="' + this.offsetY + '"></feOffset>' + '<feMerge>' + '<feMergeNode></feMergeNode>' + '<feMergeNode in="SourceGraphic"></feMergeNode>' + '</feMerge>' + '</filter>'); }, /* _TO_SVG_END_ */ /** * Returns object representation of a shadow * @return {Object} Object representation of a shadow instance */ toObject: function() { if (this.includeDefaultValues) { return { color: this.color, blur: this.blur, offsetX: this.offsetX, offsetY: this.offsetY }; } var obj = { }, proto = fabric.Shadow.prototype; if (this.color !== proto.color) { obj.color = this.color; } if (this.blur !== proto.blur) { obj.blur = this.blur; } if (this.offsetX !== proto.offsetX) { obj.offsetX = this.offsetX; } if (this.offsetY !== proto.offsetY) { obj.offsetY = this.offsetY; } return obj; } }); /** * Regex matching shadow offsetX, offsetY and blur (ex: "2px 2px 10px rgba(0,0,0,0.2)", "rgb(0,255,0) 2px 2px") * @static * @field * @memberOf fabric.Shadow */ fabric.Shadow.reOffsetsAndBlur = /(?:\s|^)(-?\d+(?:px)?(?:\s?|$))?(-?\d+(?:px)?(?:\s?|$))?(\d+(?:px)?)?(?:\s?|$)(?:$|\s)/; })(typeof exports !== 'undefined' ? exports : this); (function () { 'use strict'; if (fabric.StaticCanvas) { fabric.warn('fabric.StaticCanvas is already defined.'); return; } // aliases for faster resolution var extend = fabric.util.object.extend, getElementOffset = fabric.util.getElementOffset, removeFromArray = fabric.util.removeFromArray, CANVAS_INIT_ERROR = new Error('Could not initialize `canvas` element'); /** * Static canvas class * @class fabric.StaticCanvas * @mixes fabric.Collection * @mixes fabric.Observable * @see {@link http://fabricjs.com/static_canvas/|StaticCanvas demo} * @see {@link fabric.StaticCanvas#initialize} for constructor definition * @fires before:render * @fires after:render * @fires canvas:cleared * @fires object:added * @fires object:removed */ fabric.StaticCanvas = fabric.util.createClass(/** @lends fabric.StaticCanvas.prototype */ { /** * Constructor * @param {HTMLElement | String} el &lt;canvas> element to initialize instance on * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(el, options) { options || (options = { }); this._initStatic(el, options); fabric.StaticCanvas.activeInstance = this; }, /** * Background color of canvas instance. * Should be set via {@link fabric.StaticCanvas#setBackgroundColor}. * @type {(String|fabric.Pattern)} * @default */ backgroundColor: '', /** * Background image of canvas instance. * Should be set via {@link fabric.StaticCanvas#setBackgroundImage}. * <b>Backwards incompatibility note:</b> The "backgroundImageOpacity" * and "backgroundImageStretch" properties are deprecated since 1.3.9. * Use {@link fabric.Image#opacity}, {@link fabric.Image#width} and {@link fabric.Image#height}. * @type fabric.Image * @default */ backgroundImage: null, /** * Overlay color of canvas instance. * Should be set via {@link fabric.StaticCanvas#setOverlayColor} * @since 1.3.9 * @type {(String|fabric.Pattern)} * @default */ overlayColor: '', /** * Overlay image of canvas instance. * Should be set via {@link fabric.StaticCanvas#setOverlayImage}. * <b>Backwards incompatibility note:</b> The "overlayImageLeft" * and "overlayImageTop" properties are deprecated since 1.3.9. * Use {@link fabric.Image#left} and {@link fabric.Image#top}. * @type fabric.Image * @default */ overlayImage: null, /** * Indicates whether toObject/toDatalessObject should include default values * @type Boolean * @default */ includeDefaultValues: true, /** * Indicates whether objects' state should be saved * @type Boolean * @default */ stateful: true, /** * Indicates whether {@link fabric.Collection.add}, {@link fabric.Collection.insertAt} and {@link fabric.Collection.remove} should also re-render canvas. * Disabling this option could give a great performance boost when adding/removing a lot of objects to/from canvas at once * (followed by a manual rendering after addition/deletion) * @type Boolean * @default */ renderOnAddRemove: true, /** * Function that determines clipping of entire canvas area * Being passed context as first argument. See clipping canvas area in {@link https://github.com/kangax/fabric.js/wiki/FAQ} * @type Function * @default */ clipTo: null, /** * Indicates whether object controls (borders/controls) are rendered above overlay image * @type Boolean * @default */ controlsAboveOverlay: false, /** * Indicates whether the browser can be scrolled when using a touchscreen and dragging on the canvas * @type Boolean * @default */ allowTouchScrolling: false, /** * Indicates whether this canvas will use image smoothing, this is on by default in browsers * @type Boolean * @default */ imageSmoothingEnabled: true, /** * The transformation (in the format of Canvas transform) which focuses the viewport * @type Array * @default */ viewportTransform: [1, 0, 0, 1, 0, 0], /** * Callback; invoked right before object is about to be scaled/rotated */ onBeforeScaleRotate: function () { /* NOOP */ }, /** * @private * @param {HTMLElement | String} el &lt;canvas> element to initialize instance on * @param {Object} [options] Options object */ _initStatic: function(el, options) { this._objects = []; this._createLowerCanvas(el); this._initOptions(options); this._setImageSmoothing(); if (options.overlayImage) { this.setOverlayImage(options.overlayImage, this.renderAll.bind(this)); } if (options.backgroundImage) { this.setBackgroundImage(options.backgroundImage, this.renderAll.bind(this)); } if (options.backgroundColor) { this.setBackgroundColor(options.backgroundColor, this.renderAll.bind(this)); } if (options.overlayColor) { this.setOverlayColor(options.overlayColor, this.renderAll.bind(this)); } this.calcOffset(); }, /** * Calculates canvas element offset relative to the document * This method is also attached as "resize" event handler of window * @return {fabric.Canvas} instance * @chainable */ calcOffset: function () { this._offset = getElementOffset(this.lowerCanvasEl); return this; }, /** * Sets {@link fabric.StaticCanvas#overlayImage|overlay image} for this canvas * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set overlay to * @param {Function} callback callback to invoke when image is loaded and set as an overlay * @param {Object} [options] Optional options to set for the {@link fabric.Image|overlay image}. * @return {fabric.Canvas} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/MnzHT/|jsFiddle demo} * @example <caption>Normal overlayImage with left/top = 0</caption> * canvas.setOverlayImage('http://fabricjs.com/assets/jail_cell_bars.png', canvas.renderAll.bind(canvas), { * // Needed to position overlayImage at 0/0 * originX: 'left', * originY: 'top' * }); * @example <caption>overlayImage with different properties</caption> * canvas.setOverlayImage('http://fabricjs.com/assets/jail_cell_bars.png', canvas.renderAll.bind(canvas), { * opacity: 0.5, * angle: 45, * left: 400, * top: 400, * originX: 'left', * originY: 'top' * }); * @example <caption>Stretched overlayImage #1 - width/height correspond to canvas width/height</caption> * fabric.Image.fromURL('http://fabricjs.com/assets/jail_cell_bars.png', function(img) { * img.set({width: canvas.width, height: canvas.height, originX: 'left', originY: 'top'}); * canvas.setOverlayImage(img, canvas.renderAll.bind(canvas)); * }); * @example <caption>Stretched overlayImage #2 - width/height correspond to canvas width/height</caption> * canvas.setOverlayImage('http://fabricjs.com/assets/jail_cell_bars.png', canvas.renderAll.bind(canvas), { * width: canvas.width, * height: canvas.height, * // Needed to position overlayImage at 0/0 * originX: 'left', * originY: 'top' * }); */ setOverlayImage: function (image, callback, options) { return this.__setBgOverlayImage('overlayImage', image, callback, options); }, /** * Sets {@link fabric.StaticCanvas#backgroundImage|background image} for this canvas * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set background to * @param {Function} callback Callback to invoke when image is loaded and set as background * @param {Object} [options] Optional options to set for the {@link fabric.Image|background image}. * @return {fabric.Canvas} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/YH9yD/|jsFiddle demo} * @example <caption>Normal backgroundImage with left/top = 0</caption> * canvas.setBackgroundImage('http://fabricjs.com/assets/honey_im_subtle.png', canvas.renderAll.bind(canvas), { * // Needed to position backgroundImage at 0/0 * originX: 'left', * originY: 'top' * }); * @example <caption>backgroundImage with different properties</caption> * canvas.setBackgroundImage('http://fabricjs.com/assets/honey_im_subtle.png', canvas.renderAll.bind(canvas), { * opacity: 0.5, * angle: 45, * left: 400, * top: 400, * originX: 'left', * originY: 'top' * }); * @example <caption>Stretched backgroundImage #1 - width/height correspond to canvas width/height</caption> * fabric.Image.fromURL('http://fabricjs.com/assets/honey_im_subtle.png', function(img) { * img.set({width: canvas.width, height: canvas.height, originX: 'left', originY: 'top'}); * canvas.setBackgroundImage(img, canvas.renderAll.bind(canvas)); * }); * @example <caption>Stretched backgroundImage #2 - width/height correspond to canvas width/height</caption> * canvas.setBackgroundImage('http://fabricjs.com/assets/honey_im_subtle.png', canvas.renderAll.bind(canvas), { * width: canvas.width, * height: canvas.height, * // Needed to position backgroundImage at 0/0 * originX: 'left', * originY: 'top' * }); */ setBackgroundImage: function (image, callback, options) { return this.__setBgOverlayImage('backgroundImage', image, callback, options); }, /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas * @param {(String|fabric.Pattern)} overlayColor Color or pattern to set background color to * @param {Function} callback Callback to invoke when background color is set * @return {fabric.Canvas} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/pB55h/|jsFiddle demo} * @example <caption>Normal overlayColor - color value</caption> * canvas.setOverlayColor('rgba(255, 73, 64, 0.6)', canvas.renderAll.bind(canvas)); * @example <caption>fabric.Pattern used as overlayColor</caption> * canvas.setOverlayColor({ * source: 'http://fabricjs.com/assets/escheresque_ste.png' * }, canvas.renderAll.bind(canvas)); * @example <caption>fabric.Pattern used as overlayColor with repeat and offset</caption> * canvas.setOverlayColor({ * source: 'http://fabricjs.com/assets/escheresque_ste.png', * repeat: 'repeat', * offsetX: 200, * offsetY: 100 * }, canvas.renderAll.bind(canvas)); */ setOverlayColor: function(overlayColor, callback) { return this.__setBgOverlayColor('overlayColor', overlayColor, callback); }, /** * Sets {@link fabric.StaticCanvas#backgroundColor|background color} for this canvas * @param {(String|fabric.Pattern)} backgroundColor Color or pattern to set background color to * @param {Function} callback Callback to invoke when background color is set * @return {fabric.Canvas} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/hXzvk/|jsFiddle demo} * @example <caption>Normal backgroundColor - color value</caption> * canvas.setBackgroundColor('rgba(255, 73, 64, 0.6)', canvas.renderAll.bind(canvas)); * @example <caption>fabric.Pattern used as backgroundColor</caption> * canvas.setBackgroundColor({ * source: 'http://fabricjs.com/assets/escheresque_ste.png' * }, canvas.renderAll.bind(canvas)); * @example <caption>fabric.Pattern used as backgroundColor with repeat and offset</caption> * canvas.setBackgroundColor({ * source: 'http://fabricjs.com/assets/escheresque_ste.png', * repeat: 'repeat', * offsetX: 200, * offsetY: 100 * }, canvas.renderAll.bind(canvas)); */ setBackgroundColor: function(backgroundColor, callback) { return this.__setBgOverlayColor('backgroundColor', backgroundColor, callback); }, /** * @private * @see {@link http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-imagesmoothingenabled|WhatWG Canvas Standard} */ _setImageSmoothing: function(){ var ctx = this.getContext(); ctx.imageSmoothingEnabled = this.imageSmoothingEnabled; ctx.webkitImageSmoothingEnabled = this.imageSmoothingEnabled; ctx.mozImageSmoothingEnabled = this.imageSmoothingEnabled; ctx.msImageSmoothingEnabled = this.imageSmoothingEnabled; ctx.oImageSmoothingEnabled = this.imageSmoothingEnabled; }, /** * @private * @param {String} property Property to set ({@link fabric.StaticCanvas#backgroundImage|backgroundImage} * or {@link fabric.StaticCanvas#overlayImage|overlayImage}) * @param {(fabric.Image|String|null)} image fabric.Image instance, URL of an image or null to set background or overlay to * @param {Function} callback Callback to invoke when image is loaded and set as background or overlay * @param {Object} [options] Optional options to set for the {@link fabric.Image|image}. */ __setBgOverlayImage: function(property, image, callback, options) { if (typeof image === 'string') { fabric.util.loadImage(image, function(img) { this[property] = new fabric.Image(img, options); callback && callback(); }, this); } else { this[property] = image; callback && callback(); } return this; }, /** * @private * @param {String} property Property to set ({@link fabric.StaticCanvas#backgroundColor|backgroundColor} * or {@link fabric.StaticCanvas#overlayColor|overlayColor}) * @param {(Object|String|null)} color Object with pattern information, color value or null * @param {Function} [callback] Callback is invoked when color is set */ __setBgOverlayColor: function(property, color, callback) { if (color && color.source) { var _this = this; fabric.util.loadImage(color.source, function(img) { _this[property] = new fabric.Pattern({ source: img, repeat: color.repeat, offsetX: color.offsetX, offsetY: color.offsetY }); callback && callback(); }); } else { this[property] = color; callback && callback(); } return this; }, /** * @private */ _createCanvasElement: function() { var element = fabric.document.createElement('canvas'); if (!element.style) { element.style = { }; } if (!element) { throw CANVAS_INIT_ERROR; } this._initCanvasElement(element); return element; }, /** * @private * @param {HTMLElement} element */ _initCanvasElement: function(element) { fabric.util.createCanvasElement(element); if (typeof element.getContext === 'undefined') { throw CANVAS_INIT_ERROR; } }, /** * @private * @param {Object} [options] Options object */ _initOptions: function (options) { for (var prop in options) { this[prop] = options[prop]; } this.width = this.width || parseInt(this.lowerCanvasEl.width, 10) || 0; this.height = this.height || parseInt(this.lowerCanvasEl.height, 10) || 0; if (!this.lowerCanvasEl.style) { return; } this.lowerCanvasEl.width = this.width; this.lowerCanvasEl.height = this.height; this.lowerCanvasEl.style.width = this.width + 'px'; this.lowerCanvasEl.style.height = this.height + 'px'; this.viewportTransform = this.viewportTransform.slice(); }, /** * Creates a bottom canvas * @private * @param {HTMLElement} [canvasEl] */ _createLowerCanvas: function (canvasEl) { this.lowerCanvasEl = fabric.util.getById(canvasEl) || this._createCanvasElement(); this._initCanvasElement(this.lowerCanvasEl); fabric.util.addClass(this.lowerCanvasEl, 'lower-canvas'); if (this.interactive) { this._applyCanvasStyle(this.lowerCanvasEl); } this.contextContainer = this.lowerCanvasEl.getContext('2d'); }, /** * Returns canvas width (in px) * @return {Number} */ getWidth: function () { return this.width; }, /** * Returns canvas height (in px) * @return {Number} */ getHeight: function () { return this.height; }, /** * Sets width of this canvas instance * @param {Number|String} value Value to set width to * @param {Object} [options] Options object * @param {Boolean} [options.backstoreOnly=false] Set the given dimensions only as canvas backstore dimensions * @param {Boolean} [options.cssOnly=false] Set the given dimensions only as css dimensions * @return {fabric.Canvas} instance * @chainable true */ setWidth: function (value, options) { return this.setDimensions({ width: value }, options); }, /** * Sets height of this canvas instance * @param {Number|String} value Value to set height to * @param {Object} [options] Options object * @param {Boolean} [options.backstoreOnly=false] Set the given dimensions only as canvas backstore dimensions * @param {Boolean} [options.cssOnly=false] Set the given dimensions only as css dimensions * @return {fabric.Canvas} instance * @chainable true */ setHeight: function (value, options) { return this.setDimensions({ height: value }, options); }, /** * Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em) * @param {Object} dimensions Object with width/height properties * @param {Number|String} [dimensions.width] Width of canvas element * @param {Number|String} [dimensions.height] Height of canvas element * @param {Object} [options] Options object * @param {Boolean} [options.backstoreOnly=false] Set the given dimensions only as canvas backstore dimensions * @param {Boolean} [options.cssOnly=false] Set the given dimensions only as css dimensions * @return {fabric.Canvas} thisArg * @chainable */ setDimensions: function (dimensions, options) { var cssValue; options = options || {}; for (var prop in dimensions) { cssValue = dimensions[prop]; if (!options.cssOnly) { this._setBackstoreDimension(prop, dimensions[prop]); cssValue += 'px'; } if (!options.backstoreOnly) { this._setCssDimension(prop, cssValue); } } if (!options.cssOnly) { this.renderAll(); } this.calcOffset(); return this; }, /** * Helper for setting width/height * @private * @param {String} prop property (width|height) * @param {Number} value value to set property to * @return {fabric.Canvas} instance * @chainable true */ _setBackstoreDimension: function (prop, value) { this.lowerCanvasEl[prop] = value; if (this.upperCanvasEl) { this.upperCanvasEl[prop] = value; } if (this.cacheCanvasEl) { this.cacheCanvasEl[prop] = value; } this[prop] = value; return this; }, /** * Helper for setting css width/height * @private * @param {String} prop property (width|height) * @param {String} value value to set property to * @return {fabric.Canvas} instance * @chainable true */ _setCssDimension: function (prop, value) { this.lowerCanvasEl.style[prop] = value; if (this.upperCanvasEl) { this.upperCanvasEl.style[prop] = value; } if (this.wrapperEl) { this.wrapperEl.style[prop] = value; } return this; }, /** * Returns canvas zoom level * @return {Number} */ getZoom: function () { return Math.sqrt(this.viewportTransform[0] * this.viewportTransform[3]); }, /** * Sets viewport transform of this canvas instance * @param {Array} vpt the transform in the form of context.transform * @return {fabric.Canvas} instance * @chainable true */ setViewportTransform: function (vpt) { this.viewportTransform = vpt; this.renderAll(); for (var i = 0, len = this._objects.length; i < len; i++) { this._objects[i].setCoords(); } return this; }, /** * Sets zoom level of this canvas instance, zoom centered around point * @param {fabric.Point} point to zoom with respect to * @param {Number} value to set zoom to, less than 1 zooms out * @return {fabric.Canvas} instance * @chainable true */ zoomToPoint: function (point, value) { // TODO: just change the scale, preserve other transformations var before = point; point = fabric.util.transformPoint(point, fabric.util.invertTransform(this.viewportTransform)); this.viewportTransform[0] = value; this.viewportTransform[3] = value; var after = fabric.util.transformPoint(point, this.viewportTransform); this.viewportTransform[4] += before.x - after.x; this.viewportTransform[5] += before.y - after.y; this.renderAll(); for (var i = 0, len = this._objects.length; i < len; i++) { this._objects[i].setCoords(); } return this; }, /** * Sets zoom level of this canvas instance * @param {Number} value to set zoom to, less than 1 zooms out * @return {fabric.Canvas} instance * @chainable true */ setZoom: function (value) { this.zoomToPoint(new fabric.Point(0, 0), value); return this; }, /** * Pan viewport so as to place point at top left corner of canvas * @param {fabric.Point} point to move to * @return {fabric.Canvas} instance * @chainable true */ absolutePan: function (point) { this.viewportTransform[4] = -point.x; this.viewportTransform[5] = -point.y; this.renderAll(); for (var i = 0, len = this._objects.length; i < len; i++) { this._objects[i].setCoords(); } return this; }, /** * Pans viewpoint relatively * @param {fabric.Point} point (position vector) to move by * @return {fabric.Canvas} instance * @chainable true */ relativePan: function (point) { return this.absolutePan(new fabric.Point( -point.x - this.viewportTransform[4], -point.y - this.viewportTransform[5] )); }, /** * Returns &lt;canvas> element corresponding to this instance * @return {HTMLCanvasElement} */ getElement: function () { return this.lowerCanvasEl; }, /** * Returns currently selected object, if any * @return {fabric.Object} */ getActiveObject: function() { return null; }, /** * Returns currently selected group of object, if any * @return {fabric.Group} */ getActiveGroup: function() { return null; }, /** * Given a context, renders an object on that context * @param {CanvasRenderingContext2D} ctx Context to render object on * @param {fabric.Object} object Object to render * @private */ _draw: function (ctx, object) { if (!object) { return; } ctx.save(); var v = this.viewportTransform; ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]); object.render(ctx); ctx.restore(); if (!this.controlsAboveOverlay) { object._renderControls(ctx); } }, /** * @private * @param {fabric.Object} obj Object that was added */ _onObjectAdded: function(obj) { this.stateful && obj.setupState(); obj.canvas = this; obj.setCoords(); this.fire('object:added', { target: obj }); obj.fire('added'); }, /** * @private * @param {fabric.Object} obj Object that was removed */ _onObjectRemoved: function(obj) { // removing active object should fire "selection:cleared" events if (this.getActiveObject() === obj) { this.fire('before:selection:cleared', { target: obj }); this._discardActiveObject(); this.fire('selection:cleared'); } this.fire('object:removed', { target: obj }); obj.fire('removed'); }, /** * Clears specified context of canvas element * @param {CanvasRenderingContext2D} ctx Context to clear * @return {fabric.Canvas} thisArg * @chainable */ clearContext: function(ctx) { ctx.clearRect(0, 0, this.width, this.height); return this; }, /** * Returns context of canvas where objects are drawn * @return {CanvasRenderingContext2D} */ getContext: function () { return this.contextContainer; }, /** * Clears all contexts (background, main, top) of an instance * @return {fabric.Canvas} thisArg * @chainable */ clear: function () { this._objects.length = 0; if (this.discardActiveGroup) { this.discardActiveGroup(); } if (this.discardActiveObject) { this.discardActiveObject(); } this.clearContext(this.contextContainer); if (this.contextTop) { this.clearContext(this.contextTop); } this.fire('canvas:cleared'); this.renderAll(); return this; }, /** * Renders both the top canvas and the secondary container canvas. * @param {Boolean} [allOnTop] Whether we want to force all images to be rendered on the top canvas * @return {fabric.Canvas} instance * @chainable */ renderAll: function (allOnTop) { var canvasToDrawOn = this[(allOnTop === true && this.interactive) ? 'contextTop' : 'contextContainer'], activeGroup = this.getActiveGroup(); if (this.contextTop && this.selection && !this._groupSelector) { this.clearContext(this.contextTop); } if (!allOnTop) { this.clearContext(canvasToDrawOn); } this.fire('before:render'); if (this.clipTo) { fabric.util.clipContext(this, canvasToDrawOn); } this._renderBackground(canvasToDrawOn); this._renderObjects(canvasToDrawOn, activeGroup); this._renderActiveGroup(canvasToDrawOn, activeGroup); if (this.clipTo) { canvasToDrawOn.restore(); } this._renderOverlay(canvasToDrawOn); if (this.controlsAboveOverlay && this.interactive) { this.drawControls(canvasToDrawOn); } this.fire('after:render'); return this; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {fabric.Group} activeGroup */ _renderObjects: function(ctx, activeGroup) { var i, length; // fast path if (!activeGroup) { for (i = 0, length = this._objects.length; i < length; ++i) { this._draw(ctx, this._objects[i]); } } else { for (i = 0, length = this._objects.length; i < length; ++i) { if (this._objects[i] && !activeGroup.contains(this._objects[i])) { this._draw(ctx, this._objects[i]); } } } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {fabric.Group} activeGroup */ _renderActiveGroup: function(ctx, activeGroup) { // delegate rendering to group selection (if one exists) if (activeGroup) { //Store objects in group preserving order, then replace var sortedObjects = []; this.forEachObject(function (object) { if (activeGroup.contains(object)) { sortedObjects.push(object); } }); activeGroup._set('objects', sortedObjects); this._draw(ctx, activeGroup); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderBackground: function(ctx) { if (this.backgroundColor) { ctx.fillStyle = this.backgroundColor.toLive ? this.backgroundColor.toLive(ctx) : this.backgroundColor; ctx.fillRect( this.backgroundColor.offsetX || 0, this.backgroundColor.offsetY || 0, this.width, this.height); } if (this.backgroundImage) { this._draw(ctx, this.backgroundImage); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderOverlay: function(ctx) { if (this.overlayColor) { ctx.fillStyle = this.overlayColor.toLive ? this.overlayColor.toLive(ctx) : this.overlayColor; ctx.fillRect( this.overlayColor.offsetX || 0, this.overlayColor.offsetY || 0, this.width, this.height); } if (this.overlayImage) { this._draw(ctx, this.overlayImage); } }, /** * Method to render only the top canvas. * Also used to render the group selection box. * @return {fabric.Canvas} thisArg * @chainable */ renderTop: function () { var ctx = this.contextTop || this.contextContainer; this.clearContext(ctx); // we render the top context - last object if (this.selection && this._groupSelector) { this._drawSelection(); } // delegate rendering to group selection if one exists // used for drawing selection borders/controls var activeGroup = this.getActiveGroup(); if (activeGroup) { activeGroup.render(ctx); } this._renderOverlay(ctx); this.fire('after:render'); return this; }, /** * Returns coordinates of a center of canvas. * Returned value is an object with top and left properties * @return {Object} object with "top" and "left" number values */ getCenter: function () { return { top: this.getHeight() / 2, left: this.getWidth() / 2 }; }, /** * Centers object horizontally. * You might need to call `setCoords` on an object after centering, to update controls area. * @param {fabric.Object} object Object to center horizontally * @return {fabric.Canvas} thisArg */ centerObjectH: function (object) { this._centerObject(object, new fabric.Point(this.getCenter().left, object.getCenterPoint().y)); this.renderAll(); return this; }, /** * Centers object vertically. * You might need to call `setCoords` on an object after centering, to update controls area. * @param {fabric.Object} object Object to center vertically * @return {fabric.Canvas} thisArg * @chainable */ centerObjectV: function (object) { this._centerObject(object, new fabric.Point(object.getCenterPoint().x, this.getCenter().top)); this.renderAll(); return this; }, /** * Centers object vertically and horizontally. * You might need to call `setCoords` on an object after centering, to update controls area. * @param {fabric.Object} object Object to center vertically and horizontally * @return {fabric.Canvas} thisArg * @chainable */ centerObject: function(object) { var center = this.getCenter(); this._centerObject(object, new fabric.Point(center.left, center.top)); this.renderAll(); return this; }, /** * @private * @param {fabric.Object} object Object to center * @param {fabric.Point} center Center point * @return {fabric.Canvas} thisArg * @chainable */ _centerObject: function(object, center) { object.setPositionByOrigin(center, 'center', 'center'); return this; }, /** * Returs dataless JSON representation of canvas * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {String} json string */ toDatalessJSON: function (propertiesToInclude) { return this.toDatalessObject(propertiesToInclude); }, /** * Returns object representation of canvas * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function (propertiesToInclude) { return this._toObjectMethod('toObject', propertiesToInclude); }, /** * Returns dataless object representation of canvas * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toDatalessObject: function (propertiesToInclude) { return this._toObjectMethod('toDatalessObject', propertiesToInclude); }, /** * @private */ _toObjectMethod: function (methodName, propertiesToInclude) { var activeGroup = this.getActiveGroup(); if (activeGroup) { this.discardActiveGroup(); } var data = { objects: this._toObjects(methodName, propertiesToInclude) }; extend(data, this.__serializeBgOverlay()); fabric.util.populateWithProperties(this, data, propertiesToInclude); if (activeGroup) { this.setActiveGroup(new fabric.Group(activeGroup.getObjects(), { originX: 'center', originY: 'center' })); activeGroup.forEachObject(function(o) { o.set('active', true); }); if (this._currentTransform) { this._currentTransform.target = this.getActiveGroup(); } } return data; }, /** * @private */ _toObjects: function(methodName, propertiesToInclude) { return this.getObjects().map(function(instance) { return this._toObject(instance, methodName, propertiesToInclude); }, this); }, /** * @private */ _toObject: function(instance, methodName, propertiesToInclude) { var originalValue; if (!this.includeDefaultValues) { originalValue = instance.includeDefaultValues; instance.includeDefaultValues = false; } var object = instance[methodName](propertiesToInclude); if (!this.includeDefaultValues) { instance.includeDefaultValues = originalValue; } return object; }, /** * @private */ __serializeBgOverlay: function() { var data = { background: (this.backgroundColor && this.backgroundColor.toObject) ? this.backgroundColor.toObject() : this.backgroundColor }; if (this.overlayColor) { data.overlay = this.overlayColor.toObject ? this.overlayColor.toObject() : this.overlayColor; } if (this.backgroundImage) { data.backgroundImage = this.backgroundImage.toObject(); } if (this.overlayImage) { data.overlayImage = this.overlayImage.toObject(); } return data; }, /* _TO_SVG_START_ */ /** * Returns SVG representation of canvas * @function * @param {Object} [options] Options object for SVG output * @param {Boolean} [options.suppressPreamble=false] If true xml tag is not included * @param {Object} [options.viewBox] SVG viewbox object * @param {Number} [options.viewBox.x] x-cooridnate of viewbox * @param {Number} [options.viewBox.y] y-coordinate of viewbox * @param {Number} [options.viewBox.width] Width of viewbox * @param {Number} [options.viewBox.height] Height of viewbox * @param {String} [options.encoding=UTF-8] Encoding of SVG output * @param {Function} [reviver] Method for further parsing of svg elements, called after each fabric object converted into svg representation. * @return {String} SVG string * @tutorial {@link http://fabricjs.com/fabric-intro-part-3/#serialization} * @see {@link http://jsfiddle.net/fabricjs/jQ3ZZ/|jsFiddle demo} * @example <caption>Normal SVG output</caption> * var svg = canvas.toSVG(); * @example <caption>SVG output without preamble (without &lt;?xml ../>)</caption> * var svg = canvas.toSVG({suppressPreamble: true}); * @example <caption>SVG output with viewBox attribute</caption> * var svg = canvas.toSVG({ * viewBox: { * x: 100, * y: 100, * width: 200, * height: 300 * } * }); * @example <caption>SVG output with different encoding (default: UTF-8)</caption> * var svg = canvas.toSVG({encoding: 'ISO-8859-1'}); * @example <caption>Modify SVG output with reviver function</caption> * var svg = canvas.toSVG(null, function(svg) { * return svg.replace('stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; ', ''); * }); */ toSVG: function(options, reviver) { options || (options = { }); var markup = []; this._setSVGPreamble(markup, options); this._setSVGHeader(markup, options); this._setSVGBgOverlayColor(markup, 'backgroundColor'); this._setSVGBgOverlayImage(markup, 'backgroundImage'); this._setSVGObjects(markup, reviver); this._setSVGBgOverlayColor(markup, 'overlayColor'); this._setSVGBgOverlayImage(markup, 'overlayImage'); markup.push('</svg>'); return markup.join(''); }, /** * @private */ _setSVGPreamble: function(markup, options) { if (!options.suppressPreamble) { markup.push( '<?xml version="1.0" encoding="', (options.encoding || 'UTF-8'), '" standalone="no" ?>', '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ', '"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n' ); } }, /** * @private */ _setSVGHeader: function(markup, options) { markup.push( '<svg ', 'xmlns="http://www.w3.org/2000/svg" ', 'xmlns:xlink="http://www.w3.org/1999/xlink" ', 'version="1.1" ', 'width="', (options.viewBox ? options.viewBox.width : this.width), '" ', 'height="', (options.viewBox ? options.viewBox.height : this.height), '" ', (this.backgroundColor && !this.backgroundColor.toLive ? 'style="background-color: ' + this.backgroundColor + '" ' : null), (options.viewBox ? 'viewBox="' + options.viewBox.x + ' ' + options.viewBox.y + ' ' + options.viewBox.width + ' ' + options.viewBox.height + '" ' : null), 'xml:space="preserve">', '<desc>Created with Fabric.js ', fabric.version, '</desc>', '<defs>', fabric.createSVGFontFacesMarkup(this.getObjects()), fabric.createSVGRefElementsMarkup(this), '</defs>' ); }, /** * @private */ _setSVGObjects: function(markup, reviver) { var activeGroup = this.getActiveGroup(); if (activeGroup) { this.discardActiveGroup(); } for (var i = 0, objects = this.getObjects(), len = objects.length; i < len; i++) { markup.push(objects[i].toSVG(reviver)); } if (activeGroup) { this.setActiveGroup(new fabric.Group(activeGroup.getObjects())); activeGroup.forEachObject(function(o) { o.set('active', true); }); } }, /** * @private */ _setSVGBgOverlayImage: function(markup, property) { if (this[property] && this[property].toSVG) { markup.push(this[property].toSVG()); } }, /** * @private */ _setSVGBgOverlayColor: function(markup, property) { if (this[property] && this[property].source) { markup.push( '<rect x="', this[property].offsetX, '" y="', this[property].offsetY, '" ', 'width="', (this[property].repeat === 'repeat-y' || this[property].repeat === 'no-repeat' ? this[property].source.width : this.width), '" height="', (this[property].repeat === 'repeat-x' || this[property].repeat === 'no-repeat' ? this[property].source.height : this.height), '" fill="url(#' + property + 'Pattern)"', '></rect>' ); } else if (this[property] && property === 'overlayColor') { markup.push( '<rect x="0" y="0" ', 'width="', this.width, '" height="', this.height, '" fill="', this[property], '"', '></rect>' ); } }, /* _TO_SVG_END_ */ /** * Moves an object to the bottom of the stack of drawn objects * @param {fabric.Object} object Object to send to back * @return {fabric.Canvas} thisArg * @chainable */ sendToBack: function (object) { removeFromArray(this._objects, object); this._objects.unshift(object); return this.renderAll && this.renderAll(); }, /** * Moves an object to the top of the stack of drawn objects * @param {fabric.Object} object Object to send * @return {fabric.Canvas} thisArg * @chainable */ bringToFront: function (object) { removeFromArray(this._objects, object); this._objects.push(object); return this.renderAll && this.renderAll(); }, /** * Moves an object down in stack of drawn objects * @param {fabric.Object} object Object to send * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object * @return {fabric.Canvas} thisArg * @chainable */ sendBackwards: function (object, intersecting) { var idx = this._objects.indexOf(object); // if object is not on the bottom of stack if (idx !== 0) { var newIdx = this._findNewLowerIndex(object, idx, intersecting); removeFromArray(this._objects, object); this._objects.splice(newIdx, 0, object); this.renderAll && this.renderAll(); } return this; }, /** * @private */ _findNewLowerIndex: function(object, idx, intersecting) { var newIdx; if (intersecting) { newIdx = idx; // traverse down the stack looking for the nearest intersecting object for (var i = idx - 1; i >= 0; --i) { var isIntersecting = object.intersectsWithObject(this._objects[i]) || object.isContainedWithinObject(this._objects[i]) || this._objects[i].isContainedWithinObject(object); if (isIntersecting) { newIdx = i; break; } } } else { newIdx = idx - 1; } return newIdx; }, /** * Moves an object up in stack of drawn objects * @param {fabric.Object} object Object to send * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object * @return {fabric.Canvas} thisArg * @chainable */ bringForward: function (object, intersecting) { var idx = this._objects.indexOf(object); // if object is not on top of stack (last item in an array) if (idx !== this._objects.length - 1) { var newIdx = this._findNewUpperIndex(object, idx, intersecting); removeFromArray(this._objects, object); this._objects.splice(newIdx, 0, object); this.renderAll && this.renderAll(); } return this; }, /** * @private */ _findNewUpperIndex: function(object, idx, intersecting) { var newIdx; if (intersecting) { newIdx = idx; // traverse up the stack looking for the nearest intersecting object for (var i = idx + 1; i < this._objects.length; ++i) { var isIntersecting = object.intersectsWithObject(this._objects[i]) || object.isContainedWithinObject(this._objects[i]) || this._objects[i].isContainedWithinObject(object); if (isIntersecting) { newIdx = i; break; } } } else { newIdx = idx + 1; } return newIdx; }, /** * Moves an object to specified level in stack of drawn objects * @param {fabric.Object} object Object to send * @param {Number} index Position to move to * @return {fabric.Canvas} thisArg * @chainable */ moveTo: function (object, index) { removeFromArray(this._objects, object); this._objects.splice(index, 0, object); return this.renderAll && this.renderAll(); }, /** * Clears a canvas element and removes all event listeners * @return {fabric.Canvas} thisArg * @chainable */ dispose: function () { this.clear(); this.interactive && this.removeListeners(); return this; }, /** * Returns a string representation of an instance * @return {String} string representation of an instance */ toString: function () { return '#<fabric.Canvas (' + this.complexity() + '): ' + '{ objects: ' + this.getObjects().length + ' }>'; } }); extend(fabric.StaticCanvas.prototype, fabric.Observable); extend(fabric.StaticCanvas.prototype, fabric.Collection); extend(fabric.StaticCanvas.prototype, fabric.DataURLExporter); extend(fabric.StaticCanvas, /** @lends fabric.StaticCanvas */ { /** * @static * @type String * @default */ EMPTY_JSON: '{"objects": [], "background": "white"}', /** * Provides a way to check support of some of the canvas methods * (either those of HTMLCanvasElement itself, or rendering context) * * @param {String} methodName Method to check support for; * Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" * @return {Boolean | null} `true` if method is supported (or at least exists), * `null` if canvas element or context can not be initialized */ supports: function (methodName) { var el = fabric.util.createCanvasElement(); if (!el || !el.getContext) { return null; } var ctx = el.getContext('2d'); if (!ctx) { return null; } switch (methodName) { case 'getImageData': return typeof ctx.getImageData !== 'undefined'; case 'setLineDash': return typeof ctx.setLineDash !== 'undefined'; case 'toDataURL': return typeof el.toDataURL !== 'undefined'; case 'toDataURLWithQuality': try { el.toDataURL('image/jpeg', 0); return true; } catch (e) { } return false; default: return null; } } }); /** * Returns JSON representation of canvas * @function * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {String} JSON string * @tutorial {@link http://fabricjs.com/fabric-intro-part-3/#serialization} * @see {@link http://jsfiddle.net/fabricjs/pec86/|jsFiddle demo} * @example <caption>JSON without additional properties</caption> * var json = canvas.toJSON(); * @example <caption>JSON with additional properties included</caption> * var json = canvas.toJSON(['lockMovementX', 'lockMovementY', 'lockRotation', 'lockScalingX', 'lockScalingY', 'lockUniScaling']); * @example <caption>JSON without default values</caption> * canvas.includeDefaultValues = false; * var json = canvas.toJSON(); */ fabric.StaticCanvas.prototype.toJSON = fabric.StaticCanvas.prototype.toObject; })(); /** * BaseBrush class * @class fabric.BaseBrush * @see {@link http://fabricjs.com/freedrawing/|Freedrawing demo} */ fabric.BaseBrush = fabric.util.createClass(/** @lends fabric.BaseBrush.prototype */ { /** * Color of a brush * @type String * @default */ color: 'rgb(0, 0, 0)', /** * Width of a brush * @type Number * @default */ width: 1, /** * Shadow object representing shadow of this shape. * <b>Backwards incompatibility note:</b> This property replaces "shadowColor" (String), "shadowOffsetX" (Number), * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 * @type fabric.Shadow * @default */ shadow: null, /** * Line endings style of a brush (one of "butt", "round", "square") * @type String * @default */ strokeLineCap: 'round', /** * Corner style of a brush (one of "bevil", "round", "miter") * @type String * @default */ strokeLineJoin: 'round', /** * Sets shadow of an object * @param {Object|String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") * @return {fabric.Object} thisArg * @chainable */ setShadow: function(options) { this.shadow = new fabric.Shadow(options); return this; }, /** * Sets brush styles * @private */ _setBrushStyles: function() { var ctx = this.canvas.contextTop; ctx.strokeStyle = this.color; ctx.lineWidth = this.width; ctx.lineCap = this.strokeLineCap; ctx.lineJoin = this.strokeLineJoin; }, /** * Sets brush shadow styles * @private */ _setShadow: function() { if (!this.shadow) { return; } var ctx = this.canvas.contextTop; ctx.shadowColor = this.shadow.color; ctx.shadowBlur = this.shadow.blur; ctx.shadowOffsetX = this.shadow.offsetX; ctx.shadowOffsetY = this.shadow.offsetY; }, /** * Removes brush shadow styles * @private */ _resetShadow: function() { var ctx = this.canvas.contextTop; ctx.shadowColor = ''; ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0; } }); (function() { var utilMin = fabric.util.array.min, utilMax = fabric.util.array.max; /** * PencilBrush class * @class fabric.PencilBrush * @extends fabric.BaseBrush */ fabric.PencilBrush = fabric.util.createClass(fabric.BaseBrush, /** @lends fabric.PencilBrush.prototype */ { /** * Constructor * @param {fabric.Canvas} canvas * @return {fabric.PencilBrush} Instance of a pencil brush */ initialize: function(canvas) { this.canvas = canvas; this._points = [ ]; }, /** * Inovoked on mouse down * @param {Object} pointer */ onMouseDown: function(pointer) { this._prepareForDrawing(pointer); // capture coordinates immediately // this allows to draw dots (when movement never occurs) this._captureDrawingPath(pointer); this._render(); }, /** * Inovoked on mouse move * @param {Object} pointer */ onMouseMove: function(pointer) { this._captureDrawingPath(pointer); // redraw curve // clear top canvas this.canvas.clearContext(this.canvas.contextTop); this._render(); }, /** * Invoked on mouse up */ onMouseUp: function() { this._finalizeAndAddPath(); }, /** * @private * @param {Object} pointer Actual mouse position related to the canvas. */ _prepareForDrawing: function(pointer) { var p = new fabric.Point(pointer.x, pointer.y); this._reset(); this._addPoint(p); this.canvas.contextTop.moveTo(p.x, p.y); }, /** * @private * @param {fabric.Point} point Point to be added to points array */ _addPoint: function(point) { this._points.push(point); }, /** * Clear points array and set contextTop canvas style. * @private */ _reset: function() { this._points.length = 0; this._setBrushStyles(); this._setShadow(); }, /** * @private * @param {Object} pointer Actual mouse position related to the canvas. */ _captureDrawingPath: function(pointer) { var pointerPoint = new fabric.Point(pointer.x, pointer.y); this._addPoint(pointerPoint); }, /** * Draw a smooth path on the topCanvas using quadraticCurveTo * @private */ _render: function() { var ctx = this.canvas.contextTop, v = this.canvas.viewportTransform, p1 = this._points[0], p2 = this._points[1]; ctx.save(); ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]); ctx.beginPath(); //if we only have 2 points in the path and they are the same //it means that the user only clicked the canvas without moving the mouse //then we should be drawing a dot. A path isn't drawn between two identical dots //that's why we set them apart a bit if (this._points.length === 2 && p1.x === p2.x && p1.y === p2.y) { p1.x -= 0.5; p2.x += 0.5; } ctx.moveTo(p1.x, p1.y); for (var i = 1, len = this._points.length; i < len; i++) { // we pick the point between pi + 1 & pi + 2 as the // end point and p1 as our control point. var midPoint = p1.midPointFrom(p2); ctx.quadraticCurveTo(p1.x, p1.y, midPoint.x, midPoint.y); p1 = this._points[i]; p2 = this._points[i + 1]; } // Draw last line as a straight line while // we wait for the next point to be able to calculate // the bezier control point ctx.lineTo(p1.x, p1.y); ctx.stroke(); ctx.restore(); }, /** * Return an SVG path based on our captured points and their bounding box * @private */ _getSVGPathData: function() { this.box = this.getPathBoundingBox(this._points); return this.convertPointsToSVGPath( this._points, this.box.minX, this.box.minY); }, /** * Returns bounding box of a path based on given points * @param {Array} points Array of points * @return {Object} Object with minX, minY, maxX, maxY */ getPathBoundingBox: function(points) { var xBounds = [], yBounds = [], p1 = points[0], p2 = points[1], startPoint = p1; for (var i = 1, len = points.length; i < len; i++) { var midPoint = p1.midPointFrom(p2); // with startPoint, p1 as control point, midpoint as end point xBounds.push(startPoint.x); xBounds.push(midPoint.x); yBounds.push(startPoint.y); yBounds.push(midPoint.y); p1 = points[i]; p2 = points[i + 1]; startPoint = midPoint; } xBounds.push(p1.x); yBounds.push(p1.y); return { minX: utilMin(xBounds), minY: utilMin(yBounds), maxX: utilMax(xBounds), maxY: utilMax(yBounds) }; }, /** * Converts points to SVG path * @param {Array} points Array of points * @param {Number} minX * @param {Number} minY * @return {String} SVG path */ convertPointsToSVGPath: function(points, minX, minY) { var path = [], p1 = new fabric.Point(points[0].x - minX, points[0].y - minY), p2 = new fabric.Point(points[1].x - minX, points[1].y - minY); path.push('M ', points[0].x - minX, ' ', points[0].y - minY, ' '); for (var i = 1, len = points.length; i < len; i++) { var midPoint = p1.midPointFrom(p2); // p1 is our bezier control point // midpoint is our endpoint // start point is p(i-1) value. path.push('Q ', p1.x, ' ', p1.y, ' ', midPoint.x, ' ', midPoint.y, ' '); p1 = new fabric.Point(points[i].x - minX, points[i].y - minY); if ((i + 1) < points.length) { p2 = new fabric.Point(points[i + 1].x - minX, points[i + 1].y - minY); } } path.push('L ', p1.x, ' ', p1.y, ' '); return path; }, /** * Creates fabric.Path object to add on canvas * @param {String} pathData Path data * @return {fabric.Path} Path to add on canvas */ createPath: function(pathData) { var path = new fabric.Path(pathData); path.fill = null; path.stroke = this.color; path.strokeWidth = this.width; path.strokeLineCap = this.strokeLineCap; path.strokeLineJoin = this.strokeLineJoin; if (this.shadow) { this.shadow.affectStroke = true; path.setShadow(this.shadow); } return path; }, /** * On mouseup after drawing the path on contextTop canvas * we use the points captured to create an new fabric path object * and add it to the fabric canvas. */ _finalizeAndAddPath: function() { var ctx = this.canvas.contextTop; ctx.closePath(); var pathData = this._getSVGPathData().join(''); if (pathData === 'M 0 0 Q 0 0 0 0 L 0 0') { // do not create 0 width/height paths, as they are // rendered inconsistently across browsers // Firefox 4, for example, renders a dot, // whereas Chrome 10 renders nothing this.canvas.renderAll(); return; } // set path origin coordinates based on our bounding box var originLeft = this.box.minX + (this.box.maxX - this.box.minX) / 2, originTop = this.box.minY + (this.box.maxY - this.box.minY) / 2; this.canvas.contextTop.arc(originLeft, originTop, 3, 0, Math.PI * 2, false); var path = this.createPath(pathData); path.set({ left: originLeft, top: originTop, originX: 'center', originY: 'center' }); this.canvas.add(path); path.setCoords(); this.canvas.clearContext(this.canvas.contextTop); this._resetShadow(); this.canvas.renderAll(); // fire event 'path' created this.canvas.fire('path:created', { path: path }); } }); })(); /** * CircleBrush class * @class fabric.CircleBrush */ fabric.CircleBrush = fabric.util.createClass(fabric.BaseBrush, /** @lends fabric.CircleBrush.prototype */ { /** * Width of a brush * @type Number * @default */ width: 10, /** * Constructor * @param {fabric.Canvas} canvas * @return {fabric.CircleBrush} Instance of a circle brush */ initialize: function(canvas) { this.canvas = canvas; this.points = [ ]; }, /** * Invoked inside on mouse down and mouse move * @param {Object} pointer */ drawDot: function(pointer) { var point = this.addPoint(pointer), ctx = this.canvas.contextTop, v = this.canvas.viewportTransform; ctx.save(); ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]); ctx.fillStyle = point.fill; ctx.beginPath(); ctx.arc(point.x, point.y, point.radius, 0, Math.PI * 2, false); ctx.closePath(); ctx.fill(); ctx.restore(); }, /** * Invoked on mouse down */ onMouseDown: function(pointer) { this.points.length = 0; this.canvas.clearContext(this.canvas.contextTop); this._setShadow(); this.drawDot(pointer); }, /** * Invoked on mouse move * @param {Object} pointer */ onMouseMove: function(pointer) { this.drawDot(pointer); }, /** * Invoked on mouse up */ onMouseUp: function() { var originalRenderOnAddRemove = this.canvas.renderOnAddRemove; this.canvas.renderOnAddRemove = false; var circles = [ ]; for (var i = 0, len = this.points.length; i < len; i++) { var point = this.points[i], circle = new fabric.Circle({ radius: point.radius, left: point.x, top: point.y, originX: 'center', originY: 'center', fill: point.fill }); this.shadow && circle.setShadow(this.shadow); circles.push(circle); } var group = new fabric.Group(circles, { originX: 'center', originY: 'center' }); group.canvas = this.canvas; this.canvas.add(group); this.canvas.fire('path:created', { path: group }); this.canvas.clearContext(this.canvas.contextTop); this._resetShadow(); this.canvas.renderOnAddRemove = originalRenderOnAddRemove; this.canvas.renderAll(); }, /** * @param {Object} pointer * @return {fabric.Point} Just added pointer point */ addPoint: function(pointer) { var pointerPoint = new fabric.Point(pointer.x, pointer.y), circleRadius = fabric.util.getRandomInt( Math.max(0, this.width - 20), this.width + 20) / 2, circleColor = new fabric.Color(this.color) .setAlpha(fabric.util.getRandomInt(0, 100) / 100) .toRgba(); pointerPoint.radius = circleRadius; pointerPoint.fill = circleColor; this.points.push(pointerPoint); return pointerPoint; } }); /** * SprayBrush class * @class fabric.SprayBrush */ fabric.SprayBrush = fabric.util.createClass( fabric.BaseBrush, /** @lends fabric.SprayBrush.prototype */ { /** * Width of a spray * @type Number * @default */ width: 10, /** * Density of a spray (number of dots per chunk) * @type Number * @default */ density: 20, /** * Width of spray dots * @type Number * @default */ dotWidth: 1, /** * Width variance of spray dots * @type Number * @default */ dotWidthVariance: 1, /** * Whether opacity of a dot should be random * @type Boolean * @default */ randomOpacity: false, /** * Whether overlapping dots (rectangles) should be removed (for performance reasons) * @type Boolean * @default */ optimizeOverlapping: true, /** * Constructor * @param {fabric.Canvas} canvas * @return {fabric.SprayBrush} Instance of a spray brush */ initialize: function(canvas) { this.canvas = canvas; this.sprayChunks = [ ]; }, /** * Invoked on mouse down * @param {Object} pointer */ onMouseDown: function(pointer) { this.sprayChunks.length = 0; this.canvas.clearContext(this.canvas.contextTop); this._setShadow(); this.addSprayChunk(pointer); this.render(); }, /** * Invoked on mouse move * @param {Object} pointer */ onMouseMove: function(pointer) { this.addSprayChunk(pointer); this.render(); }, /** * Invoked on mouse up */ onMouseUp: function() { var originalRenderOnAddRemove = this.canvas.renderOnAddRemove; this.canvas.renderOnAddRemove = false; var rects = [ ]; for (var i = 0, ilen = this.sprayChunks.length; i < ilen; i++) { var sprayChunk = this.sprayChunks[i]; for (var j = 0, jlen = sprayChunk.length; j < jlen; j++) { var rect = new fabric.Rect({ width: sprayChunk[j].width, height: sprayChunk[j].width, left: sprayChunk[j].x + 1, top: sprayChunk[j].y + 1, originX: 'center', originY: 'center', fill: this.color }); this.shadow && rect.setShadow(this.shadow); rects.push(rect); } } if (this.optimizeOverlapping) { rects = this._getOptimizedRects(rects); } var group = new fabric.Group(rects, { originX: 'center', originY: 'center' }); group.canvas = this.canvas; this.canvas.add(group); this.canvas.fire('path:created', { path: group }); this.canvas.clearContext(this.canvas.contextTop); this._resetShadow(); this.canvas.renderOnAddRemove = originalRenderOnAddRemove; this.canvas.renderAll(); }, /** * @private * @param {Array} rects */ _getOptimizedRects: function(rects) { // avoid creating duplicate rects at the same coordinates var uniqueRects = { }, key; for (var i = 0, len = rects.length; i < len; i++) { key = rects[i].left + '' + rects[i].top; if (!uniqueRects[key]) { uniqueRects[key] = rects[i]; } } var uniqueRectsArray = [ ]; for (key in uniqueRects) { uniqueRectsArray.push(uniqueRects[key]); } return uniqueRectsArray; }, /** * Renders brush */ render: function() { var ctx = this.canvas.contextTop; ctx.fillStyle = this.color; var v = this.canvas.viewportTransform; ctx.save(); ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]); for (var i = 0, len = this.sprayChunkPoints.length; i < len; i++) { var point = this.sprayChunkPoints[i]; if (typeof point.opacity !== 'undefined') { ctx.globalAlpha = point.opacity; } ctx.fillRect(point.x, point.y, point.width, point.width); } ctx.restore(); }, /** * @param {Object} pointer */ addSprayChunk: function(pointer) { this.sprayChunkPoints = [ ]; var x, y, width, radius = this.width / 2; for (var i = 0; i < this.density; i++) { x = fabric.util.getRandomInt(pointer.x - radius, pointer.x + radius); y = fabric.util.getRandomInt(pointer.y - radius, pointer.y + radius); if (this.dotWidthVariance) { width = fabric.util.getRandomInt( // bottom clamp width to 1 Math.max(1, this.dotWidth - this.dotWidthVariance), this.dotWidth + this.dotWidthVariance); } else { width = this.dotWidth; } var point = new fabric.Point(x, y); point.width = width; if (this.randomOpacity) { point.opacity = fabric.util.getRandomInt(0, 100) / 100; } this.sprayChunkPoints.push(point); } this.sprayChunks.push(this.sprayChunkPoints); } }); /** * PatternBrush class * @class fabric.PatternBrush * @extends fabric.BaseBrush */ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fabric.PatternBrush.prototype */ { getPatternSrc: function() { var dotWidth = 20, dotDistance = 5, patternCanvas = fabric.document.createElement('canvas'), patternCtx = patternCanvas.getContext('2d'); patternCanvas.width = patternCanvas.height = dotWidth + dotDistance; patternCtx.fillStyle = this.color; patternCtx.beginPath(); patternCtx.arc(dotWidth / 2, dotWidth / 2, dotWidth / 2, 0, Math.PI * 2, false); patternCtx.closePath(); patternCtx.fill(); return patternCanvas; }, getPatternSrcFunction: function() { return String(this.getPatternSrc).replace('this.color', '"' + this.color + '"'); }, /** * Creates "pattern" instance property */ getPattern: function() { return this.canvas.contextTop.createPattern(this.source || this.getPatternSrc(), 'repeat'); }, /** * Sets brush styles */ _setBrushStyles: function() { this.callSuper('_setBrushStyles'); this.canvas.contextTop.strokeStyle = this.getPattern(); }, /** * Creates path */ createPath: function(pathData) { var path = this.callSuper('createPath', pathData); path.stroke = new fabric.Pattern({ source: this.source || this.getPatternSrcFunction() }); return path; } }); (function() { var getPointer = fabric.util.getPointer, degreesToRadians = fabric.util.degreesToRadians, radiansToDegrees = fabric.util.radiansToDegrees, atan2 = Math.atan2, abs = Math.abs, STROKE_OFFSET = 0.5; /** * Canvas class * @class fabric.Canvas * @extends fabric.StaticCanvas * @tutorial {@link http://fabricjs.com/fabric-intro-part-1/#canvas} * @see {@link fabric.Canvas#initialize} for constructor definition * * @fires object:modified * @fires object:rotating * @fires object:scaling * @fires object:moving * @fires object:selected * * @fires before:selection:cleared * @fires selection:cleared * @fires selection:created * * @fires path:created * @fires mouse:down * @fires mouse:move * @fires mouse:up * @fires mouse:over * @fires mouse:out * */ fabric.Canvas = fabric.util.createClass(fabric.StaticCanvas, /** @lends fabric.Canvas.prototype */ { /** * Constructor * @param {HTMLElement | String} el &lt;canvas> element to initialize instance on * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(el, options) { options || (options = { }); this._initStatic(el, options); this._initInteractive(); this._createCacheCanvas(); fabric.Canvas.activeInstance = this; }, /** * When true, objects can be transformed by one side (unproportionally) * @type Boolean * @default */ uniScaleTransform: false, /** * When true, objects use center point as the origin of scale transformation. * <b>Backwards incompatibility note:</b> This property replaces "centerTransform" (Boolean). * @since 1.3.4 * @type Boolean * @default */ centeredScaling: false, /** * When true, objects use center point as the origin of rotate transformation. * <b>Backwards incompatibility note:</b> This property replaces "centerTransform" (Boolean). * @since 1.3.4 * @type Boolean * @default */ centeredRotation: false, /** * Indicates that canvas is interactive. This property should not be changed. * @type Boolean * @default */ interactive: true, /** * Indicates whether group selection should be enabled * @type Boolean * @default */ selection: true, /** * Color of selection * @type String * @default */ selectionColor: 'rgba(100, 100, 255, 0.3)', // blue /** * Default dash array pattern * If not empty the selection border is dashed * @type Array */ selectionDashArray: [ ], /** * Color of the border of selection (usually slightly darker than color of selection itself) * @type String * @default */ selectionBorderColor: 'rgba(255, 255, 255, 0.3)', /** * Width of a line used in object/group selection * @type Number * @default */ selectionLineWidth: 1, /** * Default cursor value used when hovering over an object on canvas * @type String * @default */ hoverCursor: 'move', /** * Default cursor value used when moving an object on canvas * @type String * @default */ moveCursor: 'move', /** * Default cursor value used for the entire canvas * @type String * @default */ defaultCursor: 'default', /** * Cursor value used during free drawing * @type String * @default */ freeDrawingCursor: 'crosshair', /** * Cursor value used for rotation point * @type String * @default */ rotationCursor: 'crosshair', /** * Default element class that's given to wrapper (div) element of canvas * @type String * @default */ containerClass: 'canvas-container', /** * When true, object detection happens on per-pixel basis rather than on per-bounding-box * @type Boolean * @default */ perPixelTargetFind: false, /** * Number of pixels around target pixel to tolerate (consider active) during object detection * @type Number * @default */ targetFindTolerance: 0, /** * When true, target detection is skipped when hovering over canvas. This can be used to improve performance. * @type Boolean * @default */ skipTargetFind: false, /** * @private */ _initInteractive: function() { this._currentTransform = null; this._groupSelector = null; this._initWrapperElement(); this._createUpperCanvas(); this._initEventListeners(); this.freeDrawingBrush = fabric.PencilBrush && new fabric.PencilBrush(this); this.calcOffset(); }, /** * Resets the current transform to its original values and chooses the type of resizing based on the event * @private * @param {Event} e Event object fired on mousemove */ _resetCurrentTransform: function(e) { var t = this._currentTransform; t.target.set({ scaleX: t.original.scaleX, scaleY: t.original.scaleY, left: t.original.left, top: t.original.top }); if (this._shouldCenterTransform(e, t.target)) { if (t.action === 'rotate') { this._setOriginToCenter(t.target); } else { if (t.originX !== 'center') { if (t.originX === 'right') { t.mouseXSign = -1; } else { t.mouseXSign = 1; } } if (t.originY !== 'center') { if (t.originY === 'bottom') { t.mouseYSign = -1; } else { t.mouseYSign = 1; } } t.originX = 'center'; t.originY = 'center'; } } else { t.originX = t.original.originX; t.originY = t.original.originY; } }, /** * Checks if point is contained within an area of given object * @param {Event} e Event object * @param {fabric.Object} target Object to test against * @return {Boolean} true if point is contained within an area of given object */ containsPoint: function (e, target) { var pointer = this.getPointer(e, true), xy = this._normalizePointer(target, pointer); // http://www.geog.ubc.ca/courses/klink/gis.notes/ncgia/u32.html // http://idav.ucdavis.edu/~okreylos/TAship/Spring2000/PointInPolygon.html return (target.containsPoint(xy) || target._findTargetCorner(pointer)); }, /** * @private */ _normalizePointer: function (object, pointer) { var activeGroup = this.getActiveGroup(), x = pointer.x, y = pointer.y, isObjectInGroup = ( activeGroup && object.type !== 'group' && activeGroup.contains(object)), lt; if (isObjectInGroup) { lt = new fabric.Point(activeGroup.left, activeGroup.top); lt = fabric.util.transformPoint(lt, this.viewportTransform, true); x -= lt.x; y -= lt.y; } return { x: x, y: y }; }, /** * Returns true if object is transparent at a certain location * @param {fabric.Object} target Object to check * @param {Number} x Left coordinate * @param {Number} y Top coordinate * @return {Boolean} */ isTargetTransparent: function (target, x, y) { var hasBorders = target.hasBorders, transparentCorners = target.transparentCorners; target.hasBorders = target.transparentCorners = false; this._draw(this.contextCache, target); target.hasBorders = hasBorders; target.transparentCorners = transparentCorners; var isTransparent = fabric.util.isTransparent( this.contextCache, x, y, this.targetFindTolerance); this.clearContext(this.contextCache); return isTransparent; }, /** * @private * @param {Event} e Event object * @param {fabric.Object} target */ _shouldClearSelection: function (e, target) { var activeGroup = this.getActiveGroup(), activeObject = this.getActiveObject(); return ( !target || (target && activeGroup && !activeGroup.contains(target) && activeGroup !== target && !e.shiftKey) || (target && !target.evented) || (target && !target.selectable && activeObject && activeObject !== target) ); }, /** * @private * @param {Event} e Event object * @param {fabric.Object} target */ _shouldCenterTransform: function (e, target) { if (!target) { return; } var t = this._currentTransform, centerTransform; if (t.action === 'scale' || t.action === 'scaleX' || t.action === 'scaleY') { centerTransform = this.centeredScaling || target.centeredScaling; } else if (t.action === 'rotate') { centerTransform = this.centeredRotation || target.centeredRotation; } return centerTransform ? !e.altKey : e.altKey; }, /** * @private */ _getOriginFromCorner: function(target, corner) { var origin = { x: target.originX, y: target.originY }; if (corner === 'ml' || corner === 'tl' || corner === 'bl') { origin.x = 'right'; } else if (corner === 'mr' || corner === 'tr' || corner === 'br') { origin.x = 'left'; } if (corner === 'tl' || corner === 'mt' || corner === 'tr') { origin.y = 'bottom'; } else if (corner === 'bl' || corner === 'mb' || corner === 'br') { origin.y = 'top'; } return origin; }, /** * @private */ _getActionFromCorner: function(target, corner) { var action = 'drag'; if (corner) { action = (corner === 'ml' || corner === 'mr') ? 'scaleX' : (corner === 'mt' || corner === 'mb') ? 'scaleY' : corner === 'mtr' ? 'rotate' : 'scale'; } return action; }, /** * @private * @param {Event} e Event object * @param {fabric.Object} target */ _setupCurrentTransform: function (e, target) { if (!target) { return; } var pointer = this.getPointer(e), corner = target._findTargetCorner(this.getPointer(e, true)), action = this._getActionFromCorner(target, corner), origin = this._getOriginFromCorner(target, corner); this._currentTransform = { target: target, action: action, scaleX: target.scaleX, scaleY: target.scaleY, offsetX: pointer.x - target.left, offsetY: pointer.y - target.top, originX: origin.x, originY: origin.y, ex: pointer.x, ey: pointer.y, left: target.left, top: target.top, theta: degreesToRadians(target.angle), width: target.width * target.scaleX, mouseXSign: 1, mouseYSign: 1 }; this._currentTransform.original = { left: target.left, top: target.top, scaleX: target.scaleX, scaleY: target.scaleY, originX: origin.x, originY: origin.y }; this._resetCurrentTransform(e); }, /** * Translates object by "setting" its left/top * @private * @param {Number} x pointer's x coordinate * @param {Number} y pointer's y coordinate */ _translateObject: function (x, y) { var target = this._currentTransform.target; if (!target.get('lockMovementX')) { target.set('left', x - this._currentTransform.offsetX); } if (!target.get('lockMovementY')) { target.set('top', y - this._currentTransform.offsetY); } }, /** * Scales object by invoking its scaleX/scaleY methods * @private * @param {Number} x pointer's x coordinate * @param {Number} y pointer's y coordinate * @param {String} by Either 'x' or 'y' - specifies dimension constraint by which to scale an object. * When not provided, an object is scaled by both dimensions equally */ _scaleObject: function (x, y, by) { var t = this._currentTransform, target = t.target, lockScalingX = target.get('lockScalingX'), lockScalingY = target.get('lockScalingY'), lockScalingFlip = target.get('lockScalingFlip'); if (lockScalingX && lockScalingY) { return; } // Get the constraint point var constraintPosition = target.translateToOriginPoint(target.getCenterPoint(), t.originX, t.originY), localMouse = target.toLocalPoint(new fabric.Point(x, y), t.originX, t.originY); this._setLocalMouse(localMouse, t); // Actually scale the object this._setObjectScale(localMouse, t, lockScalingX, lockScalingY, by, lockScalingFlip); // Make sure the constraints apply target.setPositionByOrigin(constraintPosition, t.originX, t.originY); }, /** * @private */ _setObjectScale: function(localMouse, transform, lockScalingX, lockScalingY, by, lockScalingFlip) { var target = transform.target, forbidScalingX = false, forbidScalingY = false; transform.newScaleX = localMouse.x / (target.width + target.strokeWidth); transform.newScaleY = localMouse.y / (target.height + target.strokeWidth); if (lockScalingFlip && transform.newScaleX <= 0 && transform.newScaleX < target.scaleX) { forbidScalingX = true; } if (lockScalingFlip && transform.newScaleY <= 0 && transform.newScaleY < target.scaleY) { forbidScalingY = true; } if (by === 'equally' && !lockScalingX && !lockScalingY) { forbidScalingX || forbidScalingY || this._scaleObjectEqually(localMouse, target, transform); } else if (!by) { forbidScalingX || lockScalingX || target.set('scaleX', transform.newScaleX); forbidScalingY || lockScalingY || target.set('scaleY', transform.newScaleY); } else if (by === 'x' && !target.get('lockUniScaling')) { forbidScalingX || lockScalingX || target.set('scaleX', transform.newScaleX); } else if (by === 'y' && !target.get('lockUniScaling')) { forbidScalingY || lockScalingY || target.set('scaleY', transform.newScaleY); } forbidScalingX || forbidScalingY || this._flipObject(transform); }, /** * @private */ _scaleObjectEqually: function(localMouse, target, transform) { var dist = localMouse.y + localMouse.x, lastDist = (target.height + (target.strokeWidth)) * transform.original.scaleY + (target.width + (target.strokeWidth)) * transform.original.scaleX; // We use transform.scaleX/Y instead of target.scaleX/Y // because the object may have a min scale and we'll loose the proportions transform.newScaleX = transform.original.scaleX * dist / lastDist; transform.newScaleY = transform.original.scaleY * dist / lastDist; target.set('scaleX', transform.newScaleX); target.set('scaleY', transform.newScaleY); }, /** * @private */ _flipObject: function(transform) { if (transform.newScaleX < 0) { if (transform.originX === 'left') { transform.originX = 'right'; } else if (transform.originX === 'right') { transform.originX = 'left'; } } if (transform.newScaleY < 0) { if (transform.originY === 'top') { transform.originY = 'bottom'; } else if (transform.originY === 'bottom') { transform.originY = 'top'; } } }, /** * @private */ _setLocalMouse: function(localMouse, t) { var target = t.target; if (t.originX === 'right') { localMouse.x *= -1; } else if (t.originX === 'center') { localMouse.x *= t.mouseXSign * 2; if (localMouse.x < 0) { t.mouseXSign = -t.mouseXSign; } } if (t.originY === 'bottom') { localMouse.y *= -1; } else if (t.originY === 'center') { localMouse.y *= t.mouseYSign * 2; if (localMouse.y < 0) { t.mouseYSign = -t.mouseYSign; } } // adjust the mouse coordinates when dealing with padding if (abs(localMouse.x) > target.padding) { if (localMouse.x < 0) { localMouse.x += target.padding; } else { localMouse.x -= target.padding; } } else { // mouse is within the padding, set to 0 localMouse.x = 0; } if (abs(localMouse.y) > target.padding) { if (localMouse.y < 0) { localMouse.y += target.padding; } else { localMouse.y -= target.padding; } } else { localMouse.y = 0; } }, /** * Rotates object by invoking its rotate method * @private * @param {Number} x pointer's x coordinate * @param {Number} y pointer's y coordinate */ _rotateObject: function (x, y) { var t = this._currentTransform; if (t.target.get('lockRotation')) { return; } var lastAngle = atan2(t.ey - t.top, t.ex - t.left), curAngle = atan2(y - t.top, x - t.left), angle = radiansToDegrees(curAngle - lastAngle + t.theta); // normalize angle to positive value if (angle < 0) { angle = 360 + angle; } t.target.angle = angle; }, /** * Set the cursor type of the canvas element * @param {String} value Cursor type of the canvas element. * @see http://www.w3.org/TR/css3-ui/#cursor */ setCursor: function (value) { this.upperCanvasEl.style.cursor = value; }, /** * @private */ _resetObjectTransform: function (target) { target.scaleX = 1; target.scaleY = 1; target.setAngle(0); }, /** * @private */ _drawSelection: function () { var ctx = this.contextTop, groupSelector = this._groupSelector, left = groupSelector.left, top = groupSelector.top, aleft = abs(left), atop = abs(top); ctx.fillStyle = this.selectionColor; ctx.fillRect( groupSelector.ex - ((left > 0) ? 0 : -left), groupSelector.ey - ((top > 0) ? 0 : -top), aleft, atop ); ctx.lineWidth = this.selectionLineWidth; ctx.strokeStyle = this.selectionBorderColor; // selection border if (this.selectionDashArray.length > 1) { var px = groupSelector.ex + STROKE_OFFSET - ((left > 0) ? 0: aleft), py = groupSelector.ey + STROKE_OFFSET - ((top > 0) ? 0: atop); ctx.beginPath(); fabric.util.drawDashedLine(ctx, px, py, px + aleft, py, this.selectionDashArray); fabric.util.drawDashedLine(ctx, px, py + atop - 1, px + aleft, py + atop - 1, this.selectionDashArray); fabric.util.drawDashedLine(ctx, px, py, px, py + atop, this.selectionDashArray); fabric.util.drawDashedLine(ctx, px + aleft - 1, py, px + aleft - 1, py + atop, this.selectionDashArray); ctx.closePath(); ctx.stroke(); } else { ctx.strokeRect( groupSelector.ex + STROKE_OFFSET - ((left > 0) ? 0 : aleft), groupSelector.ey + STROKE_OFFSET - ((top > 0) ? 0 : atop), aleft, atop ); } }, /** * @private */ _isLastRenderedObject: function(e) { return ( this.controlsAboveOverlay && this.lastRenderedObjectWithControlsAboveOverlay && this.lastRenderedObjectWithControlsAboveOverlay.visible && this.containsPoint(e, this.lastRenderedObjectWithControlsAboveOverlay) && this.lastRenderedObjectWithControlsAboveOverlay._findTargetCorner(this.getPointer(e, true))); }, /** * Method that determines what object we are clicking on * @param {Event} e mouse event * @param {Boolean} skipGroup when true, group is skipped and only objects are traversed through */ findTarget: function (e, skipGroup) { if (this.skipTargetFind) { return; } if (this._isLastRenderedObject(e)) { return this.lastRenderedObjectWithControlsAboveOverlay; } // first check current group (if one exists) var activeGroup = this.getActiveGroup(); if (activeGroup && !skipGroup && this.containsPoint(e, activeGroup)) { return activeGroup; } var target = this._searchPossibleTargets(e); this._fireOverOutEvents(target); return target; }, /** * @private */ _fireOverOutEvents: function(target) { if (target) { if (this._hoveredTarget !== target) { this.fire('mouse:over', { target: target }); target.fire('mouseover'); if (this._hoveredTarget) { this.fire('mouse:out', { target: this._hoveredTarget }); this._hoveredTarget.fire('mouseout'); } this._hoveredTarget = target; } } else if (this._hoveredTarget) { this.fire('mouse:out', { target: this._hoveredTarget }); this._hoveredTarget.fire('mouseout'); this._hoveredTarget = null; } }, /** * @private */ _checkTarget: function(e, obj, pointer) { if (obj && obj.visible && obj.evented && this.containsPoint(e, obj)){ if ((this.perPixelTargetFind || obj.perPixelTargetFind) && !obj.isEditing) { var isTransparent = this.isTargetTransparent(obj, pointer.x, pointer.y); if (!isTransparent) { return true; } } else { return true; } } }, /** * @private */ _searchPossibleTargets: function(e) { // Cache all targets where their bounding box contains point. var target, pointer = this.getPointer(e, true), i = this._objects.length; while (i--) { if (this._checkTarget(e, this._objects[i], pointer)){ this.relatedTarget = this._objects[i]; target = this._objects[i]; break; } } return target; }, /** * Returns pointer coordinates relative to canvas. * @param {Event} e * @return {Object} object with "x" and "y" number values */ getPointer: function (e, ignoreZoom, upperCanvasEl) { if (!upperCanvasEl) { upperCanvasEl = this.upperCanvasEl; } var pointer = getPointer(e, upperCanvasEl), bounds = upperCanvasEl.getBoundingClientRect(), cssScale; this.calcOffset(); pointer.x = pointer.x - this._offset.left; pointer.y = pointer.y - this._offset.top; if (!ignoreZoom) { pointer = fabric.util.transformPoint( pointer, fabric.util.invertTransform(this.viewportTransform) ); } if (bounds.width === 0 || bounds.height === 0) { // If bounds are not available (i.e. not visible), do not apply scale. cssScale = { width: 1, height: 1 }; } else { cssScale = { width: upperCanvasEl.width / bounds.width, height: upperCanvasEl.height / bounds.height }; } return { x: pointer.x * cssScale.width, y: pointer.y * cssScale.height }; }, /** * @private * @throws {CANVAS_INIT_ERROR} If canvas can not be initialized */ _createUpperCanvas: function () { var lowerCanvasClass = this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/, ''); this.upperCanvasEl = this._createCanvasElement(); fabric.util.addClass(this.upperCanvasEl, 'upper-canvas ' + lowerCanvasClass); this.wrapperEl.appendChild(this.upperCanvasEl); this._copyCanvasStyle(this.lowerCanvasEl, this.upperCanvasEl); this._applyCanvasStyle(this.upperCanvasEl); this.contextTop = this.upperCanvasEl.getContext('2d'); }, /** * @private */ _createCacheCanvas: function () { this.cacheCanvasEl = this._createCanvasElement(); this.cacheCanvasEl.setAttribute('width', this.width); this.cacheCanvasEl.setAttribute('height', this.height); this.contextCache = this.cacheCanvasEl.getContext('2d'); }, /** * @private */ _initWrapperElement: function () { this.wrapperEl = fabric.util.wrapElement(this.lowerCanvasEl, 'div', { 'class': this.containerClass }); fabric.util.setStyle(this.wrapperEl, { width: this.getWidth() + 'px', height: this.getHeight() + 'px', position: 'relative' }); fabric.util.makeElementUnselectable(this.wrapperEl); }, /** * @private * @param {HTMLElement} element canvas element to apply styles on */ _applyCanvasStyle: function (element) { var width = this.getWidth() || element.width, height = this.getHeight() || element.height; fabric.util.setStyle(element, { position: 'absolute', width: width + 'px', height: height + 'px', left: 0, top: 0 }); element.width = width; element.height = height; fabric.util.makeElementUnselectable(element); }, /** * Copys the the entire inline style from one element (fromEl) to another (toEl) * @private * @param {Element} fromEl Element style is copied from * @param {Element} toEl Element copied style is applied to */ _copyCanvasStyle: function (fromEl, toEl) { toEl.style.cssText = fromEl.style.cssText; }, /** * Returns context of canvas where object selection is drawn * @return {CanvasRenderingContext2D} */ getSelectionContext: function() { return this.contextTop; }, /** * Returns &lt;canvas> element on which object selection is drawn * @return {HTMLCanvasElement} */ getSelectionElement: function () { return this.upperCanvasEl; }, /** * @private * @param {Object} object */ _setActiveObject: function(object) { if (this._activeObject) { this._activeObject.set('active', false); } this._activeObject = object; object.set('active', true); }, /** * Sets given object as the only active object on canvas * @param {fabric.Object} object Object to set as an active one * @param {Event} [e] Event (passed along when firing "object:selected") * @return {fabric.Canvas} thisArg * @chainable */ setActiveObject: function (object, e) { this._setActiveObject(object); this.renderAll(); this.fire('object:selected', { target: object, e: e }); object.fire('selected', { e: e }); return this; }, /** * Returns currently active object * @return {fabric.Object} active object */ getActiveObject: function () { return this._activeObject; }, /** * @private */ _discardActiveObject: function() { if (this._activeObject) { this._activeObject.set('active', false); } this._activeObject = null; }, /** * Discards currently active object * @return {fabric.Canvas} thisArg * @chainable */ discardActiveObject: function (e) { this._discardActiveObject(); this.renderAll(); this.fire('selection:cleared', { e: e }); return this; }, /** * @private * @param {fabric.Group} group */ _setActiveGroup: function(group) { this._activeGroup = group; if (group) { group.set('active', true); } }, /** * Sets active group to a speicified one * @param {fabric.Group} group Group to set as a current one * @return {fabric.Canvas} thisArg * @chainable */ setActiveGroup: function (group, e) { this._setActiveGroup(group); if (group) { this.fire('object:selected', { target: group, e: e }); group.fire('selected', { e: e }); } return this; }, /** * Returns currently active group * @return {fabric.Group} Current group */ getActiveGroup: function () { return this._activeGroup; }, /** * @private */ _discardActiveGroup: function() { var g = this.getActiveGroup(); if (g) { g.destroy(); } this.setActiveGroup(null); }, /** * Discards currently active group * @return {fabric.Canvas} thisArg */ discardActiveGroup: function (e) { this._discardActiveGroup(); this.fire('selection:cleared', { e: e }); return this; }, /** * Deactivates all objects on canvas, removing any active group or object * @return {fabric.Canvas} thisArg */ deactivateAll: function () { var allObjects = this.getObjects(), i = 0, len = allObjects.length; for ( ; i < len; i++) { allObjects[i].set('active', false); } this._discardActiveGroup(); this._discardActiveObject(); return this; }, /** * Deactivates all objects and dispatches appropriate events * @return {fabric.Canvas} thisArg */ deactivateAllWithDispatch: function (e) { var activeObject = this.getActiveGroup() || this.getActiveObject(); if (activeObject) { this.fire('before:selection:cleared', { target: activeObject, e: e }); } this.deactivateAll(); if (activeObject) { this.fire('selection:cleared', { e: e }); } return this; }, /** * Draws objects' controls (borders/controls) * @param {CanvasRenderingContext2D} ctx Context to render controls on */ drawControls: function(ctx) { var activeGroup = this.getActiveGroup(); if (activeGroup) { this._drawGroupControls(ctx, activeGroup); } else { this._drawObjectsControls(ctx); } }, /** * @private */ _drawGroupControls: function(ctx, activeGroup) { activeGroup._renderControls(ctx); }, /** * @private */ _drawObjectsControls: function(ctx) { for (var i = 0, len = this._objects.length; i < len; ++i) { if (!this._objects[i] || !this._objects[i].active) { continue; } this._objects[i]._renderControls(ctx); this.lastRenderedObjectWithControlsAboveOverlay = this._objects[i]; } } }); // copying static properties manually to work around Opera's bug, // where "prototype" property is enumerable and overrides existing prototype for (var prop in fabric.StaticCanvas) { if (prop !== 'prototype') { fabric.Canvas[prop] = fabric.StaticCanvas[prop]; } } if (fabric.isTouchSupported) { /** @ignore */ fabric.Canvas.prototype._setCursorFromEvent = function() { }; } /** * @class fabric.Element * @alias fabric.Canvas * @deprecated Use {@link fabric.Canvas} instead. * @constructor */ fabric.Element = fabric.Canvas; })(); (function(){ var cursorOffset = { mt: 0, // n tr: 1, // ne mr: 2, // e br: 3, // se mb: 4, // s bl: 5, // sw ml: 6, // w tl: 7 // nw }, addListener = fabric.util.addListener, removeListener = fabric.util.removeListener; fabric.util.object.extend(fabric.Canvas.prototype, /** @lends fabric.Canvas.prototype */ { /** * Map of cursor style values for each of the object controls * @private */ cursorMap: [ 'n-resize', 'ne-resize', 'e-resize', 'se-resize', 's-resize', 'sw-resize', 'w-resize', 'nw-resize' ], /** * Adds mouse listeners to canvas * @private */ _initEventListeners: function () { this._bindEvents(); addListener(fabric.window, 'resize', this._onResize); // mouse events addListener(this.upperCanvasEl, 'mousedown', this._onMouseDown); addListener(this.upperCanvasEl, 'mousemove', this._onMouseMove); addListener(this.upperCanvasEl, 'mousewheel', this._onMouseWheel); // touch events addListener(this.upperCanvasEl, 'touchstart', this._onMouseDown); addListener(this.upperCanvasEl, 'touchmove', this._onMouseMove); if (typeof Event !== 'undefined' && 'add' in Event) { Event.add(this.upperCanvasEl, 'gesture', this._onGesture); Event.add(this.upperCanvasEl, 'drag', this._onDrag); Event.add(this.upperCanvasEl, 'orientation', this._onOrientationChange); Event.add(this.upperCanvasEl, 'shake', this._onShake); } }, /** * @private */ _bindEvents: function() { this._onMouseDown = this._onMouseDown.bind(this); this._onMouseMove = this._onMouseMove.bind(this); this._onMouseUp = this._onMouseUp.bind(this); this._onResize = this._onResize.bind(this); this._onGesture = this._onGesture.bind(this); this._onDrag = this._onDrag.bind(this); this._onShake = this._onShake.bind(this); this._onOrientationChange = this._onOrientationChange.bind(this); this._onMouseWheel = this._onMouseWheel.bind(this); }, /** * Removes all event listeners */ removeListeners: function() { removeListener(fabric.window, 'resize', this._onResize); removeListener(this.upperCanvasEl, 'mousedown', this._onMouseDown); removeListener(this.upperCanvasEl, 'mousemove', this._onMouseMove); removeListener(this.upperCanvasEl, 'mousewheel', this._onMouseWheel); removeListener(this.upperCanvasEl, 'touchstart', this._onMouseDown); removeListener(this.upperCanvasEl, 'touchmove', this._onMouseMove); if (typeof Event !== 'undefined' && 'remove' in Event) { Event.remove(this.upperCanvasEl, 'gesture', this._onGesture); Event.remove(this.upperCanvasEl, 'drag', this._onDrag); Event.remove(this.upperCanvasEl, 'orientation', this._onOrientationChange); Event.remove(this.upperCanvasEl, 'shake', this._onShake); } }, /** * @private * @param {Event} [e] Event object fired on Event.js gesture * @param {Event} [self] Inner Event object */ _onGesture: function(e, self) { this.__onTransformGesture && this.__onTransformGesture(e, self); }, /** * @private * @param {Event} [e] Event object fired on Event.js drag * @param {Event} [self] Inner Event object */ _onDrag: function(e, self) { this.__onDrag && this.__onDrag(e, self); }, /** * @private * @param {Event} [e] Event object fired on Event.js wheel event * @param {Event} [self] Inner Event object */ _onMouseWheel: function(e, self) { this.__onMouseWheel && this.__onMouseWheel(e, self); }, /** * @private * @param {Event} [e] Event object fired on Event.js orientation change * @param {Event} [self] Inner Event object */ _onOrientationChange: function(e,self) { this.__onOrientationChange && this.__onOrientationChange(e,self); }, /** * @private * @param {Event} [e] Event object fired on Event.js shake * @param {Event} [self] Inner Event object */ _onShake: function(e, self) { this.__onShake && this.__onShake(e,self); }, /** * @private * @param {Event} e Event object fired on mousedown */ _onMouseDown: function (e) { this.__onMouseDown(e); addListener(fabric.document, 'touchend', this._onMouseUp); addListener(fabric.document, 'touchmove', this._onMouseMove); removeListener(this.upperCanvasEl, 'mousemove', this._onMouseMove); removeListener(this.upperCanvasEl, 'touchmove', this._onMouseMove); if (e.type === 'touchstart') { // Unbind mousedown to prevent double triggers from touch devices removeListener(this.upperCanvasEl, 'mousedown', this._onMouseDown); } else { addListener(fabric.document, 'mouseup', this._onMouseUp); addListener(fabric.document, 'mousemove', this._onMouseMove); } }, /** * @private * @param {Event} e Event object fired on mouseup */ _onMouseUp: function (e) { this.__onMouseUp(e); removeListener(fabric.document, 'mouseup', this._onMouseUp); removeListener(fabric.document, 'touchend', this._onMouseUp); removeListener(fabric.document, 'mousemove', this._onMouseMove); removeListener(fabric.document, 'touchmove', this._onMouseMove); addListener(this.upperCanvasEl, 'mousemove', this._onMouseMove); addListener(this.upperCanvasEl, 'touchmove', this._onMouseMove); if (e.type === 'touchend') { // Wait 400ms before rebinding mousedown to prevent double triggers // from touch devices var _this = this; setTimeout(function() { addListener(_this.upperCanvasEl, 'mousedown', _this._onMouseDown); }, 400); } }, /** * @private * @param {Event} e Event object fired on mousemove */ _onMouseMove: function (e) { !this.allowTouchScrolling && e.preventDefault && e.preventDefault(); this.__onMouseMove(e); }, /** * @private */ _onResize: function () { this.calcOffset(); }, /** * Decides whether the canvas should be redrawn in mouseup and mousedown events. * @private * @param {Object} target * @param {Object} pointer */ _shouldRender: function(target, pointer) { var activeObject = this.getActiveGroup() || this.getActiveObject(); return !!( (target && ( target.isMoving || target !== activeObject)) || (!target && !!activeObject) || (!target && !activeObject && !this._groupSelector) || (pointer && this._previousPointer && this.selection && ( pointer.x !== this._previousPointer.x || pointer.y !== this._previousPointer.y)) ); }, /** * Method that defines the actions when mouse is released on canvas. * The method resets the currentTransform parameters, store the image corner * position in the image object and render the canvas on top. * @private * @param {Event} e Event object fired on mouseup */ __onMouseUp: function (e) { var target; if (this.isDrawingMode && this._isCurrentlyDrawing) { this._onMouseUpInDrawingMode(e); return; } if (this._currentTransform) { this._finalizeCurrentTransform(); target = this._currentTransform.target; } else { target = this.findTarget(e, true); } var shouldRender = this._shouldRender(target, this.getPointer(e)); this._maybeGroupObjects(e); if (target) { target.isMoving = false; } shouldRender && this.renderAll(); this._handleCursorAndEvent(e, target); }, _handleCursorAndEvent: function(e, target) { this._setCursorFromEvent(e, target); // TODO: why are we doing this? var _this = this; setTimeout(function () { _this._setCursorFromEvent(e, target); }, 50); this.fire('mouse:up', { target: target, e: e }); target && target.fire('mouseup', { e: e }); }, /** * @private */ _finalizeCurrentTransform: function() { var transform = this._currentTransform, target = transform.target; if (target._scaling) { target._scaling = false; } target.setCoords(); // only fire :modified event if target coordinates were changed during mousedown-mouseup if (this.stateful && target.hasStateChanged()) { this.fire('object:modified', { target: target }); target.fire('modified'); } this._restoreOriginXY(target); }, /** * @private * @param {Object} target Object to restore */ _restoreOriginXY: function(target) { if (this._previousOriginX && this._previousOriginY) { var originPoint = target.translateToOriginPoint( target.getCenterPoint(), this._previousOriginX, this._previousOriginY); target.originX = this._previousOriginX; target.originY = this._previousOriginY; target.left = originPoint.x; target.top = originPoint.y; this._previousOriginX = null; this._previousOriginY = null; } }, /** * @private * @param {Event} e Event object fired on mousedown */ _onMouseDownInDrawingMode: function(e) { this._isCurrentlyDrawing = true; this.discardActiveObject(e).renderAll(); if (this.clipTo) { fabric.util.clipContext(this, this.contextTop); } var ivt = fabric.util.invertTransform(this.viewportTransform), pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt); this.freeDrawingBrush.onMouseDown(pointer); this.fire('mouse:down', { e: e }); }, /** * @private * @param {Event} e Event object fired on mousemove */ _onMouseMoveInDrawingMode: function(e) { if (this._isCurrentlyDrawing) { var ivt = fabric.util.invertTransform(this.viewportTransform), pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt); this.freeDrawingBrush.onMouseMove(pointer); } this.setCursor(this.freeDrawingCursor); this.fire('mouse:move', { e: e }); }, /** * @private * @param {Event} e Event object fired on mouseup */ _onMouseUpInDrawingMode: function(e) { this._isCurrentlyDrawing = false; if (this.clipTo) { this.contextTop.restore(); } this.freeDrawingBrush.onMouseUp(); this.fire('mouse:up', { e: e }); }, /** * Method that defines the actions when mouse is clic ked on canvas. * The method inits the currentTransform parameters and renders all the * canvas so the current image can be placed on the top canvas and the rest * in on the container one. * @private * @param {Event} e Event object fired on mousedown */ __onMouseDown: function (e) { // accept only left clicks var isLeftClick = 'which' in e ? e.which === 1 : e.button === 1; if (!isLeftClick && !fabric.isTouchSupported) { return; } if (this.isDrawingMode) { this._onMouseDownInDrawingMode(e); return; } // ignore if some object is being transformed at this moment if (this._currentTransform) { return; } var target = this.findTarget(e), pointer = this.getPointer(e, true); // save pointer for check in __onMouseUp event this._previousPointer = pointer; var shouldRender = this._shouldRender(target, pointer), shouldGroup = this._shouldGroup(e, target); if (this._shouldClearSelection(e, target)) { this._clearSelection(e, target, pointer); } else if (shouldGroup) { this._handleGrouping(e, target); target = this.getActiveGroup(); } if (target && target.selectable && !shouldGroup) { this._beforeTransform(e, target); this._setupCurrentTransform(e, target); } // we must renderAll so that active image is placed on the top canvas shouldRender && this.renderAll(); this.fire('mouse:down', { target: target, e: e }); target && target.fire('mousedown', { e: e }); }, /** * @private */ _beforeTransform: function(e, target) { var corner; this.stateful && target.saveState(); // determine if it's a drag or rotate case if ((corner = target._findTargetCorner(this.getPointer(e)))) { this.onBeforeScaleRotate(target); } if (target !== this.getActiveGroup() && target !== this.getActiveObject()) { this.deactivateAll(); this.setActiveObject(target, e); } }, /** * @private */ _clearSelection: function(e, target, pointer) { this.deactivateAllWithDispatch(e); if (target && target.selectable) { this.setActiveObject(target, e); } else if (this.selection) { this._groupSelector = { ex: pointer.x, ey: pointer.y, top: 0, left: 0 }; } }, /** * @private * @param {Object} target Object for that origin is set to center */ _setOriginToCenter: function(target) { this._previousOriginX = this._currentTransform.target.originX; this._previousOriginY = this._currentTransform.target.originY; var center = target.getCenterPoint(); target.originX = 'center'; target.originY = 'center'; target.left = center.x; target.top = center.y; this._currentTransform.left = target.left; this._currentTransform.top = target.top; }, /** * @private * @param {Object} target Object for that center is set to origin */ _setCenterToOrigin: function(target) { var originPoint = target.translateToOriginPoint( target.getCenterPoint(), this._previousOriginX, this._previousOriginY); target.originX = this._previousOriginX; target.originY = this._previousOriginY; target.left = originPoint.x; target.top = originPoint.y; this._previousOriginX = null; this._previousOriginY = null; }, /** * Method that defines the actions when mouse is hovering the canvas. * The currentTransform parameter will definde whether the user is rotating/scaling/translating * an image or neither of them (only hovering). A group selection is also possible and would cancel * all any other type of action. * In case of an image transformation only the top canvas will be rendered. * @private * @param {Event} e Event object fired on mousemove */ __onMouseMove: function (e) { var target, pointer; if (this.isDrawingMode) { this._onMouseMoveInDrawingMode(e); return; } var groupSelector = this._groupSelector; // We initially clicked in an empty area, so we draw a box for multiple selection if (groupSelector) { pointer = this.getPointer(e, true); groupSelector.left = pointer.x - groupSelector.ex; groupSelector.top = pointer.y - groupSelector.ey; this.renderTop(); } else if (!this._currentTransform) { target = this.findTarget(e); if (!target || target && !target.selectable) { this.setCursor(this.defaultCursor); } else { this._setCursorFromEvent(e, target); } } else { this._transformObject(e); } this.fire('mouse:move', { target: target, e: e }); target && target.fire('mousemove', { e: e }); }, /** * @private * @param {Event} e Event fired on mousemove */ _transformObject: function(e) { var pointer = this.getPointer(e), transform = this._currentTransform; transform.reset = false, transform.target.isMoving = true; this._beforeScaleTransform(e, transform); this._performTransformAction(e, transform, pointer); this.renderAll(); }, /** * @private */ _performTransformAction: function(e, transform, pointer) { var x = pointer.x, y = pointer.y, target = transform.target, action = transform.action; if (action === 'rotate') { this._rotateObject(x, y); this._fire('rotating', target, e); } else if (action === 'scale') { this._onScale(e, transform, x, y); this._fire('scaling', target, e); } else if (action === 'scaleX') { this._scaleObject(x, y, 'x'); this._fire('scaling', target, e); } else if (action === 'scaleY') { this._scaleObject(x, y, 'y'); this._fire('scaling', target, e); } else { this._translateObject(x, y); this._fire('moving', target, e); this.setCursor(this.moveCursor); } }, /** * @private */ _fire: function(eventName, target, e) { this.fire('object:' + eventName, { target: target, e: e }); target.fire(eventName, { e: e }); }, /** * @private */ _beforeScaleTransform: function(e, transform) { if (transform.action === 'scale' || transform.action === 'scaleX' || transform.action === 'scaleY') { var centerTransform = this._shouldCenterTransform(e, transform.target); // Switch from a normal resize to center-based if ((centerTransform && (transform.originX !== 'center' || transform.originY !== 'center')) || // Switch from center-based resize to normal one (!centerTransform && transform.originX === 'center' && transform.originY === 'center') ) { this._resetCurrentTransform(e); transform.reset = true; } } }, /** * @private */ _onScale: function(e, transform, x, y) { // rotate object only if shift key is not pressed // and if it is not a group we are transforming if ((e.shiftKey || this.uniScaleTransform) && !transform.target.get('lockUniScaling')) { transform.currentAction = 'scale'; this._scaleObject(x, y); } else { // Switch from a normal resize to proportional if (!transform.reset && transform.currentAction === 'scale') { this._resetCurrentTransform(e, transform.target); } transform.currentAction = 'scaleEqually'; this._scaleObject(x, y, 'equally'); } }, /** * Sets the cursor depending on where the canvas is being hovered. * Note: very buggy in Opera * @param {Event} e Event object * @param {Object} target Object that the mouse is hovering, if so. */ _setCursorFromEvent: function (e, target) { if (!target || !target.selectable) { this.setCursor(this.defaultCursor); return false; } else { var activeGroup = this.getActiveGroup(), // only show proper corner when group selection is not active corner = target._findTargetCorner && (!activeGroup || !activeGroup.contains(target)) && target._findTargetCorner(this.getPointer(e, true)); if (!corner) { this.setCursor(target.hoverCursor || this.hoverCursor); } else { this._setCornerCursor(corner, target); } } return true; }, /** * @private */ _setCornerCursor: function(corner, target) { if (corner in cursorOffset) { this.setCursor(this._getRotatedCornerCursor(corner, target)); } else if (corner === 'mtr' && target.hasRotatingPoint) { this.setCursor(this.rotationCursor); } else { this.setCursor(this.defaultCursor); return false; } }, /** * @private */ _getRotatedCornerCursor: function(corner, target) { var n = Math.round((target.getAngle() % 360) / 45); if (n < 0) { n += 8; // full circle ahead } n += cursorOffset[corner]; // normalize n to be from 0 to 7 n %= 8; return this.cursorMap[n]; } }); })(); (function(){ var min = Math.min, max = Math.max; fabric.util.object.extend(fabric.Canvas.prototype, /** @lends fabric.Canvas.prototype */ { /** * @private * @param {Event} e Event object * @param {fabric.Object} target * @return {Boolean} */ _shouldGroup: function(e, target) { var activeObject = this.getActiveObject(); return e.shiftKey && (this.getActiveGroup() || (activeObject && activeObject !== target)) && this.selection; }, /** * @private * @param {Event} e Event object * @param {fabric.Object} target */ _handleGrouping: function (e, target) { if (target === this.getActiveGroup()) { // if it's a group, find target again, this time skipping group target = this.findTarget(e, true); // if even object is not found, bail out if (!target || target.isType('group')) { return; } } if (this.getActiveGroup()) { this._updateActiveGroup(target, e); } else { this._createActiveGroup(target, e); } if (this._activeGroup) { this._activeGroup.saveCoords(); } }, /** * @private */ _updateActiveGroup: function(target, e) { var activeGroup = this.getActiveGroup(); if (activeGroup.contains(target)) { activeGroup.removeWithUpdate(target); this._resetObjectTransform(activeGroup); target.set('active', false); if (activeGroup.size() === 1) { // remove group alltogether if after removal it only contains 1 object this.discardActiveGroup(e); // activate last remaining object this.setActiveObject(activeGroup.item(0)); return; } } else { activeGroup.addWithUpdate(target); this._resetObjectTransform(activeGroup); } this.fire('selection:created', { target: activeGroup, e: e }); activeGroup.set('active', true); }, /** * @private */ _createActiveGroup: function(target, e) { if (this._activeObject && target !== this._activeObject) { var group = this._createGroup(target); group.addWithUpdate(); this.setActiveGroup(group); this._activeObject = null; this.fire('selection:created', { target: group, e: e }); } target.set('active', true); }, /** * @private * @param {Object} target */ _createGroup: function(target) { var objects = this.getObjects(), isActiveLower = objects.indexOf(this._activeObject) < objects.indexOf(target), groupObjects = isActiveLower ? [ this._activeObject, target ] : [ target, this._activeObject ]; return new fabric.Group(groupObjects, { originX: 'center', originY: 'center', canvas: this }); }, /** * @private * @param {Event} e mouse event */ _groupSelectedObjects: function (e) { var group = this._collectObjects(); // do not create group for 1 element only if (group.length === 1) { this.setActiveObject(group[0], e); } else if (group.length > 1) { group = new fabric.Group(group.reverse(), { originX: 'center', originY: 'center', canvas: this }); group.addWithUpdate(); this.setActiveGroup(group, e); group.saveCoords(); this.fire('selection:created', { target: group }); this.renderAll(); } }, /** * @private */ _collectObjects: function() { var group = [ ], currentObject, x1 = this._groupSelector.ex, y1 = this._groupSelector.ey, x2 = x1 + this._groupSelector.left, y2 = y1 + this._groupSelector.top, selectionX1Y1 = new fabric.Point(min(x1, x2), min(y1, y2)), selectionX2Y2 = new fabric.Point(max(x1, x2), max(y1, y2)), isClick = x1 === x2 && y1 === y2; for (var i = this._objects.length; i--; ) { currentObject = this._objects[i]; if (!currentObject || !currentObject.selectable || !currentObject.visible) { continue; } if (currentObject.intersectsWithRect(selectionX1Y1, selectionX2Y2) || currentObject.isContainedWithinRect(selectionX1Y1, selectionX2Y2) || currentObject.containsPoint(selectionX1Y1) || currentObject.containsPoint(selectionX2Y2) ) { currentObject.set('active', true); group.push(currentObject); // only add one object if it's a click if (isClick) { break; } } } return group; }, /** * @private */ _maybeGroupObjects: function(e) { if (this.selection && this._groupSelector) { this._groupSelectedObjects(e); } var activeGroup = this.getActiveGroup(); if (activeGroup) { activeGroup.setObjectsCoords().setCoords(); activeGroup.isMoving = false; this.setCursor(this.defaultCursor); } // clear selection and current transformation this._groupSelector = null; this._currentTransform = null; } }); })(); fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.StaticCanvas.prototype */ { /** * Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately * @param {Object} [options] Options object * @param {String} [options.format=png] The format of the output image. Either "jpeg" or "png" * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg. * @param {Number} [options.multiplier=1] Multiplier to scale by * @param {Number} [options.left] Cropping left offset. Introduced in v1.2.14 * @param {Number} [options.top] Cropping top offset. Introduced in v1.2.14 * @param {Number} [options.width] Cropping width. Introduced in v1.2.14 * @param {Number} [options.height] Cropping height. Introduced in v1.2.14 * @return {String} Returns a data: URL containing a representation of the object in the format specified by options.format * @see {@link http://jsfiddle.net/fabricjs/NfZVb/|jsFiddle demo} * @example <caption>Generate jpeg dataURL with lower quality</caption> * var dataURL = canvas.toDataURL({ * format: 'jpeg', * quality: 0.8 * }); * @example <caption>Generate cropped png dataURL (clipping of canvas)</caption> * var dataURL = canvas.toDataURL({ * format: 'png', * left: 100, * top: 100, * width: 200, * height: 200 * }); * @example <caption>Generate double scaled png dataURL</caption> * var dataURL = canvas.toDataURL({ * format: 'png', * multiplier: 2 * }); */ toDataURL: function (options) { options || (options = { }); var format = options.format || 'png', quality = options.quality || 1, multiplier = options.multiplier || 1, cropping = { left: options.left, top: options.top, width: options.width, height: options.height }; if (multiplier !== 1) { return this.__toDataURLWithMultiplier(format, quality, cropping, multiplier); } else { return this.__toDataURL(format, quality, cropping); } }, /** * @private */ __toDataURL: function(format, quality, cropping) { this.renderAll(true); var canvasEl = this.upperCanvasEl || this.lowerCanvasEl, croppedCanvasEl = this.__getCroppedCanvas(canvasEl, cropping); // to avoid common confusion https://github.com/kangax/fabric.js/issues/806 if (format === 'jpg') { format = 'jpeg'; } var data = (fabric.StaticCanvas.supports('toDataURLWithQuality')) ? (croppedCanvasEl || canvasEl).toDataURL('image/' + format, quality) : (croppedCanvasEl || canvasEl).toDataURL('image/' + format); this.contextTop && this.clearContext(this.contextTop); this.renderAll(); if (croppedCanvasEl) { croppedCanvasEl = null; } return data; }, /** * @private */ __getCroppedCanvas: function(canvasEl, cropping) { var croppedCanvasEl, croppedCtx, shouldCrop = 'left' in cropping || 'top' in cropping || 'width' in cropping || 'height' in cropping; if (shouldCrop) { croppedCanvasEl = fabric.util.createCanvasElement(); croppedCtx = croppedCanvasEl.getContext('2d'); croppedCanvasEl.width = cropping.width || this.width; croppedCanvasEl.height = cropping.height || this.height; croppedCtx.drawImage(canvasEl, -cropping.left || 0, -cropping.top || 0); } return croppedCanvasEl; }, /** * @private */ __toDataURLWithMultiplier: function(format, quality, cropping, multiplier) { var origWidth = this.getWidth(), origHeight = this.getHeight(), scaledWidth = origWidth * multiplier, scaledHeight = origHeight * multiplier, activeObject = this.getActiveObject(), activeGroup = this.getActiveGroup(), ctx = this.contextTop || this.contextContainer; if (multiplier > 1) { this.setWidth(scaledWidth).setHeight(scaledHeight); } ctx.scale(multiplier, multiplier); if (cropping.left) { cropping.left *= multiplier; } if (cropping.top) { cropping.top *= multiplier; } if (cropping.width) { cropping.width *= multiplier; } else if (multiplier < 1) { cropping.width = scaledWidth; } if (cropping.height) { cropping.height *= multiplier; } else if (multiplier < 1) { cropping.height = scaledHeight; } if (activeGroup) { // not removing group due to complications with restoring it with correct state afterwords this._tempRemoveBordersControlsFromGroup(activeGroup); } else if (activeObject && this.deactivateAll) { this.deactivateAll(); } this.renderAll(true); var data = this.__toDataURL(format, quality, cropping); // restoring width, height for `renderAll` to draw // background properly (while context is scaled) this.width = origWidth; this.height = origHeight; ctx.scale(1 / multiplier, 1 / multiplier); this.setWidth(origWidth).setHeight(origHeight); if (activeGroup) { this._restoreBordersControlsOnGroup(activeGroup); } else if (activeObject && this.setActiveObject) { this.setActiveObject(activeObject); } this.contextTop && this.clearContext(this.contextTop); this.renderAll(); return data; }, /** * Exports canvas element to a dataurl image (allowing to change image size via multiplier). * @deprecated since 1.0.13 * @param {String} format (png|jpeg) * @param {Number} multiplier * @param {Number} quality (0..1) * @return {String} */ toDataURLWithMultiplier: function (format, multiplier, quality) { return this.toDataURL({ format: format, multiplier: multiplier, quality: quality }); }, /** * @private */ _tempRemoveBordersControlsFromGroup: function(group) { group.origHasControls = group.hasControls; group.origBorderColor = group.borderColor; group.hasControls = true; group.borderColor = 'rgba(0,0,0,0)'; group.forEachObject(function(o) { o.origBorderColor = o.borderColor; o.borderColor = 'rgba(0,0,0,0)'; }); }, /** * @private */ _restoreBordersControlsOnGroup: function(group) { group.hideControls = group.origHideControls; group.borderColor = group.origBorderColor; group.forEachObject(function(o) { o.borderColor = o.origBorderColor; delete o.origBorderColor; }); } }); fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.StaticCanvas.prototype */ { /** * Populates canvas with data from the specified dataless JSON. * JSON format must conform to the one of {@link fabric.Canvas#toDatalessJSON} * @deprecated since 1.2.2 * @param {String|Object} json JSON string or object * @param {Function} callback Callback, invoked when json is parsed * and corresponding objects (e.g: {@link fabric.Image}) * are initialized * @param {Function} [reviver] Method for further parsing of JSON elements, called after each fabric object created. * @return {fabric.Canvas} instance * @chainable * @tutorial {@link http://fabricjs.com/fabric-intro-part-3/#deserialization} */ loadFromDatalessJSON: function (json, callback, reviver) { return this.loadFromJSON(json, callback, reviver); }, /** * Populates canvas with data from the specified JSON. * JSON format must conform to the one of {@link fabric.Canvas#toJSON} * @param {String|Object} json JSON string or object * @param {Function} callback Callback, invoked when json is parsed * and corresponding objects (e.g: {@link fabric.Image}) * are initialized * @param {Function} [reviver] Method for further parsing of JSON elements, called after each fabric object created. * @return {fabric.Canvas} instance * @chainable * @tutorial {@link http://fabricjs.com/fabric-intro-part-3/#deserialization} * @see {@link http://jsfiddle.net/fabricjs/fmgXt/|jsFiddle demo} * @example <caption>loadFromJSON</caption> * canvas.loadFromJSON(json, canvas.renderAll.bind(canvas)); * @example <caption>loadFromJSON with reviver</caption> * canvas.loadFromJSON(json, canvas.renderAll.bind(canvas), function(o, object) { * // `o` = json object * // `object` = fabric.Object instance * // ... do some stuff ... * }); */ loadFromJSON: function (json, callback, reviver) { if (!json) { return; } // serialize if it wasn't already var serialized = (typeof json === 'string') ? JSON.parse(json) : json; this.clear(); var _this = this; this._enlivenObjects(serialized.objects, function () { _this._setBgOverlay(serialized, callback); }, reviver); return this; }, /** * @private * @param {Object} serialized Object with background and overlay information * @param {Function} callback Invoked after all background and overlay images/patterns loaded */ _setBgOverlay: function(serialized, callback) { var _this = this, loaded = { backgroundColor: false, overlayColor: false, backgroundImage: false, overlayImage: false }; if (!serialized.backgroundImage && !serialized.overlayImage && !serialized.background && !serialized.overlay) { callback && callback(); return; } var cbIfLoaded = function () { if (loaded.backgroundImage && loaded.overlayImage && loaded.backgroundColor && loaded.overlayColor) { _this.renderAll(); callback && callback(); } }; this.__setBgOverlay('backgroundImage', serialized.backgroundImage, loaded, cbIfLoaded); this.__setBgOverlay('overlayImage', serialized.overlayImage, loaded, cbIfLoaded); this.__setBgOverlay('backgroundColor', serialized.background, loaded, cbIfLoaded); this.__setBgOverlay('overlayColor', serialized.overlay, loaded, cbIfLoaded); cbIfLoaded(); }, /** * @private * @param {String} property Property to set (backgroundImage, overlayImage, backgroundColor, overlayColor) * @param {(Object|String)} value Value to set * @param {Object} loaded Set loaded property to true if property is set * @param {Object} callback Callback function to invoke after property is set */ __setBgOverlay: function(property, value, loaded, callback) { var _this = this; if (!value) { loaded[property] = true; return; } if (property === 'backgroundImage' || property === 'overlayImage') { fabric.Image.fromObject(value, function(img) { _this[property] = img; loaded[property] = true; callback && callback(); }); } else { this['set' + fabric.util.string.capitalize(property, true)](value, function() { loaded[property] = true; callback && callback(); }); } }, /** * @private * @param {Array} objects * @param {Function} callback * @param {Function} [reviver] */ _enlivenObjects: function (objects, callback, reviver) { var _this = this; if (!objects || objects.length === 0) { callback && callback(); return; } var renderOnAddRemove = this.renderOnAddRemove; this.renderOnAddRemove = false; fabric.util.enlivenObjects(objects, function(enlivenedObjects) { enlivenedObjects.forEach(function(obj, index) { _this.insertAt(obj, index, true); }); _this.renderOnAddRemove = renderOnAddRemove; callback && callback(); }, null, reviver); }, /** * @private * @param {String} format * @param {Function} callback */ _toDataURL: function (format, callback) { this.clone(function (clone) { callback(clone.toDataURL(format)); }); }, /** * @private * @param {String} format * @param {Number} multiplier * @param {Function} callback */ _toDataURLWithMultiplier: function (format, multiplier, callback) { this.clone(function (clone) { callback(clone.toDataURLWithMultiplier(format, multiplier)); }); }, /** * Clones canvas instance * @param {Object} [callback] Receives cloned instance as a first argument * @param {Array} [properties] Array of properties to include in the cloned canvas and children */ clone: function (callback, properties) { var data = JSON.stringify(this.toJSON(properties)); this.cloneWithoutData(function(clone) { clone.loadFromJSON(data, function() { callback && callback(clone); }); }); }, /** * Clones canvas instance without cloning existing data. * This essentially copies canvas dimensions, clipping properties, etc. * but leaves data empty (so that you can populate it with your own) * @param {Object} [callback] Receives cloned instance as a first argument */ cloneWithoutData: function(callback) { var el = fabric.document.createElement('canvas'); el.width = this.getWidth(); el.height = this.getHeight(); var clone = new fabric.Canvas(el); clone.clipTo = this.clipTo; if (this.backgroundImage) { clone.setBackgroundImage(this.backgroundImage.src, function() { clone.renderAll(); callback && callback(clone); }); clone.backgroundImageOpacity = this.backgroundImageOpacity; clone.backgroundImageStretch = this.backgroundImageStretch; } else { callback && callback(clone); } } }); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, toFixed = fabric.util.toFixed, capitalize = fabric.util.string.capitalize, degreesToRadians = fabric.util.degreesToRadians, supportsLineDash = fabric.StaticCanvas.supports('setLineDash'); if (fabric.Object) { return; } /** * Root object class from which all 2d shape classes inherit from * @class fabric.Object * @tutorial {@link http://fabricjs.com/fabric-intro-part-1/#objects} * @see {@link fabric.Object#initialize} for constructor definition * * @fires added * @fires removed * * @fires selected * @fires modified * @fires rotating * @fires scaling * @fires moving * * @fires mousedown * @fires mouseup */ fabric.Object = fabric.util.createClass(/** @lends fabric.Object.prototype */ { /** * Retrieves object's {@link fabric.Object#clipTo|clipping function} * @method getClipTo * @memberOf fabric.Object.prototype * @return {Function} */ /** * Sets object's {@link fabric.Object#clipTo|clipping function} * @method setClipTo * @memberOf fabric.Object.prototype * @param {Function} clipTo Clipping function * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#transformMatrix|transformMatrix} * @method getTransformMatrix * @memberOf fabric.Object.prototype * @return {Array} transformMatrix */ /** * Sets object's {@link fabric.Object#transformMatrix|transformMatrix} * @method setTransformMatrix * @memberOf fabric.Object.prototype * @param {Array} transformMatrix * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#visible|visible} state * @method getVisible * @memberOf fabric.Object.prototype * @return {Boolean} True if visible */ /** * Sets object's {@link fabric.Object#visible|visible} state * @method setVisible * @memberOf fabric.Object.prototype * @param {Boolean} value visible value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#shadow|shadow} * @method getShadow * @memberOf fabric.Object.prototype * @return {Object} Shadow instance */ /** * Retrieves object's {@link fabric.Object#stroke|stroke} * @method getStroke * @memberOf fabric.Object.prototype * @return {String} stroke value */ /** * Sets object's {@link fabric.Object#stroke|stroke} * @method setStroke * @memberOf fabric.Object.prototype * @param {String} value stroke value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#strokeWidth|strokeWidth} * @method getStrokeWidth * @memberOf fabric.Object.prototype * @return {Number} strokeWidth value */ /** * Sets object's {@link fabric.Object#strokeWidth|strokeWidth} * @method setStrokeWidth * @memberOf fabric.Object.prototype * @param {Number} value strokeWidth value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#originX|originX} * @method getOriginX * @memberOf fabric.Object.prototype * @return {String} originX value */ /** * Sets object's {@link fabric.Object#originX|originX} * @method setOriginX * @memberOf fabric.Object.prototype * @param {String} value originX value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#originY|originY} * @method getOriginY * @memberOf fabric.Object.prototype * @return {String} originY value */ /** * Sets object's {@link fabric.Object#originY|originY} * @method setOriginY * @memberOf fabric.Object.prototype * @param {String} value originY value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#fill|fill} * @method getFill * @memberOf fabric.Object.prototype * @return {String} Fill value */ /** * Sets object's {@link fabric.Object#fill|fill} * @method setFill * @memberOf fabric.Object.prototype * @param {String} value Fill value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#opacity|opacity} * @method getOpacity * @memberOf fabric.Object.prototype * @return {Number} Opacity value (0-1) */ /** * Sets object's {@link fabric.Object#opacity|opacity} * @method setOpacity * @memberOf fabric.Object.prototype * @param {Number} value Opacity value (0-1) * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#angle|angle} (in degrees) * @method getAngle * @memberOf fabric.Object.prototype * @return {Number} */ /** * Sets object's {@link fabric.Object#angle|angle} * @method setAngle * @memberOf fabric.Object.prototype * @param {Number} value Angle value (in degrees) * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#top|top position} * @method getTop * @memberOf fabric.Object.prototype * @return {Number} Top value (in pixels) */ /** * Sets object's {@link fabric.Object#top|top position} * @method setTop * @memberOf fabric.Object.prototype * @param {Number} value Top value (in pixels) * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#left|left position} * @method getLeft * @memberOf fabric.Object.prototype * @return {Number} Left value (in pixels) */ /** * Sets object's {@link fabric.Object#left|left position} * @method setLeft * @memberOf fabric.Object.prototype * @param {Number} value Left value (in pixels) * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#scaleX|scaleX} value * @method getScaleX * @memberOf fabric.Object.prototype * @return {Number} scaleX value */ /** * Sets object's {@link fabric.Object#scaleX|scaleX} value * @method setScaleX * @memberOf fabric.Object.prototype * @param {Number} value scaleX value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#scaleY|scaleY} value * @method getScaleY * @memberOf fabric.Object.prototype * @return {Number} scaleY value */ /** * Sets object's {@link fabric.Object#scaleY|scaleY} value * @method setScaleY * @memberOf fabric.Object.prototype * @param {Number} value scaleY value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#flipX|flipX} value * @method getFlipX * @memberOf fabric.Object.prototype * @return {Boolean} flipX value */ /** * Sets object's {@link fabric.Object#flipX|flipX} value * @method setFlipX * @memberOf fabric.Object.prototype * @param {Boolean} value flipX value * @return {fabric.Object} thisArg * @chainable */ /** * Retrieves object's {@link fabric.Object#flipY|flipY} value * @method getFlipY * @memberOf fabric.Object.prototype * @return {Boolean} flipY value */ /** * Sets object's {@link fabric.Object#flipY|flipY} value * @method setFlipY * @memberOf fabric.Object.prototype * @param {Boolean} value flipY value * @return {fabric.Object} thisArg * @chainable */ /** * Type of an object (rect, circle, path, etc.) * @type String * @default */ type: 'object', /** * Horizontal origin of transformation of an object (one of "left", "right", "center") * @type String * @default */ originX: 'left', /** * Vertical origin of transformation of an object (one of "top", "bottom", "center") * @type String * @default */ originY: 'top', /** * Top position of an object. Note that by default it's relative to object center. You can change this by setting originY={top/center/bottom} * @type Number * @default */ top: 0, /** * Left position of an object. Note that by default it's relative to object center. You can change this by setting originX={left/center/right} * @type Number * @default */ left: 0, /** * Object width * @type Number * @default */ width: 0, /** * Object height * @type Number * @default */ height: 0, /** * Object scale factor (horizontal) * @type Number * @default */ scaleX: 1, /** * Object scale factor (vertical) * @type Number * @default */ scaleY: 1, /** * When true, an object is rendered as flipped horizontally * @type Boolean * @default */ flipX: false, /** * When true, an object is rendered as flipped vertically * @type Boolean * @default */ flipY: false, /** * Opacity of an object * @type Number * @default */ opacity: 1, /** * Angle of rotation of an object (in degrees) * @type Number * @default */ angle: 0, /** * Size of object's controlling corners (in pixels) * @type Number * @default */ cornerSize: 12, /** * When true, object's controlling corners are rendered as transparent inside (i.e. stroke instead of fill) * @type Boolean * @default */ transparentCorners: true, /** * Default cursor value used when hovering over this object on canvas * @type String * @default */ hoverCursor: null, /** * Padding between object and its controlling borders (in pixels) * @type Number * @default */ padding: 0, /** * Color of controlling borders of an object (when it's active) * @type String * @default */ borderColor: 'rgba(102,153,255,0.75)', /** * Color of controlling corners of an object (when it's active) * @type String * @default */ cornerColor: 'rgba(102,153,255,0.5)', /** * When true, this object will use center point as the origin of transformation * when being scaled via the controls. * <b>Backwards incompatibility note:</b> This property replaces "centerTransform" (Boolean). * @since 1.3.4 * @type Boolean * @default */ centeredScaling: false, /** * When true, this object will use center point as the origin of transformation * when being rotated via the controls. * <b>Backwards incompatibility note:</b> This property replaces "centerTransform" (Boolean). * @since 1.3.4 * @type Boolean * @default */ centeredRotation: true, /** * Color of object's fill * @type String * @default */ fill: 'rgb(0,0,0)', /** * Fill rule used to fill an object * @type String * @default */ fillRule: 'source-over', /** * Background color of an object. Only works with text objects at the moment. * @type String * @default */ backgroundColor: '', /** * When defined, an object is rendered via stroke and this property specifies its color * @type String * @default */ stroke: null, /** * Width of a stroke used to render this object * @type Number * @default */ strokeWidth: 1, /** * Array specifying dash pattern of an object's stroke (stroke must be defined) * @type Array */ strokeDashArray: null, /** * Line endings style of an object's stroke (one of "butt", "round", "square") * @type String * @default */ strokeLineCap: 'butt', /** * Corner style of an object's stroke (one of "bevil", "round", "miter") * @type String * @default */ strokeLineJoin: 'miter', /** * Maximum miter length (used for strokeLineJoin = "miter") of an object's stroke * @type Number * @default */ strokeMiterLimit: 10, /** * Shadow object representing shadow of this shape * @type fabric.Shadow * @default */ shadow: null, /** * Opacity of object's controlling borders when object is active and moving * @type Number * @default */ borderOpacityWhenMoving: 0.4, /** * Scale factor of object's controlling borders * @type Number * @default */ borderScaleFactor: 1, /** * Transform matrix (similar to SVG's transform matrix) * @type Array */ transformMatrix: null, /** * Minimum allowed scale value of an object * @type Number * @default */ minScaleLimit: 0.01, /** * When set to `false`, an object can not be selected for modification (using either point-click-based or group-based selection). * But events still fire on it. * @type Boolean * @default */ selectable: true, /** * When set to `false`, an object can not be a target of events. All events propagate through it. Introduced in v1.3.4 * @type Boolean * @default */ evented: true, /** * When set to `false`, an object is not rendered on canvas * @type Boolean * @default */ visible: true, /** * When set to `false`, object's controls are not displayed and can not be used to manipulate object * @type Boolean * @default */ hasControls: true, /** * When set to `false`, object's controlling borders are not rendered * @type Boolean * @default */ hasBorders: true, /** * When set to `false`, object's controlling rotating point will not be visible or selectable * @type Boolean * @default */ hasRotatingPoint: true, /** * Offset for object's controlling rotating point (when enabled via `hasRotatingPoint`) * @type Number * @default */ rotatingPointOffset: 40, /** * When set to `true`, objects are "found" on canvas on per-pixel basis rather than according to bounding box * @type Boolean * @default */ perPixelTargetFind: false, /** * When `false`, default object's values are not included in its serialization * @type Boolean * @default */ includeDefaultValues: true, /** * Function that determines clipping of an object (context is passed as a first argument) * Note that context origin is at the object's center point (not left/top corner) * @type Function */ clipTo: null, /** * When `true`, object horizontal movement is locked * @type Boolean * @default */ lockMovementX: false, /** * When `true`, object vertical movement is locked * @type Boolean * @default */ lockMovementY: false, /** * When `true`, object rotation is locked * @type Boolean * @default */ lockRotation: false, /** * When `true`, object horizontal scaling is locked * @type Boolean * @default */ lockScalingX: false, /** * When `true`, object vertical scaling is locked * @type Boolean * @default */ lockScalingY: false, /** * When `true`, object non-uniform scaling is locked * @type Boolean * @default */ lockUniScaling: false, /** * When `true`, object cannot be flipped by scaling into negative values * @type Boolean * @default */ lockScalingFlip: false, /** * List of properties to consider when checking if state * of an object is changed (fabric.Object#hasStateChanged) * as well as for history (undo/redo) purposes * @type Array */ stateProperties: ( 'top left width height scaleX scaleY flipX flipY originX originY transformMatrix ' + 'stroke strokeWidth strokeDashArray strokeLineCap strokeLineJoin strokeMiterLimit ' + 'angle opacity fill fillRule shadow clipTo visible backgroundColor' ).split(' '), /** * Constructor * @param {Object} [options] Options object */ initialize: function(options) { if (options) { this.setOptions(options); } }, /** * @private * @param {Object} [options] Options object */ _initGradient: function(options) { if (options.fill && options.fill.colorStops && !(options.fill instanceof fabric.Gradient)) { this.set('fill', new fabric.Gradient(options.fill)); } }, /** * @private * @param {Object} [options] Options object */ _initPattern: function(options) { if (options.fill && options.fill.source && !(options.fill instanceof fabric.Pattern)) { this.set('fill', new fabric.Pattern(options.fill)); } if (options.stroke && options.stroke.source && !(options.stroke instanceof fabric.Pattern)) { this.set('stroke', new fabric.Pattern(options.stroke)); } }, /** * @private * @param {Object} [options] Options object */ _initClipping: function(options) { if (!options.clipTo || typeof options.clipTo !== 'string') { return; } var functionBody = fabric.util.getFunctionBody(options.clipTo); if (typeof functionBody !== 'undefined') { this.clipTo = new Function('ctx', functionBody); } }, /** * Sets object's properties from options * @param {Object} [options] Options object */ setOptions: function(options) { for (var prop in options) { this.set(prop, options[prop]); } this._initGradient(options); this._initPattern(options); this._initClipping(options); }, /** * Transforms context when rendering an object * @param {CanvasRenderingContext2D} ctx Context * @param {Boolean} fromLeft When true, context is transformed to object's top/left corner. This is used when rendering text on Node */ transform: function(ctx, fromLeft) { if (this.group) { this.group.transform(ctx, fromLeft); } ctx.globalAlpha = this.opacity; var center = fromLeft ? this._getLeftTopCoords() : this.getCenterPoint(); ctx.translate(center.x, center.y); ctx.rotate(degreesToRadians(this.angle)); ctx.scale( this.scaleX * (this.flipX ? -1 : 1), this.scaleY * (this.flipY ? -1 : 1) ); }, /** * Returns an object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toObject: function(propertiesToInclude) { var NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS, object = { type: this.type, originX: this.originX, originY: this.originY, left: toFixed(this.left, NUM_FRACTION_DIGITS), top: toFixed(this.top, NUM_FRACTION_DIGITS), width: toFixed(this.width, NUM_FRACTION_DIGITS), height: toFixed(this.height, NUM_FRACTION_DIGITS), fill: (this.fill && this.fill.toObject) ? this.fill.toObject() : this.fill, stroke: (this.stroke && this.stroke.toObject) ? this.stroke.toObject() : this.stroke, strokeWidth: toFixed(this.strokeWidth, NUM_FRACTION_DIGITS), strokeDashArray: this.strokeDashArray, strokeLineCap: this.strokeLineCap, strokeLineJoin: this.strokeLineJoin, strokeMiterLimit: toFixed(this.strokeMiterLimit, NUM_FRACTION_DIGITS), scaleX: toFixed(this.scaleX, NUM_FRACTION_DIGITS), scaleY: toFixed(this.scaleY, NUM_FRACTION_DIGITS), angle: toFixed(this.getAngle(), NUM_FRACTION_DIGITS), flipX: this.flipX, flipY: this.flipY, opacity: toFixed(this.opacity, NUM_FRACTION_DIGITS), shadow: (this.shadow && this.shadow.toObject) ? this.shadow.toObject() : this.shadow, visible: this.visible, clipTo: this.clipTo && String(this.clipTo), backgroundColor: this.backgroundColor }; if (!this.includeDefaultValues) { object = this._removeDefaultValues(object); } fabric.util.populateWithProperties(this, object, propertiesToInclude); return object; }, /** * Returns (dataless) object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toDatalessObject: function(propertiesToInclude) { // will be overwritten by subclasses return this.toObject(propertiesToInclude); }, /** * @private * @param {Object} object */ _removeDefaultValues: function(object) { var prototype = fabric.util.getKlass(object.type).prototype, stateProperties = prototype.stateProperties; stateProperties.forEach(function(prop) { if (object[prop] === prototype[prop]) { delete object[prop]; } }); return object; }, /** * Returns a string representation of an instance * @return {String} */ toString: function() { return '#<fabric.' + capitalize(this.type) + '>'; }, /** * Basic getter * @param {String} property Property name * @return {Any} value of a property */ get: function(property) { return this[property]; }, /** * @private */ _setObject: function(obj) { for (var prop in obj) { this._set(prop, obj[prop]); } }, /** * Sets property to a given value. When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. If you need to update those, call `setCoords()`. * @param {String|Object} key Property name or object (if object, iterate over the object properties) * @param {Object|Function} value Property value (if function, the value is passed into it and its return value is used as a new one) * @return {fabric.Object} thisArg * @chainable */ set: function(key, value) { if (typeof key === 'object') { this._setObject(key); } else { if (typeof value === 'function' && key !== 'clipTo') { this._set(key, value(this.get(key))); } else { this._set(key, value); } } return this; }, /** * @private * @param {String} key * @param {Any} value * @return {fabric.Object} thisArg */ _set: function(key, value) { var shouldConstrainValue = (key === 'scaleX' || key === 'scaleY'); if (shouldConstrainValue) { value = this._constrainScale(value); } if (key === 'scaleX' && value < 0) { this.flipX = !this.flipX; value *= -1; } else if (key === 'scaleY' && value < 0) { this.flipY = !this.flipY; value *= -1; } else if (key === 'width' || key === 'height') { this.minScaleLimit = toFixed(Math.min(0.1, 1/Math.max(this.width, this.height)), 2); } else if (key === 'shadow' && value && !(value instanceof fabric.Shadow)) { value = new fabric.Shadow(value); } this[key] = value; return this; }, /** * Toggles specified property from `true` to `false` or from `false` to `true` * @param {String} property Property to toggle * @return {fabric.Object} thisArg * @chainable */ toggle: function(property) { var value = this.get(property); if (typeof value === 'boolean') { this.set(property, !value); } return this; }, /** * Sets sourcePath of an object * @param {String} value Value to set sourcePath to * @return {fabric.Object} thisArg * @chainable */ setSourcePath: function(value) { this.sourcePath = value; return this; }, /** * Retrieves viewportTransform from Object's canvas if possible * @method getViewportTransform * @memberOf fabric.Object.prototype * @return {Boolean} flipY value // TODO */ getViewportTransform: function() { if (this.canvas && this.canvas.viewportTransform) { return this.canvas.viewportTransform; } return [1, 0, 0, 1, 0, 0]; }, /** * Renders an object on a specified context * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Boolean} [noTransform] When true, context is not transformed */ render: function(ctx, noTransform) { // do not render if width/height are zeros or object is not visible if (this.width === 0 || this.height === 0 || !this.visible) { return; } ctx.save(); //setup fill rule for current object this._setupFillRule(ctx); this._transform(ctx, noTransform); this._setStrokeStyles(ctx); this._setFillStyles(ctx); if (this.group && this.group.type === 'path-group') { ctx.translate(-this.group.width/2, -this.group.height/2); var m = this.transformMatrix; if (m) { ctx.transform.apply(ctx, m); } } ctx.globalAlpha = this.group ? (ctx.globalAlpha * this.opacity) : this.opacity; this._setShadow(ctx); this.clipTo && fabric.util.clipContext(this, ctx); this._render(ctx, noTransform); this.clipTo && ctx.restore(); this._removeShadow(ctx); this._restoreFillRule(ctx); ctx.restore(); }, _transform: function(ctx, noTransform) { var m = this.transformMatrix; if (m && !this.group) { ctx.setTransform.apply(ctx, m); } if (!noTransform) { this.transform(ctx); } }, _setStrokeStyles: function(ctx) { if (this.stroke) { ctx.lineWidth = this.strokeWidth; ctx.lineCap = this.strokeLineCap; ctx.lineJoin = this.strokeLineJoin; ctx.miterLimit = this.strokeMiterLimit; ctx.strokeStyle = this.stroke.toLive ? this.stroke.toLive(ctx) : this.stroke; } }, _setFillStyles: function(ctx) { if (this.fill) { ctx.fillStyle = this.fill.toLive ? this.fill.toLive(ctx) : this.fill; } }, /** * Renders controls and borders for the object * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Boolean} [noTransform] When true, context is not transformed */ _renderControls: function(ctx, noTransform) { var vpt = this.getViewportTransform(); ctx.save(); if (this.active && !noTransform) { var center; if (this.group) { center = fabric.util.transformPoint(this.group.getCenterPoint(), vpt); ctx.translate(center.x, center.y); ctx.rotate(degreesToRadians(this.group.angle)); } center = fabric.util.transformPoint(this.getCenterPoint(), vpt, null != this.group); if (this.group) { center.x *= this.group.scaleX; center.y *= this.group.scaleY; } ctx.translate(center.x, center.y); ctx.rotate(degreesToRadians(this.angle)); this.drawBorders(ctx); this.drawControls(ctx); } ctx.restore(); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _setShadow: function(ctx) { if (!this.shadow) { return; } ctx.shadowColor = this.shadow.color; ctx.shadowBlur = this.shadow.blur; ctx.shadowOffsetX = this.shadow.offsetX; ctx.shadowOffsetY = this.shadow.offsetY; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _removeShadow: function(ctx) { if (!this.shadow) { return; } ctx.shadowColor = ''; ctx.shadowBlur = ctx.shadowOffsetX = ctx.shadowOffsetY = 0; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderFill: function(ctx) { if (!this.fill) { return; } ctx.save(); if (this.fill.toLive) { ctx.translate( -this.width / 2 + this.fill.offsetX || 0, -this.height / 2 + this.fill.offsetY || 0); } if (this.fill.gradientTransform) { var g = this.fill.gradientTransform; ctx.transform.apply(ctx, g); } if (this.fillRule === 'destination-over') { ctx.fill('evenodd'); } else { ctx.fill(); } ctx.restore(); if (this.shadow && !this.shadow.affectStroke) { this._removeShadow(ctx); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderStroke: function(ctx) { if (!this.stroke || this.strokeWidth === 0) { return; } ctx.save(); if (this.strokeDashArray) { // Spec requires the concatenation of two copies the dash list when the number of elements is odd if (1 & this.strokeDashArray.length) { this.strokeDashArray.push.apply(this.strokeDashArray, this.strokeDashArray); } if (supportsLineDash) { ctx.setLineDash(this.strokeDashArray); this._stroke && this._stroke(ctx); } else { this._renderDashedStroke && this._renderDashedStroke(ctx); } ctx.stroke(); } else { if (this.stroke.gradientTransform) { var g = this.stroke.gradientTransform; ctx.transform.apply(ctx, g); } this._stroke ? this._stroke(ctx) : ctx.stroke(); } this._removeShadow(ctx); ctx.restore(); }, /** * Clones an instance * @param {Function} callback Callback is invoked with a clone as a first argument * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {fabric.Object} clone of an instance */ clone: function(callback, propertiesToInclude) { if (this.constructor.fromObject) { return this.constructor.fromObject(this.toObject(propertiesToInclude), callback); } return new fabric.Object(this.toObject(propertiesToInclude)); }, /** * Creates an instance of fabric.Image out of an object * @param {Function} callback callback, invoked with an instance as a first argument * @return {fabric.Object} thisArg */ cloneAsImage: function(callback) { var dataUrl = this.toDataURL(); fabric.util.loadImage(dataUrl, function(img) { if (callback) { callback(new fabric.Image(img)); } }); return this; }, /** * Converts an object into a data-url-like string * @param {Object} options Options object * @param {String} [options.format=png] The format of the output image. Either "jpeg" or "png" * @param {Number} [options.quality=1] Quality level (0..1). Only used for jpeg. * @param {Number} [options.multiplier=1] Multiplier to scale by * @param {Number} [options.left] Cropping left offset. Introduced in v1.2.14 * @param {Number} [options.top] Cropping top offset. Introduced in v1.2.14 * @param {Number} [options.width] Cropping width. Introduced in v1.2.14 * @param {Number} [options.height] Cropping height. Introduced in v1.2.14 * @return {String} Returns a data: URL containing a representation of the object in the format specified by options.format */ toDataURL: function(options) { options || (options = { }); var el = fabric.util.createCanvasElement(), boundingRect = this.getBoundingRect(); el.width = boundingRect.width; el.height = boundingRect.height; fabric.util.wrapElement(el, 'div'); var canvas = new fabric.Canvas(el); // to avoid common confusion https://github.com/kangax/fabric.js/issues/806 if (options.format === 'jpg') { options.format = 'jpeg'; } if (options.format === 'jpeg') { canvas.backgroundColor = '#fff'; } var origParams = { active: this.get('active'), left: this.getLeft(), top: this.getTop() }; this.set('active', false); this.setPositionByOrigin(new fabric.Point(el.width / 2, el.height / 2), 'center', 'center'); var originalCanvas = this.canvas; canvas.add(this); var data = canvas.toDataURL(options); this.set(origParams).setCoords(); this.canvas = originalCanvas; canvas.dispose(); canvas = null; return data; }, /** * Returns true if specified type is identical to the type of an instance * @param {String} type Type to check against * @return {Boolean} */ isType: function(type) { return this.type === type; }, /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return 0; }, /** * Returns a JSON representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} JSON */ toJSON: function(propertiesToInclude) { // delegate, not alias return this.toObject(propertiesToInclude); }, /** * Sets gradient (fill or stroke) of an object * <b>Backwards incompatibility note:</b> This method was named "setGradientFill" until v1.1.0 * @param {String} property Property name 'stroke' or 'fill' * @param {Object} [options] Options object * @param {String} [options.type] Type of gradient 'radial' or 'linear' * @param {Number} [options.x1=0] x-coordinate of start point * @param {Number} [options.y1=0] y-coordinate of start point * @param {Number} [options.x2=0] x-coordinate of end point * @param {Number} [options.y2=0] y-coordinate of end point * @param {Number} [options.r1=0] Radius of start point (only for radial gradients) * @param {Number} [options.r2=0] Radius of end point (only for radial gradients) * @param {Object} [options.colorStops] Color stops object eg. {0: 'ff0000', 1: '000000'} * @return {fabric.Object} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/58y8b/|jsFiddle demo} * @example <caption>Set linear gradient</caption> * object.setGradient('fill', { * type: 'linear', * x1: -object.width / 2, * y1: 0, * x2: object.width / 2, * y2: 0, * colorStops: { * 0: 'red', * 0.5: '#005555', * 1: 'rgba(0,0,255,0.5)' * } * }); * canvas.renderAll(); * @example <caption>Set radial gradient</caption> * object.setGradient('fill', { * type: 'radial', * x1: 0, * y1: 0, * x2: 0, * y2: 0, * r1: object.width / 2, * r2: 10, * colorStops: { * 0: 'red', * 0.5: '#005555', * 1: 'rgba(0,0,255,0.5)' * } * }); * canvas.renderAll(); */ setGradient: function(property, options) { options || (options = { }); var gradient = { colorStops: [] }; gradient.type = options.type || (options.r1 || options.r2 ? 'radial' : 'linear'); gradient.coords = { x1: options.x1, y1: options.y1, x2: options.x2, y2: options.y2 }; if (options.r1 || options.r2) { gradient.coords.r1 = options.r1; gradient.coords.r2 = options.r2; } for (var position in options.colorStops) { var color = new fabric.Color(options.colorStops[position]); gradient.colorStops.push({ offset: position, color: color.toRgb(), opacity: color.getAlpha() }); } return this.set(property, fabric.Gradient.forObject(this, gradient)); }, /** * Sets pattern fill of an object * @param {Object} options Options object * @param {(String|HTMLImageElement)} options.source Pattern source * @param {String} [options.repeat=repeat] Repeat property of a pattern (one of repeat, repeat-x, repeat-y or no-repeat) * @param {Number} [options.offsetX=0] Pattern horizontal offset from object's left/top corner * @param {Number} [options.offsetY=0] Pattern vertical offset from object's left/top corner * @return {fabric.Object} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/QT3pa/|jsFiddle demo} * @example <caption>Set pattern</caption> * fabric.util.loadImage('http://fabricjs.com/assets/escheresque_ste.png', function(img) { * object.setPatternFill({ * source: img, * repeat: 'repeat' * }); * canvas.renderAll(); * }); */ setPatternFill: function(options) { return this.set('fill', new fabric.Pattern(options)); }, /** * Sets {@link fabric.Object#shadow|shadow} of an object * @param {Object|String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") * @param {String} [options.color=rgb(0,0,0)] Shadow color * @param {Number} [options.blur=0] Shadow blur * @param {Number} [options.offsetX=0] Shadow horizontal offset * @param {Number} [options.offsetY=0] Shadow vertical offset * @return {fabric.Object} thisArg * @chainable * @see {@link http://jsfiddle.net/fabricjs/7gvJG/|jsFiddle demo} * @example <caption>Set shadow with string notation</caption> * object.setShadow('2px 2px 10px rgba(0,0,0,0.2)'); * canvas.renderAll(); * @example <caption>Set shadow with object notation</caption> * object.setShadow({ * color: 'red', * blur: 10, * offsetX: 20, * offsetY: 20 * }); * canvas.renderAll(); */ setShadow: function(options) { return this.set('shadow', options ? new fabric.Shadow(options) : null); }, /** * Sets "color" of an instance (alias of `set('fill', &hellip;)`) * @param {String} color Color value * @return {fabric.Object} thisArg * @chainable */ setColor: function(color) { this.set('fill', color); return this; }, /** * Sets "angle" of an instance * @param {Number} angle Angle value * @return {fabric.Object} thisArg * @chainable */ setAngle: function(angle) { var shouldCenterOrigin = (this.originX !== 'center' || this.originY !== 'center') && this.centeredRotation; if (shouldCenterOrigin) { this._setOriginToCenter(); } this.set('angle', angle); if (shouldCenterOrigin) { this._resetOrigin(); } return this; }, /** * Centers object horizontally on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. * @return {fabric.Object} thisArg * @chainable */ centerH: function () { this.canvas.centerObjectH(this); return this; }, /** * Centers object vertically on canvas to which it was added last. * You might need to call `setCoords` on an object after centering, to update controls area. * @return {fabric.Object} thisArg * @chainable */ centerV: function () { this.canvas.centerObjectV(this); return this; }, /** * Centers object vertically and horizontally on canvas to which is was added last * You might need to call `setCoords` on an object after centering, to update controls area. * @return {fabric.Object} thisArg * @chainable */ center: function () { this.canvas.centerObject(this); return this; }, /** * Removes object from canvas to which it was added last * @return {fabric.Object} thisArg * @chainable */ remove: function() { this.canvas.remove(this); return this; }, /** * Returns coordinates of a pointer relative to an object * @param {Event} e Event to operate upon * @param {Object} [pointer] Pointer to operate upon (instead of event) * @return {Object} Coordinates of a pointer (x, y) */ getLocalPointer: function(e, pointer) { pointer = pointer || this.canvas.getPointer(e); var objectLeftTop = this.translateToOriginPoint(this.getCenterPoint(), 'left', 'top'); return { x: pointer.x - objectLeftTop.x, y: pointer.y - objectLeftTop.y }; }, /** * Sets canvas globalCompositeOperation for specific object * custom composition operation for the particular object can be specifed using fillRule property * @param {CanvasRenderingContext2D} ctx Rendering canvas context */ _setupFillRule: function (ctx) { if (this.fillRule) { this._prevFillRule = ctx.globalCompositeOperation; ctx.globalCompositeOperation = this.fillRule; } }, /** * Restores previously saved canvas globalCompositeOperation after obeject rendering * @param {CanvasRenderingContext2D} ctx Rendering canvas context */ _restoreFillRule: function (ctx) { if (this.fillRule && this._prevFillRule) { ctx.globalCompositeOperation = this._prevFillRule; } } }); fabric.util.createAccessors(fabric.Object); /** * Alias for {@link fabric.Object.prototype.setAngle} * @alias rotate -> setAngle * @memberof fabric.Object */ fabric.Object.prototype.rotate = fabric.Object.prototype.setAngle; extend(fabric.Object.prototype, fabric.Observable); /** * Defines the number of fraction digits to use when serializing object values. * You can use it to increase/decrease precision of such values like left, top, scaleX, scaleY, etc. * @static * @memberof fabric.Object * @constant * @type Number */ fabric.Object.NUM_FRACTION_DIGITS = 2; /** * Unique id used internally when creating SVG elements * @static * @memberof fabric.Object * @type Number */ fabric.Object.__uid = 0; })(typeof exports !== 'undefined' ? exports : this); (function() { var degreesToRadians = fabric.util.degreesToRadians; fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Translates the coordinates from origin to center coordinates (based on the object's dimensions) * @param {fabric.Point} point The point which corresponds to the originX and originY params * @param {String} originX Horizontal origin: 'left', 'center' or 'right' * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' * @return {fabric.Point} */ translateToCenterPoint: function(point, originX, originY) { var cx = point.x, cy = point.y, strokeWidth = this.stroke ? this.strokeWidth : 0; if (originX === 'left') { cx = point.x + (this.getWidth() + strokeWidth * this.scaleX) / 2; } else if (originX === 'right') { cx = point.x - (this.getWidth() + strokeWidth * this.scaleX) / 2; } if (originY === 'top') { cy = point.y + (this.getHeight() + strokeWidth * this.scaleY) / 2; } else if (originY === 'bottom') { cy = point.y - (this.getHeight() + strokeWidth * this.scaleY) / 2; } // Apply the reverse rotation to the point (it's already scaled properly) return fabric.util.rotatePoint(new fabric.Point(cx, cy), point, degreesToRadians(this.angle)); }, /** * Translates the coordinates from center to origin coordinates (based on the object's dimensions) * @param {fabric.Point} center The point which corresponds to center of the object * @param {String} originX Horizontal origin: 'left', 'center' or 'right' * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' * @return {fabric.Point} */ translateToOriginPoint: function(center, originX, originY) { var x = center.x, y = center.y, strokeWidth = this.stroke ? this.strokeWidth : 0; // Get the point coordinates if (originX === 'left') { x = center.x - (this.getWidth() + strokeWidth * this.scaleX) / 2; } else if (originX === 'right') { x = center.x + (this.getWidth() + strokeWidth * this.scaleX) / 2; } if (originY === 'top') { y = center.y - (this.getHeight() + strokeWidth * this.scaleY) / 2; } else if (originY === 'bottom') { y = center.y + (this.getHeight() + strokeWidth * this.scaleY) / 2; } // Apply the rotation to the point (it's already scaled properly) return fabric.util.rotatePoint(new fabric.Point(x, y), center, degreesToRadians(this.angle)); }, /** * Returns the real center coordinates of the object * @return {fabric.Point} */ getCenterPoint: function() { var leftTop = new fabric.Point(this.left, this.top); return this.translateToCenterPoint(leftTop, this.originX, this.originY); }, /** * Returns the coordinates of the object based on center coordinates * @param {fabric.Point} point The point which corresponds to the originX and originY params * @return {fabric.Point} */ // getOriginPoint: function(center) { // return this.translateToOriginPoint(center, this.originX, this.originY); // }, /** * Returns the coordinates of the object as if it has a different origin * @param {String} originX Horizontal origin: 'left', 'center' or 'right' * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' * @return {fabric.Point} */ getPointByOrigin: function(originX, originY) { var center = this.getCenterPoint(); return this.translateToOriginPoint(center, originX, originY); }, /** * Returns the point in local coordinates * @param {fabric.Point} point The point relative to the global coordinate system * @param {String} originX Horizontal origin: 'left', 'center' or 'right' * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' * @return {fabric.Point} */ toLocalPoint: function(point, originX, originY) { var center = this.getCenterPoint(), strokeWidth = this.stroke ? this.strokeWidth : 0, x, y; if (originX && originY) { if (originX === 'left') { x = center.x - (this.getWidth() + strokeWidth * this.scaleX) / 2; } else if (originX === 'right') { x = center.x + (this.getWidth() + strokeWidth * this.scaleX) / 2; } else { x = center.x; } if (originY === 'top') { y = center.y - (this.getHeight() + strokeWidth * this.scaleY) / 2; } else if (originY === 'bottom') { y = center.y + (this.getHeight() + strokeWidth * this.scaleY) / 2; } else { y = center.y; } } else { x = this.left; y = this.top; } return fabric.util.rotatePoint(new fabric.Point(point.x, point.y), center, -degreesToRadians(this.angle)) .subtractEquals(new fabric.Point(x, y)); }, /** * Returns the point in global coordinates * @param {fabric.Point} The point relative to the local coordinate system * @return {fabric.Point} */ // toGlobalPoint: function(point) { // return fabric.util.rotatePoint(point, this.getCenterPoint(), degreesToRadians(this.angle)).addEquals(new fabric.Point(this.left, this.top)); // }, /** * Sets the position of the object taking into consideration the object's origin * @param {fabric.Point} pos The new position of the object * @param {String} originX Horizontal origin: 'left', 'center' or 'right' * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' * @return {void} */ setPositionByOrigin: function(pos, originX, originY) { var center = this.translateToCenterPoint(pos, originX, originY), position = this.translateToOriginPoint(center, this.originX, this.originY); this.set('left', position.x); this.set('top', position.y); }, /** * @param {String} to One of 'left', 'center', 'right' */ adjustPosition: function(to) { var angle = degreesToRadians(this.angle), hypotHalf = this.getWidth() / 2, xHalf = Math.cos(angle) * hypotHalf, yHalf = Math.sin(angle) * hypotHalf, hypotFull = this.getWidth(), xFull = Math.cos(angle) * hypotFull, yFull = Math.sin(angle) * hypotFull; if (this.originX === 'center' && to === 'left' || this.originX === 'right' && to === 'center') { // move half left this.left -= xHalf; this.top -= yHalf; } else if (this.originX === 'left' && to === 'center' || this.originX === 'center' && to === 'right') { // move half right this.left += xHalf; this.top += yHalf; } else if (this.originX === 'left' && to === 'right') { // move full right this.left += xFull; this.top += yFull; } else if (this.originX === 'right' && to === 'left') { // move full left this.left -= xFull; this.top -= yFull; } this.setCoords(); this.originX = to; }, /** * Sets the origin/position of the object to it's center point * @private * @return {void} */ _setOriginToCenter: function() { this._originalOriginX = this.originX; this._originalOriginY = this.originY; var center = this.getCenterPoint(); this.originX = 'center'; this.originY = 'center'; this.left = center.x; this.top = center.y; }, /** * Resets the origin/position of the object to it's original origin * @private * @return {void} */ _resetOrigin: function() { var originPoint = this.translateToOriginPoint( this.getCenterPoint(), this._originalOriginX, this._originalOriginY); this.originX = this._originalOriginX; this.originY = this._originalOriginY; this.left = originPoint.x; this.top = originPoint.y; this._originalOriginX = null; this._originalOriginY = null; }, /** * @private */ _getLeftTopCoords: function() { return this.translateToOriginPoint(this.getCenterPoint(), 'left', 'center'); } }); })(); (function() { var degreesToRadians = fabric.util.degreesToRadians; fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Object containing coordinates of object's controls * @type Object * @default */ oCoords: null, /** * Checks if object intersects with an area formed by 2 points * @param {Object} pointTL top-left point of area * @param {Object} pointBR bottom-right point of area * @return {Boolean} true if object intersects with an area formed by 2 points */ intersectsWithRect: function(pointTL, pointBR) { var oCoords = this.oCoords, tl = new fabric.Point(oCoords.tl.x, oCoords.tl.y), tr = new fabric.Point(oCoords.tr.x, oCoords.tr.y), bl = new fabric.Point(oCoords.bl.x, oCoords.bl.y), br = new fabric.Point(oCoords.br.x, oCoords.br.y), intersection = fabric.Intersection.intersectPolygonRectangle( [tl, tr, br, bl], pointTL, pointBR ); return intersection.status === 'Intersection'; }, /** * Checks if object intersects with another object * @param {Object} other Object to test * @return {Boolean} true if object intersects with another object */ intersectsWithObject: function(other) { // extracts coords function getCoords(oCoords) { return { tl: new fabric.Point(oCoords.tl.x, oCoords.tl.y), tr: new fabric.Point(oCoords.tr.x, oCoords.tr.y), bl: new fabric.Point(oCoords.bl.x, oCoords.bl.y), br: new fabric.Point(oCoords.br.x, oCoords.br.y) }; } var thisCoords = getCoords(this.oCoords), otherCoords = getCoords(other.oCoords), intersection = fabric.Intersection.intersectPolygonPolygon( [thisCoords.tl, thisCoords.tr, thisCoords.br, thisCoords.bl], [otherCoords.tl, otherCoords.tr, otherCoords.br, otherCoords.bl] ); return intersection.status === 'Intersection'; }, /** * Checks if object is fully contained within area of another object * @param {Object} other Object to test * @return {Boolean} true if object is fully contained within area of another object */ isContainedWithinObject: function(other) { var boundingRect = other.getBoundingRect(), point1 = new fabric.Point(boundingRect.left, boundingRect.top), point2 = new fabric.Point(boundingRect.left + boundingRect.width, boundingRect.top + boundingRect.height); return this.isContainedWithinRect(point1, point2); }, /** * Checks if object is fully contained within area formed by 2 points * @param {Object} pointTL top-left point of area * @param {Object} pointBR bottom-right point of area * @return {Boolean} true if object is fully contained within area formed by 2 points */ isContainedWithinRect: function(pointTL, pointBR) { var boundingRect = this.getBoundingRect(); return ( boundingRect.left >= pointTL.x && boundingRect.left + boundingRect.width <= pointBR.x && boundingRect.top >= pointTL.y && boundingRect.top + boundingRect.height <= pointBR.y ); }, /** * Checks if point is inside the object * @param {fabric.Point} point Point to check against * @return {Boolean} true if point is inside the object */ containsPoint: function(point) { var lines = this._getImageLines(this.oCoords), xPoints = this._findCrossPoints(point, lines); // if xPoints is odd then point is inside the object return (xPoints !== 0 && xPoints % 2 === 1); }, /** * Method that returns an object with the object edges in it, given the coordinates of the corners * @private * @param {Object} oCoords Coordinates of the object corners */ _getImageLines: function(oCoords) { return { topline: { o: oCoords.tl, d: oCoords.tr }, rightline: { o: oCoords.tr, d: oCoords.br }, bottomline: { o: oCoords.br, d: oCoords.bl }, leftline: { o: oCoords.bl, d: oCoords.tl } }; }, /** * Helper method to determine how many cross points are between the 4 object edges * and the horizontal line determined by a point on canvas * @private * @param {fabric.Point} point Point to check * @param {Object} oCoords Coordinates of the object being evaluated */ _findCrossPoints: function(point, oCoords) { var b1, b2, a1, a2, xi, yi, xcount = 0, iLine; for (var lineKey in oCoords) { iLine = oCoords[lineKey]; // optimisation 1: line below point. no cross if ((iLine.o.y < point.y) && (iLine.d.y < point.y)) { continue; } // optimisation 2: line above point. no cross if ((iLine.o.y >= point.y) && (iLine.d.y >= point.y)) { continue; } // optimisation 3: vertical line case if ((iLine.o.x === iLine.d.x) && (iLine.o.x >= point.x)) { xi = iLine.o.x; yi = point.y; } // calculate the intersection point else { b1 = 0; b2 = (iLine.d.y - iLine.o.y) / (iLine.d.x - iLine.o.x); a1 = point.y - b1 * point.x; a2 = iLine.o.y - b2 * iLine.o.x; xi = - (a1 - a2) / (b1 - b2); yi = a1 + b1 * xi; } // dont count xi < point.x cases if (xi >= point.x) { xcount += 1; } // optimisation 4: specific for square images if (xcount === 2) { break; } } return xcount; }, /** * Returns width of an object's bounding rectangle * @deprecated since 1.0.4 * @return {Number} width value */ getBoundingRectWidth: function() { return this.getBoundingRect().width; }, /** * Returns height of an object's bounding rectangle * @deprecated since 1.0.4 * @return {Number} height value */ getBoundingRectHeight: function() { return this.getBoundingRect().height; }, /** * Returns coordinates of object's bounding rectangle (left, top, width, height) * @return {Object} Object with left, top, width, height properties */ getBoundingRect: function() { this.oCoords || this.setCoords(); var xCoords = [this.oCoords.tl.x, this.oCoords.tr.x, this.oCoords.br.x, this.oCoords.bl.x], minX = fabric.util.array.min(xCoords), maxX = fabric.util.array.max(xCoords), width = Math.abs(minX - maxX), yCoords = [this.oCoords.tl.y, this.oCoords.tr.y, this.oCoords.br.y, this.oCoords.bl.y], minY = fabric.util.array.min(yCoords), maxY = fabric.util.array.max(yCoords), height = Math.abs(minY - maxY); return { left: minX, top: minY, width: width, height: height }; }, /** * Returns width of an object * @return {Number} width value */ getWidth: function() { return this.width * this.scaleX; }, /** * Returns height of an object * @return {Number} height value */ getHeight: function() { return this.height * this.scaleY; }, /** * Makes sure the scale is valid and modifies it if necessary * @private * @param {Number} value * @return {Number} */ _constrainScale: function(value) { if (Math.abs(value) < this.minScaleLimit) { if (value < 0) { return -this.minScaleLimit; } else { return this.minScaleLimit; } } return value; }, /** * Scales an object (equally by x and y) * @param {Number} value Scale factor * @return {fabric.Object} thisArg * @chainable */ scale: function(value) { value = this._constrainScale(value); if (value < 0) { this.flipX = !this.flipX; this.flipY = !this.flipY; value *= -1; } this.scaleX = value; this.scaleY = value; this.setCoords(); return this; }, /** * Scales an object to a given width, with respect to bounding box (scaling by x/y equally) * @param {Number} value New width value * @return {fabric.Object} thisArg * @chainable */ scaleToWidth: function(value) { // adjust to bounding rect factor so that rotated shapes would fit as well var boundingRectFactor = this.getBoundingRectWidth() / this.getWidth(); return this.scale(value / this.width / boundingRectFactor); }, /** * Scales an object to a given height, with respect to bounding box (scaling by x/y equally) * @param {Number} value New height value * @return {fabric.Object} thisArg * @chainable */ scaleToHeight: function(value) { // adjust to bounding rect factor so that rotated shapes would fit as well var boundingRectFactor = this.getBoundingRectHeight() / this.getHeight(); return this.scale(value / this.height / boundingRectFactor); }, /** * Sets corner position coordinates based on current angle, width and height * @return {fabric.Object} thisArg * @chainable */ setCoords: function() { var strokeWidth = this.strokeWidth > 1 ? this.strokeWidth : 0, theta = degreesToRadians(this.angle), vpt = this.getViewportTransform(), f = function (p) { return fabric.util.transformPoint(p, vpt); }, w = this.width, h = this.height, capped = this.strokeLineCap === 'round' || this.strokeLineCap === 'square', vLine = this.type === 'line' && this.width === 1, hLine = this.type === 'line' && this.height === 1, strokeW = (capped && hLine) || this.type !== 'line', strokeH = (capped && vLine) || this.type !== 'line'; if (vLine) { w = strokeWidth; } else if (hLine) { h = strokeWidth; } if (strokeW) { w += strokeWidth; } if (strokeH) { h += strokeWidth; } this.currentWidth = w * this.scaleX; this.currentHeight = h * this.scaleY; // If width is negative, make postive. Fixes path selection issue if (this.currentWidth < 0) { this.currentWidth = Math.abs(this.currentWidth); } var _hypotenuse = Math.sqrt( Math.pow(this.currentWidth / 2, 2) + Math.pow(this.currentHeight / 2, 2)), _angle = Math.atan(isFinite(this.currentHeight / this.currentWidth) ? this.currentHeight / this.currentWidth : 0), // offset added for rotate and scale actions offsetX = Math.cos(_angle + theta) * _hypotenuse, offsetY = Math.sin(_angle + theta) * _hypotenuse, sinTh = Math.sin(theta), cosTh = Math.cos(theta), coords = this.getCenterPoint(), wh = new fabric.Point(this.currentWidth, this.currentHeight), _tl = new fabric.Point(coords.x - offsetX, coords.y - offsetY), _tr = new fabric.Point(_tl.x + (wh.x * cosTh), _tl.y + (wh.x * sinTh)), _bl = new fabric.Point(_tl.x - (wh.y * sinTh), _tl.y + (wh.y * cosTh)), _mt = new fabric.Point(_tl.x + (wh.x/2 * cosTh), _tl.y + (wh.x/2 * sinTh)), tl = f(_tl), tr = f(_tr), br = f(new fabric.Point(_tr.x - (wh.y * sinTh), _tr.y + (wh.y * cosTh))), bl = f(_bl), ml = f(new fabric.Point(_tl.x - (wh.y/2 * sinTh), _tl.y + (wh.y/2 * cosTh))), mt = f(_mt), mr = f(new fabric.Point(_tr.x - (wh.y/2 * sinTh), _tr.y + (wh.y/2 * cosTh))), mb = f(new fabric.Point(_bl.x + (wh.x/2 * cosTh), _bl.y + (wh.x/2 * sinTh))), mtr = f(new fabric.Point(_mt.x, _mt.y)), // padding padX = Math.cos(_angle + theta) * this.padding * Math.sqrt(2), padY = Math.sin(_angle + theta) * this.padding * Math.sqrt(2); tl = tl.add(new fabric.Point(-padX, -padY)); tr = tr.add(new fabric.Point(padY, -padX)); br = br.add(new fabric.Point(padX, padY)); bl = bl.add(new fabric.Point(-padY, padX)); ml = ml.add(new fabric.Point((-padX - padY) / 2, (-padY + padX) / 2)); mt = mt.add(new fabric.Point((padY - padX) / 2, -(padY + padX) / 2)); mr = mr.add(new fabric.Point((padY + padX) / 2, (padY - padX) / 2)); mb = mb.add(new fabric.Point((padX - padY) / 2, (padX + padY) / 2)); mtr = mtr.add(new fabric.Point((padY - padX) / 2, -(padY + padX) / 2)); // debugging // setTimeout(function() { // canvas.contextTop.fillStyle = 'green'; // canvas.contextTop.fillRect(mb.x, mb.y, 3, 3); // canvas.contextTop.fillRect(bl.x, bl.y, 3, 3); // canvas.contextTop.fillRect(br.x, br.y, 3, 3); // canvas.contextTop.fillRect(tl.x, tl.y, 3, 3); // canvas.contextTop.fillRect(tr.x, tr.y, 3, 3); // canvas.contextTop.fillRect(ml.x, ml.y, 3, 3); // canvas.contextTop.fillRect(mr.x, mr.y, 3, 3); // canvas.contextTop.fillRect(mt.x, mt.y, 3, 3); // }, 50); this.oCoords = { // corners tl: tl, tr: tr, br: br, bl: bl, // middle ml: ml, mt: mt, mr: mr, mb: mb, // rotating point mtr: mtr }; // set coordinates of the draggable boxes in the corners used to scale/rotate the image this._setCornerCoords && this._setCornerCoords(); return this; } }); })(); fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Moves an object to the bottom of the stack of drawn objects * @return {fabric.Object} thisArg * @chainable */ sendToBack: function() { if (this.group) { fabric.StaticCanvas.prototype.sendToBack.call(this.group, this); } else { this.canvas.sendToBack(this); } return this; }, /** * Moves an object to the top of the stack of drawn objects * @return {fabric.Object} thisArg * @chainable */ bringToFront: function() { if (this.group) { fabric.StaticCanvas.prototype.bringToFront.call(this.group, this); } else { this.canvas.bringToFront(this); } return this; }, /** * Moves an object down in stack of drawn objects * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object * @return {fabric.Object} thisArg * @chainable */ sendBackwards: function(intersecting) { if (this.group) { fabric.StaticCanvas.prototype.sendBackwards.call(this.group, this, intersecting); } else { this.canvas.sendBackwards(this, intersecting); } return this; }, /** * Moves an object up in stack of drawn objects * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object * @return {fabric.Object} thisArg * @chainable */ bringForward: function(intersecting) { if (this.group) { fabric.StaticCanvas.prototype.bringForward.call(this.group, this, intersecting); } else { this.canvas.bringForward(this, intersecting); } return this; }, /** * Moves an object to specified level in stack of drawn objects * @param {Number} index New position of object * @return {fabric.Object} thisArg * @chainable */ moveTo: function(index) { if (this.group) { fabric.StaticCanvas.prototype.moveTo.call(this.group, this, index); } else { this.canvas.moveTo(this, index); } return this; } }); /* _TO_SVG_START_ */ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Returns styles-string for svg-export * @return {String} */ getSvgStyles: function() { var fill = this.fill ? (this.fill.toLive ? 'url(#SVGID_' + this.fill.id + ')' : this.fill) : 'none', fillRule = (this.fillRule === 'destination-over' ? 'evenodd' : this.fillRule), stroke = this.stroke ? (this.stroke.toLive ? 'url(#SVGID_' + this.stroke.id + ')' : this.stroke) : 'none', strokeWidth = this.strokeWidth ? this.strokeWidth : '0', strokeDashArray = this.strokeDashArray ? this.strokeDashArray.join(' ') : '', strokeLineCap = this.strokeLineCap ? this.strokeLineCap : 'butt', strokeLineJoin = this.strokeLineJoin ? this.strokeLineJoin : 'miter', strokeMiterLimit = this.strokeMiterLimit ? this.strokeMiterLimit : '4', opacity = typeof this.opacity !== 'undefined' ? this.opacity : '1', visibility = this.visible ? '' : ' visibility: hidden;', filter = this.shadow && this.type !== 'text' ? 'filter: url(#SVGID_' + this.shadow.id + ');' : ''; return [ 'stroke: ', stroke, '; ', 'stroke-width: ', strokeWidth, '; ', 'stroke-dasharray: ', strokeDashArray, '; ', 'stroke-linecap: ', strokeLineCap, '; ', 'stroke-linejoin: ', strokeLineJoin, '; ', 'stroke-miterlimit: ', strokeMiterLimit, '; ', 'fill: ', fill, '; ', 'fill-rule: ', fillRule, '; ', 'opacity: ', opacity, ';', filter, visibility ].join(''); }, /** * Returns transform-string for svg-export * @return {String} */ getSvgTransform: function() { if (this.group) return ''; var toFixed = fabric.util.toFixed, angle = this.getAngle(), vpt = this.getViewportTransform(), center = fabric.util.transformPoint(this.getCenterPoint(), vpt), NUM_FRACTION_DIGITS = fabric.Object.NUM_FRACTION_DIGITS, translatePart = this.type === 'path-group' ? '' : 'translate(' + toFixed(center.x, NUM_FRACTION_DIGITS) + ' ' + toFixed(center.y, NUM_FRACTION_DIGITS) + ')', anglePart = angle !== 0 ? (' rotate(' + toFixed(angle, NUM_FRACTION_DIGITS) + ')') : '', scalePart = (this.scaleX === 1 && this.scaleY === 1 && vpt[0] === 1 && vpt[3] === 1) ? '' : (' scale(' + toFixed(this.scaleX * vpt[0], NUM_FRACTION_DIGITS) + ' ' + toFixed(this.scaleY * vpt[3], NUM_FRACTION_DIGITS) + ')'), addTranslateX = this.type === 'path-group' ? this.width * vpt[0] : 0, flipXPart = this.flipX ? ' matrix(-1 0 0 1 ' + addTranslateX + ' 0) ' : '', addTranslateY = this.type === 'path-group' ? this.height * vpt[3] : 0, flipYPart = this.flipY ? ' matrix(1 0 0 -1 0 ' + addTranslateY + ')' : ''; return [ translatePart, anglePart, scalePart, flipXPart, flipYPart ].join(''); }, /** * Returns transform-string for svg-export from the transform matrix of single elements * @return {String} */ getSvgTransformMatrix: function() { return this.transformMatrix ? ' matrix(' + this.transformMatrix.join(' ') + ')' : ''; }, /** * @private */ _createBaseSVGMarkup: function() { var markup = [ ]; if (this.fill && this.fill.toLive) { markup.push(this.fill.toSVG(this, false)); } if (this.stroke && this.stroke.toLive) { markup.push(this.stroke.toSVG(this, false)); } if (this.shadow) { markup.push(this.shadow.toSVG(this)); } return markup; } }); /* _TO_SVG_END_ */ /* Depends on `stateProperties` */ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Returns true if object state (one of its state properties) was changed * @return {Boolean} true if instance' state has changed since `{@link fabric.Object#saveState}` was called */ hasStateChanged: function() { return this.stateProperties.some(function(prop) { return this.get(prop) !== this.originalState[prop]; }, this); }, /** * Saves state of an object * @param {Object} [options] Object with additional `stateProperties` array to include when saving state * @return {fabric.Object} thisArg */ saveState: function(options) { this.stateProperties.forEach(function(prop) { this.originalState[prop] = this.get(prop); }, this); if (options && options.stateProperties) { options.stateProperties.forEach(function(prop) { this.originalState[prop] = this.get(prop); }, this); } return this; }, /** * Setups state of an object * @return {fabric.Object} thisArg */ setupState: function() { this.originalState = { }; this.saveState(); return this; } }); (function(){ var degreesToRadians = fabric.util.degreesToRadians, //jscs:disable requireCamelCaseOrUpperCaseIdentifiers isVML = function() { return typeof G_vmlCanvasManager !== 'undefined'; }; //jscs:enable requireCamelCaseOrUpperCaseIdentifiers fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * The object interactivity controls. * @private */ _controlsVisibility: null, /** * Determines which corner has been clicked * @private * @param {Object} pointer The pointer indicating the mouse position * @return {String|Boolean} corner code (tl, tr, bl, br, etc.), or false if nothing is found */ _findTargetCorner: function(pointer) { if (!this.hasControls || !this.active) { return false; } var ex = pointer.x, ey = pointer.y, xPoints, lines; for (var i in this.oCoords) { if (!this.isControlVisible(i)) { continue; } if (i === 'mtr' && !this.hasRotatingPoint) { continue; } if (this.get('lockUniScaling') && (i === 'mt' || i === 'mr' || i === 'mb' || i === 'ml')) { continue; } lines = this._getImageLines(this.oCoords[i].corner); // debugging // canvas.contextTop.fillRect(lines.bottomline.d.x, lines.bottomline.d.y, 2, 2); // canvas.contextTop.fillRect(lines.bottomline.o.x, lines.bottomline.o.y, 2, 2); // canvas.contextTop.fillRect(lines.leftline.d.x, lines.leftline.d.y, 2, 2); // canvas.contextTop.fillRect(lines.leftline.o.x, lines.leftline.o.y, 2, 2); // canvas.contextTop.fillRect(lines.topline.d.x, lines.topline.d.y, 2, 2); // canvas.contextTop.fillRect(lines.topline.o.x, lines.topline.o.y, 2, 2); // canvas.contextTop.fillRect(lines.rightline.d.x, lines.rightline.d.y, 2, 2); // canvas.contextTop.fillRect(lines.rightline.o.x, lines.rightline.o.y, 2, 2); xPoints = this._findCrossPoints({ x: ex, y: ey }, lines); if (xPoints !== 0 && xPoints % 2 === 1) { this.__corner = i; return i; } } return false; }, /** * Sets the coordinates of the draggable boxes in the corners of * the image used to scale/rotate it. * @private */ _setCornerCoords: function() { var coords = this.oCoords, theta = degreesToRadians(this.angle), newTheta = degreesToRadians(45 - this.angle), cornerHypotenuse = Math.sqrt(2 * Math.pow(this.cornerSize, 2)) / 2, cosHalfOffset = cornerHypotenuse * Math.cos(newTheta), sinHalfOffset = cornerHypotenuse * Math.sin(newTheta), sinTh = Math.sin(theta), cosTh = Math.cos(theta); coords.tl.corner = { tl: { x: coords.tl.x - sinHalfOffset, y: coords.tl.y - cosHalfOffset }, tr: { x: coords.tl.x + cosHalfOffset, y: coords.tl.y - sinHalfOffset }, bl: { x: coords.tl.x - cosHalfOffset, y: coords.tl.y + sinHalfOffset }, br: { x: coords.tl.x + sinHalfOffset, y: coords.tl.y + cosHalfOffset } }; coords.tr.corner = { tl: { x: coords.tr.x - sinHalfOffset, y: coords.tr.y - cosHalfOffset }, tr: { x: coords.tr.x + cosHalfOffset, y: coords.tr.y - sinHalfOffset }, br: { x: coords.tr.x + sinHalfOffset, y: coords.tr.y + cosHalfOffset }, bl: { x: coords.tr.x - cosHalfOffset, y: coords.tr.y + sinHalfOffset } }; coords.bl.corner = { tl: { x: coords.bl.x - sinHalfOffset, y: coords.bl.y - cosHalfOffset }, bl: { x: coords.bl.x - cosHalfOffset, y: coords.bl.y + sinHalfOffset }, br: { x: coords.bl.x + sinHalfOffset, y: coords.bl.y + cosHalfOffset }, tr: { x: coords.bl.x + cosHalfOffset, y: coords.bl.y - sinHalfOffset } }; coords.br.corner = { tr: { x: coords.br.x + cosHalfOffset, y: coords.br.y - sinHalfOffset }, bl: { x: coords.br.x - cosHalfOffset, y: coords.br.y + sinHalfOffset }, br: { x: coords.br.x + sinHalfOffset, y: coords.br.y + cosHalfOffset }, tl: { x: coords.br.x - sinHalfOffset, y: coords.br.y - cosHalfOffset } }; coords.ml.corner = { tl: { x: coords.ml.x - sinHalfOffset, y: coords.ml.y - cosHalfOffset }, tr: { x: coords.ml.x + cosHalfOffset, y: coords.ml.y - sinHalfOffset }, bl: { x: coords.ml.x - cosHalfOffset, y: coords.ml.y + sinHalfOffset }, br: { x: coords.ml.x + sinHalfOffset, y: coords.ml.y + cosHalfOffset } }; coords.mt.corner = { tl: { x: coords.mt.x - sinHalfOffset, y: coords.mt.y - cosHalfOffset }, tr: { x: coords.mt.x + cosHalfOffset, y: coords.mt.y - sinHalfOffset }, bl: { x: coords.mt.x - cosHalfOffset, y: coords.mt.y + sinHalfOffset }, br: { x: coords.mt.x + sinHalfOffset, y: coords.mt.y + cosHalfOffset } }; coords.mr.corner = { tl: { x: coords.mr.x - sinHalfOffset, y: coords.mr.y - cosHalfOffset }, tr: { x: coords.mr.x + cosHalfOffset, y: coords.mr.y - sinHalfOffset }, bl: { x: coords.mr.x - cosHalfOffset, y: coords.mr.y + sinHalfOffset }, br: { x: coords.mr.x + sinHalfOffset, y: coords.mr.y + cosHalfOffset } }; coords.mb.corner = { tl: { x: coords.mb.x - sinHalfOffset, y: coords.mb.y - cosHalfOffset }, tr: { x: coords.mb.x + cosHalfOffset, y: coords.mb.y - sinHalfOffset }, bl: { x: coords.mb.x - cosHalfOffset, y: coords.mb.y + sinHalfOffset }, br: { x: coords.mb.x + sinHalfOffset, y: coords.mb.y + cosHalfOffset } }; coords.mtr.corner = { tl: { x: coords.mtr.x - sinHalfOffset + (sinTh * this.rotatingPointOffset), y: coords.mtr.y - cosHalfOffset - (cosTh * this.rotatingPointOffset) }, tr: { x: coords.mtr.x + cosHalfOffset + (sinTh * this.rotatingPointOffset), y: coords.mtr.y - sinHalfOffset - (cosTh * this.rotatingPointOffset) }, bl: { x: coords.mtr.x - cosHalfOffset + (sinTh * this.rotatingPointOffset), y: coords.mtr.y + sinHalfOffset - (cosTh * this.rotatingPointOffset) }, br: { x: coords.mtr.x + sinHalfOffset + (sinTh * this.rotatingPointOffset), y: coords.mtr.y + cosHalfOffset - (cosTh * this.rotatingPointOffset) } }; }, /** * Draws borders of an object's bounding box. * Requires public properties: width, height * Requires public options: padding, borderColor * @param {CanvasRenderingContext2D} ctx Context to draw on * @return {fabric.Object} thisArg * @chainable */ drawBorders: function(ctx) { if (!this.hasBorders) { return this; } var padding = this.padding, padding2 = padding * 2, vpt = this.getViewportTransform(); ctx.save(); ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1; ctx.strokeStyle = this.borderColor; var scaleX = 1 / this._constrainScale(this.scaleX), scaleY = 1 / this._constrainScale(this.scaleY); ctx.lineWidth = 1 / this.borderScaleFactor; var w = this.getWidth(), h = this.getHeight(), strokeWidth = this.strokeWidth > 1 ? this.strokeWidth : 0, capped = this.strokeLineCap === 'round' || this.strokeLineCap === 'square', vLine = this.type === 'line' && this.width === 1, hLine = this.type === 'line' && this.height === 1, strokeW = (capped && hLine) || this.type !== 'line', strokeH = (capped && vLine) || this.type !== 'line'; if (vLine) { w = strokeWidth / scaleX; } else if (hLine) { h = strokeWidth / scaleY; } if (strokeW) { w += strokeWidth / scaleX; } if (strokeH) { h += strokeWidth / scaleY; } var wh = fabric.util.transformPoint(new fabric.Point(w, h), vpt, true), width = wh.x, height = wh.y; if (this.group) { width = width * this.group.scaleX; height = height * this.group.scaleY; } ctx.strokeRect( ~~(-(width / 2) - padding) - 0.5, // offset needed to make lines look sharper ~~(-(height / 2) - padding) - 0.5, ~~(width + padding2) + 1, // double offset needed to make lines look sharper ~~(height + padding2) + 1 ); if (this.hasRotatingPoint && this.isControlVisible('mtr') && !this.get('lockRotation') && this.hasControls) { var rotateHeight = ( -height - (padding * 2)) / 2; ctx.beginPath(); ctx.moveTo(0, rotateHeight); ctx.lineTo(0, rotateHeight - this.rotatingPointOffset); ctx.closePath(); ctx.stroke(); } ctx.restore(); return this; }, /** * Draws corners of an object's bounding box. * Requires public properties: width, height * Requires public options: cornerSize, padding * @param {CanvasRenderingContext2D} ctx Context to draw on * @return {fabric.Object} thisArg * @chainable */ drawControls: function(ctx) { if (!this.hasControls) { return this; } var size = this.cornerSize, size2 = size / 2, vpt = this.getViewportTransform(), strokeWidth = this.strokeWidth > 1 ? this.strokeWidth : 0, w = this.width, h = this.height, capped = this.strokeLineCap === 'round' || this.strokeLineCap === 'square', vLine = this.type === 'line' && this.width === 1, hLine = this.type === 'line' && this.height === 1, strokeW = (capped && hLine) || this.type !== 'line', strokeH = (capped && vLine) || this.type !== 'line'; if (vLine) { w = strokeWidth; } else if (hLine) { h = strokeWidth; } if (strokeW) { w += strokeWidth; } if (strokeH) { h += strokeWidth; } w *= this.scaleX; h *= this.scaleY; var wh = fabric.util.transformPoint(new fabric.Point(w, h), vpt, true), width = wh.x, height = wh.y, left = -(width / 2), top = -(height / 2), padding = this.padding, scaleOffset = size2, scaleOffsetSize = size2 - size, methodName = this.transparentCorners ? 'strokeRect' : 'fillRect'; ctx.save(); ctx.lineWidth = 1; ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1; ctx.strokeStyle = ctx.fillStyle = this.cornerColor; // top-left this._drawControl('tl', ctx, methodName, left - scaleOffset - padding, top - scaleOffset - padding); // top-right this._drawControl('tr', ctx, methodName, left + width - scaleOffset + padding, top - scaleOffset - padding); // bottom-left this._drawControl('bl', ctx, methodName, left - scaleOffset - padding, top + height + scaleOffsetSize + padding); // bottom-right this._drawControl('br', ctx, methodName, left + width + scaleOffsetSize + padding, top + height + scaleOffsetSize + padding); if (!this.get('lockUniScaling')) { // middle-top this._drawControl('mt', ctx, methodName, left + width/2 - scaleOffset, top - scaleOffset - padding); // middle-bottom this._drawControl('mb', ctx, methodName, left + width/2 - scaleOffset, top + height + scaleOffsetSize + padding); // middle-right this._drawControl('mr', ctx, methodName, left + width + scaleOffsetSize + padding, top + height/2 - scaleOffset); // middle-left this._drawControl('ml', ctx, methodName, left - scaleOffset - padding, top + height/2 - scaleOffset); } // middle-top-rotate if (this.hasRotatingPoint) { this._drawControl('mtr', ctx, methodName, left + width/2 - scaleOffset, top - this.rotatingPointOffset - this.cornerSize/2 - padding); } ctx.restore(); return this; }, /** * @private */ _drawControl: function(control, ctx, methodName, left, top) { var size = this.cornerSize; if (this.isControlVisible(control)) { isVML() || this.transparentCorners || ctx.clearRect(left, top, size, size); ctx[methodName](left, top, size, size); } }, /** * Returns true if the specified control is visible, false otherwise. * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. * @returns {Boolean} true if the specified control is visible, false otherwise */ isControlVisible: function(controlName) { return this._getControlsVisibility()[controlName]; }, /** * Sets the visibility of the specified control. * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. * @param {Boolean} visible true to set the specified control visible, false otherwise * @return {fabric.Object} thisArg * @chainable */ setControlVisible: function(controlName, visible) { this._getControlsVisibility()[controlName] = visible; return this; }, /** * Sets the visibility state of object controls. * @param {Object} [options] Options object * @param {Boolean} [options.bl] true to enable the bottom-left control, false to disable it * @param {Boolean} [options.br] true to enable the bottom-right control, false to disable it * @param {Boolean} [options.mb] true to enable the middle-bottom control, false to disable it * @param {Boolean} [options.ml] true to enable the middle-left control, false to disable it * @param {Boolean} [options.mr] true to enable the middle-right control, false to disable it * @param {Boolean} [options.mt] true to enable the middle-top control, false to disable it * @param {Boolean} [options.tl] true to enable the top-left control, false to disable it * @param {Boolean} [options.tr] true to enable the top-right control, false to disable it * @param {Boolean} [options.mtr] true to enable the middle-top-rotate control, false to disable it * @return {fabric.Object} thisArg * @chainable */ setControlsVisibility: function(options) { options || (options = { }); for (var p in options) { this.setControlVisible(p, options[p]); } return this; }, /** * Returns the instance of the control visibility set for this object. * @private * @returns {Object} */ _getControlsVisibility: function() { if (!this._controlsVisibility) { this._controlsVisibility = { tl: true, tr: true, br: true, bl: true, ml: true, mt: true, mr: true, mb: true, mtr: true }; } return this._controlsVisibility; } }); })(); fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.StaticCanvas.prototype */ { /** * Animation duration (in ms) for fx* methods * @type Number * @default */ FX_DURATION: 500, /** * Centers object horizontally with animation. * @param {fabric.Object} object Object to center * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties * @param {Function} [callbacks.onComplete] Invoked on completion * @param {Function} [callbacks.onChange] Invoked on every step of animation * @return {fabric.Canvas} thisArg * @chainable */ fxCenterObjectH: function (object, callbacks) { callbacks = callbacks || { }; var empty = function() { }, onComplete = callbacks.onComplete || empty, onChange = callbacks.onChange || empty, _this = this; fabric.util.animate({ startValue: object.get('left'), endValue: this.getCenter().left, duration: this.FX_DURATION, onChange: function(value) { object.set('left', value); _this.renderAll(); onChange(); }, onComplete: function() { object.setCoords(); onComplete(); } }); return this; }, /** * Centers object vertically with animation. * @param {fabric.Object} object Object to center * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties * @param {Function} [callbacks.onComplete] Invoked on completion * @param {Function} [callbacks.onChange] Invoked on every step of animation * @return {fabric.Canvas} thisArg * @chainable */ fxCenterObjectV: function (object, callbacks) { callbacks = callbacks || { }; var empty = function() { }, onComplete = callbacks.onComplete || empty, onChange = callbacks.onChange || empty, _this = this; fabric.util.animate({ startValue: object.get('top'), endValue: this.getCenter().top, duration: this.FX_DURATION, onChange: function(value) { object.set('top', value); _this.renderAll(); onChange(); }, onComplete: function() { object.setCoords(); onComplete(); } }); return this; }, /** * Same as `fabric.Canvas#remove` but animated * @param {fabric.Object} object Object to remove * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties * @param {Function} [callbacks.onComplete] Invoked on completion * @param {Function} [callbacks.onChange] Invoked on every step of animation * @return {fabric.Canvas} thisArg * @chainable */ fxRemove: function (object, callbacks) { callbacks = callbacks || { }; var empty = function() { }, onComplete = callbacks.onComplete || empty, onChange = callbacks.onChange || empty, _this = this; fabric.util.animate({ startValue: object.get('opacity'), endValue: 0, duration: this.FX_DURATION, onStart: function() { object.set('active', false); }, onChange: function(value) { object.set('opacity', value); _this.renderAll(); onChange(); }, onComplete: function () { _this.remove(object); onComplete(); } }); return this; } }); fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * Animates object's properties * @param {String|Object} property Property to animate (if string) or properties to animate (if object) * @param {Number|Object} value Value to animate property to (if string was given first) or options object * @return {fabric.Object} thisArg * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#animation} * @chainable * * As object — multiple properties * * object.animate({ left: ..., top: ... }); * object.animate({ left: ..., top: ... }, { duration: ... }); * * As string — one property * * object.animate('left', ...); * object.animate('left', { duration: ... }); * */ animate: function() { if (arguments[0] && typeof arguments[0] === 'object') { var propsToAnimate = [ ], prop, skipCallbacks; for (prop in arguments[0]) { propsToAnimate.push(prop); } for (var i = 0, len = propsToAnimate.length; i < len; i++) { prop = propsToAnimate[i]; skipCallbacks = i !== len - 1; this._animate(prop, arguments[0][prop], arguments[1], skipCallbacks); } } else { this._animate.apply(this, arguments); } return this; }, /** * @private * @param {String} property Property to animate * @param {String} to Value to animate to * @param {Object} [options] Options object * @param {Boolean} [skipCallbacks] When true, callbacks like onchange and oncomplete are not invoked */ _animate: function(property, to, options, skipCallbacks) { var _this = this, propPair; to = to.toString(); if (!options) { options = { }; } else { options = fabric.util.object.clone(options); } if (~property.indexOf('.')) { propPair = property.split('.'); } var currentValue = propPair ? this.get(propPair[0])[propPair[1]] : this.get(property); if (!('from' in options)) { options.from = currentValue; } if (~to.indexOf('=')) { to = currentValue + parseFloat(to.replace('=', '')); } else { to = parseFloat(to); } fabric.util.animate({ startValue: options.from, endValue: to, byValue: options.by, easing: options.easing, duration: options.duration, abort: options.abort && function() { return options.abort.call(_this); }, onChange: function(value) { if (propPair) { _this[propPair[0]][propPair[1]] = value; } else { _this.set(property, value); } if (skipCallbacks) { return; } options.onChange && options.onChange(); }, onComplete: function() { if (skipCallbacks) { return; } _this.setCoords(); options.onComplete && options.onComplete(); } }); } }); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, coordProps = { x1: 1, x2: 1, y1: 1, y2: 1 }, supportsLineDash = fabric.StaticCanvas.supports('setLineDash'); if (fabric.Line) { fabric.warn('fabric.Line is already defined'); return; } /** * Line class * @class fabric.Line * @extends fabric.Object * @see {@link fabric.Line#initialize} for constructor definition */ fabric.Line = fabric.util.createClass(fabric.Object, /** @lends fabric.Line.prototype */ { /** * Type of an object * @type String * @default */ type: 'line', /** * x value or first line edge * @type Number * @default */ x1: 0, /** * y value or first line edge * @type Number * @default */ y1: 0, /** * x value or second line edge * @type Number * @default */ x2: 0, /** * y value or second line edge * @type Number * @default */ y2: 0, /** * Constructor * @param {Array} [points] Array of points * @param {Object} [options] Options object * @return {fabric.Line} thisArg */ initialize: function(points, options) { options = options || { }; if (!points) { points = [0, 0, 0, 0]; } this.callSuper('initialize', options); this.set('x1', points[0]); this.set('y1', points[1]); this.set('x2', points[2]); this.set('y2', points[3]); this._setWidthHeight(options); }, /** * @private * @param {Object} [options] Options */ _setWidthHeight: function(options) { options || (options = { }); this.width = Math.abs(this.x2 - this.x1) || 1; this.height = Math.abs(this.y2 - this.y1) || 1; this.left = 'left' in options ? options.left : this._getLeftToOriginX(); this.top = 'top' in options ? options.top : this._getTopToOriginY(); }, /** * @private * @param {String} key * @param {Any} value */ _set: function(key, value) { this[key] = value; if (typeof coordProps[key] !== 'undefined') { this._setWidthHeight(); } return this; }, /** * @private * @return {Number} leftToOriginX Distance from left edge of canvas to originX of Line. */ _getLeftToOriginX: makeEdgeToOriginGetter( { // property names origin: 'originX', axis1: 'x1', axis2: 'x2', dimension: 'width' }, { // possible values of origin nearest: 'left', center: 'center', farthest: 'right' } ), /** * @private * @return {Number} topToOriginY Distance from top edge of canvas to originY of Line. */ _getTopToOriginY: makeEdgeToOriginGetter( { // property names origin: 'originY', axis1: 'y1', axis2: 'y2', dimension: 'height' }, { // possible values of origin nearest: 'top', center: 'center', farthest: 'bottom' } ), /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx, noTransform) { ctx.beginPath(); if (noTransform) { // Line coords are distances from left-top of canvas to origin of line. // // To render line in a path-group, we need to translate them to // distances from center of path-group to center of line. var cp = this.getCenterPoint(); ctx.translate( cp.x, cp.y ); } if (!this.strokeDashArray || this.strokeDashArray && supportsLineDash) { // move from center (of virtual box) to its left/top corner // we can't assume x1, y1 is top left and x2, y2 is bottom right var xMult = this.x1 <= this.x2 ? -1 : 1, yMult = this.y1 <= this.y2 ? -1 : 1; ctx.moveTo( this.width === 1 ? 0 : (xMult * this.width / 2), this.height === 1 ? 0 : (yMult * this.height / 2)); ctx.lineTo( this.width === 1 ? 0 : (xMult * -1 * this.width / 2), this.height === 1 ? 0 : (yMult * -1 * this.height / 2)); } ctx.lineWidth = this.strokeWidth; // TODO: test this // make sure setting "fill" changes color of a line // (by copying fillStyle to strokeStyle, since line is stroked, not filled) var origStrokeStyle = ctx.strokeStyle; ctx.strokeStyle = this.stroke || ctx.fillStyle; this.stroke && this._renderStroke(ctx); ctx.strokeStyle = origStrokeStyle; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var xMult = this.x1 <= this.x2 ? -1 : 1, yMult = this.y1 <= this.y2 ? -1 : 1, x = this.width === 1 ? 0 : xMult * this.width / 2, y = this.height === 1 ? 0 : yMult * this.height / 2; ctx.beginPath(); fabric.util.drawDashedLine(ctx, x, y, -x, -y, this.strokeDashArray); ctx.closePath(); }, /** * Returns object representation of an instance * @methd toObject * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { x1: this.get('x1'), y1: this.get('y1'), x2: this.get('x2'), y2: this.get('y2') }); }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = this._createBaseSVGMarkup(), addTranslate = ''; if (!this.group) { var x = - this.width / 2 - (this.x1 > this.x2 ? this.x2 : this.x1), y = - this.height / 2 - (this.y1 > this.y2 ? this.y2 : this.y1); addTranslate = 'translate(' + x + ', ' + y + ') '; } markup.push( '<line ', 'x1="', this.x1, '" y1="', this.y1, '" x2="', this.x2, '" y2="', this.y2, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), addTranslate, this.getSvgTransformMatrix(), '"/>\n' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns complexity of an instance * @return {Number} complexity */ complexity: function() { return 1; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Line.fromElement}) * @static * @memberOf fabric.Line * @see http://www.w3.org/TR/SVG/shapes.html#LineElement */ fabric.Line.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat('x1 y1 x2 y2'.split(' ')); /** * Returns fabric.Line instance from an SVG element * @static * @memberOf fabric.Line * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Line} instance of fabric.Line */ fabric.Line.fromElement = function(element, options) { var parsedAttributes = fabric.parseAttributes(element, fabric.Line.ATTRIBUTE_NAMES), points = [ parsedAttributes.x1 || 0, parsedAttributes.y1 || 0, parsedAttributes.x2 || 0, parsedAttributes.y2 || 0 ]; return new fabric.Line(points, extend(parsedAttributes, options)); }; /* _FROM_SVG_END_ */ /** * Returns fabric.Line instance from an object representation * @static * @memberOf fabric.Line * @param {Object} object Object to create an instance from * @return {fabric.Line} instance of fabric.Line */ fabric.Line.fromObject = function(object) { var points = [object.x1, object.y1, object.x2, object.y2]; return new fabric.Line(points, object); }; /** * Produces a function that calculates distance from canvas edge to Line origin. */ function makeEdgeToOriginGetter(propertyNames, originValues) { var origin = propertyNames.origin, axis1 = propertyNames.axis1, axis2 = propertyNames.axis2, dimension = propertyNames.dimension, nearest = originValues.nearest, center = originValues.center, farthest = originValues.farthest; return function() { switch (this.get(origin)) { case nearest: return Math.min(this.get(axis1), this.get(axis2)); case center: return Math.min(this.get(axis1), this.get(axis2)) + (0.5 * this.get(dimension)); case farthest: return Math.max(this.get(axis1), this.get(axis2)); } }; } })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), piBy2 = Math.PI * 2, extend = fabric.util.object.extend; if (fabric.Circle) { fabric.warn('fabric.Circle is already defined.'); return; } /** * Circle class * @class fabric.Circle * @extends fabric.Object * @see {@link fabric.Circle#initialize} for constructor definition */ fabric.Circle = fabric.util.createClass(fabric.Object, /** @lends fabric.Circle.prototype */ { /** * Type of an object * @type String * @default */ type: 'circle', /** * Radius of this circle * @type Number * @default */ radius: 0, /** * Constructor * @param {Object} [options] Options object * @return {fabric.Circle} thisArg */ initialize: function(options) { options = options || { }; this.callSuper('initialize', options); this.set('radius', options.radius || 0); }, /** * @private * @param {String} key * @param {Any} value * @return {fabric.Circle} thisArg */ _set: function(key, value) { this.callSuper('_set', key, value); if (key === 'radius') { this.setRadius(value); } return this; }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { radius: this.get('radius') }); }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = this._createBaseSVGMarkup(), x = 0, y = 0; if (this.group) { x = this.left + this.radius; y = this.top + this.radius; } markup.push( '<circle ', 'cx="' + x + '" cy="' + y + '" ', 'r="', this.radius, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), ' ', this.getSvgTransformMatrix(), '"/>\n' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * @private * @param {CanvasRenderingContext2D} ctx context to render on * @param {Boolean} [noTransform] When true, context is not transformed */ _render: function(ctx, noTransform) { ctx.beginPath(); ctx.arc(noTransform ? this.left + this.radius : 0, noTransform ? this.top + this.radius : 0, this.radius, 0, piBy2, false); this._renderFill(ctx); this._renderStroke(ctx); }, /** * Returns horizontal radius of an object (according to how an object is scaled) * @return {Number} */ getRadiusX: function() { return this.get('radius') * this.get('scaleX'); }, /** * Returns vertical radius of an object (according to how an object is scaled) * @return {Number} */ getRadiusY: function() { return this.get('radius') * this.get('scaleY'); }, /** * Sets radius of an object (and updates width accordingly) * @return {Number} */ setRadius: function(value) { this.radius = value; this.set('width', value * 2).set('height', value * 2); }, /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return 1; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Circle.fromElement}) * @static * @memberOf fabric.Circle * @see: http://www.w3.org/TR/SVG/shapes.html#CircleElement */ fabric.Circle.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat('cx cy r'.split(' ')); /** * Returns {@link fabric.Circle} instance from an SVG element * @static * @memberOf fabric.Circle * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @throws {Error} If value of `r` attribute is missing or invalid * @return {fabric.Circle} Instance of fabric.Circle */ fabric.Circle.fromElement = function(element, options) { options || (options = { }); var parsedAttributes = fabric.parseAttributes(element, fabric.Circle.ATTRIBUTE_NAMES); if (!isValidRadius(parsedAttributes)) { throw new Error('value of `r` attribute is required and can not be negative'); } parsedAttributes.left = parsedAttributes.left || 0; parsedAttributes.top = parsedAttributes.top || 0; var obj = new fabric.Circle(extend(parsedAttributes, options)); obj.left -= obj.radius; obj.top -= obj.radius; return obj; }; /** * @private */ function isValidRadius(attributes) { return (('radius' in attributes) && (attributes.radius > 0)); } /* _FROM_SVG_END_ */ /** * Returns {@link fabric.Circle} instance from an object representation * @static * @memberOf fabric.Circle * @param {Object} object Object to create an instance from * @return {Object} Instance of fabric.Circle */ fabric.Circle.fromObject = function(object) { return new fabric.Circle(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); if (fabric.Triangle) { fabric.warn('fabric.Triangle is already defined'); return; } /** * Triangle class * @class fabric.Triangle * @extends fabric.Object * @return {fabric.Triangle} thisArg * @see {@link fabric.Triangle#initialize} for constructor definition */ fabric.Triangle = fabric.util.createClass(fabric.Object, /** @lends fabric.Triangle.prototype */ { /** * Type of an object * @type String * @default */ type: 'triangle', /** * Constructor * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(options) { options = options || { }; this.callSuper('initialize', options); this.set('width', options.width || 100) .set('height', options.height || 100); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { var widthBy2 = this.width / 2, heightBy2 = this.height / 2; ctx.beginPath(); ctx.moveTo(-widthBy2, heightBy2); ctx.lineTo(0, -heightBy2); ctx.lineTo(widthBy2, heightBy2); ctx.closePath(); this._renderFill(ctx); this._renderStroke(ctx); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var widthBy2 = this.width / 2, heightBy2 = this.height / 2; ctx.beginPath(); fabric.util.drawDashedLine(ctx, -widthBy2, heightBy2, 0, -heightBy2, this.strokeDashArray); fabric.util.drawDashedLine(ctx, 0, -heightBy2, widthBy2, heightBy2, this.strokeDashArray); fabric.util.drawDashedLine(ctx, widthBy2, heightBy2, -widthBy2, heightBy2, this.strokeDashArray); ctx.closePath(); }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = this._createBaseSVGMarkup(), widthBy2 = this.width / 2, heightBy2 = this.height / 2, points = [ -widthBy2 + ' ' + heightBy2, '0 ' + -heightBy2, widthBy2 + ' ' + heightBy2 ] .join(','); markup.push( '<polygon ', 'points="', points, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), '"/>' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return 1; } }); /** * Returns fabric.Triangle instance from an object representation * @static * @memberOf fabric.Triangle * @param {Object} object Object to create an instance from * @return {Object} instance of Canvas.Triangle */ fabric.Triangle.fromObject = function(object) { return new fabric.Triangle(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global){ 'use strict'; var fabric = global.fabric || (global.fabric = { }), piBy2 = Math.PI * 2, extend = fabric.util.object.extend; if (fabric.Ellipse) { fabric.warn('fabric.Ellipse is already defined.'); return; } /** * Ellipse class * @class fabric.Ellipse * @extends fabric.Object * @return {fabric.Ellipse} thisArg * @see {@link fabric.Ellipse#initialize} for constructor definition */ fabric.Ellipse = fabric.util.createClass(fabric.Object, /** @lends fabric.Ellipse.prototype */ { /** * Type of an object * @type String * @default */ type: 'ellipse', /** * Horizontal radius * @type Number * @default */ rx: 0, /** * Vertical radius * @type Number * @default */ ry: 0, /** * Constructor * @param {Object} [options] Options object * @return {fabric.Ellipse} thisArg */ initialize: function(options) { options = options || { }; this.callSuper('initialize', options); this.set('rx', options.rx || 0); this.set('ry', options.ry || 0); this.set('width', this.get('rx') * 2); this.set('height', this.get('ry') * 2); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { rx: this.get('rx'), ry: this.get('ry') }); }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = this._createBaseSVGMarkup(), x = 0, y = 0; if (this.group) { x = this.left + this.rx; y = this.top + this.ry; } markup.push( '<ellipse ', 'cx="', x, '" cy="', y, '" ', 'rx="', this.rx, '" ry="', this.ry, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '"/>\n' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * @private * @param {CanvasRenderingContext2D} ctx context to render on * @param {Boolean} [noTransform] When true, context is not transformed */ _render: function(ctx, noTransform) { ctx.beginPath(); ctx.save(); ctx.transform(1, 0, 0, this.ry/this.rx, 0, 0); ctx.arc(noTransform ? this.left + this.rx : 0, noTransform ? (this.top + this.ry) * this.rx/this.ry : 0, this.rx, 0, piBy2, false); ctx.restore(); this._renderFill(ctx); this._renderStroke(ctx); }, /** * Returns complexity of an instance * @return {Number} complexity */ complexity: function() { return 1; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Ellipse.fromElement}) * @static * @memberOf fabric.Ellipse * @see http://www.w3.org/TR/SVG/shapes.html#EllipseElement */ fabric.Ellipse.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat('cx cy rx ry'.split(' ')); /** * Returns {@link fabric.Ellipse} instance from an SVG element * @static * @memberOf fabric.Ellipse * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Ellipse} */ fabric.Ellipse.fromElement = function(element, options) { options || (options = { }); var parsedAttributes = fabric.parseAttributes(element, fabric.Ellipse.ATTRIBUTE_NAMES); parsedAttributes.left = parsedAttributes.left || 0; parsedAttributes.top = parsedAttributes.top || 0; var ellipse = new fabric.Ellipse(extend(parsedAttributes, options)); ellipse.top -= ellipse.ry; ellipse.left -= ellipse.rx; return ellipse; }; /* _FROM_SVG_END_ */ /** * Returns {@link fabric.Ellipse} instance from an object representation * @static * @memberOf fabric.Ellipse * @param {Object} object Object to create an instance from * @return {fabric.Ellipse} */ fabric.Ellipse.fromObject = function(object) { return new fabric.Ellipse(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; if (fabric.Rect) { console.warn('fabric.Rect is already defined'); return; } var stateProperties = fabric.Object.prototype.stateProperties.concat(); stateProperties.push('rx', 'ry', 'x', 'y'); /** * Rectangle class * @class fabric.Rect * @extends fabric.Object * @return {fabric.Rect} thisArg * @see {@link fabric.Rect#initialize} for constructor definition */ fabric.Rect = fabric.util.createClass(fabric.Object, /** @lends fabric.Rect.prototype */ { /** * List of properties to consider when checking if state of an object is changed ({@link fabric.Object#hasStateChanged}) * as well as for history (undo/redo) purposes * @type Array */ stateProperties: stateProperties, /** * Type of an object * @type String * @default */ type: 'rect', /** * Horizontal border radius * @type Number * @default */ rx: 0, /** * Vertical border radius * @type Number * @default */ ry: 0, /** * Used to specify dash pattern for stroke on this object * @type Array */ strokeDashArray: null, /** * Constructor * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(options) { options = options || { }; this.callSuper('initialize', options); this._initRxRy(); }, /** * Initializes rx/ry attributes * @private */ _initRxRy: function() { if (this.rx && !this.ry) { this.ry = this.rx; } else if (this.ry && !this.rx) { this.rx = this.ry; } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx, noTransform) { // optimize 1x1 case (used in spray brush) if (this.width === 1 && this.height === 1) { ctx.fillRect(0, 0, 1, 1); return; } var rx = this.rx ? Math.min(this.rx, this.width / 2) : 0, ry = this.ry ? Math.min(this.ry, this.height / 2) : 0, w = this.width, h = this.height, x = noTransform ? this.left : 0, y = noTransform ? this.top : 0, isRounded = rx !== 0 || ry !== 0, k = 1 - 0.5522847498 /* "magic number" for bezier approximations of arcs (http://itc.ktu.lt/itc354/Riskus354.pdf) */; ctx.beginPath(); if (!noTransform) { ctx.translate(-this.width / 2, -this.height / 2); } ctx.moveTo(x + rx, y); ctx.lineTo(x + w - rx, y); isRounded && ctx.bezierCurveTo(x + w - k * rx, y, x + w, y + k * ry, x + w, y + ry); ctx.lineTo(x + w, y + h - ry); isRounded && ctx.bezierCurveTo(x + w, y + h - k * ry, x + w - k * rx, y + h, x + w - rx, y + h); ctx.lineTo(x + rx, y + h); isRounded && ctx.bezierCurveTo(x + k * rx, y + h, x, y + h - k * ry, x, y + h - ry); ctx.lineTo(x, y + ry); isRounded && ctx.bezierCurveTo(x, y + k * ry, x + k * rx, y, x + rx, y); ctx.closePath(); this._renderFill(ctx); this._renderStroke(ctx); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var x = -this.width / 2, y = -this.height / 2, w = this.width, h = this.height; ctx.beginPath(); fabric.util.drawDashedLine(ctx, x, y, x + w, y, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x + w, y, x + w, y + h, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x + w, y + h, x, y + h, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x, y + h, x, y, this.strokeDashArray); ctx.closePath(); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { var object = extend(this.callSuper('toObject', propertiesToInclude), { rx: this.get('rx') || 0, ry: this.get('ry') || 0 }); if (!this.includeDefaultValues) { this._removeDefaultValues(object); } return object; }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = this._createBaseSVGMarkup(), x = this.left, y = this.top; if (!this.group) { x = -this.width / 2; y = -this.height / 2; } markup.push( '<rect ', 'x="', x, '" y="', y, '" rx="', this.get('rx'), '" ry="', this.get('ry'), '" width="', this.width, '" height="', this.height, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '"/>\n'); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns complexity of an instance * @return {Number} complexity */ complexity: function() { return 1; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by `fabric.Rect.fromElement`) * @static * @memberOf fabric.Rect * @see: http://www.w3.org/TR/SVG/shapes.html#RectElement */ fabric.Rect.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat('x y rx ry width height'.split(' ')); /** * Returns {@link fabric.Rect} instance from an SVG element * @static * @memberOf fabric.Rect * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Rect} Instance of fabric.Rect */ fabric.Rect.fromElement = function(element, options) { if (!element) { return null; } options = options || { }; var parsedAttributes = fabric.parseAttributes(element, fabric.Rect.ATTRIBUTE_NAMES); parsedAttributes.left = parsedAttributes.left || 0; parsedAttributes.top = parsedAttributes.top || 0; return new fabric.Rect(extend((options ? fabric.util.object.clone(options) : { }), parsedAttributes)); }; /* _FROM_SVG_END_ */ /** * Returns {@link fabric.Rect} instance from an object representation * @static * @memberOf fabric.Rect * @param {Object} object Object to create an instance from * @return {Object} instance of fabric.Rect */ fabric.Rect.fromObject = function(object) { return new fabric.Rect(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), toFixed = fabric.util.toFixed; if (fabric.Polyline) { fabric.warn('fabric.Polyline is already defined'); return; } /** * Polyline class * @class fabric.Polyline * @extends fabric.Object * @see {@link fabric.Polyline#initialize} for constructor definition */ fabric.Polyline = fabric.util.createClass(fabric.Object, /** @lends fabric.Polyline.prototype */ { /** * Type of an object * @type String * @default */ type: 'polyline', /** * Points array * @type Array * @default */ points: null, /** * Constructor * @param {Array} points Array of points (where each point is an object with x and y) * @param {Object} [options] Options object * @param {Boolean} [skipOffset] Whether points offsetting should be skipped * @return {fabric.Polyline} thisArg * @example * var poly = new fabric.Polyline([ * { x: 10, y: 10 }, * { x: 50, y: 30 }, * { x: 40, y: 70 }, * { x: 60, y: 50 }, * { x: 100, y: 150 }, * { x: 40, y: 100 } * ], { * stroke: 'red', * left: 100, * top: 100 * }); */ initialize: function(points, options, skipOffset) { options = options || { }; this.set('points', points); this.callSuper('initialize', options); this._calcDimensions(skipOffset); }, /** * @private * @param {Boolean} [skipOffset] Whether points offsetting should be skipped */ _calcDimensions: function(skipOffset) { return fabric.Polygon.prototype._calcDimensions.call(this, skipOffset); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toObject: function(propertiesToInclude) { return fabric.Polygon.prototype.toObject.call(this, propertiesToInclude); }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var points = [], markup = this._createBaseSVGMarkup(); for (var i = 0, len = this.points.length; i < len; i++) { points.push(toFixed(this.points[i].x, 2), ',', toFixed(this.points[i].y, 2), ' '); } markup.push( '<polyline ', 'points="', points.join(''), '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), ' ', this.getSvgTransformMatrix(), '"/>\n' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { var point; ctx.beginPath(); ctx.moveTo(this.points[0].x, this.points[0].y); for (var i = 0, len = this.points.length; i < len; i++) { point = this.points[i]; ctx.lineTo(point.x, point.y); } this._renderFill(ctx); this._renderStroke(ctx); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var p1, p2; ctx.beginPath(); for (var i = 0, len = this.points.length; i < len; i++) { p1 = this.points[i]; p2 = this.points[i + 1] || p1; fabric.util.drawDashedLine(ctx, p1.x, p1.y, p2.x, p2.y, this.strokeDashArray); } }, /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return this.get('points').length; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Polyline.fromElement}) * @static * @memberOf fabric.Polyline * @see: http://www.w3.org/TR/SVG/shapes.html#PolylineElement */ fabric.Polyline.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat(); /** * Returns fabric.Polyline instance from an SVG element * @static * @memberOf fabric.Polyline * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Polyline} Instance of fabric.Polyline */ fabric.Polyline.fromElement = function(element, options) { if (!element) { return null; } options || (options = { }); var points = fabric.parsePointsAttribute(element.getAttribute('points')), parsedAttributes = fabric.parseAttributes(element, fabric.Polyline.ATTRIBUTE_NAMES); if (points === null) { return null; } return new fabric.Polyline(points, fabric.util.object.extend(parsedAttributes, options), true); }; /* _FROM_SVG_END_ */ /** * Returns fabric.Polyline instance from an object representation * @static * @memberOf fabric.Polyline * @param {Object} object Object to create an instance from * @return {fabric.Polyline} Instance of fabric.Polyline */ fabric.Polyline.fromObject = function(object) { var points = object.points; return new fabric.Polyline(points, object, true); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, min = fabric.util.array.min, max = fabric.util.array.max, toFixed = fabric.util.toFixed; if (fabric.Polygon) { fabric.warn('fabric.Polygon is already defined'); return; } /** * Polygon class * @class fabric.Polygon * @extends fabric.Object * @see {@link fabric.Polygon#initialize} for constructor definition */ fabric.Polygon = fabric.util.createClass(fabric.Object, /** @lends fabric.Polygon.prototype */ { /** * Type of an object * @type String * @default */ type: 'polygon', /** * Points array * @type Array * @default */ points: null, /** * Constructor * @param {Array} points Array of points * @param {Object} [options] Options object * @param {Boolean} [skipOffset] Whether points offsetting should be skipped * @return {fabric.Polygon} thisArg */ initialize: function(points, options, skipOffset) { options = options || { }; this.points = points; this.callSuper('initialize', options); this._calcDimensions(skipOffset); }, /** * @private * @param {Boolean} [skipOffset] Whether points offsetting should be skipped */ _calcDimensions: function(skipOffset) { var points = this.points, minX = min(points, 'x'), minY = min(points, 'y'), maxX = max(points, 'x'), maxY = max(points, 'y'); this.width = (maxX - minX) || 1; this.height = (maxY - minY) || 1; this.minX = minX; this.minY = minY; if (skipOffset) { return; } var halfWidth = this.width / 2 + this.minX, halfHeight = this.height / 2 + this.minY; // change points to offset polygon into a bounding box this.points.forEach(function(p) { p.x -= halfWidth; p.y -= halfHeight; }, this); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { points: this.points.concat() }); }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var points = [], markup = this._createBaseSVGMarkup(); for (var i = 0, len = this.points.length; i < len; i++) { points.push(toFixed(this.points[i].x, 2), ',', toFixed(this.points[i].y, 2), ' '); } markup.push( '<polygon ', 'points="', points.join(''), '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), ' ', this.getSvgTransformMatrix(), '"/>\n' ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { var point; ctx.beginPath(); ctx.moveTo(this.points[0].x, this.points[0].y); for (var i = 0, len = this.points.length; i < len; i++) { point = this.points[i]; ctx.lineTo(point.x, point.y); } this._renderFill(ctx); if (this.stroke || this.strokeDashArray) { ctx.closePath(); this._renderStroke(ctx); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var p1, p2; ctx.beginPath(); for (var i = 0, len = this.points.length; i < len; i++) { p1 = this.points[i]; p2 = this.points[i + 1] || this.points[0]; fabric.util.drawDashedLine(ctx, p1.x, p1.y, p2.x, p2.y, this.strokeDashArray); } ctx.closePath(); }, /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return this.points.length; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by `fabric.Polygon.fromElement`) * @static * @memberOf fabric.Polygon * @see: http://www.w3.org/TR/SVG/shapes.html#PolygonElement */ fabric.Polygon.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat(); /** * Returns {@link fabric.Polygon} instance from an SVG element * @static * @memberOf fabric.Polygon * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Polygon} Instance of fabric.Polygon */ fabric.Polygon.fromElement = function(element, options) { if (!element) { return null; } options || (options = { }); var points = fabric.parsePointsAttribute(element.getAttribute('points')), parsedAttributes = fabric.parseAttributes(element, fabric.Polygon.ATTRIBUTE_NAMES); if (points === null) { return null; } return new fabric.Polygon(points, extend(parsedAttributes, options), true); }; /* _FROM_SVG_END_ */ /** * Returns fabric.Polygon instance from an object representation * @static * @memberOf fabric.Polygon * @param {Object} object Object to create an instance from * @return {fabric.Polygon} Instance of fabric.Polygon */ fabric.Polygon.fromObject = function(object) { return new fabric.Polygon(object.points, object, true); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), min = fabric.util.array.min, max = fabric.util.array.max, extend = fabric.util.object.extend, _toString = Object.prototype.toString, drawArc = fabric.util.drawArc, commandLengths = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7 }, repeatedCommands = { m: 'l', M: 'L' }; if (fabric.Path) { fabric.warn('fabric.Path is already defined'); return; } /** * @private */ function getX(item) { if (item[0] === 'H') { return item[1]; } return item[item.length - 2]; } /** * @private */ function getY(item) { if (item[0] === 'V') { return item[1]; } return item[item.length - 1]; } /** * Path class * @class fabric.Path * @extends fabric.Object * @tutorial {@link http://fabricjs.com/fabric-intro-part-1/#path_and_pathgroup} * @see {@link fabric.Path#initialize} for constructor definition */ fabric.Path = fabric.util.createClass(fabric.Object, /** @lends fabric.Path.prototype */ { /** * Type of an object * @type String * @default */ type: 'path', /** * Array of path points * @type Array * @default */ path: null, /** * Constructor * @param {Array|String} path Path data (sequence of coordinates and corresponding "command" tokens) * @param {Object} [options] Options object * @return {fabric.Path} thisArg */ initialize: function(path, options) { options = options || { }; this.setOptions(options); if (!path) { throw new Error('`path` argument is required'); } var fromArray = _toString.call(path) === '[object Array]'; this.path = fromArray ? path // one of commands (m,M,l,L,q,Q,c,C,etc.) followed by non-command characters (i.e. command values) : path.match && path.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi); if (!this.path) { return; } if (!fromArray) { this.path = this._parsePath(); } this._initializePath(options); if (options.sourcePath) { this.setSourcePath(options.sourcePath); } }, /** * @private * @param {Object} [options] Options object */ _initializePath: function (options) { var isWidthSet = 'width' in options && options.width != null, isHeightSet = 'height' in options && options.width != null, isLeftSet = 'left' in options, isTopSet = 'top' in options, origLeft = isLeftSet ? this.left : 0, origTop = isTopSet ? this.top : 0; if (!isWidthSet || !isHeightSet) { extend(this, this._parseDimensions()); if (isWidthSet) { this.width = options.width; } if (isHeightSet) { this.height = options.height; } } else { //Set center location relative to given height/width if not specified if (!isTopSet) { this.top = this.height / 2; } if (!isLeftSet) { this.left = this.width / 2; } } this.pathOffset = this.pathOffset || // Save top-left coords as offset this._calculatePathOffset(origLeft, origTop); }, /** * @private * @param {Number} origLeft Original left position * @param {Number} origTop Original top position */ _calculatePathOffset: function (origLeft, origTop) { return { x: this.left - origLeft - (this.width / 2), y: this.top - origTop - (this.height / 2) }; }, /** * @private * @param {CanvasRenderingContext2D} ctx context to render path on */ _render: function(ctx, noTransform) { var current, // current instruction previous = null, subpathStartX = 0, subpathStartY = 0, x = 0, // current x y = 0, // current y controlX = 0, // current control point x controlY = 0, // current control point y tempX, tempY, tempControlX, tempControlY, l = -((this.width / 2) + this.pathOffset.x), t = -((this.height / 2) + this.pathOffset.y); if (noTransform) { l += this.width / 2; t += this.height / 2; } for (var i = 0, len = this.path.length; i < len; ++i) { current = this.path[i]; switch (current[0]) { // first letter case 'l': // lineto, relative x += current[1]; y += current[2]; ctx.lineTo(x + l, y + t); break; case 'L': // lineto, absolute x = current[1]; y = current[2]; ctx.lineTo(x + l, y + t); break; case 'h': // horizontal lineto, relative x += current[1]; ctx.lineTo(x + l, y + t); break; case 'H': // horizontal lineto, absolute x = current[1]; ctx.lineTo(x + l, y + t); break; case 'v': // vertical lineto, relative y += current[1]; ctx.lineTo(x + l, y + t); break; case 'V': // verical lineto, absolute y = current[1]; ctx.lineTo(x + l, y + t); break; case 'm': // moveTo, relative x += current[1]; y += current[2]; subpathStartX = x; subpathStartY = y; ctx.moveTo(x + l, y + t); break; case 'M': // moveTo, absolute x = current[1]; y = current[2]; subpathStartX = x; subpathStartY = y; ctx.moveTo(x + l, y + t); break; case 'c': // bezierCurveTo, relative tempX = x + current[5]; tempY = y + current[6]; controlX = x + current[3]; controlY = y + current[4]; ctx.bezierCurveTo( x + current[1] + l, // x1 y + current[2] + t, // y1 controlX + l, // x2 controlY + t, // y2 tempX + l, tempY + t ); x = tempX; y = tempY; break; case 'C': // bezierCurveTo, absolute x = current[5]; y = current[6]; controlX = current[3]; controlY = current[4]; ctx.bezierCurveTo( current[1] + l, current[2] + t, controlX + l, controlY + t, x + l, y + t ); break; case 's': // shorthand cubic bezierCurveTo, relative // transform to absolute x,y tempX = x + current[3]; tempY = y + current[4]; // calculate reflection of previous control points controlX = controlX ? (2 * x - controlX) : x; controlY = controlY ? (2 * y - controlY) : y; ctx.bezierCurveTo( controlX + l, controlY + t, x + current[1] + l, y + current[2] + t, tempX + l, tempY + t ); // set control point to 2nd one of this command // "... the first control point is assumed to be // the reflection of the second control point on // the previous command relative to the current point." controlX = x + current[1]; controlY = y + current[2]; x = tempX; y = tempY; break; case 'S': // shorthand cubic bezierCurveTo, absolute tempX = current[3]; tempY = current[4]; // calculate reflection of previous control points controlX = 2 * x - controlX; controlY = 2 * y - controlY; ctx.bezierCurveTo( controlX + l, controlY + t, current[1] + l, current[2] + t, tempX + l, tempY + t ); x = tempX; y = tempY; // set control point to 2nd one of this command // "... the first control point is assumed to be // the reflection of the second control point on // the previous command relative to the current point." controlX = current[1]; controlY = current[2]; break; case 'q': // quadraticCurveTo, relative // transform to absolute x,y tempX = x + current[3]; tempY = y + current[4]; controlX = x + current[1]; controlY = y + current[2]; ctx.quadraticCurveTo( controlX + l, controlY + t, tempX + l, tempY + t ); x = tempX; y = tempY; break; case 'Q': // quadraticCurveTo, absolute tempX = current[3]; tempY = current[4]; ctx.quadraticCurveTo( current[1] + l, current[2] + t, tempX + l, tempY + t ); x = tempX; y = tempY; controlX = current[1]; controlY = current[2]; break; case 't': // shorthand quadraticCurveTo, relative // transform to absolute x,y tempX = x + current[1]; tempY = y + current[2]; if (previous[0].match(/[QqTt]/) === null) { // If there is no previous command or if the previous command was not a Q, q, T or t, // assume the control point is coincident with the current point controlX = x; controlY = y; } else if (previous[0] === 't') { // calculate reflection of previous control points for t controlX = 2 * x - tempControlX; controlY = 2 * y - tempControlY; } else if (previous[0] === 'q') { // calculate reflection of previous control points for q controlX = 2 * x - controlX; controlY = 2 * y - controlY; } tempControlX = controlX; tempControlY = controlY; ctx.quadraticCurveTo( controlX + l, controlY + t, tempX + l, tempY + t ); x = tempX; y = tempY; controlX = x + current[1]; controlY = y + current[2]; break; case 'T': tempX = current[1]; tempY = current[2]; // calculate reflection of previous control points controlX = 2 * x - controlX; controlY = 2 * y - controlY; ctx.quadraticCurveTo( controlX + l, controlY + t, tempX + l, tempY + t ); x = tempX; y = tempY; break; case 'a': // TODO: optimize this drawArc(ctx, x + l, y + t, [ current[1], current[2], current[3], current[4], current[5], current[6] + x + l, current[7] + y + t ]); x += current[6]; y += current[7]; break; case 'A': // TODO: optimize this drawArc(ctx, x + l, y + t, [ current[1], current[2], current[3], current[4], current[5], current[6] + l, current[7] + t ]); x = current[6]; y = current[7]; break; case 'z': case 'Z': x = subpathStartX; y = subpathStartY; ctx.closePath(); break; } previous = current; } }, /** * Renders path on a specified context * @param {CanvasRenderingContext2D} ctx context to render path on * @param {Boolean} [noTransform] When true, context is not transformed */ render: function(ctx, noTransform) { // do not render if object is not visible if (!this.visible) { return; } ctx.save(); if (noTransform) { ctx.translate(-this.width/2, -this.height/2); } var m = this.transformMatrix; if (m) { ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); } if (!noTransform) { this.transform(ctx); } this._setStrokeStyles(ctx); this._setFillStyles(ctx); this._setShadow(ctx); this.clipTo && fabric.util.clipContext(this, ctx); ctx.beginPath(); ctx.globalAlpha = this.group ? (ctx.globalAlpha * this.opacity) : this.opacity; this._render(ctx, noTransform); this._renderFill(ctx); this._renderStroke(ctx); this.clipTo && ctx.restore(); this._removeShadow(ctx); ctx.restore(); }, /** * Returns string representation of an instance * @return {String} string representation of an instance */ toString: function() { return '#<fabric.Path (' + this.complexity() + '): { "top": ' + this.top + ', "left": ' + this.left + ' }>'; }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { var o = extend(this.callSuper('toObject', propertiesToInclude), { path: this.path.map(function(item) { return item.slice() }), pathOffset: this.pathOffset }); if (this.sourcePath) { o.sourcePath = this.sourcePath; } if (this.transformMatrix) { o.transformMatrix = this.transformMatrix; } return o; }, /** * Returns dataless object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toDatalessObject: function(propertiesToInclude) { var o = this.toObject(propertiesToInclude); if (this.sourcePath) { o.path = this.sourcePath; } delete o.sourcePath; return o; }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var chunks = [], markup = this._createBaseSVGMarkup(); for (var i = 0, len = this.path.length; i < len; i++) { chunks.push(this.path[i].join(' ')); } var path = chunks.join(' '); markup.push( //jscs:disable validateIndentation '<path ', 'd="', path, '" style="', this.getSvgStyles(), '" transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '" stroke-linecap="round" ', '/>\n' //jscs:enable validateIndentation ); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns number representation of an instance complexity * @return {Number} complexity of this instance */ complexity: function() { return this.path.length; }, /** * @private */ _parsePath: function() { var result = [ ], coords = [ ], currentPath, parsed, re = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/ig, match, coordsStr; for (var i = 0, coordsParsed, len = this.path.length; i < len; i++) { currentPath = this.path[i]; coordsStr = currentPath.slice(1).trim(); coords.length = 0; while ((match = re.exec(coordsStr))) { coords.push(match[0]); } coordsParsed = [ currentPath.charAt(0) ]; for (var j = 0, jlen = coords.length; j < jlen; j++) { parsed = parseFloat(coords[j]); if (!isNaN(parsed)) { coordsParsed.push(parsed); } } var command = coordsParsed[0], commandLength = commandLengths[command.toLowerCase()], repeatedCommand = repeatedCommands[command] || command; if (coordsParsed.length - 1 > commandLength) { for (var k = 1, klen = coordsParsed.length; k < klen; k += commandLength) { result.push([ command ].concat(coordsParsed.slice(k, k + commandLength))); command = repeatedCommand; } } else { result.push(coordsParsed); } } return result; }, /** * @private */ _parseDimensions: function() { var aX = [], aY = [], previous = { }; this.path.forEach(function(item, i) { this._getCoordsFromCommand(item, i, aX, aY, previous); }, this); var minX = min(aX), minY = min(aY), maxX = max(aX), maxY = max(aY), deltaX = maxX - minX, deltaY = maxY - minY, o = { left: this.left + (minX + deltaX / 2), top: this.top + (minY + deltaY / 2), width: deltaX, height: deltaY }; return o; }, _getCoordsFromCommand: function(item, i, aX, aY, previous) { var isLowerCase = false; if (item[0] !== 'H') { previous.x = (i === 0) ? getX(item) : getX(this.path[i - 1]); } if (item[0] !== 'V') { previous.y = (i === 0) ? getY(item) : getY(this.path[i - 1]); } // lowercased letter denotes relative position; // transform to absolute if (item[0] === item[0].toLowerCase()) { isLowerCase = true; } var xy = this._getXY(item, isLowerCase, previous), val; val = parseInt(xy.x, 10); if (!isNaN(val)) { aX.push(val); } val = parseInt(xy.y, 10); if (!isNaN(val)) { aY.push(val); } }, _getXY: function(item, isLowerCase, previous) { // last 2 items in an array of coordinates are the actualy x/y (except H/V), collect them // TODO (kangax): support relative h/v commands var x = isLowerCase ? previous.x + getX(item) : item[0] === 'V' ? previous.x : getX(item), y = isLowerCase ? previous.y + getY(item) : item[0] === 'H' ? previous.y : getY(item); return { x: x, y: y }; } }); /** * Creates an instance of fabric.Path from an object * @static * @memberOf fabric.Path * @param {Object} object * @param {Function} callback Callback to invoke when an fabric.Path instance is created */ fabric.Path.fromObject = function(object, callback) { if (typeof object.path === 'string') { fabric.loadSVGFromURL(object.path, function (elements) { var path = elements[0], pathUrl = object.path; delete object.path; fabric.util.object.extend(path, object); path.setSourcePath(pathUrl); callback(path); }); } else { callback(new fabric.Path(object.path, object)); } }; /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by `fabric.Path.fromElement`) * @static * @memberOf fabric.Path * @see http://www.w3.org/TR/SVG/paths.html#PathElement */ fabric.Path.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat(['d']); /** * Creates an instance of fabric.Path from an SVG <path> element * @static * @memberOf fabric.Path * @param {SVGElement} element to parse * @param {Function} callback Callback to invoke when an fabric.Path instance is created * @param {Object} [options] Options object */ fabric.Path.fromElement = function(element, callback, options) { var parsedAttributes = fabric.parseAttributes(element, fabric.Path.ATTRIBUTE_NAMES); callback && callback(new fabric.Path(parsedAttributes.d, extend(parsedAttributes, options))); }; /* _FROM_SVG_END_ */ /** * Indicates that instances of this type are async * @static * @memberOf fabric.Path * @type Boolean * @default */ fabric.Path.async = true; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, invoke = fabric.util.array.invoke, parentToObject = fabric.Object.prototype.toObject; if (fabric.PathGroup) { fabric.warn('fabric.PathGroup is already defined'); return; } /** * Path group class * @class fabric.PathGroup * @extends fabric.Path * @tutorial {@link http://fabricjs.com/fabric-intro-part-1/#path_and_pathgroup} * @see {@link fabric.PathGroup#initialize} for constructor definition */ fabric.PathGroup = fabric.util.createClass(fabric.Path, /** @lends fabric.PathGroup.prototype */ { /** * Type of an object * @type String * @default */ type: 'path-group', /** * Fill value * @type String * @default */ fill: '', /** * Constructor * @param {Array} paths * @param {Object} [options] Options object * @return {fabric.PathGroup} thisArg */ initialize: function(paths, options) { options = options || { }; this.paths = paths || [ ]; for (var i = this.paths.length; i--; ) { this.paths[i].group = this; } this.setOptions(options); if (options.widthAttr) { this.scaleX = options.widthAttr / options.width; } if (options.heightAttr) { this.scaleY = options.heightAttr / options.height; } this.setCoords(); if (options.sourcePath) { this.setSourcePath(options.sourcePath); } }, /** * Renders this group on a specified context * @param {CanvasRenderingContext2D} ctx Context to render this instance on */ render: function(ctx) { // do not render if object is not visible if (!this.visible) { return; } ctx.save(); var m = this.transformMatrix; if (m) { ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); } this.transform(ctx); this._setShadow(ctx); this.clipTo && fabric.util.clipContext(this, ctx); for (var i = 0, l = this.paths.length; i < l; ++i) { this.paths[i].render(ctx, true); } this.clipTo && ctx.restore(); this._removeShadow(ctx); ctx.restore(); }, /** * Sets certain property to a certain value * @param {String} prop * @param {Any} value * @return {fabric.PathGroup} thisArg */ _set: function(prop, value) { if (prop === 'fill' && value && this.isSameColor()) { var i = this.paths.length; while (i--) { this.paths[i]._set(prop, value); } } return this.callSuper('_set', prop, value); }, /** * Returns object representation of this path group * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { var o = extend(parentToObject.call(this, propertiesToInclude), { paths: invoke(this.getObjects(), 'toObject', propertiesToInclude) }); if (this.sourcePath) { o.sourcePath = this.sourcePath; } return o; }, /** * Returns dataless object representation of this path group * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} dataless object representation of an instance */ toDatalessObject: function(propertiesToInclude) { var o = this.toObject(propertiesToInclude); if (this.sourcePath) { o.paths = this.sourcePath; } return o; }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var objects = this.getObjects(), translatePart = 'translate(' + this.left + ' ' + this.top + ')', markup = [ //jscs:disable validateIndentation '<g ', 'style="', this.getSvgStyles(), '" ', 'transform="', translatePart, this.getSvgTransform(), '" ', '>\n' //jscs:enable validateIndentation ]; for (var i = 0, len = objects.length; i < len; i++) { markup.push(objects[i].toSVG(reviver)); } markup.push('</g>\n'); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns a string representation of this path group * @return {String} string representation of an object */ toString: function() { return '#<fabric.PathGroup (' + this.complexity() + '): { top: ' + this.top + ', left: ' + this.left + ' }>'; }, /** * Returns true if all paths in this group are of same color * @return {Boolean} true if all paths are of the same color (`fill`) */ isSameColor: function() { var firstPathFill = (this.getObjects()[0].get('fill') || '').toLowerCase(); return this.getObjects().every(function(path) { return (path.get('fill') || '').toLowerCase() === firstPathFill; }); }, /** * Returns number representation of object's complexity * @return {Number} complexity */ complexity: function() { return this.paths.reduce(function(total, path) { return total + ((path && path.complexity) ? path.complexity() : 0); }, 0); }, /** * Returns all paths in this path group * @return {Array} array of path objects included in this path group */ getObjects: function() { return this.paths; } }); /** * Creates fabric.PathGroup instance from an object representation * @static * @memberOf fabric.PathGroup * @param {Object} object Object to create an instance from * @param {Function} callback Callback to invoke when an fabric.PathGroup instance is created */ fabric.PathGroup.fromObject = function(object, callback) { if (typeof object.paths === 'string') { fabric.loadSVGFromURL(object.paths, function (elements) { var pathUrl = object.paths; delete object.paths; var pathGroup = fabric.util.groupSVGElements(elements, object, pathUrl); callback(pathGroup); }); } else { fabric.util.enlivenObjects(object.paths, function(enlivenedObjects) { delete object.paths; callback(new fabric.PathGroup(enlivenedObjects, object)); }); } }; /** * Indicates that instances of this type are async * @static * @memberOf fabric.PathGroup * @type Boolean * @default */ fabric.PathGroup.async = true; })(typeof exports !== 'undefined' ? exports : this); (function(global){ 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, min = fabric.util.array.min, max = fabric.util.array.max, invoke = fabric.util.array.invoke; if (fabric.Group) { return; } // lock-related properties, for use in fabric.Group#get // to enable locking behavior on group // when one of its objects has lock-related properties set var _lockProperties = { lockMovementX: true, lockMovementY: true, lockRotation: true, lockScalingX: true, lockScalingY: true, lockUniScaling: true }; /** * Group class * @class fabric.Group * @extends fabric.Object * @mixes fabric.Collection * @tutorial {@link http://fabricjs.com/fabric-intro-part-3/#groups} * @see {@link fabric.Group#initialize} for constructor definition */ fabric.Group = fabric.util.createClass(fabric.Object, fabric.Collection, /** @lends fabric.Group.prototype */ { /** * Type of an object * @type String * @default */ type: 'group', /** * Constructor * @param {Object} objects Group objects * @param {Object} [options] Options object * @return {Object} thisArg */ initialize: function(objects, options) { options = options || { }; this._objects = objects || []; for (var i = this._objects.length; i--; ) { this._objects[i].group = this; } this.originalState = { }; this.callSuper('initialize'); this._calcBounds(); this._updateObjectsCoords(); if (options) { extend(this, options); } this._setOpacityIfSame(); this.setCoords(); this.saveCoords(); }, /** * @private */ _updateObjectsCoords: function() { this.forEachObject(this._updateObjectCoords, this); }, /** * @private */ _updateObjectCoords: function(object) { var objectLeft = object.getLeft(), objectTop = object.getTop(); object.set({ originalLeft: objectLeft, originalTop: objectTop, left: objectLeft - this.left, top: objectTop - this.top }); object.setCoords(); // do not display corners of objects enclosed in a group object.__origHasControls = object.hasControls; object.hasControls = false; }, /** * Returns string represenation of a group * @return {String} */ toString: function() { return '#<fabric.Group: (' + this.complexity() + ')>'; }, /** * Adds an object to a group; Then recalculates group's dimension, position. * @param {Object} object * @return {fabric.Group} thisArg * @chainable */ addWithUpdate: function(object) { this._restoreObjectsState(); if (object) { this._objects.push(object); object.group = this; } // since _restoreObjectsState set objects inactive this.forEachObject(this._setObjectActive, this); this._calcBounds(); this._updateObjectsCoords(); return this; }, /** * @private */ _setObjectActive: function(object) { object.set('active', true); object.group = this; }, /** * Removes an object from a group; Then recalculates group's dimension, position. * @param {Object} object * @return {fabric.Group} thisArg * @chainable */ removeWithUpdate: function(object) { this._moveFlippedObject(object); this._restoreObjectsState(); // since _restoreObjectsState set objects inactive this.forEachObject(this._setObjectActive, this); this.remove(object); this._calcBounds(); this._updateObjectsCoords(); return this; }, /** * @private */ _onObjectAdded: function(object) { object.group = this; }, /** * @private */ _onObjectRemoved: function(object) { delete object.group; object.set('active', false); }, /** * Properties that are delegated to group objects when reading/writing * @param {Object} delegatedProperties */ delegatedProperties: { fill: true, opacity: true, fontFamily: true, fontWeight: true, fontSize: true, fontStyle: true, lineHeight: true, textDecoration: true, textAlign: true, backgroundColor: true }, /** * @private */ _set: function(key, value) { if (key in this.delegatedProperties) { var i = this._objects.length; this[key] = value; while (i--) { this._objects[i].set(key, value); } } else { this[key] = value; } }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { objects: invoke(this._objects, 'toObject', propertiesToInclude) }); }, /** * Renders instance on a given context * @param {CanvasRenderingContext2D} ctx context to render instance on */ render: function(ctx) { // do not render if object is not visible if (!this.visible) { return; } ctx.save(); this.clipTo && fabric.util.clipContext(this, ctx); // the array is now sorted in order of highest first, so start from end for (var i = 0, len = this._objects.length; i < len; i++) { this._renderObject(this._objects[i], ctx); } this.clipTo && ctx.restore(); ctx.restore(); }, /** * Renders controls and borders for the object * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Boolean} [noTransform] When true, context is not transformed */ _renderControls: function(ctx, noTransform) { this.callSuper('_renderControls', ctx, noTransform); for (var i = 0, len = this._objects.length; i < len; i++) { this._objects[i]._renderControls(ctx); } }, /** * @private */ _renderObject: function(object, ctx) { var originalHasRotatingPoint = object.hasRotatingPoint; // do not render if object is not visible if (!object.visible) { return; } object.hasRotatingPoint = false; object.render(ctx); object.hasRotatingPoint = originalHasRotatingPoint; }, /** * Retores original state of each of group objects (original state is that which was before group was created). * @private * @return {fabric.Group} thisArg * @chainable */ _restoreObjectsState: function() { this._objects.forEach(this._restoreObjectState, this); return this; }, /** * Moves a flipped object to the position where it's displayed * @private * @param {fabric.Object} object * @return {fabric.Group} thisArg */ _moveFlippedObject: function(object) { var oldOriginX = object.get('originX'), oldOriginY = object.get('originY'), center = object.getCenterPoint(); object.set({ originX: 'center', originY: 'center', left: center.x, top: center.y }); this._toggleFlipping(object); var newOrigin = object.getPointByOrigin(oldOriginX, oldOriginY); object.set({ originX: oldOriginX, originY: oldOriginY, left: newOrigin.x, top: newOrigin.y }); return this; }, /** * @private */ _toggleFlipping: function(object) { if (this.flipX) { object.toggle('flipX'); object.set('left', -object.get('left')); object.setAngle(-object.getAngle()); } if (this.flipY) { object.toggle('flipY'); object.set('top', -object.get('top')); object.setAngle(-object.getAngle()); } }, /** * Restores original state of a specified object in group * @private * @param {fabric.Object} object * @return {fabric.Group} thisArg */ _restoreObjectState: function(object) { this._setObjectPosition(object); object.setCoords(); object.hasControls = object.__origHasControls; delete object.__origHasControls; object.set('active', false); object.setCoords(); delete object.group; return this; }, /** * @private */ _setObjectPosition: function(object) { var groupLeft = this.getLeft(), groupTop = this.getTop(), rotated = this._getRotatedLeftTop(object); object.set({ angle: object.getAngle() + this.getAngle(), left: groupLeft + rotated.left, top: groupTop + rotated.top, scaleX: object.get('scaleX') * this.get('scaleX'), scaleY: object.get('scaleY') * this.get('scaleY') }); }, /** * @private */ _getRotatedLeftTop: function(object) { var groupAngle = this.getAngle() * (Math.PI / 180); return { left: (-Math.sin(groupAngle) * object.getTop() * this.get('scaleY') + Math.cos(groupAngle) * object.getLeft() * this.get('scaleX')), top: (Math.cos(groupAngle) * object.getTop() * this.get('scaleY') + Math.sin(groupAngle) * object.getLeft() * this.get('scaleX')) }; }, /** * Destroys a group (restoring state of its objects) * @return {fabric.Group} thisArg * @chainable */ destroy: function() { this._objects.forEach(this._moveFlippedObject, this); return this._restoreObjectsState(); }, /** * Saves coordinates of this instance (to be used together with `hasMoved`) * @saveCoords * @return {fabric.Group} thisArg * @chainable */ saveCoords: function() { this._originalLeft = this.get('left'); this._originalTop = this.get('top'); return this; }, /** * Checks whether this group was moved (since `saveCoords` was called last) * @return {Boolean} true if an object was moved (since fabric.Group#saveCoords was called) */ hasMoved: function() { return this._originalLeft !== this.get('left') || this._originalTop !== this.get('top'); }, /** * Sets coordinates of all group objects * @return {fabric.Group} thisArg * @chainable */ setObjectsCoords: function() { this.forEachObject(function(object) { object.setCoords(); }); return this; }, /** * @private */ _setOpacityIfSame: function() { var objects = this.getObjects(), firstValue = objects[0] ? objects[0].get('opacity') : 1, isSameOpacity = objects.every(function(o) { return o.get('opacity') === firstValue; }); if (isSameOpacity) { this.opacity = firstValue; } }, /** * @private */ _calcBounds: function(onlyWidthHeight) { var aX = [], aY = [], o; for (var i = 0, len = this._objects.length; i < len; ++i) { o = this._objects[i]; o.setCoords(); for (var prop in o.oCoords) { aX.push(o.oCoords[prop].x); aY.push(o.oCoords[prop].y); } } this.set(this._getBounds(aX, aY, onlyWidthHeight)); }, /** * @private */ _getBounds: function(aX, aY, onlyWidthHeight) { var ivt = fabric.util.invertTransform(this.getViewportTransform()), minXY = fabric.util.transformPoint(new fabric.Point(min(aX), min(aY)), ivt), maxXY = fabric.util.transformPoint(new fabric.Point(max(aX), max(aY)), ivt), obj = { width: (maxXY.x - minXY.x) || 0, height: (maxXY.y - minXY.y) || 0 }; if (!onlyWidthHeight) { obj.left = (minXY.x + maxXY.x) / 2 || 0; obj.top = (minXY.y + maxXY.y) / 2 || 0; } return obj; }, /* _TO_SVG_START_ */ /** * Returns svg representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = [ //jscs:disable validateIndentation '<g ', 'transform="', this.getSvgTransform(), '">\n' //jscs:enable validateIndentation ]; for (var i = 0, len = this._objects.length; i < len; i++) { markup.push(this._objects[i].toSVG(reviver)); } markup.push('</g>\n'); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns requested property * @param {String} prop Property to get * @return {Any} */ get: function(prop) { if (prop in _lockProperties) { if (this[prop]) { return this[prop]; } else { for (var i = 0, len = this._objects.length; i < len; i++) { if (this._objects[i][prop]) { return true; } } return false; } } else { if (prop in this.delegatedProperties) { return this._objects[0] && this._objects[0].get(prop); } return this[prop]; } } }); /** * Returns {@link fabric.Group} instance from an object representation * @static * @memberOf fabric.Group * @param {Object} object Object to create a group from * @param {Function} [callback] Callback to invoke when an group instance is created * @return {fabric.Group} An instance of fabric.Group */ fabric.Group.fromObject = function(object, callback) { fabric.util.enlivenObjects(object.objects, function(enlivenedObjects) { delete object.objects; callback && callback(new fabric.Group(enlivenedObjects, object)); }); }; /** * Indicates that instances of this type are async * @static * @memberOf fabric.Group * @type Boolean * @default */ fabric.Group.async = true; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var extend = fabric.util.object.extend; if (!global.fabric) { global.fabric = { }; } if (global.fabric.Image) { fabric.warn('fabric.Image is already defined.'); return; } /** * Image class * @class fabric.Image * @extends fabric.Object * @tutorial {@link http://fabricjs.com/fabric-intro-part-1/#images} * @see {@link fabric.Image#initialize} for constructor definition */ fabric.Image = fabric.util.createClass(fabric.Object, /** @lends fabric.Image.prototype */ { /** * Type of an object * @type String * @default */ type: 'image', /** * crossOrigin value (one of "", "anonymous", "allow-credentials") * @see https://developer.mozilla.org/en-US/docs/HTML/CORS_settings_attributes * @type String * @default */ crossOrigin: '', /** * Constructor * @param {HTMLImageElement | String} element Image element * @param {Object} [options] Options object * @return {fabric.Image} thisArg */ initialize: function(element, options) { options || (options = { }); this.filters = [ ]; this.callSuper('initialize', options); this._initElement(element, options); this._initConfig(options); if (options.filters) { this.filters = options.filters; this.applyFilters(); } }, /** * Returns image element which this instance if based on * @return {HTMLImageElement} Image element */ getElement: function() { return this._element; }, /** * Sets image element for this instance to a specified one. * If filters defined they are applied to new image. * You might need to call `canvas.renderAll` and `object.setCoords` after replacing, to render new image and update controls area. * @param {HTMLImageElement} element * @param {Function} [callback] Callback is invoked when all filters have been applied and new image is generated * @return {fabric.Image} thisArg * @chainable */ setElement: function(element, callback) { this._element = element; this._originalElement = element; this._initConfig(); if (this.filters.length !== 0) { this.applyFilters(callback); } return this; }, /** * Sets crossOrigin value (on an instance and corresponding image element) * @return {fabric.Image} thisArg * @chainable */ setCrossOrigin: function(value) { this.crossOrigin = value; this._element.crossOrigin = value; return this; }, /** * Returns original size of an image * @return {Object} Object with "width" and "height" properties */ getOriginalSize: function() { var element = this.getElement(); return { width: element.width, height: element.height }; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _stroke: function(ctx) { ctx.save(); this._setStrokeStyles(ctx); ctx.beginPath(); ctx.strokeRect(-this.width / 2, -this.height / 2, this.width, this.height); ctx.closePath(); ctx.restore(); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderDashedStroke: function(ctx) { var x = -this.width / 2, y = -this.height / 2, w = this.width, h = this.height; ctx.save(); this._setStrokeStyles(ctx); ctx.beginPath(); fabric.util.drawDashedLine(ctx, x, y, x + w, y, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x + w, y, x + w, y + h, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x + w, y + h, x, y + h, this.strokeDashArray); fabric.util.drawDashedLine(ctx, x, y + h, x, y, this.strokeDashArray); ctx.closePath(); ctx.restore(); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toObject: function(propertiesToInclude) { return extend(this.callSuper('toObject', propertiesToInclude), { src: this._originalElement.src || this._originalElement._src, filters: this.filters.map(function(filterObj) { return filterObj && filterObj.toObject(); }), crossOrigin: this.crossOrigin }); }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = [], x = -this.width / 2, y = -this.height / 2; if (this.group) { x = this.left; y = this.top; } markup.push( '<g transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '">\n', '<image xlink:href="', this.getSvgSrc(), '" x="', x, '" y="', y, '" style="', this.getSvgStyles(), // we're essentially moving origin of transformation from top/left corner to the center of the shape // by wrapping it in container <g> element with actual transformation, then offsetting object to the top/left // so that object's center aligns with container's left/top '" width="', this.width, '" height="', this.height, '" preserveAspectRatio="none"', '></image>\n' ); if (this.stroke || this.strokeDashArray) { var origFill = this.fill; this.fill = null; markup.push( '<rect ', 'x="', x, '" y="', y, '" width="', this.width, '" height="', this.height, '" style="', this.getSvgStyles(), '"/>\n' ); this.fill = origFill; } markup.push('</g>\n'); return reviver ? reviver(markup.join('')) : markup.join(''); }, /* _TO_SVG_END_ */ /** * Returns source of an image * @return {String} Source of an image */ getSrc: function() { if (this.getElement()) { return this.getElement().src || this.getElement()._src; } }, /** * Returns string representation of an instance * @return {String} String representation of an instance */ toString: function() { return '#<fabric.Image: { src: "' + this.getSrc() + '" }>'; }, /** * Returns a clone of an instance * @param {Function} callback Callback is invoked with a clone as a first argument * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output */ clone: function(callback, propertiesToInclude) { this.constructor.fromObject(this.toObject(propertiesToInclude), callback); }, /** * Applies filters assigned to this image (from "filters" array) * @mthod applyFilters * @param {Function} callback Callback is invoked when all filters have been applied and new image is generated * @return {fabric.Image} thisArg * @chainable */ applyFilters: function(callback) { if (!this._originalElement) { return; } if (this.filters.length === 0) { this._element = this._originalElement; callback && callback(); return; } var imgEl = this._originalElement, canvasEl = fabric.util.createCanvasElement(), replacement = fabric.util.createImage(), _this = this; canvasEl.width = imgEl.width; canvasEl.height = imgEl.height; canvasEl.getContext('2d').drawImage(imgEl, 0, 0, imgEl.width, imgEl.height); this.filters.forEach(function(filter) { filter && filter.applyTo(canvasEl); }); /** @ignore */ replacement.width = imgEl.width; replacement.height = imgEl.height; if (fabric.isLikelyNode) { replacement.src = canvasEl.toBuffer(undefined, fabric.Image.pngCompression); // onload doesn't fire in some node versions, so we invoke callback manually _this._element = replacement; callback && callback(); } else { replacement.onload = function() { _this._element = replacement; callback && callback(); replacement.onload = canvasEl = imgEl = null; }; replacement.src = canvasEl.toDataURL('image/png'); } return this; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx, noTransform) { this._element && ctx.drawImage( this._element, noTransform ? this.left : -this.width/2, noTransform ? this.top : -this.height/2, this.width, this.height ); this._renderStroke(ctx); }, /** * @private */ _resetWidthHeight: function() { var element = this.getElement(); this.set('width', element.width); this.set('height', element.height); }, /** * The Image class's initialization method. This method is automatically * called by the constructor. * @private * @param {HTMLImageElement|String} element The element representing the image */ _initElement: function(element) { this.setElement(fabric.util.getById(element)); fabric.util.addClass(this.getElement(), fabric.Image.CSS_CANVAS); }, /** * @private * @param {Object} [options] Options object */ _initConfig: function(options) { options || (options = { }); this.setOptions(options); this._setWidthHeight(options); if (this._element && this.crossOrigin) { this._element.crossOrigin = this.crossOrigin; } }, /** * @private * @param {Object} object Object with filters property * @param {Function} callback Callback to invoke when all fabric.Image.filters instances are created */ _initFilters: function(object, callback) { if (object.filters && object.filters.length) { fabric.util.enlivenObjects(object.filters, function(enlivenedObjects) { callback && callback(enlivenedObjects); }, 'fabric.Image.filters'); } else { callback && callback(); } }, /** * @private * @param {Object} [options] Object with width/height properties */ _setWidthHeight: function(options) { this.width = 'width' in options ? options.width : (this.getElement() ? this.getElement().width || 0 : 0); this.height = 'height' in options ? options.height : (this.getElement() ? this.getElement().height || 0 : 0); }, /** * Returns complexity of an instance * @return {Number} complexity of this instance */ complexity: function() { return 1; } }); /** * Default CSS class name for canvas * @static * @type String * @default */ fabric.Image.CSS_CANVAS = 'canvas-img'; /** * Alias for getSrc * @static */ fabric.Image.prototype.getSvgSrc = fabric.Image.prototype.getSrc; /** * Creates an instance of fabric.Image from its object representation * @static * @param {Object} object Object to create an instance from * @param {Function} [callback] Callback to invoke when an image instance is created */ fabric.Image.fromObject = function(object, callback) { fabric.util.loadImage(object.src, function(img) { fabric.Image.prototype._initFilters.call(object, object, function(filters) { object.filters = filters || [ ]; var instance = new fabric.Image(img, object); callback && callback(instance); }); }, null, object.crossOrigin); }; /** * Creates an instance of fabric.Image from an URL string * @static * @param {String} url URL to create an image from * @param {Function} [callback] Callback to invoke when image is created (newly created image is passed as a first argument) * @param {Object} [imgOptions] Options object */ fabric.Image.fromURL = function(url, callback, imgOptions) { fabric.util.loadImage(url, function(img) { callback(new fabric.Image(img, imgOptions)); }, null, imgOptions && imgOptions.crossOrigin); }; /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Image.fromElement}) * @static * @see {@link http://www.w3.org/TR/SVG/struct.html#ImageElement} */ fabric.Image.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat('x y width height xlink:href'.split(' ')); /** * Returns {@link fabric.Image} instance from an SVG element * @static * @param {SVGElement} element Element to parse * @param {Function} callback Callback to execute when fabric.Image object is created * @param {Object} [options] Options object * @return {fabric.Image} Instance of fabric.Image */ fabric.Image.fromElement = function(element, callback, options) { var parsedAttributes = fabric.parseAttributes(element, fabric.Image.ATTRIBUTE_NAMES); fabric.Image.fromURL(parsedAttributes['xlink:href'], callback, extend((options ? fabric.util.object.clone(options) : { }), parsedAttributes)); }; /* _FROM_SVG_END_ */ /** * Indicates that instances of this type are async * @static * @type Boolean * @default */ fabric.Image.async = true; /** * Indicates compression level used when generating PNG under Node (in applyFilters). Any of 0-9 * @static * @type Number * @default */ fabric.Image.pngCompression = 1; })(typeof exports !== 'undefined' ? exports : this); fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ { /** * @private * @return {Number} angle value */ _getAngleValueForStraighten: function() { var angle = this.getAngle() % 360; if (angle > 0) { return Math.round((angle - 1) / 90) * 90; } return Math.round(angle / 90) * 90; }, /** * Straightens an object (rotating it from current angle to one of 0, 90, 180, 270, etc. depending on which is closer) * @return {fabric.Object} thisArg * @chainable */ straighten: function() { this.setAngle(this._getAngleValueForStraighten()); return this; }, /** * Same as {@link fabric.Object.prototype.straighten} but with animation * @param {Object} callbacks Object with callback functions * @param {Function} [callbacks.onComplete] Invoked on completion * @param {Function} [callbacks.onChange] Invoked on every step of animation * @return {fabric.Object} thisArg * @chainable */ fxStraighten: function(callbacks) { callbacks = callbacks || { }; var empty = function() { }, onComplete = callbacks.onComplete || empty, onChange = callbacks.onChange || empty, _this = this; fabric.util.animate({ startValue: this.get('angle'), endValue: this._getAngleValueForStraighten(), duration: this.FX_DURATION, onChange: function(value) { _this.setAngle(value); onChange(); }, onComplete: function() { _this.setCoords(); onComplete(); }, onStart: function() { _this.set('active', false); } }); return this; } }); fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.StaticCanvas.prototype */ { /** * Straightens object, then rerenders canvas * @param {fabric.Object} object Object to straighten * @return {fabric.Canvas} thisArg * @chainable */ straightenObject: function (object) { object.straighten(); this.renderAll(); return this; }, /** * Same as {@link fabric.Canvas.prototype.straightenObject}, but animated * @param {fabric.Object} object Object to straighten * @return {fabric.Canvas} thisArg * @chainable */ fxStraightenObject: function (object) { object.fxStraighten({ onChange: this.renderAll.bind(this) }); return this; } }); /** * @namespace fabric.Image.filters * @memberOf fabric.Image * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#image_filters} * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} */ fabric.Image.filters = fabric.Image.filters || { }; /** * Root filter class from which all filter classes inherit from * @class fabric.Image.filters.BaseFilter * @memberOf fabric.Image.filters */ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Image.filters.BaseFilter.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'BaseFilter', /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return { type: this.type }; }, /** * Returns a JSON representation of an instance * @return {Object} JSON */ toJSON: function() { // delegate, not alias return this.toObject(); } }); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Brightness filter class * @class fabric.Image.filters.Brightness * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Brightness#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Brightness({ * brightness: 200 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Brightness = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Brightness.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Brightness', /** * Constructor * @memberOf fabric.Image.filters.Brightness.prototype * @param {Object} [options] Options object * @param {Number} [options.brightness=0] Value to brighten the image up (0..255) */ initialize: function(options) { options = options || { }; this.brightness = options.brightness || 0; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, brightness = this.brightness; for (var i = 0, len = data.length; i < len; i += 4) { data[i] += brightness; data[i + 1] += brightness; data[i + 2] += brightness; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { brightness: this.brightness }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Brightness} Instance of fabric.Image.filters.Brightness */ fabric.Image.filters.Brightness.fromObject = function(object) { return new fabric.Image.filters.Brightness(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Adapted from <a href="http://www.html5rocks.com/en/tutorials/canvas/imagefilters/">html5rocks article</a> * @class fabric.Image.filters.Convolute * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Convolute#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example <caption>Sharpen filter</caption> * var filter = new fabric.Image.filters.Convolute({ * matrix: [ 0, -1, 0, * -1, 5, -1, * 0, -1, 0 ] * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); * @example <caption>Blur filter</caption> * var filter = new fabric.Image.filters.Convolute({ * matrix: [ 1/9, 1/9, 1/9, * 1/9, 1/9, 1/9, * 1/9, 1/9, 1/9 ] * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); * @example <caption>Emboss filter</caption> * var filter = new fabric.Image.filters.Convolute({ * matrix: [ 1, 1, 1, * 1, 0.7, -1, * -1, -1, -1 ] * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); * @example <caption>Emboss filter with opaqueness</caption> * var filter = new fabric.Image.filters.Convolute({ * opaque: true, * matrix: [ 1, 1, 1, * 1, 0.7, -1, * -1, -1, -1 ] * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Convolute = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Convolute.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Convolute', /** * Constructor * @memberOf fabric.Image.filters.Convolute.prototype * @param {Object} [options] Options object * @param {Boolean} [options.opaque=false] Opaque value (true/false) * @param {Array} [options.matrix] Filter matrix */ initialize: function(options) { options = options || { }; this.opaque = options.opaque; this.matrix = options.matrix || [ 0, 0, 0, 0, 1, 0, 0, 0, 0 ]; var canvasEl = fabric.util.createCanvasElement(); this.tmpCtx = canvasEl.getContext('2d'); }, /** * @private */ _createImageData: function(w, h) { return this.tmpCtx.createImageData(w, h); }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var weights = this.matrix, context = canvasEl.getContext('2d'), pixels = context.getImageData(0, 0, canvasEl.width, canvasEl.height), side = Math.round(Math.sqrt(weights.length)), halfSide = Math.floor(side/2), src = pixels.data, sw = pixels.width, sh = pixels.height, // pad output by the convolution matrix w = sw, h = sh, output = this._createImageData(w, h), dst = output.data, // go through the destination image pixels alphaFac = this.opaque ? 1 : 0; for (var y = 0; y < h; y++) { for (var x = 0; x < w; x++) { var sy = y, sx = x, dstOff = (y * w + x) * 4, // calculate the weighed sum of the source image pixels that // fall under the convolution matrix r = 0, g = 0, b = 0, a = 0; for (var cy = 0; cy < side; cy++) { for (var cx = 0; cx < side; cx++) { var scy = sy + cy - halfSide, scx = sx + cx - halfSide; /* jshint maxdepth:5 */ if (scy < 0 || scy > sh || scx < 0 || scx > sw) { continue; } var srcOff = (scy * sw + scx) * 4, wt = weights[cy * side + cx]; r += src[srcOff] * wt; g += src[srcOff + 1] * wt; b += src[srcOff + 2] * wt; a += src[srcOff + 3] * wt; } } dst[dstOff] = r; dst[dstOff + 1] = g; dst[dstOff + 2] = b; dst[dstOff + 3] = a + alphaFac * (255 - a); } } context.putImageData(output, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { opaque: this.opaque, matrix: this.matrix }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Convolute} Instance of fabric.Image.filters.Convolute */ fabric.Image.filters.Convolute.fromObject = function(object) { return new fabric.Image.filters.Convolute(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * GradientTransparency filter class * @class fabric.Image.filters.GradientTransparency * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.GradientTransparency#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.GradientTransparency({ * threshold: 200 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.GradientTransparency = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.GradientTransparency.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'GradientTransparency', /** * Constructor * @memberOf fabric.Image.filters.GradientTransparency.prototype * @param {Object} [options] Options object * @param {Number} [options.threshold=100] Threshold value */ initialize: function(options) { options = options || { }; this.threshold = options.threshold || 100; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, threshold = this.threshold, total = data.length; for (var i = 0, len = data.length; i < len; i += 4) { data[i + 3] = threshold + 255 * (total - i) / total; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { threshold: this.threshold }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.GradientTransparency} Instance of fabric.Image.filters.GradientTransparency */ fabric.Image.filters.GradientTransparency.fromObject = function(object) { return new fabric.Image.filters.GradientTransparency(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); /** * Grayscale image filter class * @class fabric.Image.filters.Grayscale * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Grayscale(); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Grayscale = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Grayscale.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Grayscale', /** * Applies filter to canvas element * @memberOf fabric.Image.filters.Grayscale.prototype * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, len = imageData.width * imageData.height * 4, index = 0, average; while (index < len) { average = (data[index] + data[index + 1] + data[index + 2]) / 3; data[index] = average; data[index + 1] = average; data[index + 2] = average; index += 4; } context.putImageData(imageData, 0, 0); } }); /** * Returns filter instance from an object representation * @static * @return {fabric.Image.filters.Grayscale} Instance of fabric.Image.filters.Grayscale */ fabric.Image.filters.Grayscale.fromObject = function() { return new fabric.Image.filters.Grayscale(); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); /** * Invert filter class * @class fabric.Image.filters.Invert * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Invert(); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Invert = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Invert.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Invert', /** * Applies filter to canvas element * @memberOf fabric.Image.filters.Invert.prototype * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = data.length, i; for (i = 0; i < iLen; i+=4) { data[i] = 255 - data[i]; data[i + 1] = 255 - data[i + 1]; data[i + 2] = 255 - data[i + 2]; } context.putImageData(imageData, 0, 0); } }); /** * Returns filter instance from an object representation * @static * @return {fabric.Image.filters.Invert} Instance of fabric.Image.filters.Invert */ fabric.Image.filters.Invert.fromObject = function() { return new fabric.Image.filters.Invert(); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Mask filter class * See http://resources.aleph-1.com/mask/ * @class fabric.Image.filters.Mask * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Mask#initialize} for constructor definition */ fabric.Image.filters.Mask = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Mask.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Mask', /** * Constructor * @memberOf fabric.Image.filters.Mask.prototype * @param {Object} [options] Options object * @param {fabric.Image} [options.mask] Mask image object * @param {Number} [options.channel=0] Rgb channel (0, 1, 2 or 3) */ initialize: function(options) { options = options || { }; this.mask = options.mask; this.channel = [ 0, 1, 2, 3 ].indexOf(options.channel) > -1 ? options.channel : 0; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { if (!this.mask) { return; } var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, maskEl = this.mask.getElement(), maskCanvasEl = fabric.util.createCanvasElement(), channel = this.channel, i, iLen = imageData.width * imageData.height * 4; maskCanvasEl.width = maskEl.width; maskCanvasEl.height = maskEl.height; maskCanvasEl.getContext('2d').drawImage(maskEl, 0, 0, maskEl.width, maskEl.height); var maskImageData = maskCanvasEl.getContext('2d').getImageData(0, 0, maskEl.width, maskEl.height), maskData = maskImageData.data; for (i = 0; i < iLen; i += 4) { data[i + 3] = maskData[i + channel]; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { mask: this.mask.toObject(), channel: this.channel }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @param {Function} [callback] Callback to invoke when a mask filter instance is created */ fabric.Image.filters.Mask.fromObject = function(object, callback) { fabric.util.loadImage(object.mask.src, function(img) { object.mask = new fabric.Image(img, object.mask); callback && callback(new fabric.Image.filters.Mask(object)); }); }; /** * Indicates that instances of this type are async * @static * @type Boolean * @default */ fabric.Image.filters.Mask.async = true; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Noise filter class * @class fabric.Image.filters.Noise * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Noise#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Noise({ * noise: 700 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Noise = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Noise.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Noise', /** * Constructor * @memberOf fabric.Image.filters.Noise.prototype * @param {Object} [options] Options object * @param {Number} [options.noise=0] Noise value */ initialize: function(options) { options = options || { }; this.noise = options.noise || 0; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, noise = this.noise, rand; for (var i = 0, len = data.length; i < len; i += 4) { rand = (0.5 - Math.random()) * noise; data[i] += rand; data[i + 1] += rand; data[i + 2] += rand; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { noise: this.noise }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Noise} Instance of fabric.Image.filters.Noise */ fabric.Image.filters.Noise.fromObject = function(object) { return new fabric.Image.filters.Noise(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Pixelate filter class * @class fabric.Image.filters.Pixelate * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Pixelate#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Pixelate({ * blocksize: 8 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Pixelate = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Pixelate.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Pixelate', /** * Constructor * @memberOf fabric.Image.filters.Pixelate.prototype * @param {Object} [options] Options object * @param {Number} [options.blocksize=4] Blocksize for pixelate */ initialize: function(options) { options = options || { }; this.blocksize = options.blocksize || 4; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = imageData.height, jLen = imageData.width, index, i, j, r, g, b, a; for (i = 0; i < iLen; i += this.blocksize) { for (j = 0; j < jLen; j += this.blocksize) { index = (i * 4) * jLen + (j * 4); r = data[index]; g = data[index + 1]; b = data[index + 2]; a = data[index + 3]; /* blocksize: 4 [1,x,x,x,1] [x,x,x,x,1] [x,x,x,x,1] [x,x,x,x,1] [1,1,1,1,1] */ for (var _i = i, _ilen = i + this.blocksize; _i < _ilen; _i++) { for (var _j = j, _jlen = j + this.blocksize; _j < _jlen; _j++) { index = (_i * 4) * jLen + (_j * 4); data[index] = r; data[index + 1] = g; data[index + 2] = b; data[index + 3] = a; } } } } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { blocksize: this.blocksize }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Pixelate} Instance of fabric.Image.filters.Pixelate */ fabric.Image.filters.Pixelate.fromObject = function(object) { return new fabric.Image.filters.Pixelate(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Remove white filter class * @class fabric.Image.filters.RemoveWhite * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.RemoveWhite#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.RemoveWhite({ * threshold: 40, * distance: 140 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.RemoveWhite = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.RemoveWhite.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'RemoveWhite', /** * Constructor * @memberOf fabric.Image.filters.RemoveWhite.prototype * @param {Object} [options] Options object * @param {Number} [options.threshold=30] Threshold value * @param {Number} [options.distance=20] Distance value */ initialize: function(options) { options = options || { }; this.threshold = options.threshold || 30; this.distance = options.distance || 20; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, threshold = this.threshold, distance = this.distance, limit = 255 - threshold, abs = Math.abs, r, g, b; for (var i = 0, len = data.length; i < len; i += 4) { r = data[i]; g = data[i + 1]; b = data[i + 2]; if (r > limit && g > limit && b > limit && abs(r - g) < distance && abs(r - b) < distance && abs(g - b) < distance ) { data[i + 3] = 1; } } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { threshold: this.threshold, distance: this.distance }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.RemoveWhite} Instance of fabric.Image.filters.RemoveWhite */ fabric.Image.filters.RemoveWhite.fromObject = function(object) { return new fabric.Image.filters.RemoveWhite(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); /** * Sepia filter class * @class fabric.Image.filters.Sepia * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Sepia(); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Sepia = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Sepia.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Sepia', /** * Applies filter to canvas element * @memberOf fabric.Image.filters.Sepia.prototype * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = data.length, i, avg; for (i = 0; i < iLen; i+=4) { avg = 0.3 * data[i] + 0.59 * data[i + 1] + 0.11 * data[i + 2]; data[i] = avg + 100; data[i + 1] = avg + 50; data[i + 2] = avg + 255; } context.putImageData(imageData, 0, 0); } }); /** * Returns filter instance from an object representation * @static * @return {fabric.Image.filters.Sepia} Instance of fabric.Image.filters.Sepia */ fabric.Image.filters.Sepia.fromObject = function() { return new fabric.Image.filters.Sepia(); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }); /** * Sepia2 filter class * @class fabric.Image.filters.Sepia2 * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example * var filter = new fabric.Image.filters.Sepia2(); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Sepia2 = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Sepia2.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Sepia2', /** * Applies filter to canvas element * @memberOf fabric.Image.filters.Sepia.prototype * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = data.length, i, r, g, b; for (i = 0; i < iLen; i+=4) { r = data[i]; g = data[i + 1]; b = data[i + 2]; data[i] = (r * 0.393 + g * 0.769 + b * 0.189 ) / 1.351; data[i + 1] = (r * 0.349 + g * 0.686 + b * 0.168 ) / 1.203; data[i + 2] = (r * 0.272 + g * 0.534 + b * 0.131 ) / 2.140; } context.putImageData(imageData, 0, 0); } }); /** * Returns filter instance from an object representation * @static * @return {fabric.Image.filters.Sepia2} Instance of fabric.Image.filters.Sepia2 */ fabric.Image.filters.Sepia2.fromObject = function() { return new fabric.Image.filters.Sepia2(); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Tint filter class * Adapted from <a href="https://github.com/mezzoblue/PaintbrushJS">https://github.com/mezzoblue/PaintbrushJS</a> * @class fabric.Image.filters.Tint * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @see {@link fabric.Image.filters.Tint#initialize} for constructor definition * @see {@link http://fabricjs.com/image-filters/|ImageFilters demo} * @example <caption>Tint filter with hex color and opacity</caption> * var filter = new fabric.Image.filters.Tint({ * color: '#3513B0', * opacity: 0.5 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); * @example <caption>Tint filter with rgba color</caption> * var filter = new fabric.Image.filters.Tint({ * color: 'rgba(53, 21, 176, 0.5)' * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Tint = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Tint.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Tint', /** * Constructor * @memberOf fabric.Image.filters.Tint.prototype * @param {Object} [options] Options object * @param {String} [options.color=#000000] Color to tint the image with * @param {Number} [options.opacity] Opacity value that controls the tint effect's transparency (0..1) */ initialize: function(options) { options = options || { }; this.color = options.color || '#000000'; this.opacity = typeof options.opacity !== 'undefined' ? options.opacity : new fabric.Color(this.color).getAlpha(); }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = data.length, i, tintR, tintG, tintB, r, g, b, alpha1, source; source = new fabric.Color(this.color).getSource(); tintR = source[0] * this.opacity; tintG = source[1] * this.opacity; tintB = source[2] * this.opacity; alpha1 = 1 - this.opacity; for (i = 0; i < iLen; i+=4) { r = data[i]; g = data[i + 1]; b = data[i + 2]; // alpha compositing data[i] = tintR + r * alpha1; data[i + 1] = tintG + g * alpha1; data[i + 2] = tintB + b * alpha1; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { color: this.color, opacity: this.opacity }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Tint} Instance of fabric.Image.filters.Tint */ fabric.Image.filters.Tint.fromObject = function(object) { return new fabric.Image.filters.Tint(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend; /** * Multiply filter class * Adapted from <a href="http://www.laurenscorijn.com/articles/colormath-basics">http://www.laurenscorijn.com/articles/colormath-basics</a> * @class fabric.Image.filters.Multiply * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @example <caption>Multiply filter with hex color</caption> * var filter = new fabric.Image.filters.Multiply({ * color: '#F0F' * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); * @example <caption>Multiply filter with rgb color</caption> * var filter = new fabric.Image.filters.Multiply({ * color: 'rgb(53, 21, 176)' * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Multiply = fabric.util.createClass(fabric.Image.filters.BaseFilter, /** @lends fabric.Image.filters.Multiply.prototype */ { /** * Filter type * @param {String} type * @default */ type: 'Multiply', /** * Constructor * @memberOf fabric.Image.filters.Multiply.prototype * @param {Object} [options] Options object * @param {String} [options.color=#000000] Color to multiply the image pixels with */ initialize: function(options) { options = options || { }; this.color = options.color || '#000000'; }, /** * Applies filter to canvas element * @param {Object} canvasEl Canvas element to apply filter to */ applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, iLen = data.length, i, source; source = new fabric.Color(this.color).getSource(); for (i = 0; i < iLen; i+=4) { data[i] *= source[0] / 255; data[i + 1] *= source[1] / 255; data[i + 2] *= source[2] / 255; } context.putImageData(imageData, 0, 0); }, /** * Returns object representation of an instance * @return {Object} Object representation of an instance */ toObject: function() { return extend(this.callSuper('toObject'), { color: this.color }); } }); /** * Returns filter instance from an object representation * @static * @param {Object} object Object to create an instance from * @return {fabric.Image.filters.Multiply} Instance of fabric.Image.filters.Multiply */ fabric.Image.filters.Multiply.fromObject = function(object) { return new fabric.Image.filters.Multiply(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global){ 'use strict'; var fabric = global.fabric; /** * Color Blend filter class * @class fabric.Image.filter.Blend * @memberOf fabric.Image.filters * @extends fabric.Image.filters.BaseFilter * @example * var filter = new fabric.Image.filters.Blend({ * color: '#000', * mode: 'multiply' * }); * * var filter = new fabric.Image.filters.Blend({ * image: fabricImageObject, * mode: 'multiply', * alpha: 0.5 * }); * object.filters.push(filter); * object.applyFilters(canvas.renderAll.bind(canvas)); */ fabric.Image.filters.Blend = fabric.util.createClass({ type: 'Blend', initialize: function(options){ options = options || {}; this.color = options.color || '#000'; this.image = options.image || false; this.mode = options.mode || 'multiply'; this.alpha = options.alpha || 1; }, applyTo: function(canvasEl) { var context = canvasEl.getContext('2d'), imageData = context.getImageData(0, 0, canvasEl.width, canvasEl.height), data = imageData.data, tr, tg, tb, r, g, b, source, isImage = false; if (this.image) { // Blend images isImage = true; var _el = fabric.util.createCanvasElement(); _el.width = this.image.width; _el.height = this.image.height; var tmpCanvas = new fabric.StaticCanvas(_el); tmpCanvas.add(this.image); var context2 = tmpCanvas.getContext('2d'); source = context2.getImageData(0, 0, tmpCanvas.width, tmpCanvas.height).data; } else { // Blend color source = new fabric.Color(this.color).getSource(); tr = source[0] * this.alpha; tg = source[1] * this.alpha; tb = source[2] * this.alpha; } for (var i = 0, len = data.length; i < len; i += 4) { r = data[i]; g = data[i + 1]; b = data[i + 2]; if (isImage) { tr = source[i] * this.alpha; tg = source[i + 1] * this.alpha; tb = source[i + 2] * this.alpha; } switch (this.mode) { case 'multiply': data[i] = r * tr / 255; data[i + 1] = g * tg / 255; data[i + 2] = b * tb / 255; break; case 'screen': data[i] = 1 - (1 - r) * (1 - tr); data[i + 1] = 1 - (1 - g) * (1 - tg); data[i + 2] = 1 - (1 - b) * (1 - tb); break; case 'add': data[i] = Math.min(255, r + tr); data[i + 1] = Math.min(255, g + tg); data[i + 2] = Math.min(255, b + tb); break; case 'diff': case 'difference': data[i] = Math.abs(r - tr); data[i + 1] = Math.abs(g - tg); data[i + 2] = Math.abs(b - tb); break; case 'subtract': var _r = r-tr; var _g = g-tg; var _b = b-tb; data[i] = (_r < 0) ? 0 : _r; data[i + 1] = (_g < 0) ? 0 : _g; data[i + 2] = (_b < 0) ? 0 : _b; break; case 'darken': data[i] = Math.min(r, tr); data[i + 1] = Math.min(g, tg); data[i + 2] = Math.min(b, tb); break; case 'lighten': data[i] = Math.max(r, tr); data[i + 1] = Math.max(g, tg); data[i + 2] = Math.max(b, tb); break; } } context.putImageData(imageData, 0, 0); } }); fabric.Image.filters.Blend.fromObject = function(object) { return new fabric.Image.filters.Blend(object); }; })(typeof exports !== 'undefined' ? exports : this); (function(global) { 'use strict'; var fabric = global.fabric || (global.fabric = { }), extend = fabric.util.object.extend, clone = fabric.util.object.clone, toFixed = fabric.util.toFixed, supportsLineDash = fabric.StaticCanvas.supports('setLineDash'); if (fabric.Text) { fabric.warn('fabric.Text is already defined'); return; } var stateProperties = fabric.Object.prototype.stateProperties.concat(); stateProperties.push( 'fontFamily', 'fontWeight', 'fontSize', 'text', 'textDecoration', 'textAlign', 'fontStyle', 'lineHeight', 'textBackgroundColor', 'useNative', 'path' ); /** * Text class * @class fabric.Text * @extends fabric.Object * @return {fabric.Text} thisArg * @tutorial {@link http://fabricjs.com/fabric-intro-part-2/#text} * @see {@link fabric.Text#initialize} for constructor definition */ fabric.Text = fabric.util.createClass(fabric.Object, /** @lends fabric.Text.prototype */ { /** * Properties which when set cause object to change dimensions * @type Object * @private */ _dimensionAffectingProps: { fontSize: true, fontWeight: true, fontFamily: true, textDecoration: true, fontStyle: true, lineHeight: true, stroke: true, strokeWidth: true, text: true }, /** * @private */ _reNewline: /\r?\n/, /** * Retrieves object's fontSize * @method getFontSize * @memberOf fabric.Text.prototype * @return {String} Font size (in pixels) */ /** * Sets object's fontSize * @method setFontSize * @memberOf fabric.Text.prototype * @param {Number} fontSize Font size (in pixels) * @return {fabric.Text} * @chainable */ /** * Retrieves object's fontWeight * @method getFontWeight * @memberOf fabric.Text.prototype * @return {(String|Number)} Font weight */ /** * Sets object's fontWeight * @method setFontWeight * @memberOf fabric.Text.prototype * @param {(Number|String)} fontWeight Font weight * @return {fabric.Text} * @chainable */ /** * Retrieves object's fontFamily * @method getFontFamily * @memberOf fabric.Text.prototype * @return {String} Font family */ /** * Sets object's fontFamily * @method setFontFamily * @memberOf fabric.Text.prototype * @param {String} fontFamily Font family * @return {fabric.Text} * @chainable */ /** * Retrieves object's text * @method getText * @memberOf fabric.Text.prototype * @return {String} text */ /** * Sets object's text * @method setText * @memberOf fabric.Text.prototype * @param {String} text Text * @return {fabric.Text} * @chainable */ /** * Retrieves object's textDecoration * @method getTextDecoration * @memberOf fabric.Text.prototype * @return {String} Text decoration */ /** * Sets object's textDecoration * @method setTextDecoration * @memberOf fabric.Text.prototype * @param {String} textDecoration Text decoration * @return {fabric.Text} * @chainable */ /** * Retrieves object's fontStyle * @method getFontStyle * @memberOf fabric.Text.prototype * @return {String} Font style */ /** * Sets object's fontStyle * @method setFontStyle * @memberOf fabric.Text.prototype * @param {String} fontStyle Font style * @return {fabric.Text} * @chainable */ /** * Retrieves object's lineHeight * @method getLineHeight * @memberOf fabric.Text.prototype * @return {Number} Line height */ /** * Sets object's lineHeight * @method setLineHeight * @memberOf fabric.Text.prototype * @param {Number} lineHeight Line height * @return {fabric.Text} * @chainable */ /** * Retrieves object's textAlign * @method getTextAlign * @memberOf fabric.Text.prototype * @return {String} Text alignment */ /** * Sets object's textAlign * @method setTextAlign * @memberOf fabric.Text.prototype * @param {String} textAlign Text alignment * @return {fabric.Text} * @chainable */ /** * Retrieves object's textBackgroundColor * @method getTextBackgroundColor * @memberOf fabric.Text.prototype * @return {String} Text background color */ /** * Sets object's textBackgroundColor * @method setTextBackgroundColor * @memberOf fabric.Text.prototype * @param {String} textBackgroundColor Text background color * @return {fabric.Text} * @chainable */ /** * Type of an object * @type String * @default */ type: 'text', /** * Font size (in pixels) * @type Number * @default */ fontSize: 40, /** * Font weight (e.g. bold, normal, 400, 600, 800) * @type {(Number|String)} * @default */ fontWeight: 'normal', /** * Font family * @type String * @default */ fontFamily: 'Times New Roman', /** * Text decoration Possible values: "", "underline", "overline" or "line-through". * @type String * @default */ textDecoration: '', /** * Text alignment. Possible values: "left", "center", or "right". * @type String * @default */ textAlign: 'left', /** * Font style . Possible values: "", "normal", "italic" or "oblique". * @type String * @default */ fontStyle: '', /** * Line height * @type Number * @default */ lineHeight: 1.3, /** * Background color of text lines * @type String * @default */ textBackgroundColor: '', /** * URL of a font file, when using Cufon * @type String | null * @default */ path: null, /** * Indicates whether canvas native text methods should be used to render text (otherwise, Cufon is used) * @type Boolean * @default */ useNative: true, /** * List of properties to consider when checking if * state of an object is changed ({@link fabric.Object#hasStateChanged}) * as well as for history (undo/redo) purposes * @type Array */ stateProperties: stateProperties, /** * When defined, an object is rendered via stroke and this property specifies its color. * <b>Backwards incompatibility note:</b> This property was named "strokeStyle" until v1.1.6 * @type String * @default */ stroke: null, /** * Shadow object representing shadow of this shape. * <b>Backwards incompatibility note:</b> This property was named "textShadow" (String) until v1.2.11 * @type fabric.Shadow * @default */ shadow: null, /** * Constructor * @param {String} text Text string * @param {Object} [options] Options object * @return {fabric.Text} thisArg */ initialize: function(text, options) { options = options || { }; this.text = text; this.__skipDimension = true; this.setOptions(options); this.__skipDimension = false; this._initDimensions(); }, /** * Renders text object on offscreen canvas, so that it would get dimensions * @private */ _initDimensions: function() { if (this.__skipDimension) { return; } var canvasEl = fabric.util.createCanvasElement(); this._render(canvasEl.getContext('2d')); }, /** * Returns string representation of an instance * @return {String} String representation of text object */ toString: function() { return '#<fabric.Text (' + this.complexity() + '): { "text": "' + this.text + '", "fontFamily": "' + this.fontFamily + '" }>'; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { if (typeof Cufon === 'undefined' || this.useNative === true) { this._renderViaNative(ctx); } else { this._renderViaCufon(ctx); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderViaNative: function(ctx) { var textLines = this.text.split(this._reNewline); this._setTextStyles(ctx); this.width = this._getTextWidth(ctx, textLines); this.height = this._getTextHeight(ctx, textLines); this.clipTo && fabric.util.clipContext(this, ctx); this._renderTextBackground(ctx, textLines); this._translateForTextAlign(ctx); this._renderText(ctx, textLines); if (this.textAlign !== 'left' && this.textAlign !== 'justify') { ctx.restore(); } this._renderTextDecoration(ctx, textLines); this.clipTo && ctx.restore(); this._setBoundaries(ctx, textLines); this._totalLineHeight = 0; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderText: function(ctx, textLines) { ctx.save(); this._setShadow(ctx); this._setupFillRule(ctx); this._renderTextFill(ctx, textLines); this._renderTextStroke(ctx, textLines); this._restoreFillRule(ctx); this._removeShadow(ctx); ctx.restore(); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _translateForTextAlign: function(ctx) { if (this.textAlign !== 'left' && this.textAlign !== 'justify') { ctx.save(); ctx.translate(this.textAlign === 'center' ? (this.width / 2) : this.width, 0); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _setBoundaries: function(ctx, textLines) { this._boundaries = [ ]; for (var i = 0, len = textLines.length; i < len; i++) { var lineWidth = this._getLineWidth(ctx, textLines[i]), lineLeftOffset = this._getLineLeftOffset(lineWidth); this._boundaries.push({ height: this.fontSize * this.lineHeight, width: lineWidth, left: lineLeftOffset }); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _setTextStyles: function(ctx) { this._setFillStyles(ctx); this._setStrokeStyles(ctx); ctx.textBaseline = 'alphabetic'; if (!this.skipTextAlign) { ctx.textAlign = this.textAlign; } ctx.font = this._getFontDeclaration(); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines * @return {Number} Height of fabric.Text object */ _getTextHeight: function(ctx, textLines) { return this.fontSize * textLines.length * this.lineHeight; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines * @return {Number} Maximum width of fabric.Text object */ _getTextWidth: function(ctx, textLines) { var maxWidth = ctx.measureText(textLines[0] || '|').width; for (var i = 1, len = textLines.length; i < len; i++) { var currentLineWidth = ctx.measureText(textLines[i]).width; if (currentLineWidth > maxWidth) { maxWidth = currentLineWidth; } } return maxWidth; }, /** * @private * @param {String} method Method name ("fillText" or "strokeText") * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} chars Chars to render * @param {Number} left Left position of text * @param {Number} top Top position of text */ _renderChars: function(method, ctx, chars, left, top) { ctx[method](chars, left, top); }, /** * @private * @param {String} method Method name ("fillText" or "strokeText") * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} line Text to render * @param {Number} left Left position of text * @param {Number} top Top position of text * @param {Number} lineIndex Index of a line in a text */ _renderTextLine: function(method, ctx, line, left, top, lineIndex) { // lift the line by quarter of fontSize top -= this.fontSize / 4; // short-circuit if (this.textAlign !== 'justify') { this._renderChars(method, ctx, line, left, top, lineIndex); return; } var lineWidth = ctx.measureText(line).width, totalWidth = this.width; if (totalWidth > lineWidth) { // stretch the line var words = line.split(/\s+/), wordsWidth = ctx.measureText(line.replace(/\s+/g, '')).width, widthDiff = totalWidth - wordsWidth, numSpaces = words.length - 1, spaceWidth = widthDiff / numSpaces, leftOffset = 0; for (var i = 0, len = words.length; i < len; i++) { this._renderChars(method, ctx, words[i], left + leftOffset, top, lineIndex); leftOffset += ctx.measureText(words[i]).width + spaceWidth; } } else { this._renderChars(method, ctx, line, left, top, lineIndex); } }, /** * @private * @return {Number} Left offset */ _getLeftOffset: function() { if (fabric.isLikelyNode) { return 0; } return -this.width / 2; }, /** * @private * @return {Number} Top offset */ _getTopOffset: function() { return -this.height / 2; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextFill: function(ctx, textLines) { if (!this.fill && !this._skipFillStrokeCheck) { return; } this._boundaries = [ ]; var lineHeights = 0; for (var i = 0, len = textLines.length; i < len; i++) { var heightOfLine = this._getHeightOfLine(ctx, i, textLines); lineHeights += heightOfLine; this._renderTextLine( 'fillText', ctx, textLines[i], this._getLeftOffset(), this._getTopOffset() + lineHeights, i ); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextStroke: function(ctx, textLines) { if ((!this.stroke || this.strokeWidth === 0) && !this._skipFillStrokeCheck) { return; } var lineHeights = 0; ctx.save(); if (this.strokeDashArray) { // Spec requires the concatenation of two copies the dash list when the number of elements is odd if (1 & this.strokeDashArray.length) { this.strokeDashArray.push.apply(this.strokeDashArray, this.strokeDashArray); } supportsLineDash && ctx.setLineDash(this.strokeDashArray); } ctx.beginPath(); for (var i = 0, len = textLines.length; i < len; i++) { var heightOfLine = this._getHeightOfLine(ctx, i, textLines); lineHeights += heightOfLine; this._renderTextLine( 'strokeText', ctx, textLines[i], this._getLeftOffset(), this._getTopOffset() + lineHeights, i ); } ctx.closePath(); ctx.restore(); }, _getHeightOfLine: function() { return this.fontSize * this.lineHeight; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextBackground: function(ctx, textLines) { this._renderTextBoxBackground(ctx); this._renderTextLinesBackground(ctx, textLines); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderTextBoxBackground: function(ctx) { if (!this.backgroundColor) { return; } ctx.save(); ctx.fillStyle = this.backgroundColor; ctx.fillRect( this._getLeftOffset(), this._getTopOffset(), this.width, this.height ); ctx.restore(); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextLinesBackground: function(ctx, textLines) { if (!this.textBackgroundColor) { return; } ctx.save(); ctx.fillStyle = this.textBackgroundColor; for (var i = 0, len = textLines.length; i < len; i++) { if (textLines[i] !== '') { var lineWidth = this._getLineWidth(ctx, textLines[i]), lineLeftOffset = this._getLineLeftOffset(lineWidth); ctx.fillRect( this._getLeftOffset() + lineLeftOffset, this._getTopOffset() + (i * this.fontSize * this.lineHeight), lineWidth, this.fontSize * this.lineHeight ); } } ctx.restore(); }, /** * @private * @param {Number} lineWidth Width of text line * @return {Number} Line left offset */ _getLineLeftOffset: function(lineWidth) { if (this.textAlign === 'center') { return (this.width - lineWidth) / 2; } if (this.textAlign === 'right') { return this.width - lineWidth; } return 0; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} line Text line * @return {Number} Line width */ _getLineWidth: function(ctx, line) { return this.textAlign === 'justify' ? this.width : ctx.measureText(line).width; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextDecoration: function(ctx, textLines) { if (!this.textDecoration) { return; } // var halfOfVerticalBox = this.originY === 'top' ? 0 : this._getTextHeight(ctx, textLines) / 2; var halfOfVerticalBox = this._getTextHeight(ctx, textLines) / 2, _this = this; /** @ignore */ function renderLinesAtOffset(offset) { for (var i = 0, len = textLines.length; i < len; i++) { var lineWidth = _this._getLineWidth(ctx, textLines[i]), lineLeftOffset = _this._getLineLeftOffset(lineWidth); ctx.fillRect( _this._getLeftOffset() + lineLeftOffset, ~~((offset + (i * _this._getHeightOfLine(ctx, i, textLines))) - halfOfVerticalBox), lineWidth, 1); } } if (this.textDecoration.indexOf('underline') > -1) { renderLinesAtOffset(this.fontSize * this.lineHeight); } if (this.textDecoration.indexOf('line-through') > -1) { renderLinesAtOffset(this.fontSize * this.lineHeight - this.fontSize / 2); } if (this.textDecoration.indexOf('overline') > -1) { renderLinesAtOffset(this.fontSize * this.lineHeight - this.fontSize); } }, /** * @private */ _getFontDeclaration: function() { return [ // node-canvas needs "weight style", while browsers need "style weight" (fabric.isLikelyNode ? this.fontWeight : this.fontStyle), (fabric.isLikelyNode ? this.fontStyle : this.fontWeight), this.fontSize + 'px', (fabric.isLikelyNode ? ('"' + this.fontFamily + '"') : this.fontFamily) ].join(' '); }, /** * Renders text instance on a specified context * @param {CanvasRenderingContext2D} ctx Context to render on */ render: function(ctx, noTransform) { // do not render if object is not visible if (!this.visible) { return; } ctx.save(); this._transform(ctx, noTransform); var m = this.transformMatrix, isInPathGroup = this.group && this.group.type === 'path-group'; if (isInPathGroup) { ctx.translate(-this.group.width/2, -this.group.height/2); } if (m) { ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); } if (isInPathGroup) { ctx.translate(this.left, this.top); } this._render(ctx); ctx.restore(); }, /** * Returns object representation of an instance * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} Object representation of an instance */ toObject: function(propertiesToInclude) { var object = extend(this.callSuper('toObject', propertiesToInclude), { text: this.text, fontSize: this.fontSize, fontWeight: this.fontWeight, fontFamily: this.fontFamily, fontStyle: this.fontStyle, lineHeight: this.lineHeight, textDecoration: this.textDecoration, textAlign: this.textAlign, path: this.path, textBackgroundColor: this.textBackgroundColor, useNative: this.useNative }); if (!this.includeDefaultValues) { this._removeDefaultValues(object); } return object; }, /* _TO_SVG_START_ */ /** * Returns SVG representation of an instance * @param {Function} [reviver] Method for further parsing of svg representation. * @return {String} svg representation of an instance */ toSVG: function(reviver) { var markup = [ ], textLines = this.text.split(this._reNewline), offsets = this._getSVGLeftTopOffsets(textLines), textAndBg = this._getSVGTextAndBg(offsets.lineTop, offsets.textLeft, textLines), shadowSpans = this._getSVGShadows(offsets.lineTop, textLines); // move top offset by an ascent offsets.textTop += (this._fontAscent ? ((this._fontAscent / 5) * this.lineHeight) : 0); this._wrapSVGTextAndBg(markup, textAndBg, shadowSpans, offsets); return reviver ? reviver(markup.join('')) : markup.join(''); }, /** * @private */ _getSVGLeftTopOffsets: function(textLines) { var lineTop = this.useNative ? this.fontSize * this.lineHeight : (-this._fontAscent - ((this._fontAscent / 5) * this.lineHeight)), textLeft = -(this.width/2), textTop = this.useNative ? this.fontSize - 1 : (this.height/2) - (textLines.length * this.fontSize) - this._totalLineHeight; return { textLeft: textLeft + (this.group ? this.left : 0), textTop: textTop + (this.group ? this.top : 0), lineTop: lineTop }; }, /** * @private */ _wrapSVGTextAndBg: function(markup, textAndBg, shadowSpans, offsets) { markup.push( '<g transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '">\n', textAndBg.textBgRects.join(''), '<text ', (this.fontFamily ? 'font-family="' + this.fontFamily.replace(/"/g,'\'') + '" ': ''), (this.fontSize ? 'font-size="' + this.fontSize + '" ': ''), (this.fontStyle ? 'font-style="' + this.fontStyle + '" ': ''), (this.fontWeight ? 'font-weight="' + this.fontWeight + '" ': ''), (this.textDecoration ? 'text-decoration="' + this.textDecoration + '" ': ''), 'style="', this.getSvgStyles(), '" ', /* svg starts from left/bottom corner so we normalize height */ 'transform="translate(', toFixed(offsets.textLeft, 2), ' ', toFixed(offsets.textTop, 2), ')">', shadowSpans.join(''), textAndBg.textSpans.join(''), '</text>\n', '</g>\n' ); }, /** * @private * @param {Number} lineHeight * @param {Array} textLines Array of all text lines * @return {Array} */ _getSVGShadows: function(lineHeight, textLines) { var shadowSpans = [], i, len, lineTopOffsetMultiplier = 1; if (!this.shadow || !this._boundaries) { return shadowSpans; } for (i = 0, len = textLines.length; i < len; i++) { if (textLines[i] !== '') { var lineLeftOffset = (this._boundaries && this._boundaries[i]) ? this._boundaries[i].left : 0; shadowSpans.push( '<tspan x="', toFixed((lineLeftOffset + lineTopOffsetMultiplier) + this.shadow.offsetX, 2), ((i === 0 || this.useNative) ? '" y' : '" dy'), '="', toFixed(this.useNative ? ((lineHeight * i) - this.height / 2 + this.shadow.offsetY) : (lineHeight + (i === 0 ? this.shadow.offsetY : 0)), 2), '" ', this._getFillAttributes(this.shadow.color), '>', fabric.util.string.escapeXml(textLines[i]), '</tspan>'); lineTopOffsetMultiplier = 1; } else { // in some environments (e.g. IE 7 & 8) empty tspans are completely ignored, using a lineTopOffsetMultiplier // prevents empty tspans lineTopOffsetMultiplier++; } } return shadowSpans; }, /** * @private * @param {Number} lineHeight * @param {Number} textLeftOffset Text left offset * @param {Array} textLines Array of all text lines * @return {Object} */ _getSVGTextAndBg: function(lineHeight, textLeftOffset, textLines) { var textSpans = [ ], textBgRects = [ ], lineTopOffsetMultiplier = 1; // bounding-box background this._setSVGBg(textBgRects); // text and text-background for (var i = 0, len = textLines.length; i < len; i++) { if (textLines[i] !== '') { this._setSVGTextLineText(textLines[i], i, textSpans, lineHeight, lineTopOffsetMultiplier, textBgRects); lineTopOffsetMultiplier = 1; } else { // in some environments (e.g. IE 7 & 8) empty tspans are completely ignored, using a lineTopOffsetMultiplier // prevents empty tspans lineTopOffsetMultiplier++; } if (!this.textBackgroundColor || !this._boundaries) { continue; } this._setSVGTextLineBg(textBgRects, i, textLeftOffset, lineHeight); } return { textSpans: textSpans, textBgRects: textBgRects }; }, _setSVGTextLineText: function(textLine, i, textSpans, lineHeight, lineTopOffsetMultiplier) { var lineLeftOffset = (this._boundaries && this._boundaries[i]) ? toFixed(this._boundaries[i].left, 2) : 0; textSpans.push( '<tspan x="', lineLeftOffset, '" ', (i === 0 || this.useNative ? 'y' : 'dy'), '="', toFixed(this.useNative ? ((lineHeight * i) - this.height / 2) : (lineHeight * lineTopOffsetMultiplier), 2), '" ', // doing this on <tspan> elements since setting opacity // on containing <text> one doesn't work in Illustrator this._getFillAttributes(this.fill), '>', fabric.util.string.escapeXml(textLine), '</tspan>' ); }, _setSVGTextLineBg: function(textBgRects, i, textLeftOffset, lineHeight) { textBgRects.push( '<rect ', this._getFillAttributes(this.textBackgroundColor), ' x="', toFixed(textLeftOffset + this._boundaries[i].left, 2), '" y="', /* an offset that seems to straighten things out */ toFixed((lineHeight * i) - this.height / 2, 2), '" width="', toFixed(this._boundaries[i].width, 2), '" height="', toFixed(this._boundaries[i].height, 2), '"></rect>\n'); }, _setSVGBg: function(textBgRects) { if (this.backgroundColor && this._boundaries) { textBgRects.push( '<rect ', this._getFillAttributes(this.backgroundColor), ' x="', toFixed(-this.width / 2, 2), '" y="', toFixed(-this.height / 2, 2), '" width="', toFixed(this.width, 2), '" height="', toFixed(this.height, 2), '"></rect>'); } }, /** * Adobe Illustrator (at least CS5) is unable to render rgba()-based fill values * we work around it by "moving" alpha channel into opacity attribute and setting fill's alpha to 1 * * @private * @param {Any} value * @return {String} */ _getFillAttributes: function(value) { var fillColor = (value && typeof value === 'string') ? new fabric.Color(value) : ''; if (!fillColor || !fillColor.getSource() || fillColor.getAlpha() === 1) { return 'fill="' + value + '"'; } return 'opacity="' + fillColor.getAlpha() + '" fill="' + fillColor.setAlpha(1).toRgb() + '"'; }, /* _TO_SVG_END_ */ /** * Sets specified property to a specified value * @param {String} key * @param {Any} value * @return {fabric.Text} thisArg * @chainable */ _set: function(key, value) { if (key === 'fontFamily' && this.path) { this.path = this.path.replace(/(.*?)([^\/]*)(\.font\.js)/, '$1' + value + '$3'); } this.callSuper('_set', key, value); if (key in this._dimensionAffectingProps) { this._initDimensions(); this.setCoords(); } }, /** * Returns complexity of an instance * @return {Number} complexity */ complexity: function() { return 1; } }); /* _FROM_SVG_START_ */ /** * List of attribute names to account for when parsing SVG element (used by {@link fabric.Text.fromElement}) * @static * @memberOf fabric.Text * @see: http://www.w3.org/TR/SVG/text.html#TextElement */ fabric.Text.ATTRIBUTE_NAMES = fabric.SHARED_ATTRIBUTES.concat( 'x y dx dy font-family font-style font-weight font-size text-decoration text-anchor'.split(' ')); /** * Default SVG font size * @static * @memberOf fabric.Text */ fabric.Text.DEFAULT_SVG_FONT_SIZE = 16; /** * Returns fabric.Text instance from an SVG element (<b>not yet implemented</b>) * @static * @memberOf fabric.Text * @param {SVGElement} element Element to parse * @param {Object} [options] Options object * @return {fabric.Text} Instance of fabric.Text */ fabric.Text.fromElement = function(element, options) { if (!element) { return null; } var parsedAttributes = fabric.parseAttributes(element, fabric.Text.ATTRIBUTE_NAMES); options = fabric.util.object.extend((options ? fabric.util.object.clone(options) : { }), parsedAttributes); if ('dx' in parsedAttributes) { options.left += parsedAttributes.dx; } if ('dy' in parsedAttributes) { options.top += parsedAttributes.dy; } if (!('fontSize' in options)) { options.fontSize = fabric.Text.DEFAULT_SVG_FONT_SIZE; } if (!options.originX) { options.originX = 'left'; } var text = new fabric.Text(element.textContent, options), /* Adjust positioning: x/y attributes in SVG correspond to the bottom-left corner of text bounding box top/left properties in Fabric correspond to center point of text bounding box */ offX = 0; if (text.originX === 'left') { offX = text.getWidth() / 2; } if (text.originX === 'right') { offX = -text.getWidth() / 2; } text.set({ left: text.getLeft() + offX, top: text.getTop() - text.getHeight() / 2 }); return text; }; /* _FROM_SVG_END_ */ /** * Returns fabric.Text instance from an object representation * @static * @memberOf fabric.Text * @param {Object} object Object to create an instance from * @return {fabric.Text} Instance of fabric.Text */ fabric.Text.fromObject = function(object) { return new fabric.Text(object.text, clone(object)); }; fabric.util.createAccessors(fabric.Text); })(typeof exports !== 'undefined' ? exports : this); (function() { var clone = fabric.util.object.clone; /** * IText class (introduced in <b>v1.4</b>) Events are also fired with "text:" * prefix when observing canvas. * @class fabric.IText * @extends fabric.Text * @mixes fabric.Observable * * @fires changed * @fires selection:changed * @fires editing:entered * @fires editing:exited * * @return {fabric.IText} thisArg * @see {@link fabric.IText#initialize} for constructor definition * * <p>Supported key combinations:</p> * <pre> * Move cursor: left, right, up, down * Select character: shift + left, shift + right * Select text vertically: shift + up, shift + down * Move cursor by word: alt + left, alt + right * Select words: shift + alt + left, shift + alt + right * Move cursor to line start/end: cmd + left, cmd + right * Select till start/end of line: cmd + shift + left, cmd + shift + right * Jump to start/end of text: cmd + up, cmd + down * Select till start/end of text: cmd + shift + up, cmd + shift + down * Delete character: backspace * Delete word: alt + backspace * Delete line: cmd + backspace * Forward delete: delete * Copy text: ctrl/cmd + c * Paste text: ctrl/cmd + v * Cut text: ctrl/cmd + x * Select entire text: ctrl/cmd + a * </pre> * * <p>Supported mouse/touch combination</p> * <pre> * Position cursor: click/touch * Create selection: click/touch & drag * Create selection: click & shift + click * Select word: double click * Select line: triple click * </pre> */ fabric.IText = fabric.util.createClass(fabric.Text, fabric.Observable, /** @lends fabric.IText.prototype */ { /** * Type of an object * @type String * @default */ type: 'i-text', /** * Index where text selection starts (or where cursor is when there is no selection) * @type Nubmer * @default */ selectionStart: 0, /** * Index where text selection ends * @type Nubmer * @default */ selectionEnd: 0, /** * Color of text selection * @type String * @default */ selectionColor: 'rgba(17,119,255,0.3)', /** * Indicates whether text is in editing mode * @type Boolean * @default */ isEditing: false, /** * Indicates whether a text can be edited * @type Boolean * @default */ editable: true, /** * Border color of text object while it's in editing mode * @type String * @default */ editingBorderColor: 'rgba(102,153,255,0.25)', /** * Width of cursor (in px) * @type Number * @default */ cursorWidth: 2, /** * Color of default cursor (when not overwritten by character style) * @type String * @default */ cursorColor: '#333', /** * Delay between cursor blink (in ms) * @type Number * @default */ cursorDelay: 1000, /** * Duration of cursor fadein (in ms) * @type Number * @default */ cursorDuration: 600, /** * Object containing character styles * (where top-level properties corresponds to line number and 2nd-level properties -- to char number in a line) * @type Object * @default */ styles: null, /** * Indicates whether internal text char widths can be cached * @type Boolean * @default */ caching: true, /** * @private * @type Boolean * @default */ _skipFillStrokeCheck: true, /** * @private */ _reSpace: /\s|\n/, /** * @private */ _fontSizeFraction: 4, /** * @private */ _currentCursorOpacity: 0, /** * @private */ _selectionDirection: null, /** * @private */ _abortCursorAnimation: false, /** * @private */ _charWidthsCache: { }, /** * Constructor * @param {String} text Text string * @param {Object} [options] Options object * @return {fabric.IText} thisArg */ initialize: function(text, options) { this.styles = options ? (options.styles || { }) : { }; this.callSuper('initialize', text, options); this.initBehavior(); fabric.IText.instances.push(this); // caching this.__lineWidths = { }; this.__lineHeights = { }; this.__lineOffsets = { }; }, /** * Returns true if object has no styling */ isEmptyStyles: function() { if (!this.styles) { return true; } var obj = this.styles; for (var p1 in obj) { for (var p2 in obj[p1]) { /*jshint unused:false */ for (var p3 in obj[p1][p2]) { return false; } } } return true; }, /** * Sets selection start (left boundary of a selection) * @param {Number} index Index to set selection start to */ setSelectionStart: function(index) { if (this.selectionStart !== index) { this.fire('selection:changed'); this.canvas && this.canvas.fire('text:selection:changed', { target: this }); } this.selectionStart = index; this.hiddenTextarea && (this.hiddenTextarea.selectionStart = index); }, /** * Sets selection end (right boundary of a selection) * @param {Number} index Index to set selection end to */ setSelectionEnd: function(index) { if (this.selectionEnd !== index) { this.fire('selection:changed'); this.canvas && this.canvas.fire('text:selection:changed', { target: this }); } this.selectionEnd = index; this.hiddenTextarea && (this.hiddenTextarea.selectionEnd = index); }, /** * Gets style of a current selection/cursor (at the start position) * @param {Number} [startIndex] Start index to get styles at * @param {Number} [endIndex] End index to get styles at * @return {Object} styles Style object at a specified (or current) index */ getSelectionStyles: function(startIndex, endIndex) { if (arguments.length === 2) { var styles = [ ]; for (var i = startIndex; i < endIndex; i++) { styles.push(this.getSelectionStyles(i)); } return styles; } var loc = this.get2DCursorLocation(startIndex); if (this.styles[loc.lineIndex]) { return this.styles[loc.lineIndex][loc.charIndex] || { }; } return { }; }, /** * Sets style of a current selection * @param {Object} [styles] Styles object * @return {fabric.IText} thisArg * @chainable */ setSelectionStyles: function(styles) { if (this.selectionStart === this.selectionEnd) { this._extendStyles(this.selectionStart, styles); } else { for (var i = this.selectionStart; i < this.selectionEnd; i++) { this._extendStyles(i, styles); } } return this; }, /** * @private */ _extendStyles: function(index, styles) { var loc = this.get2DCursorLocation(index); if (!this.styles[loc.lineIndex]) { this.styles[loc.lineIndex] = { }; } if (!this.styles[loc.lineIndex][loc.charIndex]) { this.styles[loc.lineIndex][loc.charIndex] = { }; } fabric.util.object.extend(this.styles[loc.lineIndex][loc.charIndex], styles); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { this.callSuper('_render', ctx); this.ctx = ctx; this.isEditing && this.renderCursorOrSelection(); }, /** * Renders cursor or selection (depending on what exists) */ renderCursorOrSelection: function() { if (!this.active) { return; } var chars = this.text.split(''), boundaries; if (this.selectionStart === this.selectionEnd) { boundaries = this._getCursorBoundaries(chars, 'cursor'); this.renderCursor(boundaries); } else { boundaries = this._getCursorBoundaries(chars, 'selection'); this.renderSelection(chars, boundaries); } }, /** * Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) * @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used. */ get2DCursorLocation: function(selectionStart) { if (typeof selectionStart === 'undefined') { selectionStart = this.selectionStart; } var textBeforeCursor = this.text.slice(0, selectionStart), linesBeforeCursor = textBeforeCursor.split(this._reNewline); return { lineIndex: linesBeforeCursor.length - 1, charIndex: linesBeforeCursor[linesBeforeCursor.length - 1].length }; }, /** * Returns complete style of char at the current cursor * @param {Number} lineIndex Line index * @param {Number} charIndex Char index * @return {Object} Character style */ getCurrentCharStyle: function(lineIndex, charIndex) { var style = this.styles[lineIndex] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)]; return { fontSize: style && style.fontSize || this.fontSize, fill: style && style.fill || this.fill, textBackgroundColor: style && style.textBackgroundColor || this.textBackgroundColor, textDecoration: style && style.textDecoration || this.textDecoration, fontFamily: style && style.fontFamily || this.fontFamily, fontWeight: style && style.fontWeight || this.fontWeight, fontStyle: style && style.fontStyle || this.fontStyle, stroke: style && style.stroke || this.stroke, strokeWidth: style && style.strokeWidth || this.strokeWidth }; }, /** * Returns fontSize of char at the current cursor * @param {Number} lineIndex Line index * @param {Number} charIndex Char index * @return {Number} Character font size */ getCurrentCharFontSize: function(lineIndex, charIndex) { return ( this.styles[lineIndex] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)].fontSize) || this.fontSize; }, /** * Returns color (fill) of char at the current cursor * @param {Number} lineIndex Line index * @param {Number} charIndex Char index * @return {String} Character color (fill) */ getCurrentCharColor: function(lineIndex, charIndex) { return ( this.styles[lineIndex] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)] && this.styles[lineIndex][charIndex === 0 ? 0 : (charIndex - 1)].fill) || this.cursorColor; }, /** * Returns cursor boundaries (left, top, leftOffset, topOffset) * @private * @param {Array} chars Array of characters * @param {String} typeOfBoundaries */ _getCursorBoundaries: function(chars, typeOfBoundaries) { var cursorLocation = this.get2DCursorLocation(), textLines = this.text.split(this._reNewline), // left/top are left/top of entire text box // leftOffset/topOffset are offset from that left/top point of a text box left = Math.round(this._getLeftOffset()), top = -this.height / 2, offsets = this._getCursorBoundariesOffsets( chars, typeOfBoundaries, cursorLocation, textLines); return { left: left, top: top, leftOffset: offsets.left + offsets.lineLeft, topOffset: offsets.top }; }, /** * @private */ _getCursorBoundariesOffsets: function(chars, typeOfBoundaries, cursorLocation, textLines) { var lineLeftOffset = 0, lineIndex = 0, charIndex = 0, leftOffset = 0, topOffset = typeOfBoundaries === 'cursor' // selection starts at the very top of the line, // whereas cursor starts at the padding created by line height ? (this._getHeightOfLine(this.ctx, 0) - this.getCurrentCharFontSize(cursorLocation.lineIndex, cursorLocation.charIndex)) : 0; for (var i = 0; i < this.selectionStart; i++) { if (chars[i] === '\n') { leftOffset = 0; var index = lineIndex + (typeOfBoundaries === 'cursor' ? 1 : 0); topOffset += this._getCachedLineHeight(index); lineIndex++; charIndex = 0; } else { leftOffset += this._getWidthOfChar(this.ctx, chars[i], lineIndex, charIndex); charIndex++; } lineLeftOffset = this._getCachedLineOffset(lineIndex, textLines); } this._clearCache(); return { top: topOffset, left: leftOffset, lineLeft: lineLeftOffset }; }, /** * @private */ _clearCache: function() { this.__lineWidths = { }; this.__lineHeights = { }; this.__lineOffsets = { }; }, /** * @private */ _getCachedLineHeight: function(index) { return this.__lineHeights[index] || (this.__lineHeights[index] = this._getHeightOfLine(this.ctx, index)); }, /** * @private */ _getCachedLineWidth: function(lineIndex, textLines) { return this.__lineWidths[lineIndex] || (this.__lineWidths[lineIndex] = this._getWidthOfLine(this.ctx, lineIndex, textLines)); }, /** * @private */ _getCachedLineOffset: function(lineIndex, textLines) { var widthOfLine = this._getCachedLineWidth(lineIndex, textLines); return this.__lineOffsets[lineIndex] || (this.__lineOffsets[lineIndex] = this._getLineLeftOffset(widthOfLine)); }, /** * Renders cursor * @param {Object} boundaries */ renderCursor: function(boundaries) { var ctx = this.ctx; ctx.save(); var cursorLocation = this.get2DCursorLocation(), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex, charHeight = this.getCurrentCharFontSize(lineIndex, charIndex), leftOffset = (lineIndex === 0 && charIndex === 0) ? this._getCachedLineOffset(lineIndex, this.text.split(this._reNewline)) : boundaries.leftOffset; ctx.fillStyle = this.getCurrentCharColor(lineIndex, charIndex); ctx.globalAlpha = this.__isMousedown ? 1 : this._currentCursorOpacity; ctx.fillRect( boundaries.left + leftOffset, boundaries.top + boundaries.topOffset, this.cursorWidth / this.scaleX, charHeight); ctx.restore(); }, /** * Renders text selection * @param {Array} chars Array of characters * @param {Object} boundaries Object with left/top/leftOffset/topOffset */ renderSelection: function(chars, boundaries) { var ctx = this.ctx; ctx.save(); ctx.fillStyle = this.selectionColor; var start = this.get2DCursorLocation(this.selectionStart), end = this.get2DCursorLocation(this.selectionEnd), startLine = start.lineIndex, endLine = end.lineIndex, textLines = this.text.split(this._reNewline); for (var i = startLine; i <= endLine; i++) { var lineOffset = this._getCachedLineOffset(i, textLines) || 0, lineHeight = this._getCachedLineHeight(i), boxWidth = 0; if (i === startLine) { for (var j = 0, len = textLines[i].length; j < len; j++) { if (j >= start.charIndex && (i !== endLine || j < end.charIndex)) { boxWidth += this._getWidthOfChar(ctx, textLines[i][j], i, j); } if (j < start.charIndex) { lineOffset += this._getWidthOfChar(ctx, textLines[i][j], i, j); } } } else if (i > startLine && i < endLine) { boxWidth += this._getCachedLineWidth(i, textLines) || 5; } else if (i === endLine) { for (var j2 = 0, j2len = end.charIndex; j2 < j2len; j2++) { boxWidth += this._getWidthOfChar(ctx, textLines[i][j2], i, j2); } } ctx.fillRect( boundaries.left + lineOffset, boundaries.top + boundaries.topOffset, boxWidth, lineHeight); boundaries.topOffset += lineHeight; } ctx.restore(); }, /** * @private * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderChars: function(method, ctx, line, left, top, lineIndex) { if (this.isEmptyStyles()) { return this._renderCharsFast(method, ctx, line, left, top); } this.skipTextAlign = true; // set proper box offset left -= this.textAlign === 'center' ? (this.width / 2) : (this.textAlign === 'right') ? this.width : 0; // set proper line offset var textLines = this.text.split(this._reNewline), lineWidth = this._getWidthOfLine(ctx, lineIndex, textLines), lineHeight = this._getHeightOfLine(ctx, lineIndex, textLines), lineLeftOffset = this._getLineLeftOffset(lineWidth), chars = line.split(''), prevStyle, charsToRender = ''; left += lineLeftOffset || 0; ctx.save(); for (var i = 0, len = chars.length; i <= len; i++) { prevStyle = prevStyle || this.getCurrentCharStyle(lineIndex, i); var thisStyle = this.getCurrentCharStyle(lineIndex, i + 1); if (this._hasStyleChanged(prevStyle, thisStyle) || i === len) { this._renderChar(method, ctx, lineIndex, i - 1, charsToRender, left, top, lineHeight); charsToRender = ''; prevStyle = thisStyle; } charsToRender += chars[i]; } ctx.restore(); }, /** * @private * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} line Content of the line * @param {Number} left Left coordinate * @param {Number} top Top coordinate */ _renderCharsFast: function(method, ctx, line, left, top) { this.skipTextAlign = false; if (method === 'fillText' && this.fill) { this.callSuper('_renderChars', method, ctx, line, left, top); } if (method === 'strokeText' && this.stroke) { this.callSuper('_renderChars', method, ctx, line, left, top); } }, /** * @private * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Number} lineIndex * @param {Number} i * @param {String} _char * @param {Number} left Left coordinate * @param {Number} top Top coordinate * @param {Number} lineHeight Height of the line */ _renderChar: function(method, ctx, lineIndex, i, _char, left, top, lineHeight) { var decl, charWidth, charHeight; if (this.styles && this.styles[lineIndex] && (decl = this.styles[lineIndex][i])) { var shouldStroke = decl.stroke || this.stroke, shouldFill = decl.fill || this.fill; ctx.save(); charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i, decl); charHeight = this._getHeightOfChar(ctx, _char, lineIndex, i); if (shouldFill) { ctx.fillText(_char, left, top); } if (shouldStroke) { ctx.strokeText(_char, left, top); } this._renderCharDecoration(ctx, decl, left, top, charWidth, lineHeight, charHeight); ctx.restore(); ctx.translate(charWidth, 0); } else { if (method === 'strokeText' && this.stroke) { ctx[method](_char, left, top); } if (method === 'fillText' && this.fill) { ctx[method](_char, left, top); } charWidth = this._applyCharStylesGetWidth(ctx, _char, lineIndex, i); this._renderCharDecoration(ctx, null, left, top, charWidth, lineHeight); ctx.translate(ctx.measureText(_char).width, 0); } }, /** * @private * @param {Object} prevStyle * @param {Object} thisStyle */ _hasStyleChanged: function(prevStyle, thisStyle) { return (prevStyle.fill !== thisStyle.fill || prevStyle.fontSize !== thisStyle.fontSize || prevStyle.textBackgroundColor !== thisStyle.textBackgroundColor || prevStyle.textDecoration !== thisStyle.textDecoration || prevStyle.fontFamily !== thisStyle.fontFamily || prevStyle.fontWeight !== thisStyle.fontWeight || prevStyle.fontStyle !== thisStyle.fontStyle || prevStyle.stroke !== thisStyle.stroke || prevStyle.strokeWidth !== thisStyle.strokeWidth ); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderCharDecoration: function(ctx, styleDeclaration, left, top, charWidth, lineHeight, charHeight) { var textDecoration = styleDeclaration ? (styleDeclaration.textDecoration || this.textDecoration) : this.textDecoration, fontSize = (styleDeclaration ? styleDeclaration.fontSize : null) || this.fontSize; if (!textDecoration) { return; } if (textDecoration.indexOf('underline') > -1) { this._renderCharDecorationAtOffset( ctx, left, top + (this.fontSize / this._fontSizeFraction), charWidth, 0, this.fontSize / 20 ); } if (textDecoration.indexOf('line-through') > -1) { this._renderCharDecorationAtOffset( ctx, left, top + (this.fontSize / this._fontSizeFraction), charWidth, charHeight / 2, fontSize / 20 ); } if (textDecoration.indexOf('overline') > -1) { this._renderCharDecorationAtOffset( ctx, left, top, charWidth, lineHeight - (this.fontSize / this._fontSizeFraction), this.fontSize / 20 ); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderCharDecorationAtOffset: function(ctx, left, top, charWidth, offset, thickness) { ctx.fillRect(left, top - offset, charWidth, thickness); }, /** * @private * @param {String} method * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} line */ _renderTextLine: function(method, ctx, line, left, top, lineIndex) { // to "cancel" this.fontSize subtraction in fabric.Text#_renderTextLine top += this.fontSize / 4; this.callSuper('_renderTextLine', method, ctx, line, left, top, lineIndex); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines */ _renderTextDecoration: function(ctx, textLines) { if (this.isEmptyStyles()) { return this.callSuper('_renderTextDecoration', ctx, textLines); } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _renderTextLinesBackground: function(ctx, textLines) { if (!this.textBackgroundColor && !this.styles) { return; } ctx.save(); if (this.textBackgroundColor) { ctx.fillStyle = this.textBackgroundColor; } var lineHeights = 0, fractionOfFontSize = this.fontSize / this._fontSizeFraction; for (var i = 0, len = textLines.length; i < len; i++) { var heightOfLine = this._getHeightOfLine(ctx, i, textLines); if (textLines[i] === '') { lineHeights += heightOfLine; continue; } var lineWidth = this._getWidthOfLine(ctx, i, textLines), lineLeftOffset = this._getLineLeftOffset(lineWidth); if (this.textBackgroundColor) { ctx.fillStyle = this.textBackgroundColor; ctx.fillRect( this._getLeftOffset() + lineLeftOffset, this._getTopOffset() + lineHeights + fractionOfFontSize, lineWidth, heightOfLine ); } if (this.styles[i]) { for (var j = 0, jlen = textLines[i].length; j < jlen; j++) { if (this.styles[i] && this.styles[i][j] && this.styles[i][j].textBackgroundColor) { var _char = textLines[i][j]; ctx.fillStyle = this.styles[i][j].textBackgroundColor; ctx.fillRect( this._getLeftOffset() + lineLeftOffset + this._getWidthOfCharsAt(ctx, i, j, textLines), this._getTopOffset() + lineHeights + fractionOfFontSize, this._getWidthOfChar(ctx, _char, i, j, textLines) + 1, heightOfLine ); } } } lineHeights += heightOfLine; } ctx.restore(); }, /** * @private */ _getCacheProp: function(_char, styleDeclaration) { return _char + styleDeclaration.fontFamily + styleDeclaration.fontSize + styleDeclaration.fontWeight + styleDeclaration.fontStyle + styleDeclaration.shadow; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {String} _char * @param {Number} lineIndex * @param {Number} charIndex * @param {Object} [decl] */ _applyCharStylesGetWidth: function(ctx, _char, lineIndex, charIndex, decl) { var styleDeclaration = decl || (this.styles[lineIndex] && this.styles[lineIndex][charIndex]); if (styleDeclaration) { // cloning so that original style object is not polluted with following font declarations styleDeclaration = clone(styleDeclaration); } else { styleDeclaration = { }; } this._applyFontStyles(styleDeclaration); var cacheProp = this._getCacheProp(_char, styleDeclaration); // short-circuit if no styles if (this.isEmptyStyles() && this._charWidthsCache[cacheProp] && this.caching) { return this._charWidthsCache[cacheProp]; } if (typeof styleDeclaration.shadow === 'string') { styleDeclaration.shadow = new fabric.Shadow(styleDeclaration.shadow); } var fill = styleDeclaration.fill || this.fill; ctx.fillStyle = fill.toLive ? fill.toLive(ctx) : fill; if (styleDeclaration.stroke) { ctx.strokeStyle = (styleDeclaration.stroke && styleDeclaration.stroke.toLive) ? styleDeclaration.stroke.toLive(ctx) : styleDeclaration.stroke; } ctx.lineWidth = styleDeclaration.strokeWidth || this.strokeWidth; ctx.font = this._getFontDeclaration.call(styleDeclaration); this._setShadow.call(styleDeclaration, ctx); if (!this.caching) { return ctx.measureText(_char).width; } if (!this._charWidthsCache[cacheProp]) { this._charWidthsCache[cacheProp] = ctx.measureText(_char).width; } return this._charWidthsCache[cacheProp]; }, /** * @private * @param {Object} styleDeclaration */ _applyFontStyles: function(styleDeclaration) { if (!styleDeclaration.fontFamily) { styleDeclaration.fontFamily = this.fontFamily; } if (!styleDeclaration.fontSize) { styleDeclaration.fontSize = this.fontSize; } if (!styleDeclaration.fontWeight) { styleDeclaration.fontWeight = this.fontWeight; } if (!styleDeclaration.fontStyle) { styleDeclaration.fontStyle = this.fontStyle; } }, /** * @private * @param {Number} lineIndex * @param {Number} charIndex */ _getStyleDeclaration: function(lineIndex, charIndex) { return (this.styles[lineIndex] && this.styles[lineIndex][charIndex]) ? clone(this.styles[lineIndex][charIndex]) : { }; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getWidthOfChar: function(ctx, _char, lineIndex, charIndex) { var styleDeclaration = this._getStyleDeclaration(lineIndex, charIndex); this._applyFontStyles(styleDeclaration); var cacheProp = this._getCacheProp(_char, styleDeclaration); if (this._charWidthsCache[cacheProp] && this.caching) { return this._charWidthsCache[cacheProp]; } else if (ctx) { ctx.save(); var width = this._applyCharStylesGetWidth(ctx, _char, lineIndex, charIndex); ctx.restore(); return width; } }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getHeightOfChar: function(ctx, _char, lineIndex, charIndex) { if (this.styles[lineIndex] && this.styles[lineIndex][charIndex]) { return this.styles[lineIndex][charIndex].fontSize || this.fontSize; } return this.fontSize; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getWidthOfCharAt: function(ctx, lineIndex, charIndex, lines) { lines = lines || this.text.split(this._reNewline); var _char = lines[lineIndex].split('')[charIndex]; return this._getWidthOfChar(ctx, _char, lineIndex, charIndex); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getHeightOfCharAt: function(ctx, lineIndex, charIndex, lines) { lines = lines || this.text.split(this._reNewline); var _char = lines[lineIndex].split('')[charIndex]; return this._getHeightOfChar(ctx, _char, lineIndex, charIndex); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getWidthOfCharsAt: function(ctx, lineIndex, charIndex, lines) { var width = 0; for (var i = 0; i < charIndex; i++) { width += this._getWidthOfCharAt(ctx, lineIndex, i, lines); } return width; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getWidthOfLine: function(ctx, lineIndex, textLines) { // if (!this.styles[lineIndex]) { // return this.callSuper('_getLineWidth', ctx, textLines[lineIndex]); // } return this._getWidthOfCharsAt(ctx, lineIndex, textLines[lineIndex].length, textLines); }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getTextWidth: function(ctx, textLines) { if (this.isEmptyStyles()) { return this.callSuper('_getTextWidth', ctx, textLines); } var maxWidth = this._getWidthOfLine(ctx, 0, textLines); for (var i = 1, len = textLines.length; i < len; i++) { var currentLineWidth = this._getWidthOfLine(ctx, i, textLines); if (currentLineWidth > maxWidth) { maxWidth = currentLineWidth; } } return maxWidth; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _getHeightOfLine: function(ctx, lineIndex, textLines) { textLines = textLines || this.text.split(this._reNewline); var maxHeight = this._getHeightOfChar(ctx, textLines[lineIndex][0], lineIndex, 0), line = textLines[lineIndex], chars = line.split(''); for (var i = 1, len = chars.length; i < len; i++) { var currentCharHeight = this._getHeightOfChar(ctx, chars[i], lineIndex, i); if (currentCharHeight > maxHeight) { maxHeight = currentCharHeight; } } return maxHeight * this.lineHeight; }, /** * @private * @param {CanvasRenderingContext2D} ctx Context to render on * @param {Array} textLines Array of all text lines */ _getTextHeight: function(ctx, textLines) { var height = 0; for (var i = 0, len = textLines.length; i < len; i++) { height += this._getHeightOfLine(ctx, i, textLines); } return height; }, /** * @private */ _getTopOffset: function() { var topOffset = fabric.Text.prototype._getTopOffset.call(this); return topOffset - (this.fontSize / this._fontSizeFraction); }, /** * This method is overwritten to account for different top offset * @private */ _renderTextBoxBackground: function(ctx) { if (!this.backgroundColor) { return; } ctx.save(); ctx.fillStyle = this.backgroundColor; ctx.fillRect( this._getLeftOffset(), this._getTopOffset() + (this.fontSize / this._fontSizeFraction), this.width, this.height ); ctx.restore(); }, /** * Returns object representation of an instance * @method toObject * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output * @return {Object} object representation of an instance */ toObject: function(propertiesToInclude) { return fabric.util.object.extend(this.callSuper('toObject', propertiesToInclude), { styles: clone(this.styles) }); } }); /** * Returns fabric.IText instance from an object representation * @static * @memberOf fabric.IText * @param {Object} object Object to create an instance from * @return {fabric.IText} instance of fabric.IText */ fabric.IText.fromObject = function(object) { return new fabric.IText(object.text, clone(object)); }; /** * Contains all fabric.IText objects that have been created * @static * @memberof fabric.IText * @type Array */ fabric.IText.instances = [ ]; })(); (function() { var clone = fabric.util.object.clone; fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.prototype */ { /** * Initializes all the interactive behavior of IText */ initBehavior: function() { this.initAddedHandler(); this.initCursorSelectionHandlers(); this.initDoubleClickSimulation(); }, /** * Initializes "selected" event handler */ initSelectedHandler: function() { this.on('selected', function() { var _this = this; setTimeout(function() { _this.selected = true; }, 100); }); }, /** * Initializes "added" event handler */ initAddedHandler: function() { this.on('added', function() { if (this.canvas && !this.canvas._hasITextHandlers) { this.canvas._hasITextHandlers = true; this._initCanvasHandlers(); } }); }, /** * @private */ _initCanvasHandlers: function() { this.canvas.on('selection:cleared', function() { fabric.IText.prototype.exitEditingOnOthers.call(); }); this.canvas.on('mouse:up', function() { fabric.IText.instances.forEach(function(obj) { obj.__isMousedown = false; }); }); this.canvas.on('object:selected', function(options) { fabric.IText.prototype.exitEditingOnOthers.call(options.target); }); }, /** * @private */ _tick: function() { if (this._abortCursorAnimation) { return; } var _this = this; this.animate('_currentCursorOpacity', 1, { duration: this.cursorDuration, onComplete: function() { _this._onTickComplete(); }, onChange: function() { _this.canvas && _this.canvas.renderAll(); }, abort: function() { return _this._abortCursorAnimation; } }); }, /** * @private */ _onTickComplete: function() { if (this._abortCursorAnimation) { return; } var _this = this; if (this._cursorTimeout1) { clearTimeout(this._cursorTimeout1); } this._cursorTimeout1 = setTimeout(function() { _this.animate('_currentCursorOpacity', 0, { duration: this.cursorDuration / 2, onComplete: function() { _this._tick(); }, onChange: function() { _this.canvas && _this.canvas.renderAll(); }, abort: function() { return _this._abortCursorAnimation; } }); }, 100); }, /** * Initializes delayed cursor */ initDelayedCursor: function(restart) { var _this = this, delay = restart ? 0 : this.cursorDelay; if (restart) { this._abortCursorAnimation = true; clearTimeout(this._cursorTimeout1); this._currentCursorOpacity = 1; this.canvas && this.canvas.renderAll(); } if (this._cursorTimeout2) { clearTimeout(this._cursorTimeout2); } this._cursorTimeout2 = setTimeout(function() { _this._abortCursorAnimation = false; _this._tick(); }, delay); }, /** * Aborts cursor animation and clears all timeouts */ abortCursorAnimation: function() { this._abortCursorAnimation = true; clearTimeout(this._cursorTimeout1); clearTimeout(this._cursorTimeout2); this._currentCursorOpacity = 0; this.canvas && this.canvas.renderAll(); var _this = this; setTimeout(function() { _this._abortCursorAnimation = false; }, 10); }, /** * Selects entire text */ selectAll: function() { this.selectionStart = 0; this.selectionEnd = this.text.length; this.fire('selection:changed'); this.canvas && this.canvas.fire('text:selection:changed', { target: this }); }, /** * Returns selected text * @return {String} */ getSelectedText: function() { return this.text.slice(this.selectionStart, this.selectionEnd); }, /** * Find new selection index representing start of current word according to current selection index * @param {Number} startFrom Surrent selection index * @return {Number} New selection index */ findWordBoundaryLeft: function(startFrom) { var offset = 0, index = startFrom - 1; // remove space before cursor first if (this._reSpace.test(this.text.charAt(index))) { while (this._reSpace.test(this.text.charAt(index))) { offset++; index--; } } while (/\S/.test(this.text.charAt(index)) && index > -1) { offset++; index--; } return startFrom - offset; }, /** * Find new selection index representing end of current word according to current selection index * @param {Number} startFrom Current selection index * @return {Number} New selection index */ findWordBoundaryRight: function(startFrom) { var offset = 0, index = startFrom; // remove space after cursor first if (this._reSpace.test(this.text.charAt(index))) { while (this._reSpace.test(this.text.charAt(index))) { offset++; index++; } } while (/\S/.test(this.text.charAt(index)) && index < this.text.length) { offset++; index++; } return startFrom + offset; }, /** * Find new selection index representing start of current line according to current selection index * @param {Number} startFrom Current selection index * @return {Number} New selection index */ findLineBoundaryLeft: function(startFrom) { var offset = 0, index = startFrom - 1; while (!/\n/.test(this.text.charAt(index)) && index > -1) { offset++; index--; } return startFrom - offset; }, /** * Find new selection index representing end of current line according to current selection index * @param {Number} startFrom Current selection index * @return {Number} New selection index */ findLineBoundaryRight: function(startFrom) { var offset = 0, index = startFrom; while (!/\n/.test(this.text.charAt(index)) && index < this.text.length) { offset++; index++; } return startFrom + offset; }, /** * Returns number of newlines in selected text * @return {Number} Number of newlines in selected text */ getNumNewLinesInSelectedText: function() { var selectedText = this.getSelectedText(), numNewLines = 0; for (var i = 0, chars = selectedText.split(''), len = chars.length; i < len; i++) { if (chars[i] === '\n') { numNewLines++; } } return numNewLines; }, /** * Finds index corresponding to beginning or end of a word * @param {Number} selectionStart Index of a character * @param {Number} direction: 1 or -1 * @return {Number} Index of the beginning or end of a word */ searchWordBoundary: function(selectionStart, direction) { var index = this._reSpace.test(this.text.charAt(selectionStart)) ? selectionStart - 1 : selectionStart, _char = this.text.charAt(index), reNonWord = /[ \n\.,;!\?\-]/; while (!reNonWord.test(_char) && index > 0 && index < this.text.length) { index += direction; _char = this.text.charAt(index); } if (reNonWord.test(_char) && _char !== '\n') { index += direction === 1 ? 0 : 1; } return index; }, /** * Selects a word based on the index * @param {Number} selectionStart Index of a character */ selectWord: function(selectionStart) { var newSelectionStart = this.searchWordBoundary(selectionStart, -1), /* search backwards */ newSelectionEnd = this.searchWordBoundary(selectionStart, 1); /* search forward */ this.setSelectionStart(newSelectionStart); this.setSelectionEnd(newSelectionEnd); this.initDelayedCursor(true); }, /** * Selects a line based on the index * @param {Number} selectionStart Index of a character */ selectLine: function(selectionStart) { var newSelectionStart = this.findLineBoundaryLeft(selectionStart), newSelectionEnd = this.findLineBoundaryRight(selectionStart); this.setSelectionStart(newSelectionStart); this.setSelectionEnd(newSelectionEnd); this.initDelayedCursor(true); }, /** * Enters editing state * @return {fabric.IText} thisArg * @chainable */ enterEditing: function() { if (this.isEditing || !this.editable) { return; } this.exitEditingOnOthers(); this.isEditing = true; this.initHiddenTextarea(); this._updateTextarea(); this._saveEditingProps(); this._setEditingProps(); this._tick(); this.canvas && this.canvas.renderAll(); this.fire('editing:entered'); this.canvas && this.canvas.fire('text:editing:entered', { target: this }); return this; }, exitEditingOnOthers: function() { fabric.IText.instances.forEach(function(obj) { obj.selected = false; if (obj.isEditing) { obj.exitEditing(); } }, this); }, /** * @private */ _setEditingProps: function() { this.hoverCursor = 'text'; if (this.canvas) { this.canvas.defaultCursor = this.canvas.moveCursor = 'text'; } this.borderColor = this.editingBorderColor; this.hasControls = this.selectable = false; this.lockMovementX = this.lockMovementY = true; }, /** * @private */ _updateTextarea: function() { if (!this.hiddenTextarea) { return; } this.hiddenTextarea.value = this.text; this.hiddenTextarea.selectionStart = this.selectionStart; }, /** * @private */ _saveEditingProps: function() { this._savedProps = { hasControls: this.hasControls, borderColor: this.borderColor, lockMovementX: this.lockMovementX, lockMovementY: this.lockMovementY, hoverCursor: this.hoverCursor, defaultCursor: this.canvas && this.canvas.defaultCursor, moveCursor: this.canvas && this.canvas.moveCursor }; }, /** * @private */ _restoreEditingProps: function() { if (!this._savedProps) { return; } this.hoverCursor = this._savedProps.overCursor; this.hasControls = this._savedProps.hasControls; this.borderColor = this._savedProps.borderColor; this.lockMovementX = this._savedProps.lockMovementX; this.lockMovementY = this._savedProps.lockMovementY; if (this.canvas) { this.canvas.defaultCursor = this._savedProps.defaultCursor; this.canvas.moveCursor = this._savedProps.moveCursor; } }, /** * Exits from editing state * @return {fabric.IText} thisArg * @chainable */ exitEditing: function() { this.selected = false; this.isEditing = false; this.selectable = true; this.selectionEnd = this.selectionStart; this.hiddenTextarea && this.canvas && this.hiddenTextarea.parentNode.removeChild(this.hiddenTextarea); this.hiddenTextarea = null; this.abortCursorAnimation(); this._restoreEditingProps(); this._currentCursorOpacity = 0; this.fire('editing:exited'); this.canvas && this.canvas.fire('text:editing:exited', { target: this }); return this; }, /** * @private */ _removeExtraneousStyles: function() { var textLines = this.text.split(this._reNewline); for (var prop in this.styles) { if (!textLines[prop]) { delete this.styles[prop]; } } }, /** * @private */ _removeCharsFromTo: function(start, end) { var i = end; while (i !== start) { var prevIndex = this.get2DCursorLocation(i).charIndex; i--; var index = this.get2DCursorLocation(i).charIndex, isNewline = index > prevIndex; if (isNewline) { this.removeStyleObject(isNewline, i + 1); } else { this.removeStyleObject(this.get2DCursorLocation(i).charIndex === 0, i); } } this.text = this.text.slice(0, start) + this.text.slice(end); }, /** * Inserts a character where cursor is (replacing selection if one exists) * @param {String} _chars Characters to insert */ insertChars: function(_chars) { var isEndOfLine = this.text.slice(this.selectionStart, this.selectionStart + 1) === '\n'; this.text = this.text.slice(0, this.selectionStart) + _chars + this.text.slice(this.selectionEnd); if (this.selectionStart === this.selectionEnd) { this.insertStyleObjects(_chars, isEndOfLine, this.copiedStyles); } // else if (this.selectionEnd - this.selectionStart > 1) { // TODO: replace styles properly // console.log('replacing MORE than 1 char'); // } this.selectionStart += _chars.length; this.selectionEnd = this.selectionStart; if (this.canvas) { // TODO: double renderAll gets rid of text box shift happenning sometimes // need to find out what exactly causes it and fix it this.canvas.renderAll().renderAll(); } this.setCoords(); this.fire('changed'); this.canvas && this.canvas.fire('text:changed', { target: this }); }, /** * Inserts new style object * @param {Number} lineIndex Index of a line * @param {Number} charIndex Index of a char * @param {Boolean} isEndOfLine True if it's end of line */ insertNewlineStyleObject: function(lineIndex, charIndex, isEndOfLine) { this.shiftLineStyles(lineIndex, +1); if (!this.styles[lineIndex + 1]) { this.styles[lineIndex + 1] = { }; } var currentCharStyle = this.styles[lineIndex][charIndex - 1], newLineStyles = { }; // if there's nothing after cursor, // we clone current char style onto the next (otherwise empty) line if (isEndOfLine) { newLineStyles[0] = clone(currentCharStyle); this.styles[lineIndex + 1] = newLineStyles; } // otherwise we clone styles of all chars // after cursor onto the next line, from the beginning else { for (var index in this.styles[lineIndex]) { if (parseInt(index, 10) >= charIndex) { newLineStyles[parseInt(index, 10) - charIndex] = this.styles[lineIndex][index]; // remove lines from the previous line since they're on a new line now delete this.styles[lineIndex][index]; } } this.styles[lineIndex + 1] = newLineStyles; } }, /** * Inserts style object for a given line/char index * @param {Number} lineIndex Index of a line * @param {Number} charIndex Index of a char * @param {Object} [style] Style object to insert, if given */ insertCharStyleObject: function(lineIndex, charIndex, style) { var currentLineStyles = this.styles[lineIndex], currentLineStylesCloned = clone(currentLineStyles); if (charIndex === 0 && !style) { charIndex = 1; } // shift all char styles by 1 forward // 0,1,2,3 -> (charIndex=2) -> 0,1,3,4 -> (insert 2) -> 0,1,2,3,4 for (var index in currentLineStylesCloned) { var numericIndex = parseInt(index, 10); if (numericIndex >= charIndex) { currentLineStyles[numericIndex + 1] = currentLineStylesCloned[numericIndex]; //delete currentLineStyles[index]; } } this.styles[lineIndex][charIndex] = style || clone(currentLineStyles[charIndex - 1]); }, /** * Inserts style object(s) * @param {String} _chars Characters at the location where style is inserted * @param {Boolean} isEndOfLine True if it's end of line * @param {Array} [styles] Styles to insert */ insertStyleObjects: function(_chars, isEndOfLine, styles) { // short-circuit if (this.isEmptyStyles()) { return; } var cursorLocation = this.get2DCursorLocation(), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex; if (!this.styles[lineIndex]) { this.styles[lineIndex] = { }; } if (_chars === '\n') { this.insertNewlineStyleObject(lineIndex, charIndex, isEndOfLine); } else { if (styles) { this._insertStyles(styles); } else { // TODO: support multiple style insertion if _chars.length > 1 this.insertCharStyleObject(lineIndex, charIndex); } } }, /** * @private */ _insertStyles: function(styles) { for (var i = 0, len = styles.length; i < len; i++) { var cursorLocation = this.get2DCursorLocation(this.selectionStart + i), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex; this.insertCharStyleObject(lineIndex, charIndex, styles[i]); } }, /** * Shifts line styles up or down * @param {Number} lineIndex Index of a line * @param {Number} offset Can be -1 or +1 */ shiftLineStyles: function(lineIndex, offset) { // shift all line styles by 1 upward var clonedStyles = clone(this.styles); for (var line in this.styles) { var numericLine = parseInt(line, 10); if (numericLine > lineIndex) { this.styles[numericLine + offset] = clonedStyles[numericLine]; } } }, /** * Removes style object * @param {Boolean} isBeginningOfLine True if cursor is at the beginning of line * @param {Number} [index] Optional index. When not given, current selectionStart is used. */ removeStyleObject: function(isBeginningOfLine, index) { var cursorLocation = this.get2DCursorLocation(index), lineIndex = cursorLocation.lineIndex, charIndex = cursorLocation.charIndex; if (isBeginningOfLine) { var textLines = this.text.split(this._reNewline), textOnPreviousLine = textLines[lineIndex - 1], newCharIndexOnPrevLine = textOnPreviousLine ? textOnPreviousLine.length : 0; if (!this.styles[lineIndex - 1]) { this.styles[lineIndex - 1] = { }; } for (charIndex in this.styles[lineIndex]) { this.styles[lineIndex - 1][parseInt(charIndex, 10) + newCharIndexOnPrevLine] = this.styles[lineIndex][charIndex]; } this.shiftLineStyles(lineIndex, -1); } else { var currentLineStyles = this.styles[lineIndex]; if (currentLineStyles) { var offset = this.selectionStart === this.selectionEnd ? -1 : 0; delete currentLineStyles[charIndex + offset]; // console.log('deleting', lineIndex, charIndex + offset); } var currentLineStylesCloned = clone(currentLineStyles); // shift all styles by 1 backwards for (var i in currentLineStylesCloned) { var numericIndex = parseInt(i, 10); if (numericIndex >= charIndex && numericIndex !== 0) { currentLineStyles[numericIndex - 1] = currentLineStylesCloned[numericIndex]; delete currentLineStyles[numericIndex]; } } } }, /** * Inserts new line */ insertNewline: function() { this.insertChars('\n'); } }); })(); fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.prototype */ { /** * Initializes "dbclick" event handler */ initDoubleClickSimulation: function() { // for double click this.__lastClickTime = +new Date(); // for triple click this.__lastLastClickTime = +new Date(); this.__lastPointer = { }; this.on('mousedown', this.onMouseDown.bind(this)); }, onMouseDown: function(options) { this.__newClickTime = +new Date(); var newPointer = this.canvas.getPointer(options.e); if (this.isTripleClick(newPointer)) { this.fire('tripleclick', options); this._stopEvent(options.e); } else if (this.isDoubleClick(newPointer)) { this.fire('dblclick', options); this._stopEvent(options.e); } this.__lastLastClickTime = this.__lastClickTime; this.__lastClickTime = this.__newClickTime; this.__lastPointer = newPointer; this.__lastIsEditing = this.isEditing; this.__lastSelected = this.selected; }, isDoubleClick: function(newPointer) { return this.__newClickTime - this.__lastClickTime < 500 && this.__lastPointer.x === newPointer.x && this.__lastPointer.y === newPointer.y && this.__lastIsEditing; }, isTripleClick: function(newPointer) { return this.__newClickTime - this.__lastClickTime < 500 && this.__lastClickTime - this.__lastLastClickTime < 500 && this.__lastPointer.x === newPointer.x && this.__lastPointer.y === newPointer.y; }, /** * @private */ _stopEvent: function(e) { e.preventDefault && e.preventDefault(); e.stopPropagation && e.stopPropagation(); }, /** * Initializes event handlers related to cursor or selection */ initCursorSelectionHandlers: function() { this.initSelectedHandler(); this.initMousedownHandler(); this.initMousemoveHandler(); this.initMouseupHandler(); this.initClicks(); }, /** * Initializes double and triple click event handlers */ initClicks: function() { this.on('dblclick', function(options) { this.selectWord(this.getSelectionStartFromPointer(options.e)); }); this.on('tripleclick', function(options) { this.selectLine(this.getSelectionStartFromPointer(options.e)); }); }, /** * Initializes "mousedown" event handler */ initMousedownHandler: function() { this.on('mousedown', function(options) { var pointer = this.canvas.getPointer(options.e); this.__mousedownX = pointer.x; this.__mousedownY = pointer.y; this.__isMousedown = true; if (this.hiddenTextarea && this.canvas) { this.canvas.wrapperEl.appendChild(this.hiddenTextarea); } if (this.selected) { this.setCursorByClick(options.e); } if (this.isEditing) { this.__selectionStartOnMouseDown = this.selectionStart; this.initDelayedCursor(true); } }); }, /** * Initializes "mousemove" event handler */ initMousemoveHandler: function() { this.on('mousemove', function(options) { if (!this.__isMousedown || !this.isEditing) { return; } var newSelectionStart = this.getSelectionStartFromPointer(options.e); if (newSelectionStart >= this.__selectionStartOnMouseDown) { this.setSelectionStart(this.__selectionStartOnMouseDown); this.setSelectionEnd(newSelectionStart); } else { this.setSelectionStart(newSelectionStart); this.setSelectionEnd(this.__selectionStartOnMouseDown); } }); }, /** * @private */ _isObjectMoved: function(e) { var pointer = this.canvas.getPointer(e); return this.__mousedownX !== pointer.x || this.__mousedownY !== pointer.y; }, /** * Initializes "mouseup" event handler */ initMouseupHandler: function() { this.on('mouseup', function(options) { this.__isMousedown = false; if (this._isObjectMoved(options.e)) { return; } if (this.__lastSelected) { this.enterEditing(); this.initDelayedCursor(true); } this.selected = true; }); }, /** * Changes cursor location in a text depending on passed pointer (x/y) object * @param {Event} e Event object */ setCursorByClick: function(e) { var newSelectionStart = this.getSelectionStartFromPointer(e); if (e.shiftKey) { if (newSelectionStart < this.selectionStart) { this.setSelectionEnd(this.selectionStart); this.setSelectionStart(newSelectionStart); } else { this.setSelectionEnd(newSelectionStart); } } else { this.setSelectionStart(newSelectionStart); this.setSelectionEnd(newSelectionStart); } }, /** * @private * @param {Event} e Event object * @return {Object} Coordinates of a pointer (x, y) */ _getLocalRotatedPointer: function(e) { var pointer = this.canvas.getPointer(e), pClicked = new fabric.Point(pointer.x, pointer.y), pLeftTop = new fabric.Point(this.left, this.top), rotated = fabric.util.rotatePoint( pClicked, pLeftTop, fabric.util.degreesToRadians(-this.angle)); return this.getLocalPointer(e, rotated); }, /** * Returns index of a character corresponding to where an object was clicked * @param {Event} e Event object * @return {Number} Index of a character */ getSelectionStartFromPointer: function(e) { var mouseOffset = this._getLocalRotatedPointer(e), textLines = this.text.split(this._reNewline), prevWidth = 0, width = 0, height = 0, charIndex = 0, newSelectionStart; for (var i = 0, len = textLines.length; i < len; i++) { height += this._getHeightOfLine(this.ctx, i) * this.scaleY; var widthOfLine = this._getWidthOfLine(this.ctx, i, textLines), lineLeftOffset = this._getLineLeftOffset(widthOfLine); width = lineLeftOffset * this.scaleX; if (this.flipX) { // when oject is horizontally flipped we reverse chars textLines[i] = textLines[i].split('').reverse().join(''); } for (var j = 0, jlen = textLines[i].length; j < jlen; j++) { var _char = textLines[i][j]; prevWidth = width; width += this._getWidthOfChar(this.ctx, _char, i, this.flipX ? jlen - j : j) * this.scaleX; if (height <= mouseOffset.y || width <= mouseOffset.x) { charIndex++; continue; } return this._getNewSelectionStartFromOffset( mouseOffset, prevWidth, width, charIndex + i, jlen); } if (mouseOffset.y < height) { return this._getNewSelectionStartFromOffset( mouseOffset, prevWidth, width, charIndex + i, jlen); } } // clicked somewhere after all chars, so set at the end if (typeof newSelectionStart === 'undefined') { return this.text.length; } }, /** * @private */ _getNewSelectionStartFromOffset: function(mouseOffset, prevWidth, width, index, jlen) { var distanceBtwLastCharAndCursor = mouseOffset.x - prevWidth, distanceBtwNextCharAndCursor = width - mouseOffset.x, offset = distanceBtwNextCharAndCursor > distanceBtwLastCharAndCursor ? 0 : 1, newSelectionStart = index + offset; // if object is horizontally flipped, mirror cursor location from the end if (this.flipX) { newSelectionStart = jlen - newSelectionStart; } if (newSelectionStart > this.text.length) { newSelectionStart = this.text.length; } return newSelectionStart; } }); fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.prototype */ { /** * Initializes hidden textarea (needed to bring up keyboard in iOS) */ initHiddenTextarea: function() { this.hiddenTextarea = fabric.document.createElement('textarea'); this.hiddenTextarea.setAttribute('autocapitalize', 'off'); this.hiddenTextarea.style.cssText = 'position: absolute; top: 0; left: -9999px'; fabric.document.body.appendChild(this.hiddenTextarea); fabric.util.addListener(this.hiddenTextarea, 'keydown', this.onKeyDown.bind(this)); fabric.util.addListener(this.hiddenTextarea, 'keypress', this.onKeyPress.bind(this)); fabric.util.addListener(this.hiddenTextarea, 'copy', this.copy.bind(this)); fabric.util.addListener(this.hiddenTextarea, 'paste', this.paste.bind(this)); if (!this._clickHandlerInitialized && this.canvas) { fabric.util.addListener(this.canvas.upperCanvasEl, 'click', this.onClick.bind(this)); this._clickHandlerInitialized = true; } }, /** * @private */ _keysMap: { 8: 'removeChars', 13: 'insertNewline', 37: 'moveCursorLeft', 38: 'moveCursorUp', 39: 'moveCursorRight', 40: 'moveCursorDown', 46: 'forwardDelete' }, /** * @private */ _ctrlKeysMap: { 65: 'selectAll', 88: 'cut' }, onClick: function() { // No need to trigger click event here, focus is enough to have the keyboard appear on Android this.hiddenTextarea && this.hiddenTextarea.focus(); }, /** * Handles keyup event * @param {Event} e Event object */ onKeyDown: function(e) { if (!this.isEditing) { return; } if (e.keyCode in this._keysMap && e.charCode === 0) { this[this._keysMap[e.keyCode]](e); } else if ((e.keyCode in this._ctrlKeysMap) && (e.ctrlKey || e.metaKey)) { this[this._ctrlKeysMap[e.keyCode]](e); } else { return; } e.stopPropagation(); this.canvas && this.canvas.renderAll(); }, /** * Forward delete */ forwardDelete: function(e) { if (this.selectionStart === this.selectionEnd) { this.moveCursorRight(e); } this.removeChars(e); }, /** * Copies selected text * @param {Event} e Event object */ copy: function(e) { var selectedText = this.getSelectedText(), clipboardData = this._getClipboardData(e); // Check for backward compatibility with old browsers if (clipboardData) { clipboardData.setData('text', selectedText); } this.copiedText = selectedText; this.copiedStyles = this.getSelectionStyles( this.selectionStart, this.selectionEnd); }, /** * Pastes text * @param {Event} e Event object */ paste: function(e) { var copiedText = null, clipboardData = this._getClipboardData(e); // Check for backward compatibility with old browsers if (clipboardData) { copiedText = clipboardData.getData('text'); } else { copiedText = this.copiedText; } if (copiedText) { this.insertChars(copiedText); } }, /** * Cuts text * @param {Event} e Event object */ cut: function(e) { if (this.selectionStart === this.selectionEnd) { return; } this.copy(); this.removeChars(e); }, /** * @private * @param {Event} e Event object * @return {Object} Clipboard data object */ _getClipboardData: function(e) { return e && (e.clipboardData || fabric.window.clipboardData); }, /** * Handles keypress event * @param {Event} e Event object */ onKeyPress: function(e) { if (!this.isEditing || e.metaKey || e.ctrlKey || ( e.keyCode in this._keysMap && e.charCode === 0 )) { return; } this.insertChars(String.fromCharCode(e.which)); e.stopPropagation(); }, /** * Gets start offset of a selection * @param {Event} e Event object * @param {Boolean} isRight * @return {Number} */ getDownCursorOffset: function(e, isRight) { var selectionProp = isRight ? this.selectionEnd : this.selectionStart, textLines = this.text.split(this._reNewline), _char, lineLeftOffset, textBeforeCursor = this.text.slice(0, selectionProp), textAfterCursor = this.text.slice(selectionProp), textOnSameLineBeforeCursor = textBeforeCursor.slice(textBeforeCursor.lastIndexOf('\n') + 1), textOnSameLineAfterCursor = textAfterCursor.match(/(.*)\n?/)[1], textOnNextLine = (textAfterCursor.match(/.*\n(.*)\n?/) || { })[1] || '', cursorLocation = this.get2DCursorLocation(selectionProp); // if on last line, down cursor goes to end of line if (cursorLocation.lineIndex === textLines.length - 1 || e.metaKey) { // move to the end of a text return this.text.length - selectionProp; } var widthOfSameLineBeforeCursor = this._getWidthOfLine(this.ctx, cursorLocation.lineIndex, textLines); lineLeftOffset = this._getLineLeftOffset(widthOfSameLineBeforeCursor); var widthOfCharsOnSameLineBeforeCursor = lineLeftOffset, lineIndex = cursorLocation.lineIndex; for (var i = 0, len = textOnSameLineBeforeCursor.length; i < len; i++) { _char = textOnSameLineBeforeCursor[i]; widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i); } var indexOnNextLine = this._getIndexOnNextLine( cursorLocation, textOnNextLine, widthOfCharsOnSameLineBeforeCursor, textLines); return textOnSameLineAfterCursor.length + 1 + indexOnNextLine; }, /** * @private */ _getIndexOnNextLine: function(cursorLocation, textOnNextLine, widthOfCharsOnSameLineBeforeCursor, textLines) { var lineIndex = cursorLocation.lineIndex + 1, widthOfNextLine = this._getWidthOfLine(this.ctx, lineIndex, textLines), lineLeftOffset = this._getLineLeftOffset(widthOfNextLine), widthOfCharsOnNextLine = lineLeftOffset, indexOnNextLine = 0, foundMatch; for (var j = 0, jlen = textOnNextLine.length; j < jlen; j++) { var _char = textOnNextLine[j], widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j); widthOfCharsOnNextLine += widthOfChar; if (widthOfCharsOnNextLine > widthOfCharsOnSameLineBeforeCursor) { foundMatch = true; var leftEdge = widthOfCharsOnNextLine - widthOfChar, rightEdge = widthOfCharsOnNextLine, offsetFromLeftEdge = Math.abs(leftEdge - widthOfCharsOnSameLineBeforeCursor), offsetFromRightEdge = Math.abs(rightEdge - widthOfCharsOnSameLineBeforeCursor); indexOnNextLine = offsetFromRightEdge < offsetFromLeftEdge ? j + 1 : j; break; } } // reached end if (!foundMatch) { indexOnNextLine = textOnNextLine.length; } return indexOnNextLine; }, /** * Moves cursor down * @param {Event} e Event object */ moveCursorDown: function(e) { this.abortCursorAnimation(); this._currentCursorOpacity = 1; var offset = this.getDownCursorOffset(e, this._selectionDirection === 'right'); if (e.shiftKey) { this.moveCursorDownWithShift(offset); } else { this.moveCursorDownWithoutShift(offset); } this.initDelayedCursor(); }, /** * Moves cursor down without keeping selection * @param {Number} offset */ moveCursorDownWithoutShift: function(offset) { this._selectionDirection = 'right'; this.selectionStart += offset; if (this.selectionStart > this.text.length) { this.selectionStart = this.text.length; } this.selectionEnd = this.selectionStart; }, /** * Moves cursor down while keeping selection * @param {Number} offset */ moveCursorDownWithShift: function(offset) { if (this._selectionDirection === 'left' && (this.selectionStart !== this.selectionEnd)) { this.selectionStart += offset; this._selectionDirection = 'left'; return; } else { this._selectionDirection = 'right'; this.selectionEnd += offset; if (this.selectionEnd > this.text.length) { this.selectionEnd = this.text.length; } } }, /** * @param {Event} e Event object * @param {Boolean} isRight * @return {Number} */ getUpCursorOffset: function(e, isRight) { var selectionProp = isRight ? this.selectionEnd : this.selectionStart, cursorLocation = this.get2DCursorLocation(selectionProp); // if on first line, up cursor goes to start of line if (cursorLocation.lineIndex === 0 || e.metaKey) { return selectionProp; } var textBeforeCursor = this.text.slice(0, selectionProp), textOnSameLineBeforeCursor = textBeforeCursor.slice(textBeforeCursor.lastIndexOf('\n') + 1), textOnPreviousLine = (textBeforeCursor.match(/\n?(.*)\n.*$/) || {})[1] || '', textLines = this.text.split(this._reNewline), _char, widthOfSameLineBeforeCursor = this._getWidthOfLine(this.ctx, cursorLocation.lineIndex, textLines), lineLeftOffset = this._getLineLeftOffset(widthOfSameLineBeforeCursor), widthOfCharsOnSameLineBeforeCursor = lineLeftOffset, lineIndex = cursorLocation.lineIndex; for (var i = 0, len = textOnSameLineBeforeCursor.length; i < len; i++) { _char = textOnSameLineBeforeCursor[i]; widthOfCharsOnSameLineBeforeCursor += this._getWidthOfChar(this.ctx, _char, lineIndex, i); } var indexOnPrevLine = this._getIndexOnPrevLine( cursorLocation, textOnPreviousLine, widthOfCharsOnSameLineBeforeCursor, textLines); return textOnPreviousLine.length - indexOnPrevLine + textOnSameLineBeforeCursor.length; }, /** * @private */ _getIndexOnPrevLine: function(cursorLocation, textOnPreviousLine, widthOfCharsOnSameLineBeforeCursor, textLines) { var lineIndex = cursorLocation.lineIndex - 1, widthOfPreviousLine = this._getWidthOfLine(this.ctx, lineIndex, textLines), lineLeftOffset = this._getLineLeftOffset(widthOfPreviousLine), widthOfCharsOnPreviousLine = lineLeftOffset, indexOnPrevLine = 0, foundMatch; for (var j = 0, jlen = textOnPreviousLine.length; j < jlen; j++) { var _char = textOnPreviousLine[j], widthOfChar = this._getWidthOfChar(this.ctx, _char, lineIndex, j); widthOfCharsOnPreviousLine += widthOfChar; if (widthOfCharsOnPreviousLine > widthOfCharsOnSameLineBeforeCursor) { foundMatch = true; var leftEdge = widthOfCharsOnPreviousLine - widthOfChar, rightEdge = widthOfCharsOnPreviousLine, offsetFromLeftEdge = Math.abs(leftEdge - widthOfCharsOnSameLineBeforeCursor), offsetFromRightEdge = Math.abs(rightEdge - widthOfCharsOnSameLineBeforeCursor); indexOnPrevLine = offsetFromRightEdge < offsetFromLeftEdge ? j : (j - 1); break; } } // reached end if (!foundMatch) { indexOnPrevLine = textOnPreviousLine.length - 1; } return indexOnPrevLine; }, /** * Moves cursor up * @param {Event} e Event object */ moveCursorUp: function(e) { this.abortCursorAnimation(); this._currentCursorOpacity = 1; var offset = this.getUpCursorOffset(e, this._selectionDirection === 'right'); if (e.shiftKey) { this.moveCursorUpWithShift(offset); } else { this.moveCursorUpWithoutShift(offset); } this.initDelayedCursor(); }, /** * Moves cursor up with shift * @param {Number} offset */ moveCursorUpWithShift: function(offset) { if (this.selectionStart === this.selectionEnd) { this.selectionStart -= offset; } else { if (this._selectionDirection === 'right') { this.selectionEnd -= offset; this._selectionDirection = 'right'; return; } else { this.selectionStart -= offset; } } if (this.selectionStart < 0) { this.selectionStart = 0; } this._selectionDirection = 'left'; }, /** * Moves cursor up without shift * @param {Number} offset */ moveCursorUpWithoutShift: function(offset) { if (this.selectionStart === this.selectionEnd) { this.selectionStart -= offset; } if (this.selectionStart < 0) { this.selectionStart = 0; } this.selectionEnd = this.selectionStart; this._selectionDirection = 'left'; }, /** * Moves cursor left * @param {Event} e Event object */ moveCursorLeft: function(e) { if (this.selectionStart === 0 && this.selectionEnd === 0) { return; } this.abortCursorAnimation(); this._currentCursorOpacity = 1; if (e.shiftKey) { this.moveCursorLeftWithShift(e); } else { this.moveCursorLeftWithoutShift(e); } this.initDelayedCursor(); }, /** * @private */ _move: function(e, prop, direction) { if (e.altKey) { this[prop] = this['findWordBoundary' + direction](this[prop]); } else if (e.metaKey) { this[prop] = this['findLineBoundary' + direction](this[prop]); } else { this[prop] += (direction === 'Left' ? -1 : 1); } }, /** * @private */ _moveLeft: function(e, prop) { this._move(e, prop, 'Left'); }, /** * @private */ _moveRight: function(e, prop) { this._move(e, prop, 'Right'); }, /** * Moves cursor left without keeping selection * @param {Event} e */ moveCursorLeftWithoutShift: function(e) { this._selectionDirection = 'left'; // only move cursor when there is no selection, // otherwise we discard it, and leave cursor on same place if (this.selectionEnd === this.selectionStart) { this._moveLeft(e, 'selectionStart'); } this.selectionEnd = this.selectionStart; }, /** * Moves cursor left while keeping selection * @param {Event} e */ moveCursorLeftWithShift: function(e) { if (this._selectionDirection === 'right' && this.selectionStart !== this.selectionEnd) { this._moveLeft(e, 'selectionEnd'); } else { this._selectionDirection = 'left'; this._moveLeft(e, 'selectionStart'); // increase selection by one if it's a newline if (this.text.charAt(this.selectionStart) === '\n') { this.selectionStart--; } if (this.selectionStart < 0) { this.selectionStart = 0; } } }, /** * Moves cursor right * @param {Event} e Event object */ moveCursorRight: function(e) { if (this.selectionStart >= this.text.length && this.selectionEnd >= this.text.length) { return; } this.abortCursorAnimation(); this._currentCursorOpacity = 1; if (e.shiftKey) { this.moveCursorRightWithShift(e); } else { this.moveCursorRightWithoutShift(e); } this.initDelayedCursor(); }, /** * Moves cursor right while keeping selection * @param {Event} e */ moveCursorRightWithShift: function(e) { if (this._selectionDirection === 'left' && this.selectionStart !== this.selectionEnd) { this._moveRight(e, 'selectionStart'); } else { this._selectionDirection = 'right'; this._moveRight(e, 'selectionEnd'); // increase selection by one if it's a newline if (this.text.charAt(this.selectionEnd - 1) === '\n') { this.selectionEnd++; } if (this.selectionEnd > this.text.length) { this.selectionEnd = this.text.length; } } }, /** * Moves cursor right without keeping selection * @param {Event} e Event object */ moveCursorRightWithoutShift: function(e) { this._selectionDirection = 'right'; if (this.selectionStart === this.selectionEnd) { this._moveRight(e, 'selectionStart'); this.selectionEnd = this.selectionStart; } else { this.selectionEnd += this.getNumNewLinesInSelectedText(); if (this.selectionEnd > this.text.length) { this.selectionEnd = this.text.length; } this.selectionStart = this.selectionEnd; } }, /** * Inserts a character where cursor is (replacing selection if one exists) * @param {Event} e Event object */ removeChars: function(e) { if (this.selectionStart === this.selectionEnd) { this._removeCharsNearCursor(e); } else { this._removeCharsFromTo(this.selectionStart, this.selectionEnd); } this.selectionEnd = this.selectionStart; this._removeExtraneousStyles(); if (this.canvas) { // TODO: double renderAll gets rid of text box shift happenning sometimes // need to find out what exactly causes it and fix it this.canvas.renderAll().renderAll(); } this.setCoords(); this.fire('changed'); this.canvas && this.canvas.fire('text:changed', { target: this }); }, /** * @private * @param {Event} e Event object */ _removeCharsNearCursor: function(e) { if (this.selectionStart !== 0) { if (e.metaKey) { // remove all till the start of current line var leftLineBoundary = this.findLineBoundaryLeft(this.selectionStart); this._removeCharsFromTo(leftLineBoundary, this.selectionStart); this.selectionStart = leftLineBoundary; } else if (e.altKey) { // remove all till the start of current word var leftWordBoundary = this.findWordBoundaryLeft(this.selectionStart); this._removeCharsFromTo(leftWordBoundary, this.selectionStart); this.selectionStart = leftWordBoundary; } else { var isBeginningOfLine = this.text.slice(this.selectionStart - 1, this.selectionStart) === '\n'; this.removeStyleObject(isBeginningOfLine); this.selectionStart--; this.text = this.text.slice(0, this.selectionStart) + this.text.slice(this.selectionStart + 1); } } } }); /* _TO_SVG_START_ */ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.prototype */ { /** * @private */ _setSVGTextLineText: function(textLine, lineIndex, textSpans, lineHeight, lineTopOffsetMultiplier, textBgRects) { if (!this.styles[lineIndex]) { this.callSuper('_setSVGTextLineText', textLine, lineIndex, textSpans, lineHeight, lineTopOffsetMultiplier); } else { this._setSVGTextLineChars( textLine, lineIndex, textSpans, lineHeight, lineTopOffsetMultiplier, textBgRects); } }, /** * @private */ _setSVGTextLineChars: function(textLine, lineIndex, textSpans, lineHeight, lineTopOffsetMultiplier, textBgRects) { var yProp = lineIndex === 0 || this.useNative ? 'y' : 'dy', chars = textLine.split(''), charOffset = 0, lineLeftOffset = this._getSVGLineLeftOffset(lineIndex), lineTopOffset = this._getSVGLineTopOffset(lineIndex), heightOfLine = this._getHeightOfLine(this.ctx, lineIndex); for (var i = 0, len = chars.length; i < len; i++) { var styleDecl = this.styles[lineIndex][i] || { }; textSpans.push( this._createTextCharSpan( chars[i], styleDecl, lineLeftOffset, lineTopOffset, yProp, charOffset)); var charWidth = this._getWidthOfChar(this.ctx, chars[i], lineIndex, i); if (styleDecl.textBackgroundColor) { textBgRects.push( this._createTextCharBg( styleDecl, lineLeftOffset, lineTopOffset, heightOfLine, charWidth, charOffset)); } charOffset += charWidth; } }, /** * @private */ _getSVGLineLeftOffset: function(lineIndex) { return (this._boundaries && this._boundaries[lineIndex]) ? fabric.util.toFixed(this._boundaries[lineIndex].left, 2) : 0; }, /** * @private */ _getSVGLineTopOffset: function(lineIndex) { var lineTopOffset = 0; for (var j = 0; j <= lineIndex; j++) { lineTopOffset += this._getHeightOfLine(this.ctx, j); } return lineTopOffset - this.height / 2; }, /** * @private */ _createTextCharBg: function(styleDecl, lineLeftOffset, lineTopOffset, heightOfLine, charWidth, charOffset) { return [ //jscs:disable validateIndentation '<rect fill="', styleDecl.textBackgroundColor, '" transform="translate(', -this.width / 2, ' ', -this.height + heightOfLine, ')', '" x="', lineLeftOffset + charOffset, '" y="', lineTopOffset + heightOfLine, '" width="', charWidth, '" height="', heightOfLine, '"></rect>' //jscs:enable validateIndentation ].join(''); }, /** * @private */ _createTextCharSpan: function(_char, styleDecl, lineLeftOffset, lineTopOffset, yProp, charOffset) { var fillStyles = this.getSvgStyles.call(fabric.util.object.extend({ visible: true, fill: this.fill, stroke: this.stroke, type: 'text' }, styleDecl)); return [ //jscs:disable validateIndentation '<tspan x="', lineLeftOffset + charOffset, '" ', yProp, '="', lineTopOffset, '" ', (styleDecl.fontFamily ? 'font-family="' + styleDecl.fontFamily.replace(/"/g,'\'') + '" ': ''), (styleDecl.fontSize ? 'font-size="' + styleDecl.fontSize + '" ': ''), (styleDecl.fontStyle ? 'font-style="' + styleDecl.fontStyle + '" ': ''), (styleDecl.fontWeight ? 'font-weight="' + styleDecl.fontWeight + '" ': ''), (styleDecl.textDecoration ? 'text-decoration="' + styleDecl.textDecoration + '" ': ''), 'style="', fillStyles, '">', fabric.util.string.escapeXml(_char), '</tspan>' //jscs:enable validateIndentation ].join(''); } }); /* _TO_SVG_END_ */ (function() { if (typeof document !== 'undefined' && typeof window !== 'undefined') { return; } var DOMParser = require('xmldom').DOMParser, URL = require('url'), HTTP = require('http'), HTTPS = require('https'), Canvas = require('canvas'), Image = require('canvas').Image; /** @private */ function request(url, encoding, callback) { var oURL = URL.parse(url); // detect if http or https is used if ( !oURL.port ) { oURL.port = ( oURL.protocol.indexOf('https:') === 0 ) ? 443 : 80; } // assign request handler based on protocol var reqHandler = ( oURL.port === 443 ) ? HTTPS : HTTP, req = reqHandler.request({ hostname: oURL.hostname, port: oURL.port, path: oURL.path, method: 'GET' }, function(response) { var body = ''; if (encoding) { response.setEncoding(encoding); } response.on('end', function () { callback(body); }); response.on('data', function (chunk) { if (response.statusCode === 200) { body += chunk; } }); }); req.on('error', function(err) { if (err.errno === process.ECONNREFUSED) { fabric.log('ECONNREFUSED: connection refused to ' + oURL.hostname + ':' + oURL.port); } else { fabric.log(err.message); } }); req.end(); } /** @private */ function requestFs(path, callback){ var fs = require('fs'); fs.readFile(path, function (err, data) { if (err) { fabric.log(err); throw err; } else { callback(data); } }); } fabric.util.loadImage = function(url, callback, context) { function createImageAndCallBack(data) { img.src = new Buffer(data, 'binary'); // preserving original url, which seems to be lost in node-canvas img._src = url; callback && callback.call(context, img); } var img = new Image(); if (url && (url instanceof Buffer || url.indexOf('data') === 0)) { img.src = img._src = url; callback && callback.call(context, img); } else if (url && url.indexOf('http') !== 0) { requestFs(url, createImageAndCallBack); } else if (url) { request(url, 'binary', createImageAndCallBack); } else { callback && callback.call(context, url); } }; fabric.loadSVGFromURL = function(url, callback, reviver) { url = url.replace(/^\n\s*/, '').replace(/\?.*$/, '').trim(); if (url.indexOf('http') !== 0) { requestFs(url, function(body) { fabric.loadSVGFromString(body.toString(), callback, reviver); }); } else { request(url, '', function(body) { fabric.loadSVGFromString(body, callback, reviver); }); } }; fabric.loadSVGFromString = function(string, callback, reviver) { var doc = new DOMParser().parseFromString(string); fabric.parseSVGDocument(doc.documentElement, function(results, options) { callback && callback(results, options); }, reviver); }; fabric.util.getScript = function(url, callback) { request(url, '', function(body) { eval(body); callback && callback(); }); }; fabric.Image.fromObject = function(object, callback) { fabric.util.loadImage(object.src, function(img) { var oImg = new fabric.Image(img); oImg._initConfig(object); oImg._initFilters(object, function(filters) { oImg.filters = filters || [ ]; callback && callback(oImg); }); }); }; /** * Only available when running fabric on node.js * @param {Number} width Canvas width * @param {Number} height Canvas height * @param {Object} [options] Options to pass to FabricCanvas. * @param {Object} [nodeCanvasOptions] Options to pass to NodeCanvas. * @return {Object} wrapped canvas instance */ fabric.createCanvasForNode = function(width, height, options, nodeCanvasOptions) { nodeCanvasOptions = nodeCanvasOptions || options; var canvasEl = fabric.document.createElement('canvas'), nodeCanvas = new Canvas(width || 600, height || 600, nodeCanvasOptions); // jsdom doesn't create style on canvas element, so here be temp. workaround canvasEl.style = { }; canvasEl.width = nodeCanvas.width; canvasEl.height = nodeCanvas.height; var FabricCanvas = fabric.Canvas || fabric.StaticCanvas, fabricCanvas = new FabricCanvas(canvasEl, options); fabricCanvas.contextContainer = nodeCanvas.getContext('2d'); fabricCanvas.nodeCanvas = nodeCanvas; fabricCanvas.Font = Canvas.Font; return fabricCanvas; }; /** @ignore */ fabric.StaticCanvas.prototype.createPNGStream = function() { return this.nodeCanvas.createPNGStream(); }; fabric.StaticCanvas.prototype.createJPEGStream = function(opts) { return this.nodeCanvas.createJPEGStream(opts); }; var origSetWidth = fabric.StaticCanvas.prototype.setWidth; fabric.StaticCanvas.prototype.setWidth = function(width, options) { origSetWidth.call(this, width, options); this.nodeCanvas.width = width; return this; }; if (fabric.Canvas) { fabric.Canvas.prototype.setWidth = fabric.StaticCanvas.prototype.setWidth; } var origSetHeight = fabric.StaticCanvas.prototype.setHeight; fabric.StaticCanvas.prototype.setHeight = function(height, options) { origSetHeight.call(this, height, options); this.nodeCanvas.height = height; return this; }; if (fabric.Canvas) { fabric.Canvas.prototype.setHeight = fabric.StaticCanvas.prototype.setHeight; } })(); /* Footer for requirejs AMD support */ window.fabric = fabric; // make sure exports.fabric is always defined when used as 'global' later scopes var exports = exports || {}; exports.fabric = fabric; if (typeof define === 'function' && define.amd) { define([], function() { return fabric }); }
Timbioz/cdnjs
ajax/libs/fabric.js/1.4.11/fabric.require.js
JavaScript
mit
651,630
.select2-container { box-sizing: border-box; display: inline-block; margin: 0; position: relative; vertical-align: middle; } .select2-container .select2-selection--single { box-sizing: border-box; cursor: pointer; display: block; height: 28px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--single .select2-selection__rendered { display: block; overflow: hidden; padding-left: 8px; padding-right: 20px; text-overflow: ellipsis; } .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered { padding-right: 8px; padding-left: 20px; } .select2-container .select2-selection--multiple { box-sizing: border-box; cursor: pointer; display: block; min-height: 32px; user-select: none; -webkit-user-select: none; } .select2-container .select2-selection--multiple .select2-selection__rendered { display: inline-block; overflow: hidden; padding-left: 8px; text-overflow: ellipsis; } .select2-container .select2-search--inline { float: left; } .select2-container .select2-search--inline .select2-search__field { border: none; font-size: 100%; margin-top: 5px; } .select2-dropdown { background-color: white; border: 1px solid #aaa; border-radius: 4px; box-sizing: border-box; display: block; position: absolute; left: -100000px; width: 100%; z-index: 1051; } .select2-results { display: block; } .select2-results__options { list-style: none; margin: 0; padding: 0; } .select2-results__option { padding: 6px; user-select: none; -webkit-user-select: none; } .select2-results__option[aria-selected] { cursor: pointer; } .select2-container--open .select2-dropdown { left: 0; } .select2-container--open .select2-dropdown--above { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--open .select2-dropdown--below { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-search--dropdown { display: block; padding: 4px; } .select2-search--dropdown .select2-search__field { padding: 4px; width: 100%; box-sizing: border-box; } .select2-search--dropdown.select2-search--hide { display: none; } .select2-close-mask { border: 0; margin: 0; padding: 0; display: block; position: fixed; left: 0; top: 0; min-height: 100%; min-width: 100%; height: auto; width: auto; opacity: 0; z-index: 99; background-color: #fff; filter: alpha(opacity=0); } .select2-container--default .select2-selection--single { background-color: #fff; border: 1px solid #aaa; border-radius: 4px; } .select2-container--default .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--default .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; } .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--default .select2-selection--single .select2-selection__arrow { height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; } .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow { left: 1px; right: auto; } .select2-container--default.select2-container--disabled .select2-selection--single { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear { display: none; } .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--default .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; } .select2-container--default .select2-selection--multiple .select2-selection__rendered { list-style: none; margin: 0; padding: 0 5px; width: 100%; } .select2-container--default .select2-selection--multiple .select2-selection__placeholder { color: #999; margin-top: 5px; float: left; } .select2-container--default .select2-selection--multiple .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-top: 5px; margin-right: 10px; } .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #999; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #333; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder { float: right; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--default.select2-container--disabled .select2-selection--multiple { background-color: #eee; cursor: default; } .select2-container--default.select2-container--disabled .select2-selection__choice__remove { display: none; } .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple { border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; } .select2-container--default .select2-search--inline .select2-search__field { background: transparent; border: none; outline: 0; } .select2-container--default .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--default .select2-results__option[role=group] { padding: 0; } .select2-container--default .select2-results__option[aria-disabled=true] { color: #999; } .select2-container--default .select2-results__option[aria-selected=true] { background-color: #ddd; } .select2-container--default .select2-results__option .select2-results__option { padding-left: 1em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__group { padding-left: 0; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option { margin-left: -1em; padding-left: 2em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -2em; padding-left: 3em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -3em; padding-left: 4em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -4em; padding-left: 5em; } .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option { margin-left: -5em; padding-left: 6em; } .select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: #5897fb; color: white; } .select2-container--default .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic .select2-selection--single { background-color: #f6f6f6; border: 1px solid #aaa; border-radius: 4px; outline: 0; background-image: -webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%); background-image: -o-linear-gradient(top, #ffffff 50%, #eeeeee 100%); background-image: linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); } .select2-container--classic .select2-selection--single:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--single .select2-selection__rendered { color: #444; line-height: 28px; } .select2-container--classic .select2-selection--single .select2-selection__clear { cursor: pointer; float: right; font-weight: bold; margin-right: 10px; } .select2-container--classic .select2-selection--single .select2-selection__placeholder { color: #999; } .select2-container--classic .select2-selection--single .select2-selection__arrow { background-color: #ddd; border: none; border-left: 1px solid #aaa; border-top-right-radius: 4px; border-bottom-right-radius: 4px; height: 26px; position: absolute; top: 1px; right: 1px; width: 20px; background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0); } .select2-container--classic .select2-selection--single .select2-selection__arrow b { border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; height: 0; left: 50%; margin-left: -4px; margin-top: -2px; position: absolute; top: 50%; width: 0; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear { float: left; } .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow { border: none; border-right: 1px solid #aaa; border-radius: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; left: 1px; right: auto; } .select2-container--classic.select2-container--open .select2-selection--single { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow { background: transparent; border: none; } .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; background-image: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%); background-image: -o-linear-gradient(top, #ffffff 0%, #eeeeee 50%); background-image: linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background-image: -webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%); background-image: -o-linear-gradient(top, #eeeeee 50%, #ffffff 100%); background-image: linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); } .select2-container--classic .select2-selection--multiple { background-color: white; border: 1px solid #aaa; border-radius: 4px; cursor: text; outline: 0; } .select2-container--classic .select2-selection--multiple:focus { border: 1px solid #5897fb; } .select2-container--classic .select2-selection--multiple .select2-selection__rendered { list-style: none; margin: 0; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__clear { display: none; } .select2-container--classic .select2-selection--multiple .select2-selection__choice { background-color: #e4e4e4; border: 1px solid #aaa; border-radius: 4px; cursor: default; float: left; margin-right: 5px; margin-top: 5px; padding: 0 5px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove { color: #888; cursor: pointer; display: inline-block; font-weight: bold; margin-right: 2px; } .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover { color: #555; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { float: right; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { margin-left: 5px; margin-right: auto; } .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove { margin-left: 2px; margin-right: auto; } .select2-container--classic.select2-container--open .select2-selection--multiple { border: 1px solid #5897fb; } .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple { border-top: none; border-top-left-radius: 0; border-top-right-radius: 0; } .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple { border-bottom: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } .select2-container--classic .select2-search--dropdown .select2-search__field { border: 1px solid #aaa; outline: 0; } .select2-container--classic .select2-search--inline .select2-search__field { outline: 0; } .select2-container--classic .select2-dropdown { background-color: white; border: 1px solid transparent; } .select2-container--classic .select2-dropdown--above { border-bottom: none; } .select2-container--classic .select2-dropdown--below { border-top: none; } .select2-container--classic .select2-results > .select2-results__options { max-height: 200px; overflow-y: auto; } .select2-container--classic .select2-results__option[role=group] { padding: 0; } .select2-container--classic .select2-results__option[aria-disabled=true] { color: grey; } .select2-container--classic .select2-results__option--highlighted[aria-selected] { background-color: #3875d7; color: white; } .select2-container--classic .select2-results__group { cursor: default; display: block; padding: 6px; } .select2-container--classic.select2-container--open .select2-dropdown { border-color: #5897fb; }
rileyjshaw/cdnjs
ajax/libs/select2/4.0.0-beta.3/css/select2.css
CSS
mit
16,395
/** * Bunch of useful filters for angularJS(with no external dependencies!) * @version v0.5.2 - 2015-01-17 * @link https://github.com/a8m/angular-filter * @author Ariel Mashraki <ariel@mashraki.co.il> * @license MIT License, http://www.opensource.org/licenses/MIT */!function(a,b,c){"use strict";function d(a){return D(a)?a:Object.keys(a).map(function(b){return a[b]})}function e(a){return null===a}function f(a,b){var d=Object.keys(a);return-1==d.map(function(d){return b[d]!==c&&b[d]==a[d]}).indexOf(!1)}function g(a,b){if(""===b)return a;var c=a.indexOf(b.charAt(0));return-1===c?!1:g(a.substr(c+1),b.substr(1))}function h(a,b,c){var d=0;return a.filter(function(a){var e=x(c)?b>d&&c(a):b>d;return d=e?d+1:d,e})}function i(a,b,c){return c.round(a*c.pow(10,b))/c.pow(10,b)}function j(a,b,c){b=b||[];var d=Object.keys(a);return d.forEach(function(d){if(C(a[d])&&!D(a[d])){var e=c?c+"."+d:c;j(a[d],b,e||d)}else{var f=c?c+"."+d:d;b.push(f)}}),b}function k(a){return a&&a.$evalAsync&&a.$watch}function l(){return function(a,b){return a>b}}function m(){return function(a,b){return a>=b}}function n(){return function(a,b){return b>a}}function o(){return function(a,b){return b>=a}}function p(){return function(a,b){return a==b}}function q(){return function(a,b){return a!=b}}function r(){return function(a,b){return a===b}}function s(){return function(a,b){return a!==b}}function t(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?!1:b.some(function(b){return C(b)||z(c)?a(c)(b):b===c})}}function u(a,b){return b=b||0,b>=a.length?a:D(a[b])?u(a.slice(0,b).concat(a[b],a.slice(b+1)),b):u(a,b+1)}function v(a){return function(b,c){function e(a,b){return y(b)?!1:a.some(function(a){return H(a,b)})}if(b=C(b)?d(b):b,!D(b))return b;var f=[],g=a(c);return b.filter(y(c)?function(a,b,c){return c.indexOf(a)===b}:function(a){var b=g(a);return e(f,b)?!1:(f.push(b),!0)})}}function w(a,b,c){return b?a+c+w(a,--b,c):a}var x=b.isDefined,y=b.isUndefined,z=b.isFunction,A=b.isString,B=b.isNumber,C=b.isObject,D=b.isArray,E=b.forEach,F=b.extend,G=b.copy,H=b.equals;String.prototype.contains||(String.prototype.contains=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),b.module("a8m.angular",[]).filter("isUndefined",function(){return function(a){return b.isUndefined(a)}}).filter("isDefined",function(){return function(a){return b.isDefined(a)}}).filter("isFunction",function(){return function(a){return b.isFunction(a)}}).filter("isString",function(){return function(a){return b.isString(a)}}).filter("isNumber",function(){return function(a){return b.isNumber(a)}}).filter("isArray",function(){return function(a){return b.isArray(a)}}).filter("isObject",function(){return function(a){return b.isObject(a)}}).filter("isEqual",function(){return function(a,c){return b.equals(a,c)}}),b.module("a8m.conditions",[]).filter({isGreaterThan:l,">":l,isGreaterThanOrEqualTo:m,">=":m,isLessThan:n,"<":n,isLessThanOrEqualTo:o,"<=":o,isEqualTo:p,"==":p,isNotEqualTo:q,"!=":q,isIdenticalTo:r,"===":r,isNotIdenticalTo:s,"!==":s}),b.module("a8m.is-null",[]).filter("isNull",function(){return function(a){return e(a)}}),b.module("a8m.after-where",[]).filter("afterWhere",function(){return function(a,b){if(a=C(a)?d(a):a,!D(a)||y(b))return a;var c=a.map(function(a){return f(b,a)}).indexOf(!0);return a.slice(-1===c?0:c)}}),b.module("a8m.after",[]).filter("after",function(){return function(a,b){return a=C(a)?d(a):a,D(a)?a.slice(b):a}}),b.module("a8m.before-where",[]).filter("beforeWhere",function(){return function(a,b){if(a=C(a)?d(a):a,!D(a)||y(b))return a;var c=a.map(function(a){return f(b,a)}).indexOf(!0);return a.slice(0,-1===c?a.length:++c)}}),b.module("a8m.before",[]).filter("before",function(){return function(a,b){return a=C(a)?d(a):a,D(a)?a.slice(0,b?--b:b):a}}),b.module("a8m.concat",[]).filter("concat",[function(){return function(a,b){if(y(b))return a;if(D(a))return a.concat(C(b)?d(b):b);if(C(a)){var c=d(a);return c.concat(C(b)?d(b):b)}return a}}]),b.module("a8m.contains",[]).filter({contains:["$parse",t],some:["$parse",t]}),b.module("a8m.count-by",[]).filter("countBy",["$parse",function(a){return function(b,c){var e,f={},g=a(c);return b=C(b)?d(b):b,!D(b)||y(c)?b:(b.forEach(function(a){e=g(a),f[e]||(f[e]=0),f[e]++}),f)}}]),b.module("a8m.defaults",[]).filter("defaults",["$parse",function(a){return function(b,c){if(b=C(b)?d(b):b,!D(b)||!C(c))return b;var e=j(c);return b.forEach(function(b){e.forEach(function(d){var e=a(d),f=e.assign;y(e(b))&&f(b,e(c))})}),b}}]),b.module("a8m.every",[]).filter("every",["$parse",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?!0:b.every(function(b){return C(b)||z(c)?a(c)(b):b===c})}}]),b.module("a8m.filter-by",[]).filter("filterBy",["$parse",function(a){return function(b,e,f){var g;return f=A(f)||B(f)?String(f).toLowerCase():c,b=C(b)?d(b):b,!D(b)||y(f)?b:b.filter(function(b){return e.some(function(c){if(~c.indexOf("+")){var d=c.replace(new RegExp("\\s","g"),"").split("+");g=d.reduce(function(c,d,e){return 1===e?a(c)(b)+" "+a(d)(b):c+" "+a(d)(b)})}else g=a(c)(b);return A(g)||B(g)?String(g).toLowerCase().contains(f):!1})})}}]),b.module("a8m.first",[]).filter("first",["$parse",function(a){return function(b){var e,f,g;return b=C(b)?d(b):b,D(b)?(g=Array.prototype.slice.call(arguments,1),e=B(g[0])?g[0]:1,f=B(g[0])?B(g[1])?c:g[1]:g[0],g.length?h(b,e,f?a(f):f):b[0]):b}}]),b.module("a8m.flatten",[]).filter("flatten",function(){return function(a,b){return b=b||!1,a=C(a)?d(a):a,D(a)?b?[].concat.apply([],a):u(a,0):a}}),b.module("a8m.fuzzy-by",[]).filter("fuzzyBy",["$parse",function(a){return function(b,c,e,f){var h,i,j=f||!1;return b=C(b)?d(b):b,!D(b)||y(c)||y(e)?b:(i=a(c),b.filter(function(a){return h=i(a),A(h)?(h=j?h:h.toLowerCase(),e=j?e:e.toLowerCase(),g(h,e)!==!1):!1}))}}]),b.module("a8m.fuzzy",[]).filter("fuzzy",function(){return function(a,b,c){function e(a,b){var c,d,e=Object.keys(a);return 0<e.filter(function(e){return c=a[e],d?!0:A(c)?(c=f?c:c.toLowerCase(),d=g(c,b)!==!1):!1}).length}var f=c||!1;return a=C(a)?d(a):a,!D(a)||y(b)?a:(b=f?b:b.toLowerCase(),a.filter(function(a){return A(a)?(a=f?a:a.toLowerCase(),g(a,b)!==!1):C(a)?e(a,b):!1}))}}),b.module("a8m.group-by",["a8m.filter-watcher"]).filter("groupBy",["$parse","filterWatcher",function(a,b){return function(c,d){function e(a,b){var c,d={};return E(a,function(a){c=b(a),d[c]||(d[c]=[]),d[c].push(a)}),d}if(!C(c)||y(d))return c;var f=a(d);return b.isMemoized("groupBy",arguments)||b.memoize("groupBy",arguments,this,e(c,f))}}]),b.module("a8m.is-empty",[]).filter("isEmpty",function(){return function(a){return C(a)?!d(a).length:!a.length}}),b.module("a8m.join",[]).filter("join",function(){return function(a,b){return y(a)||!D(a)?a:(y(b)&&(b=" "),a.join(b))}}),b.module("a8m.last",[]).filter("last",["$parse",function(a){return function(b){var e,f,g,i=G(b);return i=C(i)?d(i):i,D(i)?(g=Array.prototype.slice.call(arguments,1),e=B(g[0])?g[0]:1,f=B(g[0])?B(g[1])?c:g[1]:g[0],g.length?h(i.reverse(),e,f?a(f):f).reverse():i[i.length-1]):i}}]),b.module("a8m.map",[]).filter("map",["$parse",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.map(function(b){return a(c)(b)})}}]),b.module("a8m.omit",[]).filter("omit",["$parse",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.filter(function(b){return!a(c)(b)})}}]),b.module("a8m.pick",[]).filter("pick",["$parse",function(a){return function(b,c){return b=C(b)?d(b):b,!D(b)||y(c)?b:b.filter(function(b){return a(c)(b)})}}]),b.module("a8m.remove-with",[]).filter("removeWith",function(){return function(a,b){return y(b)?a:(a=C(a)?d(a):a,a.filter(function(a){return!f(b,a)}))}}),b.module("a8m.remove",[]).filter("remove",function(){return function(a){a=C(a)?d(a):a;var b=Array.prototype.slice.call(arguments,1);return D(a)?a.filter(function(a){return!b.some(function(b){return H(b,a)})}):a}}),b.module("a8m.reverse",[]).filter("reverse",[function(){return function(a){return a=C(a)?d(a):a,A(a)?a.split("").reverse().join(""):D(a)?a.slice().reverse():a}}]),b.module("a8m.search-field",[]).filter("searchField",["$parse",function(a){return function(b){var c,e;b=C(b)?d(b):b;var f=Array.prototype.slice.call(arguments,1);return D(b)&&f.length?b.map(function(b){return e=f.map(function(d){return(c=a(d))(b)}).join(" "),F(b,{searchField:e})}):b}}]),b.module("a8m.to-array",[]).filter("toArray",function(){return function(a,b){return C(a)?b?Object.keys(a).map(function(b){return F(a[b],{$key:b})}):d(a):a}}),b.module("a8m.unique",[]).filter({unique:["$parse",v],uniq:["$parse",v]}),b.module("a8m.where",[]).filter("where",function(){return function(a,b){return y(b)?a:(a=C(a)?d(a):a,a.filter(function(a){return f(b,a)}))}}),b.module("a8m.xor",[]).filter("xor",["$parse",function(a){return function(b,c,e){function f(b,c){var d=a(e);return c.some(function(a){return e?H(d(a),d(b)):H(a,b)})}return e=e||!1,b=C(b)?d(b):b,c=C(c)?d(c):c,D(b)&&D(c)?b.concat(c).filter(function(a){return!(f(a,b)&&f(a,c))}):b}}]),b.module("a8m.math.byteFmt",["a8m.math"]).filter("byteFmt",["$math",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1024>b?i(b,c,a)+" B":1048576>b?i(b/1024,c,a)+" KB":1073741824>b?i(b/1048576,c,a)+" MB":i(b/1073741824,c,a)+" GB":"NaN"}}]),b.module("a8m.math.degrees",["a8m.math"]).filter("degrees",["$math",function(a){return function(b,c){if(B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)){var d=180*b/a.PI;return a.round(d*a.pow(10,c))/a.pow(10,c)}return"NaN"}}]),b.module("a8m.math.kbFmt",["a8m.math"]).filter("kbFmt",["$math",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1024>b?i(b,c,a)+" KB":1048576>b?i(b/1024,c,a)+" MB":i(b/1048576,c,a)+" GB":"NaN"}}]),b.module("a8m.math",[]).factory("$math",["$window",function(a){return a.Math}]),b.module("a8m.math.max",["a8m.math"]).filter("max",["$math","$parse",function(a,b){function c(c,d){var e=c.map(function(a){return b(d)(a)});return e.indexOf(a.max.apply(a,e))}return function(b,d){return D(b)?y(d)?a.max.apply(a,b):b[c(b,d)]:b}}]),b.module("a8m.math.min",["a8m.math"]).filter("min",["$math","$parse",function(a,b){function c(c,d){var e=c.map(function(a){return b(d)(a)});return e.indexOf(a.min.apply(a,e))}return function(b,d){return D(b)?y(d)?a.min.apply(a,b):b[c(b,d)]:b}}]),b.module("a8m.math.percent",["a8m.math"]).filter("percent",["$math","$window",function(a,b){return function(c,d,e){var f=A(c)?b.Number(c):c;return d=d||100,e=e||!1,!B(f)||b.isNaN(f)?c:e?a.round(f/d*100):f/d*100}}]),b.module("a8m.math.radians",["a8m.math"]).filter("radians",["$math",function(a){return function(b,c){if(B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)){var d=3.14159265359*b/180;return a.round(d*a.pow(10,c))/a.pow(10,c)}return"NaN"}}]),b.module("a8m.math.radix",[]).filter("radix",function(){return function(a,b){var c=/^[2-9]$|^[1-2]\d$|^3[0-6]$/;return B(a)&&c.test(b)?a.toString(b).toUpperCase():a}}),b.module("a8m.math.shortFmt",["a8m.math"]).filter("shortFmt",["$math",function(a){return function(b,c){return B(c)&&isFinite(c)&&c%1===0&&c>=0&&B(b)&&isFinite(b)?1e3>b?b:1e6>b?i(b/1e3,c,a)+" K":1e9>b?i(b/1e6,c,a)+" M":i(b/1e9,c,a)+" B":"NaN"}}]),b.module("a8m.math.sum",[]).filter("sum",function(){return function(a,b){return D(a)?a.reduce(function(a,b){return a+b},b||0):a}}),b.module("a8m.ends-with",[]).filter("endsWith",function(){return function(a,b,c){var d,e=c||!1;return!A(a)||y(b)?a:(a=e?a:a.toLowerCase(),d=a.length-b.length,-1!==a.indexOf(e?b:b.toLowerCase(),d))}}),b.module("a8m.ltrim",[]).filter("ltrim",function(){return function(a,b){var c=b||"\\s";return A(a)?a.replace(new RegExp("^"+c+"+"),""):a}}),b.module("a8m.repeat",[]).filter("repeat",[function(){return function(a,b,c){var d=~~b;return A(a)&&d?w(a,--b,c||""):a}}]),b.module("a8m.rtrim",[]).filter("rtrim",function(){return function(a,b){var c=b||"\\s";return A(a)?a.replace(new RegExp(c+"+$"),""):a}}),b.module("a8m.slugify",[]).filter("slugify",[function(){return function(a,b){var c=y(b)?"-":b;return A(a)?a.toLowerCase().replace(/\s+/g,c):a}}]),b.module("a8m.starts-with",[]).filter("startsWith",function(){return function(a,b,c){var d=c||!1;return!A(a)||y(b)?a:(a=d?a:a.toLowerCase(),!a.indexOf(d?b:b.toLowerCase()))}}),b.module("a8m.stringular",[]).filter("stringular",function(){return function(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/{(\d+)}/g,function(a,c){return y(b[c])?a:b[c]})}}),b.module("a8m.strip-tags",[]).filter("stripTags",function(){return function(a){return A(a)?a.replace(/<\S[^><]*>/g,""):a}}),b.module("a8m.trim",[]).filter("trim",function(){return function(a,b){var c=b||"\\s";return A(a)?a.replace(new RegExp("^"+c+"+|"+c+"+$","g"),""):a}}),b.module("a8m.truncate",[]).filter("truncate",function(){return function(a,b,c,d){return b=y(b)?a.length:b,d=d||!1,c=c||"",!A(a)||a.length<=b?a:a.substring(0,d?-1===a.indexOf(" ",b)?a.length:a.indexOf(" ",b):b)+c}}),b.module("a8m.ucfirst",[]).filter("ucfirst",[function(){return function(a){return A(a)?a.split(" ").map(function(a){return a.charAt(0).toUpperCase()+a.substring(1)}).join(" "):a}}]),b.module("a8m.uri-component-encode",[]).filter("uriComponentEncode",["$window",function(a){return function(b){return A(b)?a.encodeURIComponent(b):b}}]),b.module("a8m.uri-encode",[]).filter("uriEncode",["$window",function(a){return function(b){return A(b)?a.encodeURI(b):b}}]),b.module("a8m.wrap",[]).filter("wrap",function(){return function(a,b,c){return!A(a)||y(b)?a:[b,a,c||b].join("")}}),b.module("a8m.filter-watcher",[]).provider("filterWatcher",function(){this.$get=["$window","$rootScope",function(a,c){function d(a,c){return[a,b.toJson(c)].join("#").replace(/"/g,"")}function e(a){var b=a.targetScope.$id;E(l[b],function(a){delete j[a]}),delete l[b]}function f(){m(function(){c.$$phase||(j={})})}function g(a,b){var c=a.$id;return y(l[c])&&(a.$on("$destroy",e),l[c]=[]),l[c].push(b)}function h(a,b){var c=d(a,b);return j[c]}function i(a,b,c,e){var h=d(a,b);return j[h]=e,k(c)?g(c,h):f(),e}var j={},l={},m=a.setTimeout;return{isMemoized:h,memoize:i}}]}),b.module("angular.filter",["a8m.ucfirst","a8m.uri-encode","a8m.uri-component-encode","a8m.slugify","a8m.strip-tags","a8m.stringular","a8m.truncate","a8m.starts-with","a8m.ends-with","a8m.wrap","a8m.trim","a8m.ltrim","a8m.rtrim","a8m.repeat","a8m.to-array","a8m.concat","a8m.contains","a8m.unique","a8m.is-empty","a8m.after","a8m.after-where","a8m.before","a8m.before-where","a8m.defaults","a8m.where","a8m.reverse","a8m.remove","a8m.remove-with","a8m.group-by","a8m.count-by","a8m.search-field","a8m.fuzzy-by","a8m.fuzzy","a8m.omit","a8m.pick","a8m.every","a8m.filter-by","a8m.xor","a8m.map","a8m.first","a8m.last","a8m.flatten","a8m.join","a8m.math","a8m.math.max","a8m.math.min","a8m.math.percent","a8m.math.radix","a8m.math.sum","a8m.math.degrees","a8m.math.radians","a8m.math.byteFmt","a8m.math.kbFmt","a8m.math.shortFmt","a8m.angular","a8m.conditions","a8m.is-null","a8m.filter-watcher"])}(window,window.angular);
JacquesMarais/cdnjs
ajax/libs/angular-filter/0.5.2/angular-filter.min.js
JavaScript
mit
14,937
/* * # Semantic UI - 1.7.3 * https://github.com/Semantic-Org/Semantic-UI * http://www.semantic-ui.com/ * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ /******************************* Icon *******************************/ @font-face { font-family: 'Icons'; src: url("../themes/default/assets/fonts/icons.eot"); src: url("../themes/default/assets/fonts/icons.eot?#iefix") format('embedded-opentype'), url("../themes/default/assets/fonts/icons.svg#icons") format('svg'), url("../themes/default/assets/fonts/icons.woff") format('woff'), url("../themes/default/assets/fonts/icons.ttf") format('truetype'); font-style: normal; font-weight: normal; font-variant: normal; text-decoration: inherit; text-transform: none; } i.icon { display: inline-block; opacity: 1; margin: 0em 0.25rem 0em 0em; width: 1.23em; height: 0.9em; font-family: 'Icons'; font-style: normal; line-height: 1; font-weight: normal; text-decoration: inherit; text-align: center; speak: none; font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-backface-visibility: hidden; backface-visibility: hidden; } i.icon:before { background: none !important; } /******************************* Types *******************************/ /*-------------- Loading ---------------*/ i.icon.loading { height: 1em; -webkit-animation: icon-loading 2s linear infinite; animation: icon-loading 2s linear infinite; } @-webkit-keyframes icon-loading { from { -webkit-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes icon-loading { from { -webkit-transform: rotate(0deg); transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } /******************************* States *******************************/ i.icon.hover { opacity: 1; } i.icon.active { opacity: 1; } i.emphasized.icon { opacity: 1; } i.disabled.icon { pointer-events: none; opacity: 0.3 !important; } /******************************* Variations *******************************/ /*------------------- Link --------------------*/ i.link.icon { cursor: pointer; opacity: 0.8; -webkit-transition: opacity 0.2s ease; transition: opacity 0.2s ease; } i.link.icon:hover { opacity: 1 !important; } /*------------------- Circular --------------------*/ i.circular.icon { border-radius: 500em !important; padding: 0.5em 0.5em !important; box-shadow: 0em 0em 0em 0.1em rgba(0, 0, 0, 0.1) inset; line-height: 1 !important; width: 2em !important; height: 2em !important; } i.circular.inverted.icon { border: none; box-shadow: none; } /*------------------- Flipped --------------------*/ i.flipped.icon, i.horizontally.flipped.icon { -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } i.vertically.flipped.icon { -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } /*------------------- Rotated --------------------*/ i.rotated.icon, i.right.rotated.icon, i.clockwise.rotated.icon { -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } i.left.rotated.icon, i.counterclockwise.rotated.icon { -webkit-transform: rotate(-90deg); -ms-transform: rotate(-90deg); transform: rotate(-90deg); } /*------------------- Bordered --------------------*/ i.bordered.icon { width: 2em; height: 2em; padding: 0.55em 0.385em !important; box-shadow: 0em 0em 0em 0.1em rgba(0, 0, 0, 0.1) inset; vertical-align: baseline; } i.bordered.inverted.icon { border: none; box-shadow: none; } /*------------------- Colors --------------------*/ i.white.icon { color: #ffffff !important; } i.black.icon { color: #1b1c1d !important; } i.blue.icon { color: #3b83c0 !important; } i.green.icon { color: #5bbd72 !important; } i.orange.icon { color: #e07b53 !important; } i.pink.icon { color: #d9499a !important; } i.purple.icon { color: #564f8a !important; } i.red.icon { color: #d95c5c !important; } i.teal.icon { color: #00b5ad !important; } i.yellow.icon { color: #f2c61f !important; } /*------------------- Inverted --------------------*/ i.inverted.icon { color: #ffffff; } i.inverted.black.icon { color: #333333 !important; } i.inverted.blue.icon { color: #54c8ff !important; } i.inverted.green.icon { color: #2ecc40 !important; } i.inverted.orange.icon { color: #ff851b !important; } i.inverted.pink.icon { color: #ff8edf !important; } i.inverted.purple.icon { color: #cdc6ff !important; } i.inverted.red.icon { color: #ff695e !important; } i.inverted.teal.icon { color: #6dffff !important; } i.inverted.yellow.icon { color: #ffe21f !important; } /* Inverted Shapes */ i.inverted.bordered.icon, i.inverted.circular.icon { background-color: #222222 !important; color: #FFFFFF !important; } i.inverted.bordered.black.icon, i.inverted.circular.black.icon { background-color: #1b1c1d !important; color: #FFFFFF !important; } i.inverted.bordered.blue.icon, i.inverted.circular.blue.icon { background-color: #3b83c0 !important; color: #FFFFFF !important; } i.inverted.bordered.green.icon, i.inverted.circular.green.icon { background-color: #5bbd72 !important; color: #FFFFFF !important; } i.inverted.bordered.orange.icon, i.inverted.circular.orange.icon { background-color: #e07b53 !important; color: #FFFFFF !important; } i.inverted.bordered.pink.icon, i.inverted.circular.pink.icon { background-color: #d9499a !important; color: #FFFFFF !important; } i.inverted.bordered.purple.icon, i.inverted.circular.purple.icon { background-color: #564f8a !important; color: #FFFFFF !important; } i.inverted.bordered.red.icon, i.inverted.circular.red.icon { background-color: #d95c5c !important; color: #FFFFFF !important; } i.inverted.bordered.teal.icon, i.inverted.circular.teal.icon { background-color: #00b5ad !important; color: #FFFFFF !important; } i.inverted.bordered.yellow.icon, i.inverted.circular.yellow.icon { background-color: #f2c61f !important; color: #FFFFFF !important; } /*------------------- Sizes --------------------*/ i.small.icon { font-size: 0.875em; } i.icon { font-size: 1em; } i.large.icon { font-size: 1.5em; vertical-align: middle; } i.big.icon { font-size: 2em; vertical-align: middle; } i.huge.icon { font-size: 4em; vertical-align: middle; } i.massive.icon { font-size: 8em; vertical-align: middle; } /* * # Semantic - Icon * http://github.com/semantic-org/semantic-ui/ * * * Copyright 2014 Contributor * Released under the MIT license * http://opensource.org/licenses/MIT * */ /* * Font Awesome 4.0.3 * the iconic font designed for Bootstrap * ------------------------------------------------------------------------------ * The full suite of pictographic icons, examples, and documentation can be * found at http://fon.io. Stay up to date on Twitter at * http://twitter.com/fon. * * License * ------------------------------------------------------------------------------ * - The Font Awesome font is licensed under SIL OFL 1.1 - * http://scripts.sil.org/OFL /******************************* Semantic-UI integration of font-awesome : ///class names are separated i.icon.circle => i.icon.circle i.icon.circle-o => i.icon.circle.outline //abbreviation are replaced by full letters: i.icon.ellipsis-h => i.icon.ellipsis.horizontal i.icon.ellipsis-v => i.icon.ellipsis.vertical .alpha => .i.icon.alphabet .asc => .i.icon.ascending .desc => .i.icon.descending .alt =>.alternate ASCII order is conserved for easier maintenance. Icons that only have one style 'outline', 'square' etc do not require this class for instance `lemon icon` not `lemon outline icon` since there is only one lemon *******************************/ /******************************* Icons *******************************/ /* Web Content */ i.icon.search:before { content: "\f002"; } i.icon.mail.outline:before { content: "\f003"; } i.icon.external.link:before { content: "\f08e"; } i.icon.wifi:before { content: "\f012"; } i.icon.setting:before { content: "\f013"; } i.icon.home:before { content: "\f015"; } i.icon.inbox:before { content: "\f01c"; } i.icon.browser:before { content: "\f022"; } i.icon.tag:before { content: "\f02b"; } i.icon.tags:before { content: "\f02c"; } i.icon.calendar:before { content: "\f073"; } i.icon.comment:before { content: "\f075"; } i.icon.comments:before { content: "\f086"; } i.icon.shop:before { content: "\f07a"; } i.icon.privacy:before { content: "\f084"; } i.icon.settings:before { content: "\f085"; } i.icon.trophy:before { content: "\f091"; } i.icon.payment:before { content: "\f09d"; } i.icon.feed:before { content: "\f09e"; } i.icon.alarm.outline:before { content: "\f0a2"; } i.icon.tasks:before { content: "\f0ae"; } i.icon.cloud:before { content: "\f0c2"; } i.icon.lab:before { content: "\f0c3"; } i.icon.mail:before { content: "\f0e0"; } i.icon.idea:before { content: "\f0eb"; } i.icon.dashboard:before { content: "\f0e4"; } i.icon.sitemap:before { content: "\f0e8"; } i.icon.alarm:before { content: "\f0f3"; } i.icon.terminal:before { content: "\f120"; } i.icon.code:before { content: "\f121"; } i.icon.protect:before { content: "\f132"; } i.icon.calendar.outline:before { content: "\f133"; } i.icon.ticket:before { content: "\f145"; } i.icon.external.link.square:before { content: "\f14c"; } i.icon.map:before { content: "\f14e"; } i.icon.bug:before { content: "\f188"; } i.icon.mail.square:before { content: "\f199"; } i.icon.history:before { content: "\f1da"; } i.icon.options:before { content: "\f1de"; } i.icon.comment.outline:before { content: "\f0e5"; } i.icon.comments.outline:before { content: "\f0e6"; } /* User Actions */ i.icon.download:before { content: "\f019"; } i.icon.repeat:before { content: "\f01e"; } i.icon.refresh:before { content: "\f021"; } i.icon.lock:before { content: "\f023"; } i.icon.bookmark:before { content: "\f02e"; } i.icon.print:before { content: "\f02f"; } i.icon.write:before { content: "\f040"; } i.icon.theme:before { content: "\f043"; } i.icon.adjust:before { content: "\f042"; } i.icon.edit:before { content: "\f044"; } i.icon.external.share:before { content: "\f045"; } i.icon.ban:before { content: "\f05e"; } i.icon.mail.forward:before { content: "\f064"; } i.icon.share:before { content: "\f064"; } i.icon.expand:before { content: "\f065"; } i.icon.compress:before { content: "\f066"; } i.icon.unhide:before { content: "\f06e"; } i.icon.hide:before { content: "\f070"; } i.icon.random:before { content: "\f074"; } i.icon.retweet:before { content: "\f079"; } i.icon.sign.out:before { content: "\f08b"; } i.icon.pin:before { content: "\f08d"; } i.icon.sign.in:before { content: "\f090"; } i.icon.upload:before { content: "\f093"; } i.icon.call:before { content: "\f095"; } i.icon.call.square:before { content: "\f098"; } i.icon.remove.bookmark:before { content: "\f097"; } i.icon.unlock:before { content: "\f09c"; } i.icon.configure:before { content: "\f0ad"; } i.icon.filter:before { content: "\f0b0"; } i.icon.wizard:before { content: "\f0d0"; } i.icon.undo:before { content: "\f0e2"; } i.icon.exchange:before { content: "\f0ec"; } i.icon.cloud.download:before { content: "\f0ed"; } i.icon.cloud.upload:before { content: "\f0ee"; } i.icon.reply:before { content: "\f112"; } i.icon.reply.all:before { content: "\f122"; } i.icon.erase:before { content: "\f12d"; } i.icon.unlock.alternate:before { content: "\f13e"; } i.icon.archive:before { content: "\f187"; } i.icon.translate:before { content: "\f1ab"; } i.icon.recycle:before { content: "\f1b8"; } i.icon.send:before { content: "\f1d8"; } i.icon.send.outline:before { content: "\f1d9"; } i.icon.share.alternate:before { content: "\f1e0"; } i.icon.share.alternate.square:before { content: "\f1e1"; } i.icon.wait:before { content: "\f017"; } i.icon.write.square:before { content: "\f14b"; } i.icon.share.square:before { content: "\f14d"; } /* Messages */ i.icon.help.circle:before { content: "\f059"; } i.icon.info.circle:before { content: "\f05a"; } i.icon.warning:before { content: "\f12a"; } i.icon.warning.circle:before { content: "\f06a"; } i.icon.warning.sign:before { content: "\f071"; } i.icon.help:before { content: "\f128"; } i.icon.info:before { content: "\f129"; } i.icon.announcement:before { content: "\f0a1"; } /* Users */ i.icon.users:before { content: "\f0c0"; } i.icon.doctor:before { content: "\f0f0"; } i.icon.female:before { content: "\f182"; } i.icon.male:before { content: "\f183"; } i.icon.child:before { content: "\f1ae"; } i.icon.user:before { content: "\f007"; } i.icon.handicap:before { content: "\f193"; } i.icon.student:before { content: "\f19d"; } /* View Adjustment */ i.icon.grid.layout:before { content: "\f00a"; } i.icon.list.layout:before { content: "\f00b"; } i.icon.block.layout:before { content: "\f009"; } i.icon.zoom:before { content: "\f00e"; } i.icon.zoom.out:before { content: "\f010"; } i.icon.resize.vertical:before { content: "\f07d"; } i.icon.resize.horizontal:before { content: "\f07e"; } i.icon.maximize:before { content: "\f0b2"; } i.icon.crop:before { content: "\f125"; } /* Literal Objects */ i.icon.cocktail:before { content: "\f000"; } i.icon.road:before { content: "\f018"; } i.icon.flag:before { content: "\f024"; } i.icon.book:before { content: "\f02d"; } i.icon.gift:before { content: "\f06b"; } i.icon.leaf:before { content: "\f06c"; } i.icon.fire:before { content: "\f06d"; } i.icon.plane:before { content: "\f072"; } i.icon.magnet:before { content: "\f076"; } i.icon.legal:before { content: "\f0e3"; } i.icon.lemon:before { content: "\f094"; } i.icon.world:before { content: "\f0ac"; } i.icon.travel:before { content: "\f0b1"; } i.icon.shipping:before { content: "\f0d1"; } i.icon.money:before { content: "\f0d6"; } i.icon.lightning:before { content: "\f0e7"; } i.icon.rain:before { content: "\f0e9"; } i.icon.treatment:before { content: "\f0f1"; } i.icon.suitcase:before { content: "\f0f2"; } i.icon.bar:before { content: "\f0fc"; } i.icon.flag.outline:before { content: "\f11d"; } i.icon.flag.checkered:before { content: "\f11e"; } i.icon.puzzle:before { content: "\f12e"; } i.icon.fire.extinguisher:before { content: "\f134"; } i.icon.rocket:before { content: "\f135"; } i.icon.anchor:before { content: "\f13d"; } i.icon.bullseye:before { content: "\f140"; } i.icon.sun:before { content: "\f185"; } i.icon.moon:before { content: "\f186"; } i.icon.fax:before { content: "\f1ac"; } i.icon.life.ring:before { content: "\f1cd"; } i.icon.bomb:before { content: "\f1e2"; } /* Shapes */ i.icon.crosshairs:before { content: "\f05b"; } i.icon.asterisk:before { content: "\f069"; } i.icon.certificate:before { content: "\f0a3"; } i.icon.circle:before { content: "\f111"; } i.icon.quote.left:before { content: "\f10d"; } i.icon.quote.right:before { content: "\f10e"; } i.icon.ellipsis.horizontal:before { content: "\f141"; } i.icon.ellipsis.vertical:before { content: "\f142"; } i.icon.cube:before { content: "\f1b2"; } i.icon.cubes:before { content: "\f1b3"; } i.icon.circle.notched:before { content: "\f1ce"; } i.icon.circle.thin:before { content: "\f1db"; } /* Item Selection */ i.icon.checkmark:before { content: "\f00c"; } i.icon.remove:before { content: "\f00d"; } i.icon.checkmark.box:before { content: "\f046"; } i.icon.move:before { content: "\f047"; } i.icon.add.circle:before { content: "\f055"; } i.icon.minus.circle:before { content: "\f056"; } i.icon.remove.circle:before { content: "\f057"; } i.icon.check.circle:before { content: "\f058"; } i.icon.remove.circle.outline:before { content: "\f05c"; } i.icon.check.circle.outline:before { content: "\f05d"; } i.icon.plus:before { content: "\f067"; } i.icon.minus:before { content: "\f068"; } i.icon.add.square:before { content: "\f0fe"; } i.icon.radio:before { content: "\f10c"; } i.icon.selected.radio:before { content: "\f192"; } i.icon.minus.square:before { content: "\f146"; } i.icon.minus.square.outline:before { content: "\f147"; } i.icon.check.square:before { content: "\f14a"; } i.icon.plus.square.outline:before { content: "\f196"; } /* Media */ i.icon.film:before { content: "\f008"; } i.icon.sound:before { content: "\f025"; } i.icon.photo:before { content: "\f030"; } i.icon.bar.chart:before { content: "\f080"; } i.icon.camera.retro:before { content: "\f083"; } /* Pointers */ i.icon.arrow.circle.outline.down:before { content: "\f01a"; } i.icon.arrow.circle.outline.up:before { content: "\f01b"; } i.icon.chevron.left:before { content: "\f053"; } i.icon.chevron.right:before { content: "\f054"; } i.icon.arrow.left:before { content: "\f060"; } i.icon.arrow.right:before { content: "\f061"; } i.icon.arrow.up:before { content: "\f062"; } i.icon.arrow.down:before { content: "\f063"; } i.icon.chevron.up:before { content: "\f077"; } i.icon.chevron.down:before { content: "\f078"; } i.icon.pointing.right:before { content: "\f0a4"; } i.icon.pointing.left:before { content: "\f0a5"; } i.icon.pointing.up:before { content: "\f0a6"; } i.icon.pointing.down:before { content: "\f0a7"; } i.icon.arrow.circle.left:before { content: "\f0a8"; } i.icon.arrow.circle.right:before { content: "\f0a9"; } i.icon.arrow.circle.up:before { content: "\f0aa"; } i.icon.arrow.circle.down:before { content: "\f0ab"; } i.icon.caret.down:before { content: "\f0d7"; } i.icon.caret.up:before { content: "\f0d8"; } i.icon.caret.left:before { content: "\f0d9"; } i.icon.caret.right:before { content: "\f0da"; } i.icon.angle.double.left:before { content: "\f100"; } i.icon.angle.double.right:before { content: "\f101"; } i.icon.angle.double.up:before { content: "\f102"; } i.icon.angle.double.down:before { content: "\f103"; } i.icon.angle.left:before { content: "\f104"; } i.icon.angle.right:before { content: "\f105"; } i.icon.angle.up:before { content: "\f106"; } i.icon.angle.down:before { content: "\f107"; } i.icon.chevron.circle.left:before { content: "\f137"; } i.icon.chevron.circle.right:before { content: "\f138"; } i.icon.chevron.circle.up:before { content: "\f139"; } i.icon.chevron.circle.down:before { content: "\f13a"; } i.icon.toggle.down:before { content: "\f150"; } i.icon.toggle.up:before { content: "\f151"; } i.icon.toggle.right:before { content: "\f152"; } i.icon.long.arrow.down:before { content: "\f175"; } i.icon.long.arrow.up:before { content: "\f176"; } i.icon.long.arrow.left:before { content: "\f177"; } i.icon.long.arrow.right:before { content: "\f178"; } i.icon.arrow.circle.outline.right:before { content: "\f18e"; } i.icon.arrow.circle.outline.left:before { content: "\f190"; } i.icon.toggle.left:before { content: "\f191"; } /* Computer */ i.icon.power:before { content: "\f011"; } i.icon.trash:before { content: "\f014"; } i.icon.disk.outline:before { content: "\f0a0"; } i.icon.desktop:before { content: "\f108"; } i.icon.laptop:before { content: "\f109"; } i.icon.tablet:before { content: "\f10a"; } i.icon.mobile:before { content: "\f10b"; } i.icon.game:before { content: "\f11b"; } i.icon.keyboard:before { content: "\f11c"; } /* File System */ i.icon.folder:before { content: "\f07b"; } i.icon.folder.open:before { content: "\f07c"; } i.icon.level.up:before { content: "\f148"; } i.icon.level.down:before { content: "\f149"; } i.icon.file:before { content: "\f15b"; } i.icon.file.outline:before { content: "\f016"; } i.icon.file.text:before { content: "\f15c"; } i.icon.file.text.outline:before { content: "\f0f6"; } i.icon.folder.outline:before { content: "\f114"; } i.icon.folder.open.outline:before { content: "\f115"; } i.icon.file.pdf.outline:before { content: "\f1c1"; } i.icon.file.word.outline:before { content: "\f1c2"; } i.icon.file.excel.outline:before { content: "\f1c3"; } i.icon.file.powerpoint.outline:before { content: "\f1c4"; } i.icon.file.image.outline:before { content: "\f1c5"; } i.icon.file.archive.outline:before { content: "\f1c6"; } i.icon.file.audio.outline:before { content: "\f1c7"; } i.icon.file.video.outline:before { content: "\f1c8"; } i.icon.file.code.outline:before { content: "\f1c9"; } /* Technologies */ i.icon.barcode:before { content: "\f02a"; } i.icon.qrcode:before { content: "\f029"; } i.icon.fork:before { content: "\f126"; } i.icon.html5:before { content: "\f13b"; } i.icon.css3:before { content: "\f13c"; } i.icon.rss.square:before { content: "\f143"; } i.icon.openid:before { content: "\f19b"; } i.icon.database:before { content: "\f1c0"; } /* Rating */ i.icon.heart:before { content: "\f004"; } i.icon.star:before { content: "\f005"; } i.icon.empty.star:before { content: "\f006"; } i.icon.thumbs.outline.up:before { content: "\f087"; } i.icon.thumbs.outline.down:before { content: "\f088"; } i.icon.star.half:before { content: "\f089"; } i.icon.empty.heart:before { content: "\f08a"; } i.icon.smile:before { content: "\f118"; } i.icon.frown:before { content: "\f119"; } i.icon.meh:before { content: "\f11a"; } i.icon.star.half.empty:before { content: "\f123"; } i.icon.thumbs.up:before { content: "\f164"; } i.icon.thumbs.down:before { content: "\f165"; } /* Audio */ i.icon.music:before { content: "\f001"; } i.icon.video.play.outline:before { content: "\f01d"; } i.icon.volume.off:before { content: "\f026"; } i.icon.volume.down:before { content: "\f027"; } i.icon.volume.up:before { content: "\f028"; } i.icon.record:before { content: "\f03d"; } i.icon.step.backward:before { content: "\f048"; } i.icon.fast.backward:before { content: "\f049"; } i.icon.backward:before { content: "\f04a"; } i.icon.play:before { content: "\f04b"; } i.icon.pause:before { content: "\f04c"; } i.icon.stop:before { content: "\f04d"; } i.icon.forward:before { content: "\f04e"; } i.icon.fast.forward:before { content: "\f050"; } i.icon.step.forward:before { content: "\f051"; } i.icon.eject:before { content: "\f052"; } i.icon.unmute:before { content: "\f130"; } i.icon.mute:before { content: "\f131"; } i.icon.video.play:before { content: "\f144"; } /* Map & Locations */ i.icon.marker:before { content: "\f041"; } i.icon.coffee:before { content: "\f0f4"; } i.icon.food:before { content: "\f0f5"; } i.icon.building.outline:before { content: "\f0f7"; } i.icon.hospital:before { content: "\f0f8"; } i.icon.emergency:before { content: "\f0f9"; } i.icon.first.aid:before { content: "\f0fa"; } i.icon.military:before { content: "\f0fb"; } i.icon.h:before { content: "\f0fd"; } i.icon.location.arrow:before { content: "\f124"; } i.icon.space.shuttle:before { content: "\f197"; } i.icon.university:before { content: "\f19c"; } i.icon.building:before { content: "\f1ad"; } i.icon.paw:before { content: "\f1b0"; } i.icon.spoon:before { content: "\f1b1"; } i.icon.car:before { content: "\f1b9"; } i.icon.taxi:before { content: "\f1ba"; } i.icon.tree:before { content: "\f1bb"; } /* Tables */ i.icon.table:before { content: "\f0ce"; } i.icon.columns:before { content: "\f0db"; } i.icon.sort:before { content: "\f0dc"; } i.icon.sort.ascending:before { content: "\f0dd"; } i.icon.sort.descending:before { content: "\f0de"; } i.icon.sort.alphabet.ascending:before { content: "\f15d"; } i.icon.sort.alphabet.descending:before { content: "\f15e"; } i.icon.sort.content.ascending:before { content: "\f160"; } i.icon.sort.content.descending:before { content: "\f161"; } i.icon.sort.numeric.ascending:before { content: "\f162"; } i.icon.sort.numeric.descending:before { content: "\f163"; } /* Text Editor */ i.icon.font:before { content: "\f031"; } i.icon.bold:before { content: "\f032"; } i.icon.italic:before { content: "\f033"; } i.icon.text.height:before { content: "\f034"; } i.icon.text.width:before { content: "\f035"; } i.icon.align.left:before { content: "\f036"; } i.icon.align.center:before { content: "\f037"; } i.icon.align.right:before { content: "\f038"; } i.icon.align.justify:before { content: "\f039"; } i.icon.list:before { content: "\f03a"; } i.icon.outdent:before { content: "\f03b"; } i.icon.indent:before { content: "\f03c"; } i.icon.linkify:before { content: "\f0c1"; } i.icon.cut:before { content: "\f0c4"; } i.icon.copy:before { content: "\f0c5"; } i.icon.attach:before { content: "\f0c6"; } i.icon.save:before { content: "\f0c7"; } i.icon.content:before { content: "\f0c9"; } i.icon.unordered.list:before { content: "\f0ca"; } i.icon.ordered.list:before { content: "\f0cb"; } i.icon.strikethrough:before { content: "\f0cc"; } i.icon.underline:before { content: "\f0cd"; } i.icon.paste:before { content: "\f0ea"; } i.icon.unlink:before { content: "\f127"; } i.icon.superscript:before { content: "\f12b"; } i.icon.subscript:before { content: "\f12c"; } i.icon.header:before { content: "\f1dc"; } i.icon.paragraph:before { content: "\f1dd"; } /* Currency */ i.icon.euro:before { content: "\f153"; } i.icon.pound:before { content: "\f154"; } i.icon.dollar:before { content: "\f155"; } i.icon.rupee:before { content: "\f156"; } i.icon.yen:before { content: "\f157"; } i.icon.ruble:before { content: "\f158"; } i.icon.won:before { content: "\f159"; } i.icon.lira:before { content: "\f195"; } /* Networks and Websites*/ i.icon.twitter.square:before { content: "\f081"; } i.icon.facebook.square:before { content: "\f082"; } i.icon.linkedin.square:before { content: "\f08c"; } i.icon.github.square:before { content: "\f092"; } i.icon.twitter:before { content: "\f099"; } i.icon.facebook:before { content: "\f09a"; } i.icon.github:before { content: "\f09b"; } i.icon.pinterest:before { content: "\f0d2"; } i.icon.pinterest.square:before { content: "\f0d3"; } i.icon.google.plus.square:before { content: "\f0d4"; } i.icon.google.plus:before { content: "\f0d5"; } i.icon.linkedin:before { content: "\f0e1"; } i.icon.github.alternate:before { content: "\f113"; } i.icon.maxcdn:before { content: "\f136"; } i.icon.bitcoin:before { content: "\f15a"; } i.icon.youtube.square:before { content: "\f166"; } i.icon.youtube:before { content: "\f167"; } i.icon.xing:before { content: "\f168"; } i.icon.xing.square:before { content: "\f169"; } i.icon.youtube.play:before { content: "\f16a"; } i.icon.dropbox:before { content: "\f16b"; } i.icon.stack.overflow:before { content: "\f16c"; } i.icon.instagram:before { content: "\f16d"; } i.icon.flickr:before { content: "\f16e"; } i.icon.adn:before { content: "\f170"; } i.icon.bitbucket:before { content: "\f171"; } i.icon.bitbucket.square:before { content: "\f172"; } i.icon.tumblr:before { content: "\f173"; } i.icon.tumblr.square:before { content: "\f174"; } i.icon.apple:before { content: "\f179"; } i.icon.windows:before { content: "\f17a"; } i.icon.android:before { content: "\f17b"; } i.icon.linux:before { content: "\f17c"; } i.icon.dribbble:before { content: "\f17d"; } i.icon.skype:before { content: "\f17e"; } i.icon.foursquare:before { content: "\f180"; } i.icon.trello:before { content: "\f181"; } i.icon.gittip:before { content: "\f184"; } i.icon.vk:before { content: "\f189"; } i.icon.weibo:before { content: "\f18a"; } i.icon.renren:before { content: "\f18b"; } i.icon.pagelines:before { content: "\f18c"; } i.icon.stack.exchange:before { content: "\f18d"; } i.icon.vimeo:before { content: "\f194"; } i.icon.slack:before { content: "\f198"; } i.icon.wordpress:before { content: "\f19a"; } i.icon.yahoo:before { content: "\f19e"; } i.icon.google:before { content: "\f1a0"; } i.icon.reddit:before { content: "\f1a1"; } i.icon.reddit.square:before { content: "\f1a2"; } i.icon.stumbleupon.circle:before { content: "\f1a3"; } i.icon.stumbleupon:before { content: "\f1a4"; } i.icon.delicious:before { content: "\f1a5"; } i.icon.digg:before { content: "\f1a6"; } i.icon.pied.piper:before { content: "\f1a7"; } i.icon.pied.piper.alternate:before { content: "\f1a8"; } i.icon.drupal:before { content: "\f1a9"; } i.icon.joomla:before { content: "\f1aa"; } i.icon.behance:before { content: "\f1b4"; } i.icon.behance.square:before { content: "\f1b5"; } i.icon.steam:before { content: "\f1b6"; } i.icon.steam.square:before { content: "\f1b7"; } i.icon.spotify:before { content: "\f1bc"; } i.icon.deviantart:before { content: "\f1bd"; } i.icon.soundcloud:before { content: "\f1be"; } i.icon.vine:before { content: "\f1ca"; } i.icon.codepen:before { content: "\f1cb"; } i.icon.jsfiddle:before { content: "\f1cc"; } i.icon.rebel:before { content: "\f1d0"; } i.icon.empire:before { content: "\f1d1"; } i.icon.git.square:before { content: "\f1d2"; } i.icon.git:before { content: "\f1d3"; } i.icon.hacker.news:before { content: "\f1d4"; } i.icon.tencent.weibo:before { content: "\f1d5"; } i.icon.qq:before { content: "\f1d6"; } i.icon.wechat:before { content: "\f1d7"; } /******************************* Aliases *******************************/ i.icon.like:before { content: "\f004"; } i.icon.favorite:before { content: "\f005"; } i.icon.video:before { content: "\f008"; } i.icon.check:before { content: "\f00c"; } i.icon.remove:before { content: "\f00d"; } i.icon.close:before { content: "\f00d"; } i.icon.cancel:before { content: "\f00d"; } i.icon.delete:before { content: "\f00d"; } i.icon.x:before { content: "\f00d"; } i.icon.zoom.in:before { content: "\f00e"; } i.icon.magnify:before { content: "\f00e"; } i.icon.shutdown:before { content: "\f011"; } i.icon.signal:before { content: "\f012"; } i.icon.clock:before { content: "\f017"; } i.icon.time:before { content: "\f017"; } i.icon.play.circle.outline:before { content: "\f01d"; } i.icon.clockwise:before { content: "\f01e"; } i.icon.headphone:before { content: "\f025"; } i.icon.volume.off:before { content: "\f026"; } i.icon.camera:before { content: "\f030"; } i.icon.video.camera:before { content: "\f03d"; } i.icon.picture:before { content: "\f03e"; } i.icon.pencil:before { content: "\f040"; } i.icon.compose:before { content: "\f040"; } i.icon.point:before { content: "\f041"; } i.icon.tint:before { content: "\f043"; } i.icon.signup:before { content: "\f044"; } i.icon.plus.circle:before { content: "\f055"; } i.icon.minus.circle:before { content: "\f056"; } i.icon.dont:before { content: "\f05e"; } i.icon.minimize:before { content: "\f066"; } i.icon.add:before { content: "\f067"; } i.icon.eye:before { content: "\f06e"; } i.icon.attention:before { content: "\f06a"; } i.icon.cart:before { content: "\f07a"; } i.icon.plane:before { content: "\f072"; } i.icon.shuffle:before { content: "\f074"; } i.icon.talk:before { content: "\f075"; } i.icon.chat:before { content: "\f075"; } i.icon.shopping.cart:before { content: "\f07a"; } i.icon.bar.graph:before { content: "\f080"; } i.icon.key:before { content: "\f084"; } i.icon.privacy:before { content: "\f084"; } i.icon.cogs:before { content: "\f085"; } i.icon.discussions:before { content: "\f086"; } i.icon.like.outline:before { content: "\f087"; } i.icon.dislike.outline:before { content: "\f088"; } i.icon.heart.outline:before { content: "\f08a"; } i.icon.log.out:before { content: "\f08b"; } i.icon.thumb.tack:before { content: "\f08d"; } i.icon.winner:before { content: "\f091"; } i.icon.bookmark.outline:before { content: "\f097"; } i.icon.phone.square:before { content: "\f098"; } i.icon.phone.square:before { content: "\f098"; } i.icon.credit.card:before { content: "\f09d"; } i.icon.rss:before { content: "\f09e"; } i.icon.hdd.outline:before { content: "\f0a0"; } i.icon.bullhorn:before { content: "\f0a1"; } i.icon.bell:before { content: "\f0f3"; } i.icon.hand.outline.right:before { content: "\f0a4"; } i.icon.hand.outline.left:before { content: "\f0a5"; } i.icon.hand.outline.up:before { content: "\f0a6"; } i.icon.hand.outline.down:before { content: "\f0a7"; } i.icon.globe:before { content: "\f0ac"; } i.icon.wrench:before { content: "\f0ad"; } i.icon.briefcase:before { content: "\f0b1"; } i.icon.group:before { content: "\f0c0"; } i.icon.flask:before { content: "\f0c3"; } i.icon.sidebar:before { content: "\f0c9"; } i.icon.bars:before { content: "\f0c9"; } i.icon.list.ul:before { content: "\f0ca"; } i.icon.list.ol:before { content: "\f0cb"; } i.icon.numbered.list:before { content: "\f0cb"; } i.icon.magic:before { content: "\f0d0"; } i.icon.truck:before { content: "\f0d1"; } i.icon.currency:before { content: "\f0d6"; } i.icon.triangle.down:before { content: "\f0d7"; } i.icon.dropdown:before { content: "\f0d7"; } i.icon.triangle.up:before { content: "\f0d8"; } i.icon.triangle.left:before { content: "\f0d9"; } i.icon.triangle.right:before { content: "\f0da"; } i.icon.envelope:before { content: "\f0e0"; } i.icon.conversation:before { content: "\f0e6"; } i.icon.lightning:before { content: "\f0e7"; } i.icon.umbrella:before { content: "\f0e9"; } i.icon.lightbulb:before { content: "\f0eb"; } i.icon.suitcase:before { content: "\f0f2"; } i.icon.bell.outline:before { content: "\f0a2"; } i.icon.ambulance:before { content: "\f0f9"; } i.icon.medkit:before { content: "\f0fa"; } i.icon.fighter.jet:before { content: "\f0fb"; } i.icon.beer:before { content: "\f0fc"; } i.icon.plus.square:before { content: "\f0fe"; } i.icon.computer:before { content: "\f108"; } i.icon.circle.outline:before { content: "\f10c"; } i.icon.spinner:before { content: "\f110"; } i.icon.gamepad:before { content: "\f11b"; } i.icon.star.half.full:before { content: "\f123"; } i.icon.question:before { content: "\f128"; } i.icon.attention:before { content: "\f12a"; } i.icon.eraser:before { content: "\f12d"; } i.icon.microphone:before { content: "\f130"; } i.icon.microphone.slash:before { content: "\f131"; } i.icon.shield:before { content: "\f132"; } i.icon.target:before { content: "\f140"; } i.icon.play.circle:before { content: "\f144"; } i.icon.pencil.square:before { content: "\f14b"; } i.icon.compass:before { content: "\f14e"; } i.icon.eur:before { content: "\f153"; } i.icon.gbp:before { content: "\f154"; } i.icon.usd:before { content: "\f155"; } i.icon.inr:before { content: "\f156"; } i.icon.cny:before, i.icon.rmb:before, i.icon.jpy:before { content: "\f157"; } i.icon.rouble:before, i.icon.rub:before { content: "\f158"; } i.icon.won:before, i.icon.krw:before { content: "\f159"; } i.icon.btc:before { content: "\f15a"; } i.icon.try:before { content: "\f195"; } i.icon.zip:before { content: "\f187"; } i.icon.dot.circle.outline:before { content: "\f192"; } i.icon.sliders:before { content: "\f1de"; } i.icon.graduation:before { content: "\f19d"; } i.icon.\33d:before { content: "\f1b2"; } i.icon.weixin:before { content: "\f1d7"; } /******************************* Site Overrides *******************************/
aaqibrasheed/cdnjs
ajax/libs/semantic-ui/1.7.3/components/icon.css
CSS
mit
35,693
/*! * Media Element * HTML5 <video> and <audio> Shim * http://mediaelementjs.com/ * * Creates a JavaScript object that mimics HTML5 media object * for browsers that don't understand HTML5 or can't play the provided codec * Can also play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 * * Copyright 2010, John Dyer * Dual licensed under the MIT or GPL Version 2 licenses. * */ // Namespace var mejs = mejs || {}; // version number mejs.version = '1.1.5'; // player number (for missing, same id attr) mejs.meIndex = 0; // media types accepted by plugins mejs.plugins = { silverlight: [ {version: [3,0], types: ['video/mp4','video/m4v','video/mov','video/wmv','audio/wma','audio/mp4','audio/m4a','audio/mp3']} ], flash: [ {version: [9,0,124], types: ['video/mp4','video/m4v','video/mov','video/flv','audio/flv','audio/mp3','audio/m4a','audio/mp3']} //,{version: [11,0], types: ['video/webm'} // for future reference ] }; // Core detector, plugins are added below mejs.PluginDetector = { // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]); hasPluginVersion: function(plugin, v) { var pv = this.plugins[plugin]; v[1] = v[1] || 0; v[2] = v[2] || 0; return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; }, // cached values nav: window.navigator, ua: window.navigator.userAgent.toLowerCase(), // stored version numbers plugins: [], // runs detectPlugin() and stores the version number addPlugin: function(p, pluginName, mimeType, activeX, axDetect) { this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect); }, // get the version number from the mimetype (all but IE) or ActiveX (IE) detectPlugin: function(pluginName, mimeType, activeX, axDetect) { var version = [0,0,0], d, i, ax; // Firefox, Webkit, Opera if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') { d = this.nav.plugins[pluginName].description; if (d && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) { version = d.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.'); for (i=0; i<version.length; i++) { version[i] = parseInt(version[i], 10); } } // Internet Explorer / ActiveX } else if (typeof(window.ActiveXObject) != 'undefined') { try { ax = new ActiveXObject(activeX); if (ax) { version = axDetect(ax); } } catch (e) { } } return version; } }; // Add Flash detection mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) { // adapted from SWFObject var version = [], d = ax.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } return version; }); // Add Silverlight detection mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) { // Silverlight cannot report its version number to IE // but it does have a isVersionSupported function, so we have to loop through it to get a version number. // adapted from http://www.silverlightversion.com/ var v = [0,0,0,0], loopMatch = function(ax, v, i, n) { while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){ v[i]+=n; } v[i] -= n; }; loopMatch(ax, v, 0, 1); loopMatch(ax, v, 1, 1); loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx) loopMatch(ax, v, 2, 1000); loopMatch(ax, v, 2, 100); loopMatch(ax, v, 2, 10); loopMatch(ax, v, 2, 1); loopMatch(ax, v, 3, 1); return v; }); // add adobe acrobat /* PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) { var version = [], d = ax.GetVersions().split(',')[0].split('=')[1]; if (d) { version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } return version; } */ // special case for Android which sadly doesn't implement the canPlayType function (always returns '') if (mejs.PluginDetector.ua.match(/Android 2\.[12]/) !== null) { HTMLMediaElement.canPlayType = function(type) { return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'probably' : ''; }; } // necessary detection (fixes for <IE9) mejs.MediaFeatures = { init: function() { var nav = mejs.PluginDetector.nav, ua = mejs.PluginDetector.ua, i, v, html5Elements = ['source','track','audio','video']; // detect browsers this.isiPad = (ua.match(/iPad/i) !== null); this.isiPhone = (ua.match(/iPhone/i) !== null); this.isAndroid = (ua.match(/Android/i) !== null); this.isIE = (nav.appName.indexOf("Microsoft") != -1); // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection for (i=0; i<html5Elements.length; i++) { v = document.createElement(html5Elements[i]); } // detect native JavaScript fullscreen (Safari only, Chrome fails) this.hasNativeFullScreen = (typeof v.webkitEnterFullScreen !== 'undefined'); if (ua.match(/Chrome/gi)) { this.hasNativeFullScreen = false; } } }; mejs.MediaFeatures.init(); /* Utility methods */ mejs.Utility = { escapeHTML: function(s) { return s.split('&').join('&amp;').split('<').join('&lt;').split('"').join('&quot;'); }, absolutizeUrl: function(url) { var el = document.createElement('div'); el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>'; return el.firstChild.href; }, getScriptPath: function(scriptNames) { var i = 0, j, path = '', name = '', script, scripts = document.getElementsByTagName('script'); for (; i < scripts.length; i++) { script = scripts[i].src; for (j = 0; j < scriptNames.length; j++) { name = scriptNames[j]; if (script.indexOf(name) > -1) { path = script.substring(0, script.indexOf(name)); break; } } if (path !== '') { break; } } return path; }, secondsToTimeCode: function(seconds) { seconds = Math.round(seconds); var minutes = Math.floor(seconds / 60); minutes = (minutes >= 10) ? minutes : "0" + minutes; seconds = Math.floor(seconds % 60); seconds = (seconds >= 10) ? seconds : "0" + seconds; return minutes + ":" + seconds; } }; /* extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below) */ mejs.HtmlMediaElement = { pluginType: 'native', setCurrentTime: function (time) { this.currentTime = time; }, setMuted: function (muted) { this.muted = muted; }, setVolume: function (volume) { this.volume = volume; }, // This can be a url string // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] setSrc: function (url) { if (typeof url == 'string') { this.src = url; } else { var i, media; for (i=0; i<url.length; i++) { media = url[i]; if (this.canPlayType(media.type)) { this.src = media.src; } } } }, setVideoSize: function (width, height) { this.width = width; this.height = height; } }; /* Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember] */ mejs.PluginMediaElement = function (pluginid, pluginType) { this.id = pluginid; this.pluginType = pluginType; this.events = {}; }; // JavaScript values and ExternalInterface methods that match HTML5 video properties methods // http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html mejs.PluginMediaElement.prototype = { // special pluginElement: null, pluginType: '', // not implemented :( playbackRate: -1, defaultPlaybackRate: -1, seekable: [], played: [], // HTML5 read-only properties paused: true, ended: false, seeking: false, duration: 0, // HTML5 get/set properties, but only set (updated by event handlers) muted: false, volume: 1, currentTime: 0, // HTML5 methods play: function () { if (this.pluginApi != null) { this.pluginApi.playMedia(); this.paused = false; } }, load: function () { if (this.pluginApi != null) { this.pluginApi.loadMedia(); this.paused = false; } }, pause: function () { if (this.pluginApi != null) { this.pluginApi.pauseMedia(); this.paused = true; } }, canPlayType: function(type) { var i, j, pluginInfo, pluginVersions = mejs.plugins[this.pluginType]; for (i=0; i<pluginVersions.length; i++) { pluginInfo = pluginVersions[i]; // test if user has the correct plugin version if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) { // test for plugin playback types for (j=0; j<pluginInfo.types.length; j++) { // find plugin that can play the type if (type == pluginInfo.types[j]) { return true; } } } } return false; }, // custom methods since not all JavaScript implementations support get/set // This can be a url string // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] setSrc: function (url) { if (typeof url == 'string') { this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url)); } else { var i, media; for (i=0; i<url.length; i++) { media = url[i]; if (this.canPlayType(media.type)) { this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src)); } } } }, setCurrentTime: function (time) { if (this.pluginApi != null) { this.pluginApi.setCurrentTime(time); this.currentTime = time; } }, setVolume: function (volume) { if (this.pluginApi != null) { this.pluginApi.setVolume(volume); this.volume = volume; } }, setMuted: function (muted) { if (this.pluginApi != null) { this.pluginApi.setMuted(muted); this.muted = muted; } }, // additional non-HTML5 methods setVideoSize: function (width, height) { if ( this.pluginElement.style) { this.pluginElement.style.width = width + 'px'; this.pluginElement.style.height = height + 'px'; } if (this.pluginApi != null) { this.pluginApi.setVideoSize(width, height); } }, setFullscreen: function (fullscreen) { if (this.pluginApi != null) { this.pluginApi.setFullscreen(fullscreen); } }, // start: fake events addEventListener: function (eventName, callback, bubble) { this.events[eventName] = this.events[eventName] || []; this.events[eventName].push(callback); }, dispatchEvent: function (eventName) { var i, args, callbacks = this.events[eventName]; if (callbacks) { args = Array.prototype.slice.call(arguments, 1); for (i = 0; i < callbacks.length; i++) { callbacks[i].apply(null, args); } } } // end: fake events }; // Handles calls from Flash/Silverlight and reports them as native <video/audio> events and properties mejs.MediaPluginBridge = { pluginMediaElements:{}, htmlMediaElements:{}, registerPluginElement: function (id, pluginMediaElement, htmlMediaElement) { this.pluginMediaElements[id] = pluginMediaElement; this.htmlMediaElements[id] = htmlMediaElement; }, // when Flash/Silverlight is ready, it calls out to this method initPlugin: function (id) { var pluginMediaElement = this.pluginMediaElements[id], htmlMediaElement = this.htmlMediaElements[id]; // find the javascript bridge switch (pluginMediaElement.pluginType) { case "flash": pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(id); break; case "silverlight": pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id); pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.SilverlightApp; break; } if (pluginMediaElement.success) { pluginMediaElement.success(pluginMediaElement, htmlMediaElement); } }, // receives events from Flash/Silverlight and sends them out as HTML5 media events // http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html fireEvent: function (id, eventName, values) { var e, i, bufferedTime, pluginMediaElement = this.pluginMediaElements[id]; pluginMediaElement.ended = false; pluginMediaElement.paused = true; // fake event object to mimic real HTML media event. e = { type: eventName, target: pluginMediaElement }; // attach all values to element and event object for (i in values) { pluginMediaElement[i] = values[i]; e[i] = values[i]; } // fake the newer W3C buffered TimeRange (loaded and total have been removed) bufferedTime = values.bufferedTime || 0; e.target.buffered = e.buffered = { start: function(index) { return 0; }, end: function (index) { return bufferedTime; }, length: 1 }; pluginMediaElement.dispatchEvent(e.type, e); } }; /* Default options */ mejs.MediaElementDefaults = { // shows debug errors on screen enablePluginDebug: false, // remove or reorder to change plugin priority plugins: ['flash','silverlight'], // specify to force MediaElement into a mode type: '', // path to Flash and Silverlight plugins pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']), // name of flash file flashName: 'flashmediaelement.swf', // name of silverlight file silverlightName: 'silverlightmediaelement.xap', // default if the <video width> is not specified defaultVideoWidth: 480, // default if the <video height> is not specified defaultVideoHeight: 270, // overrides <video width> pluginWidth: -1, // overrides <video height> pluginHeight: -1, // rate in milliseconds for Flash and Silverlight to fire the timeupdate event // larger number is less accurate, but less strain on plugin->JavaScript bridge timerRate: 250, success: function () { }, error: function () { } }; /* Determines if a browser supports the <video> or <audio> element and returns either the native element or a Flash/Silverlight version that mimics HTML5 MediaElement */ mejs.MediaElement = function (el, o) { mejs.HtmlMediaElementShim.create(el,o); }; mejs.HtmlMediaElementShim = { create: function(el, o) { var options = mejs.MediaElementDefaults, htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el, isVideo = (htmlMediaElement.tagName.toLowerCase() == 'video'), supportsMediaTag = (typeof(htmlMediaElement.canPlayType) != 'undefined'), playback = {method:'', url:''}, poster = htmlMediaElement.getAttribute('poster'), autoplay = htmlMediaElement.getAttribute('autoplay'), prop; // extend options for (prop in o) { options[prop] = o[prop]; } // check for real poster poster = (poster == 'undefined' || poster === null) ? '' : poster; // test for HTML5 and plugin capabilities playback = this.determinePlayback(htmlMediaElement, options, isVideo, supportsMediaTag); if (playback.method == 'native') { // add methods to native HTMLMediaElement this.updateNative( htmlMediaElement, options); } else if (playback.method !== '') { // create plugin to mimic HTMLMediaElement this.createPlugin( htmlMediaElement, options, isVideo, playback.method, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url).replace('&','%26') : '', poster, autoplay); } else { // boo, no HTML5, no Flash, no Silverlight. this.createErrorMessage( htmlMediaElement, options, (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : '', poster ); } }, determinePlayback: function(htmlMediaElement, options, isVideo, supportsMediaTag) { var mediaFiles = [], i, j, k, l, n, url, type, result = { method: '', url: ''}, src = htmlMediaElement.getAttribute('src'), pluginName, pluginVersions, pluginInfo; // STEP 1: Get Files from <video src> or <source src> // supplied type overrides all HTML if (typeof (options.type) != 'undefined' && options.type !== '') { mediaFiles.push({type:options.type, url:null}); // test for src attribute first } else if (src != 'undefined' && src !== null) { url = htmlMediaElement.getAttribute('src'); type = this.checkType(url, htmlMediaElement.getAttribute('type'), isVideo); mediaFiles.push({type:type, url:url}); // then test for <source> elements } else { // test <source> types to see if they are usable for (i = 0; i < htmlMediaElement.childNodes.length; i++) { n = htmlMediaElement.childNodes[i]; if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') { url = n.getAttribute('src'); type = this.checkType(url, n.getAttribute('type'), isVideo); mediaFiles.push({type:type, url:url}); } } } // STEP 2: Test for playback method // test for native playback first if (supportsMediaTag) { for (i=0; i<mediaFiles.length; i++) { if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== '') { result.method = 'native'; result.url = mediaFiles[i].url; return result; } } } // if native playback didn't work, then test plugins for (i=0; i<mediaFiles.length; i++) { type = mediaFiles[i].type; // test all plugins in order of preference [silverlight, flash] for (j=0; j<options.plugins.length; j++) { pluginName = options.plugins[j]; // test version of plugin (for future features) pluginVersions = mejs.plugins[pluginName]; for (k=0; k<pluginVersions.length; k++) { pluginInfo = pluginVersions[k]; // test if user has the correct plugin version if (mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) { // test for plugin playback types for (l=0; l<pluginInfo.types.length; l++) { // find plugin that can play the type if (type == pluginInfo.types[l]) { result.method = pluginName; result.url = mediaFiles[i].url; return result; } } } } } } // what if there's nothing to play? just grab the first available if (result.method === '') { result.url = mediaFiles[0].url; } return result; }, checkType: function(url, type, isVideo) { var ext; // if no type is supplied, fake it with the extension if (url && !type) { ext = url.substring(url.lastIndexOf('.') + 1); return ((isVideo) ? 'video' : 'audio') + '/' + ext; } else { return type; } }, createErrorMessage: function(htmlMediaElement, options, downloadUrl, poster) { var errorContainer = document.createElement('div'); errorContainer.className = 'me-cannotplay'; try { errorContainer.style.width = htmlMediaElement.width + 'px'; errorContainer.style.height = htmlMediaElement.height + 'px'; } catch (e) {} errorContainer.innerHTML = (poster !== '') ? '<a href="' + downloadUrl + '"><img src="' + poster + '" /></a>' : '<a href="' + downloadUrl + '"><span>Download File</span></a>'; htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement); htmlMediaElement.style.display = 'none'; options.error(htmlMediaElement); }, createPlugin:function(htmlMediaElement, options, isVideo, pluginType, mediaUrl, poster, autoplay) { var width = 1, height = 1, pluginid = 'me_' + pluginType + '_' + (mejs.meIndex++), pluginMediaElement = new mejs.PluginMediaElement(pluginid, pluginType), container = document.createElement('div'), node, initVars; // check for placement inside a <p> tag (sometimes WYSIWYG editors do this) node = htmlMediaElement.parentNode; while (node !== null && node.tagName.toLowerCase() != 'body') { if (node.parentNode.tagName.toLowerCase() == 'p') { node.parentNode.parentNode.insertBefore(node, node.parentNode); break; } node = node.parentNode; } if (isVideo) { width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth; height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight; } else { if (options.enablePluginDebug) { width = 320; height = 240; } } // register plugin pluginMediaElement.success = options.success; mejs.MediaPluginBridge.registerPluginElement(pluginid, pluginMediaElement, htmlMediaElement); // add container (must be added to DOM before inserting HTML for IE) container.className = 'me-plugin'; htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement); // flash/silverlight vars initVars = [ 'id=' + pluginid, 'poster=' + poster, 'isvideo=' + isVideo.toString(), 'autoplay=' + autoplay, 'width=' + width, 'timerrate=' + options.timerRate, 'height=' + height]; if (mediaUrl !== null) { initVars.push('file=' + mediaUrl); } if (options.enablePluginDebug) { initVars.push('debug=true'); } switch (pluginType) { case 'silverlight': container.innerHTML = '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '">' + '<param name="initParams" value="' + initVars.join(',') + '" />' + '<param name="windowless" value="true" />' + '<param name="background" value="black" />' + '<param name="minRuntimeVersion" value="3.0.0.0" />' + '<param name="autoUpgrade" value="true" />' + '<param name="source" value="' + options.pluginPath + options.silverlightName + '" />' + '</object>'; break; case 'flash': if (mejs.MediaFeatures.isIE) { container.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 'id="' + pluginid + '" width="' + width + '" height="' + height + '">' + '<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' + '<param name="flashvars" value="' + initVars.join('&') + '" />' + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' + '<param name="wmode" value="transparent" />' + '<param name="allowScriptAccess" value="sameDomain" />' + '<param name="allowFullScreen" value="true" />' + '</object>'; } else { container.innerHTML = '<embed id="' + pluginid + '" name="' + pluginid + '" ' + 'play="true" ' + 'loop="false" ' + 'quality="high" ' + 'bgcolor="#000000" ' + 'wmode="transparent" ' + 'allowScriptAccess="sameDomain" ' + 'allowFullScreen="true" ' + 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ' + 'src="' + options.pluginPath + options.flashName + '?' + initVars.join('&') + '" ' + 'width="' + width + '" ' + 'height="' + height + '"></embed>'; } break; } // hide original element htmlMediaElement.style.display = 'none'; // FYI: options.success will be fired by the MediaPluginBridge }, updateNative: function(htmlMediaElement, options) { // add methods to video object to bring it into parity with Flash Object for (var m in mejs.HtmlMediaElement) { htmlMediaElement[m] = mejs.HtmlMediaElement[m]; } // fire success code options.success(htmlMediaElement, htmlMediaElement); } }; window.mejs = mejs; window.MediaElement = mejs.MediaElement; /*! * Media Element jQuery plugin * http://mediaelementjs.com/ * * Creates a controller bar for HTML5 <video> add <audio> tags * using jQuery and MediaElement.js * * Copyright 2010, John Dyer * Dual licensed under the MIT or GPL Version 2 licenses. * * Version: 1.1.3 */ // TODO: // - make volume be event driven, remember setting (cookie, startup) // - add skins (function ($) { // default player values mejs.MepDefaults = { // default if the <video width> is not specified defaultVideoWidth: 480, // default if the <video height> is not specified defaultVideoHeight: 270, // if set, overrides <video width> videoWidth: -1, // if set, overrides <video height> videoHeight: -1, // width of audio player audioWidth: 300, // height of audio player audioHeight: 30, // initial volume when the player starts (overrided by user cookie) startVolume: 0.8, // useful for <audio> player loops loop: false, // this will automatically turn on a <track> startLanguage: '', // a list of languages to auto-translate via Google translations: [], // a dropdownlist of automatic translations translationSelector: false, // key for tranlsations googleApiKey: '', // turn each button on or off controls: { playpause: true, timerail: true, duration: true, volume: true, captions: true, fullscreen: true }, // customize this to change the order of the control elements controlsTemplate: '<div class="mep-playpause-button mep-play">' + '<span></span>' + '</div>'+ '<div class="mep-time-rail">'+ '<span class="mep-time-total">'+ '<span class="mep-time-loaded"></span>'+ '<span class="mep-time-current"></span>'+ '<span class="mep-time-handle"></span>'+ '</span>'+ '</div>'+ '<div class="mep-time">'+ '<span class="mep-currenttime"></span>'+ '<span>&nbsp;|&nbsp;</span>'+ '<span class="mep-duration"></span>'+ '</div>'+ '<div class="mep-captions-button">'+ '<span></span>'+ '<div class="mep-captions-selector">'+ '<ul>'+ '</ul>'+ '</div>'+ '</div>'+ '<div class="mep-volume-button mep-mute">'+ '<span></span>'+ '<div class="mep-volume-slider">'+ '<div class="mep-volume-rail">'+ '<div class="mep-volume-handle"></div>'+ '</div>'+ '</div>'+ '</div>'+ '<div class="mep-fullscreen-button">' + '<span></span>' + '</div>' }; mejs.mepIndex = 0; // wraps a MediaElement object in player controls mejs.MediaElementPlayer = function($media, o) { var t = this, mf = mejs.MediaFeatures; t.$media = $($media); t.options = $.extend(true,{},mejs.MepDefaults,o); t.isVideo = (t.$media[0].tagName.toLowerCase() == 'video'); if (mf.isiPad || mf.isiPhone) { // add controls and stop t.$media.attr('controls', 'controls'); // fix Apple bug t.$media.removeAttr('poster'); // override Apple's autoplay override for iPads if (mf.isiPad && t.$media[0].getAttribute('autoplay') !== null) { t.$media[0].load(); t.$media[0].play(); } // don't do the rest return; } else if (mf.isAndroid && t.isVideo) { // Android is better off with native controls (like iOS) t.$media.attr('controls', 'controls'); return; } else { // remove native controls and use MEP t.$media.removeAttr('controls'); } t.createPlayer(); }; mejs.MediaElementPlayer.prototype = { createPlayer: function() { var t = this, meOptions = $.extend(true, {}, t.options, { success: function(mediaElement, domNode) { t.setupPlayer(mediaElement, domNode); }, error: function(e) { t.handleError(e);} }); // unique ID t.id = 'mep_' + mejs.mepIndex++; // add HTML t.$media.before( $( '<div id="' + t.id + '" class="mep-container">'+ '<div class="mep-mediaelement">'+ '</div>'+ '<div class="mep-captions-layer">'+ '<span class="mep-captions-text"></span>'+ '</div>'+ '<div class="mep-poster">'+ '<img />'+ '</div>'+ '<div class="mep-overlay">'+ '<div class="mep-overlay-button"></div>'+ '</div>'+ '<div class="mep-chapters">'+ '</div>'+ '<div class="mep-controls">'+ t.options.controlsTemplate + '</div>'+ '<div class="mep-clear"></div>'+ '</div>') ); t.container = $('#' + this.id); t.container.find('.mep-captions-selector ul').append($( '<li>'+ '<input type="radio" name="' + this.id + '_captions" id="' + this.id + '_captions_none" value="none" checked="checked" />' + '<label for="' + this.id + '_captions_none">None</label>'+ '</li>')); // move the <video/video> tag into the right spot t.container .addClass(t.$media[0].className) .find('.mep-mediaelement') .append(t.$media); // determine the size if (t.isVideo) { // priority = videoWidth (forced), width attribute, defaultVideoWidth t.width = (t.options.videoWidth > 0) ? t.options.videoWidth : (t.$media[0].getAttribute('width') !== null) ? t.$media.attr('width') : t.options.defaultVideoWidth; t.height = (t.options.videoHeight > 0) ? t.options.videoHeight : (t.$media[0].getAttribute('height') !== null) ? t.$media.attr('height') : t.options.defaultVideoHeight; } else { t.width = t.options.audioWidth; t.height = t.options.audioHeight; } // setup main layers and objects t.buildPoster(); t.buildOverlay(); t.buildCaptionsDisplay(); t.setPlayerSize(t.width, t.height); // now that the container, overlay, and poster are ready specify their exact size t.buildControls(); // create MediaElementShim meOptions.pluginWidth = t.height; meOptions.pluginHeight = t.width; mejs.MediaElement(t.$media[0], meOptions); }, // Sets up all controls and events setupPlayer: function(mediaElement, domNode) { /* var testEvents = 'play playing played paused pausing'.split(' '); for (var i=0; i<testEvents.length;i++) { mediaElement.addEventListener(testEvents[i], function(e) { console.log(e.type, e.target.paused); }, true); } */ var t = this; t.mediaElement = mediaElement; t.domNode = domNode; // build controls if (t.isVideo) { t.overlay.show(); } t.buildControlBar(); t.buildPlayPause(); t.buildTimeRail(); t.buildVolumeControls(); t.buildCaptionsControls(); t.buildFullscreen(); // add events the MediaElement t.mediaElement.addEventListener('click', function (e) { if (t.mediaElement.paused) { t.mediaElement.play(); } }, true); t.mediaElement.addEventListener('play', function (e) { t.poster.hide(); t.overlay.hide(); t.playpause.removeClass('mep-play').addClass('mep-pause'); }, true); t.mediaElement.addEventListener('playing', function (e) { t.poster.hide(); t.overlay.hide(); t.playpause.removeClass('mep-play').addClass('mep-pause'); }, true); t.mediaElement.addEventListener('pause', function (e) { if (t.isVideo) { t.overlay.show(); } t.playpause.removeClass('mep-pause').addClass('mep-play'); }, true); t.mediaElement.addEventListener('paused', function (e) { if (t.isVideo) { t.overlay.show(); } t.playpause.removeClass('mep-pause').addClass('mep-play'); }, true); t.mediaElement.addEventListener('ended', function (e) { t.mediaElement.setCurrentTime(0); t.mediaElement.pause(); if (t.options.loop) { t.mediaElement.play(); } else { t.poster.show(); t.overlay.show(); t.controls.css('visibility','visible'); t.playpause.removeClass('mep-pause').addClass('mep-play'); t.setTimePosition(); } }, true); t.mediaElement.addEventListener('loadedmetadata', function(e) { t.displayChapters(); // if the <video height> was not set and the options.videoHeight was not set // then resize to the real dimensions if (t.isVideo && t.options.videoHeight <= 0 && t.$media[0].getAttribute('height') === null && !isNaN(e.target.videoHeight)) { t.setPlayerSize(e.target.videoWidth, e.target.videoHeight); t.setRailSize(); t.mediaElement.setVideoSize(e.target.videoWidth, e.target.videoHeight); } }, true); // webkit has trouble doing this without a delay setTimeout(function () { t.setRailSize(); }, 50); if (t.options.success) t.options.success(t.mediaElement, t.domNode); this.findTracks(); }, buildCaptionsDisplay: function() { var t = this, options = '', i; t.captionsDisplay = t.container.find('.mep-captions-layer').hide(); t.captionsText = t.container.find('.mep-captions-text'); t.chapters = t.container.find('.mep-chapters'); if (t.options.translationSelector) { for (i in mejs.language.codes) { options += '<option value="' + i + '">' + mejs.language.codes[i] + '</option>'; } t.container.find('.mep-captions-selector ul').before($( '<select class="mep-captions-translations">' + '<option value="">--Add Translation--</option>' + options + '</select>' )); // add clicks t.container.find('.mep-captions-translations').change(function() { var option = $(this); lang = option.val(); // add this language to the tracks list if (lang != '') { t.tracks.push({ srclang: lang, src: null, entries: [], isLoaded: false, isTranslation: true }); if (!t.isLoadingTrack) { t.trackToLoad--; t.addTrackButton(lang,true); t.options.startLanguage = lang; t.loadNextTrack(); } } }); } }, buildCaptionsControls: function() { var t = this, lang, i; // handle clicks to the language radio buttons t.captions.delegate('input[type=radio]','click',function() { lang = this.value; if (lang == 'none') { t.selectedTrack = null; } else { for (i=0; i<t.tracks.length; i++) { if (t.tracks[i].srclang == lang) { t.selectedTrack = t.tracks[i]; t.captionsDisplay.attr('lang', t.selectedTrack.srclang); t.displayCaptions(); break; } } } }); }, // adapted from Playr findTracks: function() { var t = this, i, tracktags = t.$media.find('track'); // create storage for tracks t.tracks = [] t.trackToLoad = -1; t.selectedTrack = null; t.isLoadingTrack = false; tracktags.each(function() { t.tracks.push({ srclang: $(this).attr('srclang').toLowerCase(), src: $(this).attr('src'), kind: $(this).attr('kind'), entries: [], isLoaded: false, isTranslation: false }); }); // add user-defined translations if (t.tracks.length > 0 && t.options.translations.length > 0) { for (i=0; i<t.options.translations.length; i++) { t.tracks.push({ srclang: t.options.translations[i].toLowerCase(), src: null, kind: 'subtitles', entries: [], isLoaded: false, isTranslation: true }); } } // add to list for (i=0; i<t.tracks.length; i++) { if (t.tracks[i].kind == 'subtitles') { t.addTrackButton(t.tracks[i].srclang, t.tracks[i].isTranslation); } } // begin loading, or remove button if (t.tracks.length > 0) { t.loadNextTrack(); } else { t.captions.remove(); t.setRailSize(); } }, loadNextTrack: function() { var t = this; t.trackToLoad++; if (t.trackToLoad < t.tracks.length) { t.isLoadingTrack = true; t.loadTrack(t.trackToLoad); } else { // add done? t.isLoadingTrack = false; } }, loadTrack: function(index){ var t = this, track = t.tracks[index], after = function() { track.isLoaded = true; // create button //t.addTrackButton(track.srclang); t.enableTrackButton(track.srclang); t.loadNextTrack(); }; if (track.isTranslation) { // translate the first track mejs.SrtParser.translateSrt(t.tracks[0].entries, t.tracks[0].srclang, track.srclang, t.options.googleApiKey, function(newOne) { // store the new translation track.entries = newOne; after(); }); } else { $.ajax({ url: track.src, success: function(d) { // parse the loaded file track.entries = mejs.SrtParser.parse(d); after(); if (track.kind == 'chapters' && t.mediaElement.duration > 0) { t.buildChapters(track); } }, error: function() { t.loadNextTrack(); } }); } }, enableTrackButton: function(lang) { var t = this; t.captions .find('input[value=' + lang + ']') .attr('disabled','') .siblings('label') .html( mejs.language.codes[lang] || lang ); // auto select if (t.options.startLanguage == lang) { $('#' + t.id + '_captions_' + lang).click(); } t.adjustLanguageBox(); }, addTrackButton: function(lang, isTranslation) { var t = this, l = mejs.language.codes[lang] || lang; t.captions.find('ul').append( $('<li>'+ '<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' + '<label for="' + t.id + '_captions_' + lang + '">' + l + ((isTranslation) ? ' (translating)' : ' (loading)') + '</label>'+ '</li>') ); t.adjustLanguageBox(); // remove this from the dropdownlist (if it exists) t.container.find('.mep-captions-translations option[value=' + lang + ']').remove(); }, adjustLanguageBox:function() { var t = this; // adjust the size of the outer box t.captions.find('.mep-captions-selector').height( t.captions.find('.mep-captions-selector ul').outerHeight(true) + t.captions.find('.mep-captions-translations').outerHeight(true) ); }, displayCaptions: function() { if (typeof this.tracks == 'undefined') return; var t = this, i, track = t.selectedTrack; if (track != null && track.isLoaded) { for (i=0; i<track.entries.times.length; i++) { if (t.mediaElement.currentTime >= track.entries.times[i].start && t.mediaElement.currentTime <= track.entries.times[i].stop){ t.captionsText.html(track.entries.text[i]); t.captionsDisplay.show(); return; // exit out if one is visible; } } t.captionsDisplay.hide(); } else { t.captionsDisplay.hide(); } }, displayChapters: function() { var t = this, i; for (i=0; i<t.tracks.length; i++) { if (t.tracks[i].kind == 'chapters') { t.buildChapters(t.tracks[i]); break; } } }, buildChapters: function(chapters) { var t = this, i, dur, width, left ; t.chapters.empty(); for (i=0; i<chapters.entries.times.length; i++) { dur = chapters.entries.times[i].stop - chapters.entries.times[i].start; //width = length / t.mediaElement.duration * 100; width = Math.floor(t.width * dur / t.mediaElement.duration); left = Math.floor(t.width * chapters.entries.times[i].start / t.mediaElement.duration); if (left + width > t.width) { width = t.width - left; } t.chapters.append( $( '<div class="mep-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + left.toString() + 'px;width: ' + width.toString() + 'px;">' + '<div class="mep-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mep-chapter-block-last' : '') + '">' + '<span class="ch-title">' + chapters.entries.text[i] + '</span>' + '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '&ndash;' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' + '</div>' + '</div>')); } t.chapters.find('div.mep-chapter').click(function() { t.mediaElement.setCurrentTime( parseFloat( $(this).attr('rel') ) ); if (t.mediaElement.paused) { t.mediaElement.play(); } }); }, buildPoster: function() { var t = this; // POSTER t.poster = t.container.find('.mep-poster'); t.posterImg = t.poster.find('img'); t.posterUrl = t.$media.attr('poster'); t.posterUrl = (t.posterUrl === null || t.posterUrl == undefined) ? '' : t.posterUrl; if (t.posterUrl !== '') { t.posterImg.attr('src',t.posterUrl); } else { t.poster.hide(); } }, buildOverlay: function() { var t = this; // OVERLAY t.overlay = t.container.find('.mep-overlay'); t.overlay.bind('click', function (e) { if (t.mediaElement.paused) { t.mediaElement.play(); } }); t.overlay.hide(); }, buildControls: function() { var t = this; // CONTROLS BAR t.controls = t.container.find('.mep-controls'); t.isControlsVisible = true; // CONTROL BUTTONS and BARS t.playpause = t.controls.find('.mep-playpause-button'); t.fullscreen = t.controls.find('.mep-fullscreen-button'); if (!t.isVideo) t.fullscreen.remove(); t.time = t.controls.find('.mep-time'); t.currentTime = t.controls.find('.mep-currenttime').html('00:00'); t.duration = t.controls.find('.mep-duration').html('00:00'); t.captions = t.controls.find('.mep-captions-button'); t.mute = t.controls.find('.mep-volume-button'); t.volumeSlider = t.controls.find('.mep-volume-slider'); t.volumeRail = t.controls.find('.mep-volume-rail'); t.volumeHandle = t.controls.find('.mep-volume-handle'); t.timeRail = t.controls.find('.mep-time-rail'); t.timeCurrent = t.timeRail.find('.mep-time-current').width(0); t.timeLoaded = t.timeRail.find('.mep-time-loaded').width(0); t.timeTotal = t.timeRail.find('.mep-time-total'); t.timeHandle = t.controls.find('.mep-time-handle'); // setup controls t.controls.show(); t.setRailSize(); t.controls.hide(); // hide unwanted controls if (!t.options.controls.playpause) { t.playpause.remove(); } if (!t.options.controls.timerail) { t.timeRail.remove(); } if (!t.options.controls.duration) { t.time.remove(); } if (!t.options.controls.volume) { t.mute.remove(); } if (!t.options.controls.fullscreen) { t.fullscreen.remove(); } }, buildControlBar: function() { var t = this; t.controls.show(); // these are hidden until the MediaElement is returned if (t.isVideo) { // show/hide controls t.container .bind('mouseenter', function () { t.controls.css('visibility','visible'); t.controls.fadeIn(200); t.captionsDisplay.css('padding-bottom', t.controls.height() + 5); t.setRailSize(); t.isControlsVisible = true; // chapters t.chapters.css('visibility','visible'); t.chapters.fadeIn(200); }) .bind('mouseleave', function () { if (!t.mediaElement.paused) { t.controls.fadeOut(200, function() { $(this).css('visibility','hidden'); $(this).css('display','block'); t.captionsDisplay.css('padding-bottom', 10); }); t.isControlsVisible = false; t.chapters.fadeOut(200, function() { $(this).css('visibility','hidden'); $(this).css('display','block'); }); } }); } }, buildPlayPause: function() { var t = this; // PLAY/PAUSE button t.playpause.bind('click', function () { if (t.playpause.hasClass('mep-play')) { //if (mediaElement.paused) { t.mediaElement.play(); t.playpause.removeClass('mep-play').addClass('mep-pause'); } else { t.mediaElement.pause(); t.playpause.removeClass('mep-pause').addClass('mep-play'); } }); }, buildTimeRail: function() { var t = this; // TIME RAIL t.timeRail.delegate('span', 'click', function (e) { // mouse position relative to the object var x = e.pageX, offset = t.timeTotal.offset(), width = t.timeTotal.outerWidth(), percentage = ((x - offset.left) / width), newTime = percentage * t.mediaElement.duration; t.mediaElement.setCurrentTime(newTime); }); // attach events to <video/audio> for RAIL updates t.mediaElement.addEventListener('timeupdate', function (e) { t.displayCaptions(); //if (!t.isControlsVisible) // return; t.setTimePosition(); t.setTimeLoaded(e.target); }, true); t.mediaElement.addEventListener('progress', function (e) { t.setTimeLoaded(e.target); }, true); }, setTimePosition: function() { var t = this, newWidth, handlePos; if (t.mediaElement.currentTime && t.mediaElement.duration) { // update current and duration text t.currentTime.html(mejs.Utility.secondsToTimeCode(t.mediaElement.currentTime)); if (t.mediaElement.duration) t.duration.html(mejs.Utility.secondsToTimeCode(t.mediaElement.duration)); // update bar and handle newWidth = t.timeTotal.width() * t.mediaElement.currentTime / t.mediaElement.duration; handlePos = newWidth - (t.timeHandle.width() / 2); t.timeCurrent.width(newWidth); t.timeHandle.css('left', handlePos); } }, setTimeLoaded:function(target) { var t = this, percent = null; // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end() // to be anything other than 0. If the byte count is available we use this instead. // Browsers that support the else if do not seem to have the bufferedBytes value and // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8. if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) { percent = target.bufferedBytes / target.bytesTotal; } // need to account for a real array with multiple values (only Firefox 4 has this so far) else if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) { percent = target.buffered.end(0) / target.duration; } if (percent !== null) { // update loaded bar t.timeLoaded.width(t.timeTotal.width() * percent); } }, setRailSize: function() { var t = this, usedWidth = t.playpause.outerWidth(true) + t.time.outerWidth(true) + t.mute.outerWidth(true) + t.captions.outerWidth(true) + ((t.isVideo) ? t.fullscreen.outerWidth(true) : 0), //usedWidth = t.timeRail.siblings().outerWidth(true), railWidth = t.controls.width() - usedWidth - (t.timeRail.outerWidth(true) - t.timeRail.outerWidth(false)); t.timeRail.width(railWidth); t.timeTotal.width(railWidth - (t.timeTotal.outerWidth(true) - t.timeTotal.width())); }, setPlayerSize: function(width,height) { var t = this; // ie9 appears to need this (jQuery bug?) t.width = parseInt(width, 10); t.height = parseInt(height, 10); t.container .width(t.width) .height(t.height); t.captionsDisplay // .height(t.height) .width(t.width); t.overlay .width(t.width) .height(t.height); t.posterImg .height(t.height) .width(t.width); }, handleError: function(me) { var t = this; t.$media.hide(); t.overlay.hide(); t.controls.hide(); t.poster.hide(); }, buildFullscreen: function() { var t = this; t.isFullScreen = false; t.normalHeight = 0; t.normalWidth = 0; t.fullscreen.bind('click', function () { t.setFullScreen(!t.isFullScreen); }); }, setFullScreen: function (goFullScreen) { var t = this; switch (t.mediaElement.pluginType) { case 'flash': t.mediaElement.setFullscreen(goFullScreen); break; case 'silverlight': t.mediaElement.setFullscreen(goFullScreen); break; case 'native': if (mejs.MediaFeatures.hasNativeFullScreen) { if (goFullScreen) { t.mediaElement.webkitEnterFullScreen(); } else { t.mediaElement.webkitExitFullScreen(); } } else { if (goFullScreen) { // store t.normalHeight = t.$media.height(); t.normalWidth = t.$media.width(); // make full size t.container .addClass('mep-container-fullscreen') .width('100%') .height('100%') .css('z-index', 1000); t.$media .width('100%') .height('100%'); t.captionsDisplay .width('100%'); t.overlay .width('100%') .height('100%'); t.posterImg .width('100%') .height('auto'); t.fullscreen .removeClass('mep-fullscreen') .addClass('mep-unfullscreen'); t.setRailSize(); t.escB = function(e) { t.escListener(e); }; t.resB = function(e) { t.resizeListener(e); }; $(document).bind('keydown', t.escB); $(window).bind('resize', t.resB); } else { t.container .removeClass('mep-container-fullscreen') .width(t.normalWidth) .height(t.normalHeight) .css('z-index', 1); t.$media .width(t.normalWidth) .height(t.normalHeight); t.posterImg .width(t.normalWidth) .height(t.normalHeight); t.captionsDisplay .width(t.normalWidth); t.fullscreen .removeClass('mep-unfullscreen') .addClass('mep-fullscreen'); t.setRailSize(); $(document).unbind('keydown', t.escB); $(window).unbind('resize', t.resB); } } } t.isFullScreen = goFullScreen; }, escListener: function (e) { if (e.keyCode == 27) { this.setFullScreen(false); } }, resizeListener: function(e) { this.setRailSize(); }, buildVolumeControls: function() { var t = this; t.vmmB = function(e) { t.volumeMove(e); }; t.vrmB = function(e) { t.removeMouseMove(e); }; // SLIDER t.volumeSlider.bind('mousedown', function (e) { t.volumeMove(e); $(document) .bind('mousemove', t.vmmB) .bind('mouseup', t.vrmB); }); // MUTE t.mute.find('span').bind('click', function () { if (t.mediaElement.muted) { t.mediaElement.setMuted(false); t.mute.removeClass('mep-unmute').addClass('mep-mute'); t.positionVolumeHandle(1); } else { t.mediaElement.setMuted(true); t.mute.removeClass('mep-mute').addClass('mep-unmute'); t.positionVolumeHandle(0); } }); t.mediaElement.addEventListener('volumechange', function(e) { t.positionVolumeHandle(e.target.volume); }, true); // set volume t.mediaElement.setVolume(t.options.startVolume); }, volumeMove: function(e) { var t = this, railHeight = t.volumeRail.height(), newY = e.pageY - t.volumeRail.offset().top, volume = (railHeight - newY) / railHeight // only allow it to move within the rail if (newY < 0) newY = 0; else if (newY > railHeight) newY = railHeight; // move the handle to match the mouse t.volumeHandle.css('top', newY - (t.volumeHandle.height() / 2)); // set mute status if (volume == 0) { t.mediaElement.setMuted(true); t.mute.removeClass('mep-mute').addClass('mep-unmute'); } else { t.mediaElement.setMuted(false); t.mute.removeClass('mep-unmute').addClass('mep-mute'); } // set the volume t.mediaElement.setVolume(volume); }, positionVolumeHandle: function(volume) { var t = this; t.volumeHandle.css('top', t.volumeRail.height() - (t.volumeRail.height() * volume) - (t.volumeHandle.height() / 2)); }, removeMouseMove: function() { var t = this; //$(document).css('cursor',''); $(document) .unbind('mousemove', t.vmmB) .unbind('mouseup', t.vrmB); } }; mejs.language = { codes: { af:'Afrikaans', sq:'Albanian', ar:'Arabic', be:'Belarusian', bg:'Bulgarian', ca:'Catalan', zh:'Chinese', 'zh-cn':'Chinese Simplified', 'zh-tw':'Chinese Traditional', hr:'Croatian', cs:'Czech', da:'Danish', nl:'Dutch', en:'English', et:'Estonian', tl:'Filipino', fi:'Finnish', fr:'French', gl:'Galician', de:'German', el:'Greek', ht:'Haitian Creole', iw:'Hebrew', hi:'Hindi', hu:'Hungarian', is:'Icelandic', id:'Indonesian', ga:'Irish', it:'Italian', ja:'Japanese', ko:'Korean', lv:'Latvian', lt:'Lithuanian', mk:'Macedonian', ms:'Malay', mt:'Maltese', no:'Norwegian', fa:'Persian', pl:'Polish', pt:'Portuguese', //'pt-pt':'Portuguese (Portugal)', ro:'Romanian', ru:'Russian', sr:'Serbian', sk:'Slovak', sl:'Slovenian', es:'Spanish', sw:'Swahili', sv:'Swedish', tl:'Tagalog', th:'Thai', tr:'Turkish', uk:'Ukrainian', vi:'Vietnamese', cy:'Welsh', yi:'Yiddish' } }; /* Parses SRT format which should be formatted as 1 00:00:01,1 --> 00:00:05,000 A line of text 2 00:01:15,1 --> 00:02:05,000 A second line of text Adapted from: http://www.delphiki.com/html5/playr */ mejs.SrtParser = { pattern_identifier: /^[0-9]+$/, pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}(,[0-9]{3})?)(.*)$/, timecodeToSeconds: function(timecode){ var tab = timecode.split(':'); return tab[0]*60*60 + tab[1]*60 + parseFloat(tab[2].replace(',','.')); }, split2: function (text, regex) { // normal version for compliant browsers // see below for IE fix return text.split(regex); }, parse: function(srtText) { var i = 0, lines = this.split2(srtText, /\r?\n/), entries = {text:[], times:[]}, timecode, text; for(; i<lines.length; i++) { // check for the line number if (this.pattern_identifier.exec(lines[i])){ // skip to the next line where the start --> end time code should be i++; timecode = this.pattern_timecode.exec(lines[i]); if (timecode && i<lines.length){ i++; // grab all the (possibly multi-line) text that follows text = lines[i]; i++; while(lines[i] !== '' && i<lines.length){ text = text + '\n' + lines[i]; i++; } // Text is in a different array so I can use .join entries.text.push(text); entries.times.push( { start: this.timecodeToSeconds(timecode[1]), stop: this.timecodeToSeconds(timecode[3]), settings: timecode[5] }); } } } return entries; }, translateSrt: function(srtData, fromLang, toLang, googleApiKey, callback) { var entries = {text:[], times:[]}, lines, i this.translateText( srtData.text.join(' <a></a>'), fromLang, toLang, googleApiKey, function(result) { // split on separators lines = result.split('<a></a>'); // create new entries for (i=0;i<srtData.text.length; i++) { // add translated line entries.text[i] = lines[i]; // copy existing times entries.times[i] = { start: srtData.times[i].start, stop: srtData.times[i].stop, settings: srtData.times[i].settings }; } callback(entries); }); }, translateText: function(text, fromLang, toLang, googleApiKey, callback) { var separatorIndex, chunks = [], chunk, maxlength = 1000, result = '', nextChunk= function() { if (chunks.length > 0) { chunk = chunks.shift(); mejs.SrtParser.translateChunk(chunk, fromLang, toLang, googleApiKey, function(r) { if (r != 'undefined') { result += r; } nextChunk(); }); } else { callback(result); } }; // split into chunks while (text.length > 0) { if (text.length > maxlength) { separatorIndex = text.lastIndexOf('.', maxlength); chunks.push(text.substring(0, separatorIndex)); text = text.substring(separatorIndex+1); } else { chunks.push(text); text = ''; } } // start handling the chunks nextChunk(); }, translateChunk: function(text, fromLang, toLang, googleApiKey, callback) { var data = { q: text, langpair: fromLang + '|' + toLang, v: '1.0' }; if (googleApiKey !== '' && googleApiKey !== null) { data.key = googleApiKey; } $.ajax({ url: 'https://ajax.googleapis.com/ajax/services/language/translate', // 'https://www.google.com/uds/Gtranslate', //'https://ajax.googleapis.com/ajax/services/language/translate', // data: data, type: 'GET', dataType: 'jsonp', success: function(d) { callback(d.responseData.translatedText); }, error: function(e) { callback(null); } }); } }; // test for browsers with bad String.split method. if ('x\n\ny'.split(/\n/gi).length != 3) { // add super slow IE8 and below version mejs.SrtParser.split2 = function(text, regex) { var parts = [], chunk = '', i; for (i=0; i<text.length; i++) { chunk += text.substring(i,i+1); if (regex.test(chunk)) { parts.push(chunk.replace(regex, '')); chunk = ''; } } parts.push(chunk); return parts; } } // turn into jQuery plugin jQuery.fn.mediaelementplayer = function (options) { return this.each(function () { return new mejs.MediaElementPlayer($(this), options); }); }; // push out to window window.MediaElementPlayer = mejs.MediaElementPlayer; })(jQuery);
fatso83/cdnjs
ajax/libs/mediaelement/1.1.6/mediaelement-and-player.js
JavaScript
mit
57,768
/*! UIkit 1.1.0 | http://www.getuikit.com | (c) 2013 YOOtheme | MIT License */ (function($, doc) { "use strict"; var UI = $.UIkit || {}; if (UI.fn) { return; } UI.fn = function(command, options) { var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; if (!UI[component]) { $.error("UIkit component [" + component + "] does not exist."); return this; } return this.each(function() { var $this = $(this), data = $this.data(component); if (!data) $this.data(component, (data = new UI[component](this, method ? undefined : options))); if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); }); }; UI.support = {}; UI.support.transition = (function() { var transitionEnd = (function() { var element = doc.body || doc.documentElement, transEndEventNames = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' }, name; for (name in transEndEventNames) { if (element.style[name] !== undefined) { return transEndEventNames[name]; } } }()); return transitionEnd && { end: transitionEnd }; })(); UI.support.touch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch); UI.Utils = {}; UI.Utils.debounce = function(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; UI.Utils.options = function(string) { if ($.isPlainObject(string)) return string; var start = string.indexOf("{"), options = {}; if (start != -1) { try { options = (new Function("", "var json = " + string.substr(start) + "; return JSON.parse(JSON.stringify(json));"))(); } catch (e) {} } return options; }; $.UIkit = UI; $.fn.uk = UI.fn; $.UIkit.langdirection = $("html").attr("dir") == "rtl" ? "right" : "left"; })(jQuery, document); ;(function($){ var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapDelay = 750, longTapTimeout; function parentIfText(node) { return 'tagName' in node ? node : node.parentNode; } function swipeDirection(x1, x2, y1, y2) { var xDelta = Math.abs(x1 - x2), yDelta = Math.abs(y1 - y2); return xDelta >= yDelta ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); } function longTap() { longTapTimeout = null; if (touch.last) { touch.el.trigger('longTap'); touch = {}; } } function cancelLongTap() { if (longTapTimeout) clearTimeout(longTapTimeout); longTapTimeout = null; } function cancelAll() { if (touchTimeout) clearTimeout(touchTimeout); if (tapTimeout) clearTimeout(tapTimeout); if (swipeTimeout) clearTimeout(swipeTimeout); if (longTapTimeout) clearTimeout(longTapTimeout); touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; touch = {}; } $(document).ready(function(){ var now, delta; $(document.body) .bind('touchstart', function(e){ now = Date.now(); delta = now - (touch.last || now); touch.el = $(parentIfText(e.originalEvent.touches[0].target)); if(touchTimeout) clearTimeout(touchTimeout); touch.x1 = e.originalEvent.touches[0].pageX; touch.y1 = e.originalEvent.touches[0].pageY; if (delta > 0 && delta <= 250) touch.isDoubleTap = true; touch.last = now; longTapTimeout = setTimeout(longTap, longTapDelay); }) .bind('touchmove', function(e){ cancelLongTap(); touch.x2 = e.originalEvent.touches[0].pageX; touch.y2 = e.originalEvent.touches[0].pageY; }) .bind('touchend', function(e){ cancelLongTap(); // swipe if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) swipeTimeout = setTimeout(function() { touch.el.trigger('swipe'); touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); touch = {}; }, 0); // normal tap else if ('last' in touch) // delay by one tick so we can cancel the 'tap' event if 'scroll' fires // ('tap' fires before 'scroll') tapTimeout = setTimeout(function() { // trigger universal 'tap' with the option to cancelTouch() // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) var event = $.Event('tap'); event.cancelTouch = cancelAll; touch.el.trigger(event); // trigger double tap immediately if (touch.isDoubleTap) { touch.el.trigger('doubleTap'); touch = {}; } // trigger single tap after 250ms of inactivity else { touchTimeout = setTimeout(function(){ touchTimeout = null; touch.el.trigger('singleTap'); touch = {}; }, 250); } }, 0); }) .bind('touchcancel', cancelAll); $(window).bind('scroll', cancelAll); }); ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(m){ $.fn[m] = function(callback){ return this.bind(m, callback); }; }); })(jQuery); (function($, UI) { "use strict"; var Alert = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on("click", this.options.trigger, function(e) { e.preventDefault(); $this.close(); }); }; $.extend(Alert.prototype, { options: { "fade": true, "duration": 200, "trigger": ".uk-alert-close" }, close: function() { var element = this.element.trigger("close"); if (this.options.fade) { element.css("overflow", "hidden").css("max-height", element.height()).animate({ "height": 0, "opacity": 0, "padding-top": 0, "padding-bottom": 0, "margin-top": 0, "margin-bottom": 0 }, this.options.duration, removeElement); } else { removeElement(); } function removeElement() { element.trigger("closed").remove(); } } }); UI["alert"] = Alert; // init code $(document).on("click.alert.uikit", "[data-uk-alert]", function(e) { var ele = $(this); if (!ele.data("alert")) { ele.data("alert", new Alert(ele, UI.Utils.options(ele.data("uk-alert")))); if ($(e.target).is(ele.data("alert").options.trigger)) { e.preventDefault(); ele.data("alert").close(); } } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var ButtonRadio = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({}, this.options, options); this.element = $element.on("click", this.options.target, function(e) { e.preventDefault(); $element.find($this.options.target).not(this).removeClass("uk-active").blur(); $element.trigger("change", [$(this).addClass("uk-active")]); }); }; $.extend(ButtonRadio.prototype, { options: { "target": ".uk-button" }, getSelected: function() { this.element.find(".uk-active"); } }); var ButtonCheckbox = function(element, options) { var $element = $(element); this.options = $.extend({}, this.options, options); this.element = $element.on("click", this.options.target, function(e) { e.preventDefault(); $element.trigger("change", [$(this).toggleClass("uk-active").blur()]); }); }; $.extend(ButtonCheckbox.prototype, { options: { "target": ".uk-button" }, getSelected: function() { this.element.find(".uk-active"); } }); var Button = function(element) { var $this = this; this.element = $(element).on("click", function(e) { e.preventDefault(); $this.toggle(); $this.element.blur(); }); }; $.extend(Button.prototype, { toggle: function() { this.element.toggleClass("uk-active"); } }); UI["button"] = Button; UI["button-checkbox"] = ButtonCheckbox; UI["button-radio"] = ButtonRadio; // init code $(document).on("click.button-radio.uikit", "[data-uk-button-radio]", function(e) { var ele = $(this); if (!ele.data("button-radio")) { ele.data("button-radio", new ButtonRadio(ele, UI.Utils.options(ele.data("uk-button-radio")))); if ($(e.target).is(ele.data("button-radio").options.target)) { $(e.target).trigger("click"); } } }); $(document).on("click.button-checkbox.uikit", "[data-uk-button-checkbox]", function(e) { var ele = $(this); if (!ele.data("button-checkbox")) { ele.data("button-checkbox", new ButtonCheckbox(ele, UI.Utils.options(ele.data("uk-button-checkbox")))); if ($(e.target).is(ele.data("button-checkbox").options.target)) { $(e.target).trigger("click"); } } }); $(document).on("click.button.uikit", "[data-uk-button]", function(e) { var ele = $(this); if (!ele.data("button")) { ele.data("button", new Button(ele, ele.data("uk-button"))).trigger("click"); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var active = false, Dropdown = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element); this.dropdown = this.element.find(".uk-dropdown"); this.centered = this.dropdown.hasClass("uk-dropdown-center"); this.justified = this.options.justify ? $(this.options.justify) : false; this.boundary = $(this.options.boundary); if(!this.boundary.length) { this.boundary = $(window); } if (this.options.mode == "click") { this.element.on("click", function(e) { if (!$(e.target).parents(".uk-dropdown").length) { e.preventDefault(); } if (active && active[0] != $this.element[0]) { active.removeClass("uk-open"); } if (!$this.element.hasClass("uk-open")) { $this.checkDimensions(); $this.element.addClass("uk-open"); active = $this.element; $(document).off("click.outer.dropdown"); setTimeout(function() { $(document).on("click.outer.dropdown", function(e) { if (active && active[0] == $this.element[0] && ($(e.target).is("a") || !$this.element.find(".uk-dropdown").find(e.target).length)) { active.removeClass("uk-open"); $(document).off("click.outer.dropdown"); } }); }, 10); } else { if ($(e.target).is("a") || !$this.element.find(".uk-dropdown").find(e.target).length) { $this.element.removeClass("uk-open"); active = false; } } }); } else { this.element.on("mouseenter", function(e) { if ($this.remainIdle) { clearTimeout($this.remainIdle); } if (active && active[0] != $this.element[0]) { active.removeClass("uk-open"); } $this.checkDimensions(); $this.element.addClass("uk-open"); active = $this.element; }).on("mouseleave", function() { $this.remainIdle = setTimeout(function() { $this.element.removeClass("uk-open"); $this.remainIdle = false; if (active && active[0] == $this.element[0]) active = false; }, $this.options.remaintime); }); } }; $.extend(Dropdown.prototype, { remainIdle: false, options: { "mode": "hover", "remaintime": 800, "justify": false, "boundary": $(window) }, checkDimensions: function() { if(!this.dropdown.length) return; var dropdown = this.dropdown.css("margin-" + $.UIkit.langdirection, "").css("min-width", ""), offset = dropdown.show().offset(), width = dropdown.outerWidth(), boundarywidth = this.boundary.width(), boundaryoffset = this.boundary.offset() ? this.boundary.offset().left:0; // centered dropdown if (this.centered) { dropdown.css("margin-" + $.UIkit.langdirection, (parseFloat(width) / 2 - dropdown.parent().width() / 2) * -1); offset = dropdown.offset(); // reset dropdown if ((width + offset.left) > boundarywidth || offset.left < 0) { dropdown.css("margin-" + $.UIkit.langdirection, ""); offset = dropdown.offset(); } } // justify dropdown if (this.justified && this.justified.length) { var jwidth = this.justified.outerWidth(); dropdown.css("min-width", jwidth); if ($.UIkit.langdirection == 'right') { var right1 = boundarywidth - (this.justified.offset().left + jwidth), right2 = boundarywidth - (dropdown.offset().left + dropdown.outerWidth()); dropdown.css("margin-right", right1 - right2); } else { dropdown.css("margin-left", this.justified.offset().left - offset.left); } offset = dropdown.offset(); } if ((width + (offset.left-boundaryoffset)) > boundarywidth) { dropdown.addClass("uk-dropdown-flip"); offset = dropdown.offset(); } if (offset.left < 0) { dropdown.addClass("uk-dropdown-stack"); } dropdown.css("display", ""); } }); UI["dropdown"] = Dropdown; // init code $(document).on("mouseenter.dropdown.uikit", "[data-uk-dropdown]", function(e) { var ele = $(this); if (!ele.data("dropdown")) { ele.data("dropdown", new Dropdown(ele, UI.Utils.options(ele.data("uk-dropdown")))); if (ele.data("dropdown").options.mode == "hover") { ele.trigger("mouseenter"); } } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var win = $(window), event = 'resize orientationchange', GridMatchHeight = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element); this.columns = this.element.children(); this.elements = this.options.target ? this.element.find(this.options.target) : this.columns; if (!this.columns.length) return; win.on(event, (function() { var fn = function() { $this.match(); }; $(function() { fn(); win.on("load", fn); }); return UI.Utils.debounce(fn, 150); })()); }; $.extend(GridMatchHeight.prototype, { options: { "target": false }, match: function() { this.revert(); var firstvisible = this.columns.filter(":visible:first"); if (!firstvisible.length) return; var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100 ? true : false, max = 0, $this = this; if (stacked) return; this.elements.each(function() { max = Math.max(max, $(this).outerHeight()); }).each(function(i) { var element = $(this), boxheight = element.css("box-sizing") == "border-box" ? "outerHeight" : "height", box = $this.columns.eq(i), height = (element.height() + (max - box[boxheight]())); element.css('min-height', height + 'px'); }); return this; }, revert: function() { this.elements.css('min-height', ''); return this; } }); var GridMargin = function(element) { var $this = this; this.element = $(element); this.columns = this.element.children(); if (!this.columns.length) return; win.on(event, (function() { var fn = function() { $this.process(); }; $(function() { fn(); win.on("load", fn); }); return UI.Utils.debounce(fn, 150); })()); }; $.extend(GridMargin.prototype, { process: function() { this.revert(); var skip = false, firstvisible = this.columns.filter(":visible:first"), offset = firstvisible.length ? firstvisible.offset().top : false; if (offset === false) return; this.columns.each(function() { var column = $(this); if (column.is(":visible")) { if (skip) { column.addClass("uk-grid-margin"); } else { if (column.offset().top != offset) { column.addClass("uk-grid-margin"); skip = true; } } } }); return this; }, revert: function() { this.columns.removeClass('uk-grid-margin'); return this; } }); UI["grid-match"] = GridMatchHeight; UI["grid-margin"] = GridMargin; // init code $(function() { $("[data-uk-grid-match],[data-uk-grid-margin]").each(function() { var grid = $(this); if (grid.is("[data-uk-grid-match]") && !grid.data("grid-match")) { grid.data("grid-match", new GridMatchHeight(grid, UI.Utils.options(grid.data("uk-grid-match")))); } if (grid.is("[data-uk-grid-margin]") && !grid.data("grid-margin")) { grid.data("grid-margin", new GridMargin(grid, UI.Utils.options(grid.data("uk-grid-margin")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI, $win) { "use strict"; var active = false, html = $("html"), Modal = function(element, options) { var $this = this; this.element = $(element); this.options = $.extend({ keyboard: true, show: false, bgclose: true }, options); this.transition = UI.support.transition; this.dialog = this.element.find(".uk-modal-dialog"); this.element.on("click", ".uk-modal-close", function(e) { e.preventDefault(); $this.hide(); }).on("click", function(e) { var target = $(e.target); if (target[0] == $this.element[0] && $this.options.bgclose) { $this.hide(); } }); if (this.options.keyboard) { $(document).on('keyup.ui.modal.escape', function(e) { if (active && e.which == 27 && $this.isActive()) $this.hide(); }); } }; $.extend(Modal.prototype, { transition: false, toggle: function() { this[this.isActive() ? "hide" : "show"](); }, show: function() { var $this = this; if (this.isActive()) return; if (active) active.hide(true); this.resize(); this.element.removeClass("uk-open").show(); active = this; html.addClass("uk-modal-page").height(); // force browser engine redraw this.element.addClass("uk-open").trigger("uk.modal.show"); }, hide: function(force) { if (!this.isActive()) return; if (!force && UI.support.transition) { var $this = this; this.element.one(UI.support.transition.end, function() { $this._hide(); }).removeClass("uk-open"); } else { this._hide(); } }, resize: function() { this.dialog.css("margin-left", ""); var modalwidth = parseInt(this.dialog.css("width"), 10), inview = (modalwidth + parseInt(this.dialog.css("margin-left"),10) + parseInt(this.dialog.css("margin-right"),10)) < $win.width(); this.dialog.css("margin-left", modalwidth && inview ? -1*Math.ceil(modalwidth/2) : ""); }, _hide: function() { this.element.hide().removeClass("uk-open"); html.removeClass("uk-modal-page"); if(active===this) active = false; this.element.trigger("uk.modal.hide"); }, isActive: function() { return (active == this); } }); var ModalTrigger = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({ "target": $element.is("a") ? $element.attr("href") : false }, options); this.element = $element; this.modal = new Modal(this.options.target, options); $element.on("click", function(e) { e.preventDefault(); $this.show(); }); //methods $.each(["show", "hide", "isActive"], function(index, method) { $this[method] = function() { return $this.modal[method](); }; }); }; ModalTrigger.Modal = Modal; UI["modal"] = ModalTrigger; // init code $(document).on("click.modal.uikit", "[data-uk-modal]", function(e) { var ele = $(this); if (!ele.data("modal")) { ele.data("modal", new ModalTrigger(ele, UI.Utils.options(ele.data("uk-modal")))); ele.data("modal").show(); } }); $win.on("resize orientationchange", UI.Utils.debounce(function(){ if(active) active.resize(); }, 150)); })(jQuery, jQuery.UIkit, jQuery(window)); (function($, UI) { "use strict"; if (UI.support.touch) { $("html").addClass("uk-touch"); } var $win = $(window), $doc = $(document), Offcanvas = { show: function(element) { element = $(element); if (!element.length) return; var doc = $("html"), bar = element.find(".uk-offcanvas-bar:first"), dir = bar.hasClass("uk-offcanvas-bar-flip") ? -1 : 1, scrollbar = dir == -1 && $win.width() < window.innerWidth ? (window.innerWidth - $win.width()) : 0; scrollpos = {x: window.scrollX, y: window.scrollY}; element.addClass("uk-active"); doc.css({"width": window.innerWidth, "height": window.innerHeight}).addClass("uk-offcanvas-page"); doc.css("margin-left", ((bar.outerWidth() - scrollbar) * dir)).width(); // .width() - force redraw bar.addClass("uk-offcanvas-bar-show").width(); element.off(".ukoffcanvas").on("click.ukoffcanvas swipeRight.ukoffcanvas swipeLeft.ukoffcanvas", function(e) { var target = $(e.target); if (!e.type.match(/swipe/)) { if (target.hasClass("uk-offcanvas-bar")) return; if (target.parents(".uk-offcanvas-bar:first").length) return; } e.stopImmediatePropagation(); Offcanvas.hide(); }); $doc.on('keydown.offcanvas', function(e) { if (e.keyCode === 27) { // ESC Offcanvas.hide(); } }); }, hide: function(force) { var doc = $("html"), panel = $(".uk-offcanvas.uk-active"), bar = panel.find(".uk-offcanvas-bar:first"); if (!panel.length) return; if ($.UIkit.support.transition && !force) { doc.one($.UIkit.support.transition.end, function() { doc.removeClass("uk-offcanvas-page").attr("style", ""); panel.removeClass("uk-active"); window.scrollTo(scrollpos.x, scrollpos.y); }).css("margin-left", ""); setTimeout(function(){ bar.removeClass("uk-offcanvas-bar-show"); }, 50); } else { doc.removeClass("uk-offcanvas-page").attr("style", ""); panel.removeClass("uk-active"); bar.removeClass("uk-offcanvas-bar-show"); window.scrollTo(scrollpos.x, scrollpos.y); } panel.off(".ukoffcanvas"); $doc.off(".ukoffcanvas"); } }, scrollpos; var OffcanvasTrigger = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({ "target": $element.is("a") ? $element.attr("href") : false }, options); this.element = $element; $element.on("click", function(e) { e.preventDefault(); Offcanvas.show($this.options.target); }); }; OffcanvasTrigger.offcanvas = Offcanvas; UI["offcanvas"] = OffcanvasTrigger; // init code $doc.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) { e.preventDefault(); var ele = $(this); if (!ele.data("offcanvas")) { ele.data("offcanvas", new OffcanvasTrigger(ele, UI.Utils.options(ele.data("uk-offcanvas")))); ele.trigger("click"); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var Nav = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on("click", this.options.toggler, function(e) { e.preventDefault(); var ele = $(this); $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li")); }); this.element.find(this.options.lists).each(function() { var $ele = $(this), parent = $ele.parent(), active = parent.hasClass("uk-active"); $ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>'); parent.data("list-container", $ele.parent()); if (active) $this.open(parent, true); }); }; $.extend(Nav.prototype, { options: { "toggler": ">li.uk-parent > a[href='#']", "lists": ">li.uk-parent > ul", "multiple": false }, open: function(li, noanimation) { var element = this.element, $li = $(li); if (!this.options.multiple) { element.children(".uk-open").not(li).each(function() { if ($(this).data("list-container")) { $(this).data("list-container").stop().animate({height: 0}, function() { $(this).parent().removeClass("uk-open"); }); } }); } $li.toggleClass("uk-open"); if ($li.data("list-container")) { if (noanimation) { $li.data('list-container').stop().height($li.hasClass("uk-open") ? "auto" : 0); } else { $li.data('list-container').stop().animate({ height: ($li.hasClass("uk-open") ? getHeight($li.data('list-container').find('ul:first')) : 0) }); } } } }); UI["nav"] = Nav; // helper function getHeight(ele) { var $ele = $(ele), height = "auto"; if ($ele.is(":visible")) { height = $ele.outerHeight(); } else { var tmp = { position: $ele.css("position"), visibility: $ele.css("visibility"), display: $ele.css("display") }; height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); $ele.css(tmp); // reset element } return height; } // init code $(function() { $("[data-uk-nav]").each(function() { var nav = $(this); if (!nav.data("nav")) { nav.data("nav", new Nav(nav, UI.Utils.options(nav.data("uk-nav")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var $tooltip; // tooltip container var Tooltip = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on({ "focus" : function(e) { $this.show(); }, "blur" : function(e) { $this.hide(); }, "mouseenter": function(e) { $this.show(); }, "mouseleave": function(e) { $this.hide(); } }); this.tip = typeof(this.options.src) === "function" ? this.options.src.call(this.element) : this.options.src; // disable title attribute this.element.attr("data-cached-title", this.element.attr("title")).attr("title", ""); }; $.extend(Tooltip.prototype, { tip: "", options: { "offset": 5, "pos": "top", "src": function() { return this.attr("title"); } }, show: function() { if (!this.tip.length) return; $tooltip.css({"top": -2000, "visibility": "hidden"}).show(); $tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>'); var pos = $.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}), width = $tooltip[0].offsetWidth, height = $tooltip[0].offsetHeight, offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset, position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos, tcss = { "display": "none", "visibility": "visible", "top": (pos.top + pos.height + height), "left": pos.left }, tmppos = position.split("-"); if ((tmppos[0] == "left" || tmppos[0] == "right") && $.UIkit.langdirection == 'right') { tmppos[0] = tmppos[0] == "left" ? "right" : "left"; } switch (tmppos[0]) { case 'bottom': $.extend(tcss, {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2}); break; case 'top': $.extend(tcss, {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2}); break; case 'left': $.extend(tcss, {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset}); break; case 'right': $.extend(tcss, {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}); break; } if (tmppos.length == 2) { tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width); } $tooltip.css(tcss).attr("class", "uk-tooltip uk-tooltip-" + position).show(); }, hide: function() { if(this.element.is("input") && this.element[0]===document.activeElement) return; $tooltip.hide(); }, content: function() { return this.tip; } }); UI["tooltip"] = Tooltip; $(function() { $tooltip = $('<div class="uk-tooltip"></div>').appendTo("body"); }); // init code $(document).on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) { var ele = $(this); if (!ele.data("tooltip")) { ele.data("tooltip", new Tooltip(ele, UI.Utils.options(ele.data("uk-tooltip")))).trigger("mouseenter"); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var Switcher = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on("click", this.options.toggler, function(e) { e.preventDefault(); $this.show(this); }); if (this.options.connect) { this.connect = $(this.options.connect).find(".uk-active").removeClass(".uk-active").end(); var active = this.element.find(this.options.toggler).filter(".uk-active"); if (active.length) { this.show(active); } } }; $.extend(Switcher.prototype, { options: { connect: false, toggler: ">*" }, show: function(tab) { tab = isNaN(tab) ? $(tab) : this.element.find(this.options.toggler).eq(tab); var active = tab; if (active.hasClass("uk-disabled")) return; this.element.find(this.options.toggler).filter(".uk-active").removeClass("uk-active"); active.addClass("uk-active"); if (this.options.connect && this.connect.length) { var index = this.element.find(this.options.toggler).index(active); this.connect.children().removeClass("uk-active").eq(index).addClass("uk-active"); } this.element.trigger("uk.switcher.show", [active]); } }); UI["switcher"] = Switcher; // init code $(function() { $("[data-uk-switcher]").each(function() { var switcher = $(this); if (!switcher.data("switcher")) { switcher.data("switcher", new Switcher(switcher, UI.Utils.options(switcher.data("uk-switcher")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var Tab = function(element, options) { var $this = this; this.element = $(element); this.options = $.extend({ connect: false }, this.options, options); if (this.options.connect) { this.connect = $(this.options.connect); } if (window.location.hash) { var active = this.element.children().filter(window.location.hash); if (active.length) { this.element.children().removeClass('uk-active').filter(active).addClass("uk-active"); } } var mobiletab = $('<li class="uk-tab-responsive uk-active"><a href="javascript:void(0);"></a></li>'), caption = mobiletab.find("a:first"), dropdown = $('<div class="uk-dropdown uk-dropdown-small"><ul class="uk-nav uk-nav-dropdown"></ul><div>'), ul = dropdown.find("ul"); caption.html(this.element.find("li.uk-active:first").find("a").text()); if (this.element.hasClass("uk-tab-bottom")) dropdown.addClass("uk-dropdown-up"); if (this.element.hasClass("uk-tab-flip")) dropdown.addClass("uk-dropdown-flip"); this.element.find("a").each(function(i) { var tab = $(this).parent(), item = $('<li><a href="javascript:void(0);">' + tab.text() + '</a></li>').on("click", function(e) { $this.element.data("switcher").show(i); }); if (!$(this).parents(".uk-disabled:first").length) ul.append(item); }); this.element.uk("switcher", {"toggler": ">li:not(.uk-tab-responsive)", "connect": this.options.connect}); mobiletab.append(dropdown).uk("dropdown", {"mode": "click"}); this.element.append(mobiletab).data({ "dropdown": mobiletab.data("dropdown"), "mobilecaption": caption }).on("uk.switcher.show", function(e, tab) { mobiletab.addClass("uk-active"); caption.html(tab.find("a").text()); }); }; UI["tab"] = Tab; // init code $(function() { $("[data-uk-tab]").each(function() { var tab = $(this); if (!tab.data("tab")) { tab.data("tab", new Tab(tab, UI.Utils.options(tab.data("uk-tab")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var Search = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element); this.timer = null; this.value = null; this.input = this.element.find(".uk-search-field"); this.form = this.input.length ? $(this.input.get(0).form) : $(); this.input.attr('autocomplete', 'off'); this.input.on({ keydown: function(event) { $this.form[($this.input.val()) ? 'addClass' : 'removeClass']($this.options.filledClass); if (event && event.which && !event.shiftKey) { switch (event.which) { case 13: // enter $this.done($this.selected); event.preventDefault(); break; case 38: // up $this.pick('prev'); event.preventDefault(); break; case 40: // down $this.pick('next'); event.preventDefault(); break; case 27: case 9: // esc, tab $this.hide(); break; default: break; } } }, keyup: function(event) { $this.trigger(); }, blur: function(event) { setTimeout(function() { $this.hide(event); }, 200); } }); this.form.find('button[type=reset]').bind('click', function() { $this.form.removeClass("uk-open").removeClass("uk-loading").removeClass("uk-active"); $this.value = null; $this.input.focus(); }); this.dropdown = $('<div class="uk-dropdown uk-dropdown-search"><ul class="uk-nav uk-nav-search"></ul></div>').appendTo(this.form).find('.uk-nav-search'); if (this.options.flipDropdown) { this.dropdown.parent().addClass('uk-dropdown-flip'); } }; $.extend(Search.prototype, { options: { source: false, param: 'search', method: 'post', minLength: 3, delay: 300, flipDropdown: false, match: ':not(.uk-skip)', skipClass: 'uk-skip', loadingClass: 'uk-loading', filledClass: 'uk-active', resultsHeaderClass: 'uk-nav-header', moreResultsClass: '', noResultsClass: '', listClass: 'results', hoverClass: 'uk-active', msgResultsHeader: 'Search Results', msgMoreResults: 'More Results', msgNoResults: 'No results found', onSelect: function(selected) { window.location = selected.data('choice').url; }, onLoadedResults: function(results) { return results; } }, request: function(options) { var $this = this; this.form.addClass(this.options.loadingClass); if (this.options.source) { $.ajax($.extend({ url: this.options.source, type: this.options.method, dataType: 'json', success: function(data) { data = $this.options.onLoadedResults.apply(this, [data]); $this.form.removeClass($this.options.loadingClass); $this.suggest(data); } }, options)); } else { this.form.removeClass($this.options.loadingClass); } }, pick: function(item) { var selected = false; if (typeof item !== "string" && !item.hasClass(this.options.skipClass)) { selected = item; } if (item == 'next' || item == 'prev') { var items = this.dropdown.children().filter(this.options.match); if (this.selected) { var index = items.index(this.selected); if (item == 'next') { selected = items.eq(index + 1 < items.length ? index + 1 : 0); } else { selected = items.eq(index - 1 < 0 ? items.length - 1 : index - 1); } } else { selected = items[(item == 'next') ? 'first' : 'last'](); } } if (selected && selected.length) { this.selected = selected; this.dropdown.children().removeClass(this.options.hoverClass); this.selected.addClass(this.options.hoverClass); } }, done: function(selected) { if (!selected) { this.form.submit(); return; } if (selected.hasClass(this.options.moreResultsClass)) { this.form.submit(); } else if (selected.data('choice')) { this.options.onSelect.apply(this, [selected]); } this.hide(); }, trigger: function() { var $this = this, old = this.value, data = {}; this.value = this.input.val(); if (this.value.length < this.options.minLength) { return this.hide(); } if (this.value != old) { if (this.timer) window.clearTimeout(this.timer); this.timer = window.setTimeout(function() { data[$this.options.param] = $this.value; $this.request({'data': data}); }, this.options.delay, this); } return this; }, suggest: function(data) { if (!data) return; var $this = this, events = { 'mouseover': function() { $this.pick($(this).parent()); }, 'click': function(e) { e.preventDefault(); $this.done($(this).parent()); } }; if (data === false) { this.hide(); } else { this.selected = null; this.dropdown.empty(); if (this.options.msgResultsHeader) { $('<li>').addClass(this.options.resultsHeaderClass + ' ' + this.options.skipClass).html(this.options.msgResultsHeader).appendTo(this.dropdown); } if (data.results && data.results.length > 0) { $(data.results).each(function(i) { var item = $('<li><a href="#">' + this.title + '</a></li>').data('choice', this); if (this["text"]) { item.find("a").append('<div>' + this.text + '</div>'); } $this.dropdown.append(item); }); if (this.options.msgMoreResults) { $('<li>').addClass('uk-nav-divider ' + $this.options.skipClass).appendTo($this.dropdown); $('<li>').addClass($this.options.moreResultsClass).html('<a href="#">' + $this.options.msgMoreResults + '</a>').appendTo($this.dropdown).on(events); } $this.dropdown.find("li>a").on(events); } else if (this.options.msgNoResults) { $('<li>').addClass(this.options.noResultsClass + ' ' + this.options.skipClass).html('<a>' + this.options.msgNoResults + '</a>').appendTo(this.dropdown); } this.show(); } }, show: function() { if (this.visible) return; this.visible = true; this.form.addClass("uk-open"); }, hide: function() { if (!this.visible) return; this.visible = false; this.form.removeClass(this.options.loadingClass).removeClass("uk-open"); } }); UI["search"] = Search; // init code $(document).on("focus.search.uikit", "[data-uk-search]", function(e) { var ele = $(this); if (!ele.data("search")) { ele.data("search", new Search(ele, UI.Utils.options(ele.data("uk-search")))); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var $win = $(window), ScrollSpy = function(element, options) { this.options = $.extend({}, this.options, options); var $this = this, inviewstate, initinview, fn = function(){ var inview = isInView($this); if(inview && !inviewstate) { if(!initinview) { $this.element.addClass($this.options.initcls); $this.offset = $this.element.offset(); initinview = true; $this.element.trigger("uk-scrollspy-init"); } $this.element.addClass("uk-scrollspy-inview").addClass($this.options.cls).width(); inviewstate = true; $this.element.trigger("uk.scrollspy.inview"); } if (!inview && inviewstate && $this.options.repeat) { $this.element.removeClass("uk-scrollspy-inview").removeClass($this.options.cls); inviewstate = false; $this.element.trigger("uk.scrollspy.outview"); } }; this.element = $(element); $win.on("scroll", fn).on("resize orientationchange", UI.Utils.debounce(fn, 50)); fn(); }; $.extend(ScrollSpy.prototype, { options: { "cls": "uk-scrollspy-inview", "initcls": "uk-scrollspy-init-inview", "topoffset": 0, "leftoffset": 0, "repeat": false } }); UI["scrollspy"] = ScrollSpy; function isInView(obj) { var $element = obj.element, options = obj.options; if (!$element.is(':visible')) { return false; } var window_left = $win.scrollLeft(), window_top = $win.scrollTop(), offset = obj.offset || $element.offset(), left = offset.left, top = offset.top; if (top + $element.height() >= window_top && top - options.topoffset <= window_top + $win.height() && left + $element.width() >= window_left && left - options.leftoffset <= window_left + $win.width()) { return true; } else { return false; } } // init code $(function() { $("[data-uk-scrollspy]").each(function() { var element = $(this); if (!element.data("scrollspy")) { element.data("scrollspy", new ScrollSpy(element, UI.Utils.options(element.data("uk-scrollspy")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var SmoothScroll = function(element, options) { var $this = this; this.options = $.extend({ duration: 1000, transition: 'easeOutExpo' }, options); this.element = $(element).on("click", function(e) { // get / set parameters var target = ($(this.hash).length ? $(this.hash) : $("body")).offset().top, docheight = $(document).height(), winheight = $(window).height(); if ((target + winheight) > docheight) { target = (target - winheight) + 50; } // animate to target and set the hash to the window.location after the animation $("html,body").stop().animate({scrollTop: target}, $this.options.duration, $this.options.transition); // cancel default click action return false; }); }; UI["smooth-scroll"] = SmoothScroll; if (!$.easing['easeOutExpo']) { $.easing['easeOutExpo'] = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }; } // init code $(document).on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) { var ele = $(this); if (!ele.data("smooth-scroll")) { ele.data("smooth-scroll", new SmoothScroll(ele, UI.Utils.options(ele.data("uk-smooth-scroll")))).trigger("click"); } }); })(jQuery, jQuery.UIkit);
davidbau/cdnjs
ajax/libs/uikit/1.1.0/js/uikit.js
JavaScript
mit
53,891
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * * @package CodeIgniter * @author ExpressionEngine Dev Team * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 1.0 * @filesource */ // ------------------------------------------------------------------------ /** * CodeIgniter Date Helpers * * @package CodeIgniter * @subpackage Helpers * @category Helpers * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/helpers/date_helper.html */ // ------------------------------------------------------------------------ /** * Get "now" time * * Returns time() or its GMT equivalent based on the config file preference * * @access public * @return integer */ if ( ! function_exists('now')) { function now() { $CI =& get_instance(); if (strtolower($CI->config->item('time_reference')) == 'gmt') { $now = time(); $system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); if (strlen($system_time) < 10) { $system_time = time(); log_message('error', 'The Date class could not set a proper GMT timestamp so the local time() value was used.'); } return $system_time; } else { return time(); } } } // ------------------------------------------------------------------------ /** * Convert MySQL Style Datecodes * * This function is identical to PHPs date() function, * except that it allows date codes to be formatted using * the MySQL style, where each code letter is preceded * with a percent sign: %Y %m %d etc... * * The benefit of doing dates this way is that you don't * have to worry about escaping your text letters that * match the date codes. * * @access public * @param string * @param integer * @return integer */ if ( ! function_exists('mdate')) { function mdate($datestr = '', $time = '') { if ($datestr == '') return ''; if ($time == '') $time = now(); $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); return date($datestr, $time); } } // ------------------------------------------------------------------------ /** * Standard Date * * Returns a date formatted according to the submitted standard. * * @access public * @param string the chosen format * @param integer Unix timestamp * @return string */ if ( ! function_exists('standard_date')) { function standard_date($fmt = 'DATE_RFC822', $time = '') { $formats = array( 'DATE_ATOM' => '%Y-%m-%dT%H:%i:%s%Q', 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%Q', 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', 'DATE_RFC850' => '%l, %d-%M-%y %H:%i:%s UTC', 'DATE_RFC1036' => '%D, %d %M %y %H:%i:%s %O', 'DATE_RFC1123' => '%D, %d %M %Y %H:%i:%s %O', 'DATE_RSS' => '%D, %d %M %Y %H:%i:%s %O', 'DATE_W3C' => '%Y-%m-%dT%H:%i:%s%Q' ); if ( ! isset($formats[$fmt])) { return FALSE; } return mdate($formats[$fmt], $time); } } // ------------------------------------------------------------------------ /** * Timespan * * Returns a span of seconds in this format: * 10 days 14 hours 36 minutes 47 seconds * * @access public * @param integer a number of seconds * @param integer Unix timestamp * @return integer */ if ( ! function_exists('timespan')) { function timespan($seconds = 1, $time = '') { $CI =& get_instance(); $CI->lang->load('date'); if ( ! is_numeric($seconds)) { $seconds = 1; } if ( ! is_numeric($time)) { $time = time(); } if ($time <= $seconds) { $seconds = 1; } else { $seconds = $time - $seconds; } $str = ''; $years = floor($seconds / 31536000); if ($years > 0) { $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; } $seconds -= $years * 31536000; $months = floor($seconds / 2628000); if ($years > 0 OR $months > 0) { if ($months > 0) { $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; } $seconds -= $months * 2628000; } $weeks = floor($seconds / 604800); if ($years > 0 OR $months > 0 OR $weeks > 0) { if ($weeks > 0) { $str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', '; } $seconds -= $weeks * 604800; } $days = floor($seconds / 86400); if ($months > 0 OR $weeks > 0 OR $days > 0) { if ($days > 0) { $str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', '; } $seconds -= $days * 86400; } $hours = floor($seconds / 3600); if ($days > 0 OR $hours > 0) { if ($hours > 0) { $str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', '; } $seconds -= $hours * 3600; } $minutes = floor($seconds / 60); if ($days > 0 OR $hours > 0 OR $minutes > 0) { if ($minutes > 0) { $str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', '; } $seconds -= $minutes * 60; } if ($str == '') { $str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', '; } return substr(trim($str), 0, -1); } } // ------------------------------------------------------------------------ /** * Number of days in a month * * Takes a month/year as input and returns the number of days * for the given month/year. Takes leap years into consideration. * * @access public * @param integer a numeric month * @param integer a numeric year * @return integer */ if ( ! function_exists('days_in_month')) { function days_in_month($month = 0, $year = '') { if ($month < 1 OR $month > 12) { return 0; } if ( ! is_numeric($year) OR strlen($year) != 4) { $year = date('Y'); } if ($month == 2) { if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0)) { return 29; } } $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); return $days_in_month[$month - 1]; } } // ------------------------------------------------------------------------ /** * Converts a local Unix timestamp to GMT * * @access public * @param integer Unix timestamp * @return integer */ if ( ! function_exists('local_to_gmt')) { function local_to_gmt($time = '') { if ($time == '') $time = time(); return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); } } // ------------------------------------------------------------------------ /** * Converts GMT time to a localized value * * Takes a Unix timestamp (in GMT) as input, and returns * at the local value based on the timezone and DST setting * submitted * * @access public * @param integer Unix timestamp * @param string timezone * @param bool whether DST is active * @return integer */ if ( ! function_exists('gmt_to_local')) { function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) { if ($time == '') { return now(); } $time += timezones($timezone) * 3600; if ($dst == TRUE) { $time += 3600; } return $time; } } // ------------------------------------------------------------------------ /** * Converts a MySQL Timestamp to Unix * * @access public * @param integer Unix timestamp * @return integer */ if ( ! function_exists('mysql_to_unix')) { function mysql_to_unix($time = '') { // We'll remove certain characters for backward compatibility // since the formatting changed with MySQL 4.1 // YYYY-MM-DD HH:MM:SS $time = str_replace('-', '', $time); $time = str_replace(':', '', $time); $time = str_replace(' ', '', $time); // YYYYMMDDHHMMSS return mktime( substr($time, 8, 2), substr($time, 10, 2), substr($time, 12, 2), substr($time, 4, 2), substr($time, 6, 2), substr($time, 0, 4) ); } } // ------------------------------------------------------------------------ /** * Unix to "Human" * * Formats Unix timestamp to the following prototype: 2006-08-21 11:35 PM * * @access public * @param integer Unix timestamp * @param bool whether to show seconds * @param string format: us or euro * @return string */ if ( ! function_exists('unix_to_human')) { function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') { $r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' '; if ($fmt == 'us') { $r .= date('h', $time).':'.date('i', $time); } else { $r .= date('H', $time).':'.date('i', $time); } if ($seconds) { $r .= ':'.date('s', $time); } if ($fmt == 'us') { $r .= ' '.date('A', $time); } return $r; } } // ------------------------------------------------------------------------ /** * Convert "human" date to GMT * * Reverses the above process * * @access public * @param string format: us or euro * @return integer */ if ( ! function_exists('human_to_unix')) { function human_to_unix($datestr = '') { if ($datestr == '') { return FALSE; } $datestr = trim($datestr); $datestr = preg_replace("/\040+/", ' ', $datestr); if ( ! preg_match('/^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s[0-9]{1,2}:[0-9]{1,2}(?::[0-9]{1,2})?(?:\s[AP]M)?$/i', $datestr)) { return FALSE; } $split = explode(' ', $datestr); $ex = explode("-", $split['0']); $year = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0']; $month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; $day = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; $ex = explode(":", $split['1']); $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; if (isset($ex['2']) && preg_match('/[0-9]{1,2}/', $ex['2'])) { $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; } else { // Unless specified, seconds get set to zero. $sec = '00'; } if (isset($split['2'])) { $ampm = strtolower($split['2']); if (substr($ampm, 0, 1) == 'p' AND $hour < 12) $hour = $hour + 12; if (substr($ampm, 0, 1) == 'a' AND $hour == 12) $hour = '00'; if (strlen($hour) == 1) $hour = '0'.$hour; } return mktime($hour, $min, $sec, $month, $day, $year); } } // ------------------------------------------------------------------------ /** * Timezone Menu * * Generates a drop-down menu of timezones. * * @access public * @param string timezone * @param string classname * @param string menu name * @return string */ if ( ! function_exists('timezone_menu')) { function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') { $CI =& get_instance(); $CI->lang->load('date'); if ($default == 'GMT') $default = 'UTC'; $menu = '<select name="'.$name.'"'; if ($class != '') { $menu .= ' class="'.$class.'"'; } $menu .= ">\n"; foreach (timezones() as $key => $val) { $selected = ($default == $key) ? " selected='selected'" : ''; $menu .= "<option value='{$key}'{$selected}>".$CI->lang->line($key)."</option>\n"; } $menu .= "</select>"; return $menu; } } // ------------------------------------------------------------------------ /** * Timezones * * Returns an array of timezones. This is a helper function * for various other ones in this library * * @access public * @param string timezone * @return string */ if ( ! function_exists('timezones')) { function timezones($tz = '') { // Note: Don't change the order of these even though // some items appear to be in the wrong order $zones = array( 'UM12' => -12, 'UM11' => -11, 'UM10' => -10, 'UM95' => -9.5, 'UM9' => -9, 'UM8' => -8, 'UM7' => -7, 'UM6' => -6, 'UM5' => -5, 'UM45' => -4.5, 'UM4' => -4, 'UM35' => -3.5, 'UM3' => -3, 'UM2' => -2, 'UM1' => -1, 'UTC' => 0, 'UP1' => +1, 'UP2' => +2, 'UP3' => +3, 'UP35' => +3.5, 'UP4' => +4, 'UP45' => +4.5, 'UP5' => +5, 'UP55' => +5.5, 'UP575' => +5.75, 'UP6' => +6, 'UP65' => +6.5, 'UP7' => +7, 'UP8' => +8, 'UP875' => +8.75, 'UP9' => +9, 'UP95' => +9.5, 'UP10' => +10, 'UP105' => +10.5, 'UP11' => +11, 'UP115' => +11.5, 'UP12' => +12, 'UP1275' => +12.75, 'UP13' => +13, 'UP14' => +14 ); if ($tz == '') { return $zones; } if ($tz == 'GMT') $tz = 'UTC'; return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; } } /* End of file date_helper.php */ /* Location: ./system/helpers/date_helper.php */
itvisionsy/collabobase
fw/helpers/date_helper.php
PHP
mit
12,971
YUI.add("oop",function(h){var d=h.Lang,c=h.Array,b=Object.prototype,a="_~yuim~_",e=b.hasOwnProperty,g=b.toString;function f(l,k,m,i,j){if(l&&l[j]&&l!==h){return l[j].call(l,k,m);}else{switch(c.test(l)){case 1:return c[j](l,k,m);case 2:return c[j](h.Array(l,0,true),k,m);default:return h.Object[j](l,k,m,i);}}}h.augment=function(i,k,r,o,s){var n=i.prototype,m=n&&k,q=k.prototype,v=n||i,j,u,p,l,t;s=s?h.Array(s):[];if(m){u={};p={};l={};j=function(x,w){if(r||!(w in n)){if(g.call(x)==="[object Function]"){l[w]=x;u[w]=p[w]=function(){return t(this,x,arguments);};}else{u[w]=x;}}};t=function(w,y,z){for(var x in l){if(e.call(l,x)&&w[x]===p[x]){w[x]=l[x];}}k.apply(w,s);return y.apply(w,z);};if(o){h.Array.each(o,function(w){if(w in q){j(q[w],w);}});}else{h.Object.each(q,j,null,true);}}h.mix(v,u||q,r,o);if(!m){k.apply(v,s);}return i;};h.aggregate=function(k,j,i,l){return h.mix(k,j,i,l,0,true);};h.extend=function(l,k,i,n){if(!k||!l){h.error("extend failed, verify dependencies");}var m=k.prototype,j=h.Object(m);l.prototype=j;j.constructor=l;l.superclass=m;if(k!=Object&&m.constructor==b.constructor){m.constructor=k;}if(i){h.mix(j,i,true);}if(n){h.mix(l,n,true);}return l;};h.each=function(k,j,l,i){return f(k,j,l,i,"each");};h.some=function(k,j,l,i){return f(k,j,l,i,"some");};h.clone=function(l,m,r,s,k,q){if(!d.isObject(l)){return l;}if(h.instanceOf(l,YUI)){return l;}var n,j=q||{},i,p=h.each;switch(d.type(l)){case"date":return new Date(l);case"regexp":return l;case"function":return l;case"array":n=[];break;default:if(l[a]){return j[l[a]];}i=h.guid();n=(m)?{}:h.Object(l);l[a]=i;j[i]=l;}if(!l.addEventListener&&!l.attachEvent){p(l,function(t,o){if((o||o===0)&&(!r||(r.call(s||this,t,o,this,l)!==false))){if(o!==a){if(o=="prototype"){}else{this[o]=h.clone(t,m,r,s,k||l,j);}}}},n);}if(!q){h.Object.each(j,function(t,o){if(t[a]){try{delete t[a];}catch(u){t[a]=null;}}},this);j=null;}return n;};h.bind=function(i,k){var j=arguments.length>2?h.Array(arguments,2,true):null;return function(){var m=d.isString(i)?k[i]:i,l=(j)?j.concat(h.Array(arguments,0,true)):arguments;return m.apply(k||m,l);};};h.rbind=function(i,k){var j=arguments.length>2?h.Array(arguments,2,true):null;return function(){var m=d.isString(i)?k[i]:i,l=(j)?h.Array(arguments,0,true).concat(j):arguments;return m.apply(k||m,l);};};},"@VERSION@",{requires:["yui-base"]});
AlexisArce/cdnjs
ajax/libs/yui/3.5.1/oop/oop-min.js
JavaScript
mit
2,338
/*! * Piwik - Web Analytics * * JavaScript tracking client * * @link http://piwik.org * @source https://github.com/piwik/piwik/blob/master/js/piwik.js * @license http://piwik.org/free-software/bsd/ Simplified BSD (also in js/LICENSE.txt) */ if(typeof JSON2!=="object"){JSON2={}}(function(){function d(f){return f<10?"0"+f:f}function l(n,m){var f=Object.prototype.toString.apply(n);if(f==="[object Date]"){return isFinite(n.valueOf())?n.getUTCFullYear()+"-"+d(n.getUTCMonth()+1)+"-"+d(n.getUTCDate())+"T"+d(n.getUTCHours())+":"+d(n.getUTCMinutes())+":"+d(n.getUTCSeconds())+"Z":null}if(f==="[object String]"||f==="[object Number]"||f==="[object Boolean]"){return n.valueOf()}if(f!=="[object Array]"&&typeof n.toJSON==="function"){return n.toJSON(m)}return n}var c=new RegExp("[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]","g"),e='\\\\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]',i=new RegExp("["+e,"g"),j,b,k={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h; function a(f){i.lastIndex=0;return i.test(f)?'"'+f.replace(i,function(m){var n=k[m];return typeof n==="string"?n:"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}function g(s,p){var n,m,t,f,q=j,o,r=p[s];if(r&&typeof r==="object"){r=l(r,s)}if(typeof h==="function"){r=h.call(p,s,r)}switch(typeof r){case"string":return a(r);case"number":return isFinite(r)?String(r):"null";case"boolean":case"null":return String(r);case"object":if(!r){return"null"}j+=b;o=[];if(Object.prototype.toString.apply(r)==="[object Array]"){f=r.length;for(n=0;n<f;n+=1){o[n]=g(n,r)||"null"}t=o.length===0?"[]":j?"[\n"+j+o.join(",\n"+j)+"\n"+q+"]":"["+o.join(",")+"]";j=q;return t}if(h&&typeof h==="object"){f=h.length;for(n=0;n<f;n+=1){if(typeof h[n]==="string"){m=h[n];t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}else{for(m in r){if(Object.prototype.hasOwnProperty.call(r,m)){t=g(m,r);if(t){o.push(a(m)+(j?": ":":")+t)}}}}t=o.length===0?"{}":j?"{\n"+j+o.join(",\n"+j)+"\n"+q+"}":"{"+o.join(",")+"}";j=q; return t}}if(typeof JSON2.stringify!=="function"){JSON2.stringify=function(o,m,n){var f;j="";b="";if(typeof n==="number"){for(f=0;f<n;f+=1){b+=" "}}else{if(typeof n==="string"){b=n}}h=m;if(m&&typeof m!=="function"&&(typeof m!=="object"||typeof m.length!=="number")){throw new Error("JSON2.stringify")}return g("",{"":o})}}if(typeof JSON2.parse!=="function"){JSON2.parse=function(o,f){var n;function m(s,r){var q,p,t=s[r];if(t&&typeof t==="object"){for(q in t){if(Object.prototype.hasOwnProperty.call(t,q)){p=m(t,q);if(p!==undefined){t[q]=p}else{delete t[q]}}}}return f.call(s,r,t)}o=String(o);c.lastIndex=0;if(c.test(o)){o=o.replace(c,function(p){return"\\u"+("0000"+p.charCodeAt(0).toString(16)).slice(-4)})}if((new RegExp("^[\\],:{}\\s]*$")).test(o.replace(new RegExp('\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})',"g"),"@").replace(new RegExp('"[^"\\\\\n\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?',"g"),"]").replace(new RegExp("(?:^|:|,)(?:\\s*\\[)+","g"),""))){n=eval("("+o+")"); return typeof f==="function"?m({"":n},""):n}throw new SyntaxError("JSON2.parse")}}}());if(typeof _paq!=="object"){_paq=[]}if(typeof Piwik!=="object"){Piwik=(function(){var h,a={},q=document,d=navigator,D=screen,A=window,e=A.performance||A.mozPerformance||A.msPerformance||A.webkitPerformance,m=false,y=[],j=A.encodeURIComponent,z=A.decodeURIComponent,f=unescape,E,p,c;function s(P){var O=typeof P;return O!=="undefined"}function n(O){return typeof O==="function"}function C(O){return typeof O==="object"}function k(O){return typeof O==="string"||O instanceof String}function J(){var O,Q,P;for(O=0;O<arguments.length;O+=1){P=arguments[O];Q=P.shift();if(k(Q)){E[Q].apply(E,P)}else{Q.apply(E,P)}}}function M(R,Q,P,O){if(R.addEventListener){R.addEventListener(Q,P,O);return true}if(R.attachEvent){return R.attachEvent("on"+Q,P)}R["on"+Q]=P}function H(P,S){var O="",R,Q;for(R in a){if(Object.prototype.hasOwnProperty.call(a,R)){Q=a[R][P];if(n(Q)){O+=Q(S)}}}return O}function K(){var O;H("unload");if(h){do{O=new Date() }while(O.getTimeAlias()<h)}}function I(){var O;if(!m){m=true;H("load");for(O=0;O<y.length;O++){y[O]()}}return true}function l(){var P;if(q.addEventListener){M(q,"DOMContentLoaded",function O(){q.removeEventListener("DOMContentLoaded",O,false);I()})}else{if(q.attachEvent){q.attachEvent("onreadystatechange",function O(){if(q.readyState==="complete"){q.detachEvent("onreadystatechange",O);I()}});if(q.documentElement.doScroll&&A===A.top){(function O(){if(!m){try{q.documentElement.doScroll("left")}catch(Q){setTimeout(O,0);return}I()}}())}}}if((new RegExp("WebKit")).test(d.userAgent)){P=setInterval(function(){if(m||/loaded|complete/.test(q.readyState)){clearInterval(P);I()}},10)}M(A,"load",I,false)}function g(Q,P){var O=q.createElement("script");O.type="text/javascript";O.src=Q;if(O.readyState){O.onreadystatechange=function(){var R=this.readyState;if(R==="loaded"||R==="complete"){O.onreadystatechange=null;P()}}}else{O.onload=P}q.getElementsByTagName("head")[0].appendChild(O)}function t(){var O=""; try{O=A.top.document.referrer}catch(Q){if(A.parent){try{O=A.parent.document.referrer}catch(P){O=""}}}if(O===""){O=q.referrer}return O}function i(O){var Q=new RegExp("^([a-z]+):"),P=Q.exec(O);return P?P[1]:null}function b(O){var Q=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),P=Q.exec(O);return P?P[1]:O}function B(Q,P){var O="[\\?&#]"+P+"=([^&#]*)";var S=new RegExp(O);var R=S.exec(Q);return R?z(R[1]):""}function o(O){return f(j(O))}function L(ae){var Q=function(aj,W){return(aj<<W)|(aj>>>(32-W))},af=function(al){var aj="",ak,W;for(ak=7;ak>=0;ak--){W=(al>>>(ak*4))&15;aj+=W.toString(16)}return aj},T,ah,ag,P=[],Y=1732584193,V=4023233417,U=2562383102,S=271733878,R=3285377520,ad,ac,ab,aa,Z,ai,O,X=[];ae=o(ae);O=ae.length;for(ah=0;ah<O-3;ah+=4){ag=ae.charCodeAt(ah)<<24|ae.charCodeAt(ah+1)<<16|ae.charCodeAt(ah+2)<<8|ae.charCodeAt(ah+3);X.push(ag)}switch(O&3){case 0:ah=2147483648;break;case 1:ah=ae.charCodeAt(O-1)<<24|8388608;break;case 2:ah=ae.charCodeAt(O-2)<<24|ae.charCodeAt(O-1)<<16|32768; break;case 3:ah=ae.charCodeAt(O-3)<<24|ae.charCodeAt(O-2)<<16|ae.charCodeAt(O-1)<<8|128;break}X.push(ah);while((X.length&15)!==14){X.push(0)}X.push(O>>>29);X.push((O<<3)&4294967295);for(T=0;T<X.length;T+=16){for(ah=0;ah<16;ah++){P[ah]=X[T+ah]}for(ah=16;ah<=79;ah++){P[ah]=Q(P[ah-3]^P[ah-8]^P[ah-14]^P[ah-16],1)}ad=Y;ac=V;ab=U;aa=S;Z=R;for(ah=0;ah<=19;ah++){ai=(Q(ad,5)+((ac&ab)|(~ac&aa))+Z+P[ah]+1518500249)&4294967295;Z=aa;aa=ab;ab=Q(ac,30);ac=ad;ad=ai}for(ah=20;ah<=39;ah++){ai=(Q(ad,5)+(ac^ab^aa)+Z+P[ah]+1859775393)&4294967295;Z=aa;aa=ab;ab=Q(ac,30);ac=ad;ad=ai}for(ah=40;ah<=59;ah++){ai=(Q(ad,5)+((ac&ab)|(ac&aa)|(ab&aa))+Z+P[ah]+2400959708)&4294967295;Z=aa;aa=ab;ab=Q(ac,30);ac=ad;ad=ai}for(ah=60;ah<=79;ah++){ai=(Q(ad,5)+(ac^ab^aa)+Z+P[ah]+3395469782)&4294967295;Z=aa;aa=ab;ab=Q(ac,30);ac=ad;ad=ai}Y=(Y+ad)&4294967295;V=(V+ac)&4294967295;U=(U+ab)&4294967295;S=(S+aa)&4294967295;R=(R+Z)&4294967295}ai=af(Y)+af(V)+af(U)+af(S)+af(R);return ai.toLowerCase()}function G(Q,O,P){if(Q==="translate.googleusercontent.com"){if(P===""){P=O }O=B(O,"u");Q=b(O)}else{if(Q==="cc.bingj.com"||Q==="webcache.googleusercontent.com"||Q.slice(0,5)==="74.6."){O=q.links[0].href;Q=b(O)}}return[Q,O,P]}function u(P){var O=P.length;if(P.charAt(--O)==="."){P=P.slice(0,O)}if(P.slice(0,2)==="*."){P=P.slice(1)}return P}function N(P){P=P&&P.text?P.text:P;if(!k(P)){var O=q.getElementsByTagName("title");if(O&&s(O[0])){P=O[0].text}}return P}function w(O,P){if(P){return P}if(O.slice(-9)==="piwik.php"){O=O.slice(0,O.length-9)}return O}function v(S){var O="Piwik_Overlay";var V=new RegExp("index\\.php\\?module=Overlay&action=startOverlaySession&idSite=([0-9]+)&period=([^&]+)&date=([^&]+)$");var Q=V.exec(q.referrer);if(Q){var R=Q[1];if(R!==String(S)){return false}var U=Q[2],P=Q[3];A.name=O+"###"+U+"###"+P}var T=A.name.split("###");return T.length===3&&T[0]===O}function F(P,U,R){var T=A.name.split("###"),S=T[1],O=T[2],Q=w(P,U);g(Q+"plugins/Overlay/client/client.js?v=1",function(){Piwik_Overlay_Client.initialize(Q,R,S,O)})}function x(am,aN){var U=G(q.domain,A.location.href,t()),a7=u(U[0]),bm=U[1],aU=U[2],bn=false,aS="GET",S=am||"",aj="",aP="",bc=aN||"",aE,au=q.title,aw="7z|aac|apk|ar[cj]|as[fx]|avi|azw3|bin|csv|deb|dmg|docx?|epub|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mobi|mp(2|3|4|e?g)|mov(ie)?|ms[ip]|od[bfgpst]|og[gv]|pdf|phps|png|pptx?|qtm?|ra[mr]?|rpm|sea|sit|tar|t?bz2?|tgz|torrent|txt|wav|wm[av]|wpd||xlsx?|xml|z|zip",aQ=[a7],X=[],aI=[],al=[],aO=500,Y,an,Z,ab,ay=["pk_campaign","piwik_campaign","utm_campaign","utm_source","utm_medium"],at=["pk_kwd","piwik_kwd","utm_term"],bk="_pk_",ae,bl,ac=false,bf,aA,aD,ai=63072000000,ak=1800000,aF=15768000000,aB=true,ap=0,W=false,aJ={},T={},bg=200,a0={},bd={},aX=false,aV=false,aT,aK,af,ax=L,aW,aC; function a2(bw,bt,bs,bv,br,bu){if(ac){return}var bq;if(bs){bq=new Date();bq.setTime(bq.getTime()+bs)}q.cookie=bw+"="+j(bt)+(bs?";expires="+bq.toGMTString():"")+";path="+(bv||"/")+(br?";domain="+br:"")+(bu?";secure":"")}function ah(bs){if(ac){return 0}var bq=new RegExp("(^|;)[ ]*"+bs+"=([^;]*)"),br=bq.exec(q.cookie);return br?z(br[2]):0}function bh(bq){var br;if(Z){br=new RegExp("#.*");return bq.replace(br,"")}return bq}function a6(bs,bq){var bt=i(bq),br;if(bt){return bq}if(bq.slice(0,1)==="/"){return i(bs)+"://"+b(bs)+bq}bs=bh(bs);br=bs.indexOf("?");if(br>=0){bs=bs.slice(0,br)}br=bs.lastIndexOf("/");if(br!==bs.length-1){bs=bs.slice(0,br+1)}return bs+bq}function aR(bt){var br,bq,bs;for(br=0;br<aQ.length;br++){bq=u(aQ[br].toLowerCase());if(bt===bq){return true}if(bq.slice(0,1)==="."){if(bt===bq.slice(1)){return true}bs=bt.length-bq.length;if((bs>0)&&(bt.slice(bs)===bq)){return true}}}return false}function bp(bq){var br=new Image(1,1);br.onload=function(){p=0};br.src=S+(S.indexOf("?")<0?"?":"&")+bq }function a3(bq){try{var bs=A.XMLHttpRequest?new A.XMLHttpRequest():A.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;bs.open("POST",S,true);bs.onreadystatechange=function(){if(this.readyState===4&&this.status!==200){bp(bq)}};bs.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");bs.send(bq)}catch(br){bp(bq)}}function az(bs,br){var bq=new Date();if(!bf){if(aS==="POST"){a3(bs)}else{bp(bs)}h=bq.getTime()+br}}function a1(bq){return bk+bq+"."+bc+"."+aW}function V(){if(ac){return"0"}if(!s(d.cookieEnabled)){var bq=a1("testcookie");a2(bq,"1");return ah(bq)==="1"?"1":"0"}return d.cookieEnabled?"1":"0"}function aL(){aW=ax((ae||a7)+(bl||"/")).slice(0,4)}function ag(){var br=a1("cvar"),bq=ah(br);if(bq.length){bq=JSON2.parse(bq);if(C(bq)){return bq}}return{}}function R(){if(W===false){W=ag()}}function bb(){var bq=new Date();aT=bq.getTime()}function ad(bu,br,bq,bt,bs,bv){a2(a1("id"),bu+"."+br+"."+bq+"."+bt+"."+bs+"."+bv,ai,bl,ae)}function Q(){var br=new Date(),bq=Math.round(br.getTime()/1000),bt=ah(a1("id")),bs; if(bt){bs=bt.split(".");bs.unshift("0")}else{if(!aC){aC=ax((d.userAgent||"")+(d.platform||"")+JSON2.stringify(bd)+br.getTime()+Math.random()).slice(0,16)}bs=["1",aC,bq,0,bq,"",""]}return bs}function O(){var bq=ah(a1("ref"));if(bq.length){try{bq=JSON2.parse(bq);if(C(bq)){return bq}}catch(br){}}return["","",0,""]}function P(){var bq=ac;ac=false;a2(a1("id"),"",-86400,bl,ae);a2(a1("ses"),"",-86400,bl,ae);a2(a1("cvar"),"",-86400,bl,ae);a2(a1("ref"),"",-86400,bl,ae);ac=bq}function ba(bu){if(!bu||!C(bu)){return}var bt=[];var bs;for(bs in bu){if(Object.prototype.hasOwnProperty.call(bu,bs)){bt.push(bs)}}var bv={};bt.sort();var bq=bt.length;var br;for(br=0;br<bq;br++){bv[bt[br]]=bu[bt[br]]}return bv}function av(bs,bQ,bR,bt){var bO,br=new Date(),bA=Math.round(br.getTime()/1000),bU,bP,bv,bG,bL,bz,bJ,bw,bN,bu=1024,bW,bD,bK=W,bB=a1("ses"),bC=a1("ref"),bX=a1("cvar"),bH=Q(),bF=ah(bB),bM=O(),bT=aE||bm,bx,bq;if(ac){P()}if(bf){return""}bU=bH[0];bP=bH[1];bG=bH[2];bv=bH[3];bL=bH[4];bz=bH[5];if(!s(bH[6])){bH[6]="" }bJ=bH[6];if(!s(bt)){bt=""}var bE=q.characterSet||q.charset;if(!bE||bE.toLowerCase()==="utf-8"){bE=null}bx=bM[0];bq=bM[1];bw=bM[2];bN=bM[3];if(!bF){var bS=ak/1000;if(!bz||(bA-bz)>bS){bv++;bz=bL}if(!aD||!bx.length){for(bO in ay){if(Object.prototype.hasOwnProperty.call(ay,bO)){bx=B(bT,ay[bO]);if(bx.length){break}}}for(bO in at){if(Object.prototype.hasOwnProperty.call(at,bO)){bq=B(bT,at[bO]);if(bq.length){break}}}}bW=b(aU);bD=bN.length?b(bN):"";if(bW.length&&!aR(bW)&&(!aD||!bD.length||aR(bD))){bN=aU}if(bN.length||bx.length){bw=bA;bM=[bx,bq,bw,bh(bN.slice(0,bu))];a2(bC,JSON2.stringify(bM),aF,bl,ae)}}bs+="&idsite="+bc+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+br.getHours()+"&m="+br.getMinutes()+"&s="+br.getSeconds()+"&url="+j(bh(bT))+(aU.length?"&urlref="+j(bh(aU)):"")+"&_id="+bP+"&_idts="+bG+"&_idvc="+bv+"&_idn="+bU+(bx.length?"&_rcn="+j(bx):"")+(bq.length?"&_rck="+j(bq):"")+"&_refts="+bw+"&_viewts="+bz+(String(bJ).length?"&_ects="+bJ:"")+(String(bN).length?"&_ref="+j(bh(bN.slice(0,bu))):"")+(bE?"&cs="+j(bE):""); for(bO in bd){if(Object.prototype.hasOwnProperty.call(bd,bO)){bs+="&"+bO+"="+bd[bO]}}if(bQ){bs+="&data="+j(JSON2.stringify(bQ))}else{if(ab){bs+="&data="+j(JSON2.stringify(ab))}}function by(bY,bZ){var b0=JSON2.stringify(bY);if(b0.length>2){return"&"+bZ+"="+j(b0)}return""}var bV=ba(aJ);var bI=ba(T);bs+=by(bV,"cvar");bs+=by(bI,"e_cvar");if(W){bs+=by(W,"_cvar");for(bO in bK){if(Object.prototype.hasOwnProperty.call(bK,bO)){if(W[bO][0]===""||W[bO][1]===""){delete W[bO]}}}a2(bX,JSON2.stringify(W),ak,bl,ae)}if(aB){if(ap){bs+="&gt_ms="+ap}else{if(e&&e.timing&&e.timing.requestStart&&e.timing.responseEnd){bs+="&gt_ms="+(e.timing.responseEnd-e.timing.requestStart)}}}ad(bP,bG,bv,bA,bz,s(bt)&&String(bt).length?bt:bJ);a2(bB,"*",ak,bl,ae);bs+=H(bR);if(aP.length){bs+="&"+aP}return bs}function a5(bt,bs,bx,bu,bq,bA){var bv="idgoal=0",bw,br=new Date(),by=[],bz;if(String(bt).length){bv+="&ec_id="+j(bt);bw=Math.round(br.getTime()/1000)}bv+="&revenue="+bs;if(String(bx).length){bv+="&ec_st="+bx}if(String(bu).length){bv+="&ec_tx="+bu }if(String(bq).length){bv+="&ec_sh="+bq}if(String(bA).length){bv+="&ec_dt="+bA}if(a0){for(bz in a0){if(Object.prototype.hasOwnProperty.call(a0,bz)){if(!s(a0[bz][1])){a0[bz][1]=""}if(!s(a0[bz][2])){a0[bz][2]=""}if(!s(a0[bz][3])||String(a0[bz][3]).length===0){a0[bz][3]=0}if(!s(a0[bz][4])||String(a0[bz][4]).length===0){a0[bz][4]=1}by.push(a0[bz])}}bv+="&ec_items="+j(JSON2.stringify(by))}bv=av(bv,ab,"ecommerce",bw);az(bv,aO)}function a4(bq,bu,bt,bs,br,bv){if(String(bq).length&&s(bu)){a5(bq,bu,bt,bs,br,bv)}}function bj(bq){if(s(bq)){a5("",bq,"","","","")}}function aH(bt,bu){var bq=new Date(),bs=av("action_name="+j(N(bt||au)),bu,"log");az(bs,aO);if(Y&&an&&!aV){aV=true;M(q,"click",bb);M(q,"mouseup",bb);M(q,"mousedown",bb);M(q,"mousemove",bb);M(q,"mousewheel",bb);M(A,"DOMMouseScroll",bb);M(A,"scroll",bb);M(q,"keypress",bb);M(q,"keydown",bb);M(q,"keyup",bb);M(A,"resize",bb);M(A,"focus",bb);M(A,"blur",bb);aT=bq.getTime();setTimeout(function br(){var bv;bq=new Date();if((aT+an)>bq.getTime()){if(Y<bq.getTime()){bv=av("ping=1",bu,"ping"); az(bv,aO)}setTimeout(br,an)}},an)}}function aa(bs,bu,bq,bt,bv){if(String(bs).length===0||String(bu).length===0){return false}var br=av("e_c="+j(bs)+"&e_a="+j(bu)+(s(bq)?"&e_n="+j(bq):"")+(s(bt)?"&e_v="+j(bt):""),bv,"event");az(br,aO)}function ar(bq,bt,br,bu){var bs=av("search="+j(bq)+(bt?"&search_cat="+j(bt):"")+(s(br)?"&search_count="+br:""),bu,"sitesearch");az(bs,aO)}function aM(bq,bt,bs){var br=av("idgoal="+bq+(bt?"&revenue="+bt:""),bs,"goal");az(br,aO)}function a9(br,bq,bt){var bs=av(bq+"="+j(bh(br)),bt,"link");az(bs,aO)}function be(br,bq){if(br!==""){return br+bq.charAt(0).toUpperCase()+bq.slice(1)}return bq}function aq(bv){var bu,bq,bt=["","webkit","ms","moz"],bs;if(!aA){for(bq=0;bq<bt.length;bq++){bs=bt[bq];if(Object.prototype.hasOwnProperty.call(q,be(bs,"hidden"))){if(q[be(bs,"visibilityState")]==="prerender"){bu=true}break}}}if(bu){M(q,bs+"visibilitychange",function br(){q.removeEventListener(bs+"visibilitychange",br,false);bv()});return}bv()}function ao(bs,br){var bt,bq="(^| )(piwik[_-]"+br; if(bs){for(bt=0;bt<bs.length;bt++){bq+="|"+bs[bt]}}bq+=")( |$)";return new RegExp(bq)}function a8(bt,bq,bu){var bs=ao(aI,"download"),br=ao(al,"link"),bv=new RegExp("\\.("+aw+")([?&#]|$)","i");return br.test(bt)?"link":(bs.test(bt)||bv.test(bq)?"download":(bu?0:"link"))}function aZ(bv){var bt,br,bq;bt=bv.parentNode;while(bt!==null&&s(bt)){br=bv.tagName.toUpperCase();if(br==="A"||br==="AREA"){break}bv=bt;bt=bv.parentNode}if(s(bv.href)){var bw=bv.hostname||b(bv.href),bx=bw.toLowerCase(),bs=bv.href.replace(bw,bx),bu=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):","i");if(!bu.test(bs)){bq=a8(bv.className,bs,aR(bx));if(bq){bs=f(bs);a9(bs,bq)}}}}function bo(bq){var br,bs;bq=bq||A.event;br=bq.which||bq.button;bs=bq.target||bq.srcElement;if(bq.type==="click"){if(bs){aZ(bs)}}else{if(bq.type==="mousedown"){if((br===1||br===2)&&bs){aK=br;af=bs}else{aK=af=null}}else{if(bq.type==="mouseup"){if(br===aK&&bs===af){aZ(bs)}aK=af=null}}}}function aY(br,bq){if(bq){M(br,"mouseup",bo,false); M(br,"mousedown",bo,false)}else{M(br,"click",bo,false)}}function aG(br){if(!aX){aX=true;var bs,bq=ao(X,"ignore"),bt=q.links;if(bt){for(bs=0;bs<bt.length;bs++){if(!bq.test(bt[bs].className)){aY(bt[bs],br)}}}}}function bi(){var br,bs,bt={pdf:"application/pdf",qt:"video/quicktime",realp:"audio/x-pn-realaudio-plugin",wma:"application/x-mplayer2",dir:"application/x-director",fla:"application/x-shockwave-flash",java:"application/x-java-vm",gears:"application/x-googlegears",ag:"application/x-silverlight"},bq=(new RegExp("Mac OS X.*Safari/")).test(d.userAgent)?A.devicePixelRatio||1:1;if(!((new RegExp("MSIE")).test(d.userAgent))){if(d.mimeTypes&&d.mimeTypes.length){for(br in bt){if(Object.prototype.hasOwnProperty.call(bt,br)){bs=d.mimeTypes[bt[br]];bd[br]=(bs&&bs.enabledPlugin)?"1":"0"}}}if(typeof navigator.javaEnabled!=="unknown"&&s(d.javaEnabled)&&d.javaEnabled()){bd.java="1"}if(n(A.GearsFactory)){bd.gears="1"}bd.cookie=V()}bd.res=D.width*bq+"x"+D.height*bq}bi();aL();return{getVisitorId:function(){return(Q())[1] },getVisitorInfo:function(){return Q()},getAttributionInfo:function(){return O()},getAttributionCampaignName:function(){return O()[0]},getAttributionCampaignKeyword:function(){return O()[1]},getAttributionReferrerTimestamp:function(){return O()[2]},getAttributionReferrerUrl:function(){return O()[3]},setTrackerUrl:function(bq){S=bq},setSiteId:function(bq){bc=bq},setCustomData:function(bq,br){if(C(bq)){ab=bq}else{if(!ab){ab=[]}ab[bq]=br}},appendToTrackingUrl:function(bq){aP=bq},getCustomData:function(){return ab},setCustomVariable:function(br,bq,bu,bs){var bt;if(!s(bs)){bs="visit"}if(!s(bq)){return}if(!s(bu)){bu=""}if(br>0){bq=!k(bq)?String(bq):bq;bu=!k(bu)?String(bu):bu;bt=[bq.slice(0,bg),bu.slice(0,bg)];if(bs==="visit"||bs===2){R();W[br]=bt}else{if(bs==="page"||bs===3){aJ[br]=bt}else{if(bs==="event"){T[br]=bt}}}}},getCustomVariable:function(br,bs){var bq;if(!s(bs)){bs="visit"}if(bs==="page"||bs===3){bq=aJ[br]}else{if(bs==="event"){bq=T[br]}else{if(bs==="visit"||bs===2){R();bq=W[br]}}}if(!s(bq)||(bq&&bq[0]==="")){return false }return bq},deleteCustomVariable:function(bq,br){if(this.getCustomVariable(bq,br)){this.setCustomVariable(bq,"","",br)}},setLinkTrackingTimer:function(bq){aO=bq},setDownloadExtensions:function(bq){aw=bq},addDownloadExtensions:function(bq){aw+="|"+bq},setDomains:function(bq){aQ=k(bq)?[bq]:bq;aQ.push(a7)},setIgnoreClasses:function(bq){X=k(bq)?[bq]:bq},setRequestMethod:function(bq){aS=bq||"GET"},setReferrerUrl:function(bq){aU=bq},setCustomUrl:function(bq){aE=a6(bm,bq)},setDocumentTitle:function(bq){au=bq},setAPIUrl:function(bq){aj=bq},setDownloadClasses:function(bq){aI=k(bq)?[bq]:bq},setLinkClasses:function(bq){al=k(bq)?[bq]:bq},setCampaignNameKey:function(bq){ay=k(bq)?[bq]:bq},setCampaignKeywordKey:function(bq){at=k(bq)?[bq]:bq},discardHashTag:function(bq){Z=bq},setCookieNamePrefix:function(bq){bk=bq;W=ag()},setCookieDomain:function(bq){ae=u(bq);aL()},setCookiePath:function(bq){bl=bq;aL()},setVisitorCookieTimeout:function(bq){ai=bq*1000},setSessionCookieTimeout:function(bq){ak=bq*1000},setReferralCookieTimeout:function(bq){aF=bq*1000 },setConversionAttributionFirstReferrer:function(bq){aD=bq},disableCookies:function(){ac=true;bd.cookie="0"},deleteCookies:function(){P()},setDoNotTrack:function(br){var bq=d.doNotTrack||d.msDoNotTrack;bf=br&&(bq==="yes"||bq==="1");if(bf){this.disableCookies()}},addListener:function(br,bq){aY(br,bq)},enableLinkTracking:function(bq){if(m){aG(bq)}else{y.push(function(){aG(bq)})}},enableJSErrorTracking:function(){if(bn){return}bn=true;var bq=A.onerror;A.onerror=function(bv,bt,bs,bu,br){aq(function(){var bw="JavaScript Errors";var bx=bt+":"+bs;if(bu){bx+=":"+bu}aa(bw,bx,bv)});if(bq){return bq(bv,bt,bs,bu,br)}return false}},disablePerformanceTracking:function(){aB=false},setGenerationTimeMs:function(bq){ap=parseInt(bq,10)},setHeartBeatTimer:function(bs,br){var bq=new Date();Y=bq.getTime()+bs*1000;an=br*1000},killFrame:function(){if(A.location!==A.top.location){A.top.location=A.location}},redirectFile:function(bq){if(A.location.protocol==="file:"){A.location=bq}},setCountPreRendered:function(bq){aA=bq },trackGoal:function(bq,bs,br){aq(function(){aM(bq,bs,br)})},trackLink:function(br,bq,bs){aq(function(){a9(br,bq,bs)})},trackPageView:function(bq,br){if(v(bc)){aq(function(){F(S,aj,bc)})}else{aq(function(){aH(bq,br)})}},trackEvent:function(br,bt,bq,bs){aq(function(){aa(br,bt,bq,bs)})},trackSiteSearch:function(bq,bs,br){aq(function(){ar(bq,bs,br)})},setEcommerceView:function(bt,bq,bs,br){if(!s(bs)||!bs.length){bs=""}else{if(bs instanceof Array){bs=JSON2.stringify(bs)}}aJ[5]=["_pkc",bs];if(s(br)&&String(br).length){aJ[2]=["_pkp",br]}if((!s(bt)||!bt.length)&&(!s(bq)||!bq.length)){return}if(s(bt)&&bt.length){aJ[3]=["_pks",bt]}if(!s(bq)||!bq.length){bq=""}aJ[4]=["_pkn",bq]},addEcommerceItem:function(bu,bq,bs,br,bt){if(bu.length){a0[bu]=[bu,bq,bs,br,bt]}},trackEcommerceOrder:function(bq,bu,bt,bs,br,bv){a4(bq,bu,bt,bs,br,bv)},trackEcommerceCartUpdate:function(bq){bj(bq)}}}function r(){return{push:J}}M(A,"beforeunload",K,false);l();Date.prototype.getTimeAlias=Date.prototype.getTime;E=new x();for(p=0; p<_paq.length;p++){if(_paq[p][0]==="setTrackerUrl"||_paq[p][0]==="setAPIUrl"||_paq[p][0]==="setSiteId"){J(_paq[p]);delete _paq[p]}}for(p=0;p<_paq.length;p++){if(_paq[p]){J(_paq[p])}}_paq=new r();c={addPlugin:function(O,P){a[O]=P},getTracker:function(O,P){return new x(O,P)},getAsyncTracker:function(){return E}};if(typeof define==="function"&&define.amd){define("piwik",[],function(){return c})}return c}())}if(typeof piwik_log!=="function"){piwik_log=function(b,f,d,g){function a(h){try{return eval("piwik_"+h)}catch(i){}return}var c,e=Piwik.getTracker(d,f);e.setDocumentTitle(b);e.setCustomData(g);c=a("tracker_pause");if(c){e.setLinkTrackingTimer(c)}c=a("download_extensions");if(c){e.setDownloadExtensions(c)}c=a("hosts_alias");if(c){e.setDomains(c)}c=a("ignore_classes");if(c){e.setIgnoreClasses(c)}e.trackPageView();if(a("install_tracker")){piwik_track=function(i,k,j,h){e.setSiteId(k);e.setTrackerUrl(j);e.trackLink(i,h)};e.enableLinkTracking()}}};
calvinf/cdnjs
ajax/libs/piwik/2.2.0-rc3/piwik.js
JavaScript
mit
23,183
.yui3-skin-sam .yui3-dial-handle{ /*container. top left corner used for trig positioning*/ background:#6C3A3A; 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*/ cursor:pointer; font-size:1px; } .yui3-skin-sam .yui3-dial-ring { background:#BEBDB7; background:-moz-linear-gradient(100% 100% 135deg, #7B7A6D, #FFFFFF); background:-webkit-gradient(linear, left top, right bottom, from(#FFFFFF), to(#7B7A6D)); box-shadow:1px 1px 5px rgba(0, 0, 0, 0.4) inset; -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4) inset; /*Chrome 7/Win bug*/ -moz-box-shadow:1px 1px 5px rgba(0, 0, 0, 0.4) inset; } .yui3-skin-sam .yui3-dial-center-button{ box-shadow:-1px -1px 2px rgba(0, 0, 0, 0.3) inset, 1px 1px 2px rgba(0, 0, 0, 0.5); -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*/ background:#DDDBD4; background:-moz-radial-gradient(30% 30% 0deg, circle farthest-side, #FBFBF9 24%, #F2F0EA 41%, #D3D0C3 83%) repeat scroll 0 0 transparent; background:-webkit-gradient(radial, 15 15, 15, 30 30, 40, from(#FBFBF9), to(#D3D0C3), color-stop(.2,#F2F0EA)); cursor:pointer; opacity:0.7; /*text-align:center;*/ } .yui3-skin-sam .yui3-dial-reset-string{ color:#676767; font-size:85%; text-decoration:underline; } .yui3-skin-sam .yui3-dial-label{ color:#808080; margin-bottom:0.8em; } .yui3-skin-sam .yui3-dial-value-string{ margin-left:0.5em; color:#000; font-size:130%; } .yui3-skin-sam .yui3-dial-value { visibility:hidden; position:absolute; top:0; left:102%; width:4em; } .yui3-skin-sam .yui3-dial-north-mark{ position:absolute; border-left:2px solid #ccc; height:5px; width:10px; left:50%; top:-7px; font-size:1px; } .yui3-skin-sam .yui3-dial-marker { background-color:#000; opacity:0.2; font-size:1px; } .yui3-skin-sam .yui3-dial-marker-max-min{ background-color:#AB3232; opacity:0.6; } .yui3-skin-sam .yui3-dial-ring-vml, .yui3-skin-sam .yui3-dial-center-button-vml, .yui3-skin-sam .yui3-dial-marker v\:oval.yui3-dial-marker-max-min, .yui3-skin-sam v\:oval.yui3-dial-marker-max-min, .yui3-skin-sam .yui3-dial-marker-vml, .yui3-skin-sam .yui3-dial-handle-vml { background: none; opacity:1; }
KevinSheedy/cdnjs
ajax/libs/yui/3.8.0/dial/assets/skins/sam/dial-skin.css
CSS
mit
2,377
/*! * jQuery UI CSS Framework 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { zoom: 1; } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } /*! * jQuery UI CSS Framework 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API * * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=ffffff&bgTextureHeader=23_fine_grain.png&bgImgOpacityHeader=15&borderColorHeader=d4d1bf&fcHeader=453821&iconColorHeader=b83400&bgColorContent=eceadf&bgTextureContent=23_fine_grain.png&bgImgOpacityContent=10&borderColorContent=d9d6c4&fcContent=1f1f1f&iconColorContent=222222&bgColorDefault=f8f7f6&bgTextureDefault=23_fine_grain.png&bgImgOpacityDefault=10&borderColorDefault=cbc7bd&fcDefault=654b24&iconColorDefault=b83400&bgColorHover=654b24&bgTextureHover=23_fine_grain.png&bgImgOpacityHover=65&borderColorHover=654b24&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=eceadf&bgTextureActive=23_fine_grain.png&bgImgOpacityActive=15&borderColorActive=d9d6c4&fcActive=140f06&iconColorActive=8c291d&bgColorHighlight=f7f3de&bgTextureHighlight=23_fine_grain.png&bgImgOpacityHighlight=15&borderColorHighlight=b2a266&fcHighlight=3a3427&iconColorHighlight=3572ac&bgColorError=b83400&bgTextureError=23_fine_grain.png&bgImgOpacityError=68&borderColorError=681818&fcError=ffffff&iconColorError=fbdb93&bgColorOverlay=6e4f1c&bgTextureOverlay=16_diagonal_maze.png&bgImgOpacityOverlay=20&opacityOverlay=60&bgColorShadow=000000&bgTextureShadow=16_diagonal_maze.png&bgImgOpacityShadow=40&opacityShadow=60&thicknessShadow=5px&offsetTopShadow=0&offsetLeftShadow=-10px&cornerRadiusShadow=18px */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #d9d6c4; background: #eceadf url(images/ui-bg_fine-grain_10_eceadf_60x60.png) 50% 50% repeat; color: #1f1f1f; } .ui-widget-content a { color: #1f1f1f; } .ui-widget-header { border: 1px solid #d4d1bf; background: #ffffff url(images/ui-bg_fine-grain_15_ffffff_60x60.png) 50% 50% repeat; color: #453821; font-weight: bold; } .ui-widget-header a { color: #453821; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cbc7bd; background: #f8f7f6 url(images/ui-bg_fine-grain_10_f8f7f6_60x60.png) 50% 50% repeat; font-weight: bold; color: #654b24; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #654b24; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #654b24; background: #654b24 url(images/ui-bg_fine-grain_65_654b24_60x60.png) 50% 50% repeat; font-weight: bold; color: #ffffff; } .ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #d9d6c4; background: #eceadf url(images/ui-bg_fine-grain_15_eceadf_60x60.png) 50% 50% repeat; font-weight: bold; color: #140f06; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #140f06; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #b2a266; background: #f7f3de url(images/ui-bg_fine-grain_15_f7f3de_60x60.png) 50% 50% repeat; color: #3a3427; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #3a3427; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #681818; background: #b83400 url(images/ui-bg_fine-grain_68_b83400_60x60.png) 50% 50% repeat; color: #ffffff; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } .ui-widget-header .ui-icon {background-image: url(images/ui-icons_b83400_256x240.png); } .ui-state-default .ui-icon { background-image: url(images/ui-icons_b83400_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_8c291d_256x240.png); } .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3572ac_256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbdb93_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-off { background-position: -96px -144px; } .ui-icon-radio-on { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } /* Overlays */ .ui-widget-overlay { background: #6e4f1c url(images/ui-bg_diagonal-maze_20_6e4f1c_10x10.png) 50% 50% repeat; opacity: .60;filter:Alpha(Opacity=60); } .ui-widget-shadow { margin: 0 0 0 -10px; padding: 5px; background: #000000 url(images/ui-bg_diagonal-maze_40_000000_10x10.png) 50% 50% repeat; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 18px; -khtml-border-radius: 18px; -webkit-border-radius: 18px; border-radius: 18px; }/*! * jQuery UI Resizable 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming */ .ui-resizable { position: relative;} .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*! * jQuery UI Selectable 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectable#theming */ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } /*! * jQuery UI Accordion 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Accordion#theming */ /* IE/Win - Fix animation bug - #4615 */ .ui-accordion { width: 100%; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } .ui-accordion .ui-accordion-content-active { display: block; } /*! * jQuery UI Autocomplete 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete#theming */ .ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ /* * jQuery UI Menu 1.8.21 * * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Menu#theming */ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; float: left; } .ui-menu .ui-menu { margin-top: -3px; } .ui-menu .ui-menu-item { margin:0; padding: 0; zoom: 1; float: left; clear: left; width: 100%; } .ui-menu .ui-menu-item a { text-decoration:none; display:block; padding:.2em .4em; line-height:1.5; zoom:1; } .ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; } /*! * jQuery UI Button 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Button#theming */ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /*button text element */ .ui-button .ui-button-text { display: block; line-height: 1.4; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /*button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /*button sets*/ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ /*! * jQuery UI Dialog 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } /*! * jQuery UI Slider 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming */ .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; }/*! * jQuery UI Tabs 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs#theming */ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } /*! * jQuery UI Datepicker 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming */ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left:2px; } .ui-datepicker .ui-datepicker-next { right:2px; } .ui-datepicker .ui-datepicker-prev-hover { left:1px; } .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width:auto; } .ui-datepicker-multi .ui-datepicker-group { float:left; } .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } .ui-datepicker-rtl .ui-datepicker-group { float:right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-datepicker-cover { display: none; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ top: -4px; /*must have*/ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ }/*! * jQuery UI Progressbar 1.8.21 * * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming */ .ui-progressbar { height:2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
iwdmb/cdnjs
ajax/libs/jqueryui/1.8.21/themes/pepper-grinder/jquery-ui.css
CSS
mit
33,399
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.YASR=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){e.exports=t("./main.js")},{"./main.js":39}],2:[function(t,e,n){var r,i=t("jquery"),o=i(document),a=i("head"),s=null,l=[],u=0,c="id",f="px",h="JColResizer",d=parseInt,p=Math,g=navigator.userAgent.indexOf("Trident/4.0")>0;try{r=sessionStorage}catch(m){}a.append("<style type='text/css'> .JColResizer{table-layout:fixed;} .JColResizer td, .JColResizer th{overflow:hidden;padding-left:0!important; padding-right:0!important;} .JCLRgrips{ height:0px; position:relative;} .JCLRgrip{margin-left:-5px; position:absolute; z-index:5; } .JCLRgrip .JColResizer{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;top:0px} .JCLRLastGrip{position:absolute; width:1px; } .JCLRgripDrag{ border-left:1px dotted black; }</style>");var v=function(t,e){var n=i(t);if(e.disable)return y(n);var r=n.id=n.attr(c)||h+u++;n.p=e.postbackSafe;if(n.is("table")&&!l[r]){n.addClass(h).attr(c,r).before('<div class="JCLRgrips"/>');n.opt=e;n.g=[];n.c=[];n.w=n.width();n.gc=n.prev();e.marginLeft&&n.gc.css("marginLeft",e.marginLeft);e.marginRight&&n.gc.css("marginRight",e.marginRight);n.cs=d(g?t.cellSpacing||t.currentStyle.borderSpacing:n.css("border-spacing"))||2;n.b=d(g?t.border||t.currentStyle.borderLeftWidth:n.css("border-left-width"))||1;l[r]=n;b(n)}},y=function(t){var e=t.attr(c),t=l[e];if(t&&t.is("table")){t.removeClass(h).gc.remove();delete l[e]}},b=function(t){var e=t.find(">thead>tr>th,>thead>tr>td");e.length||(e=t.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"));t.cg=t.find("col");t.ln=e.length;t.p&&r&&r[t.id]&&w(t,e);e.each(function(e){var n=i(this),r=i(t.gc.append('<div class="JCLRgrip"></div>')[0].lastChild);r.t=t;r.i=e;r.c=n;n.w=n.width();t.g.push(r);t.c.push(n);n.width(n.w).removeAttr("width");e<t.ln-1?r.bind("touchstart mousedown",k).append(t.opt.gripInnerHtml).append('<div class="'+h+'" style="cursor:'+t.opt.hoverCursor+'"></div>'):r.addClass("JCLRLastGrip").removeClass("JCLRgrip");r.data(h,{i:e,t:t.attr(c)})});t.cg.removeAttr("width");x(t);t.find("td, th").not(e).not("table th, table td").each(function(){i(this).removeAttr("width")})},w=function(t,e){var n,i=0,o=0,a=[];if(e){t.cg.removeAttr("width");if(t.opt.flush){r[t.id]="";return}n=r[t.id].split(";");for(;o<t.ln;o++){a.push(100*n[o]/n[t.ln]+"%");e.eq(o).css("width",a[o])}for(o=0;o<t.ln;o++)t.cg.eq(o).css("width",a[o])}else{r[t.id]="";for(;o<t.c.length;o++){n=t.c[o].width();r[t.id]+=n+";";i+=n}r[t.id]+=i}},x=function(t){t.gc.width(t.w);for(var e=0;e<t.ln;e++){var n=t.c[e];t.g[e].css({left:n.offset().left-t.offset().left+n.outerWidth(!1)+t.cs/2+f,height:t.opt.headerOnly?t.c[0].outerHeight(!1):t.outerHeight(!1)})}},C=function(t,e,n){var r=s.x-s.l,i=t.c[e],o=t.c[e+1],a=i.w+r,l=o.w-r;i.width(a+f);o.width(l+f);t.cg.eq(e).width(a+f);t.cg.eq(e+1).width(l+f);if(n){i.w=a;o.w=l}},S=function(t){if(s){var e=s.t;if(t.originalEvent.touches)var n=t.originalEvent.touches[0].pageX-s.ox+s.l;else var n=t.pageX-s.ox+s.l;var r=e.opt.minWidth,i=s.i,o=1.5*e.cs+r+e.b,a=i==e.ln-1?e.w-o:e.g[i+1].position().left-e.cs-r,l=i?e.g[i-1].position().left+e.cs+r:o;n=p.max(l,p.min(a,n));s.x=n;s.css("left",n+f);if(e.opt.liveDrag){C(e,i);x(e);var u=e.opt.onDrag;if(u){t.currentTarget=e[0];u(t)}}return!1}},T=function(t){o.unbind("touchend."+h+" mouseup."+h).unbind("touchmove."+h+" mousemove."+h);i("head :last-child").remove();if(s){s.removeClass(s.t.opt.draggingClass);var e=s.t,n=e.opt.onResize;if(s.x){C(e,s.i,!0);x(e);if(n){t.currentTarget=e[0];n(t)}}e.p&&r&&w(e);s=null}},k=function(t){var e=i(this).data(h),n=l[e.t],r=n.g[e.i];r.ox=t.originalEvent.touches?t.originalEvent.touches[0].pageX:t.pageX;r.l=r.position().left;o.bind("touchmove."+h+" mousemove."+h,S).bind("touchend."+h+" mouseup."+h,T);a.append("<style type='text/css'>*{cursor:"+n.opt.dragCursor+"!important}</style>");r.addClass(n.opt.draggingClass);s=r;if(n.c[e.i].l)for(var u,c=0;c<n.ln;c++){u=n.c[c];u.l=!1;u.w=u.width()}return!1},M=function(){for(e in l){var t,e=l[e],n=0;e.removeClass(h);if(e.w!=e.width()){e.w=e.width();for(t=0;t<e.ln;t++)n+=e.c[t].w;for(t=0;t<e.ln;t++)e.c[t].css("width",p.round(1e3*e.c[t].w/n)/10+"%").l=!0}x(e.addClass(h))}};i(window).bind("resize."+h,M);i.fn.extend({colResizable:function(t){var e={draggingClass:"JCLRgripDrag",gripInnerHtml:"",liveDrag:!1,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,onDrag:null,onResize:null},t=i.extend(e,t);return this.each(function(){v(this,t)})}})},{jquery:19}],3:[function(t,e,n){RegExp.escape=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};var r=t("jquery");r.csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(t,e){var n=/\./;if(isNaN(t))return t;if(n.test(t))return parseFloat(t);var r=parseInt(t);return isNaN(r)?null:r}},parsers:{parse:function(t,e){function n(){l=0;u="";if(e.start&&e.state.rowNum<e.start){s=[];e.state.rowNum++;e.state.colNum=1}else{if(void 0===e.onParseEntry)a.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&a.push(t)}s=[];e.end&&e.state.rowNum>=e.end&&(c=!0);e.state.rowNum++;e.state.colNum=1}}function r(){if(void 0===e.onParseValue)s.push(u);else{var t=e.onParseValue(u,e.state);t!==!1&&s.push(t)}u="";l=0;e.state.colNum++}var i=e.separator,o=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var a=[],s=[],l=0,u="",c=!1,f=RegExp.escape(i),h=RegExp.escape(o),d=/(D|S|\n|\r|[^DS\r\n]+)/,p=d.source;p=p.replace(/S/g,f);p=p.replace(/D/g,h);d=RegExp(p,"gm");t.replace(d,function(t){if(!c)switch(l){case 0:if(t===i){u+="";r();break}if(t===o){l=1;break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;u+=t;l=3;break;case 1:if(t===o){l=2;break}u+=t;l=1;break;case 2:if(t===o){u+=t;l=1;break}if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===i){r();break}if("\n"===t){r();n();break}if(/^\r$/.test(t))break;if(t===o)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});if(0!==s.length){r();n()}return a},splitLines:function(t,e){function n(){a=0;if(e.start&&e.state.rowNum<e.start){s="";e.state.rowNum++}else{if(void 0===e.onParseEntry)o.push(s);else{var t=e.onParseEntry(s,e.state);t!==!1&&o.push(t)}s="";e.end&&e.state.rowNum>=e.end&&(l=!0);e.state.rowNum++}}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);var o=[],a=0,s="",l=!1,u=RegExp.escape(r),c=RegExp.escape(i),f=/(D|S|\n|\r|[^DS\r\n]+)/,h=f.source;h=h.replace(/S/g,u);h=h.replace(/D/g,c);f=RegExp(h,"gm");t.replace(f,function(t){if(!l)switch(a){case 0:if(t===r){s+=t;a=0;break}if(t===i){s+=t;a=1;break}if("\n"===t){n();break}if(/^\r$/.test(t))break;s+=t;a=3;break;case 1:if(t===i){s+=t;a=2;break}s+=t;a=1;break;case 2:var o=s.substr(s.length-1);if(t===i&&o===i){s+=t;a=1;break}if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");case 3:if(t===r){s+=t;a=0;break}if("\n"===t){n();break}if("\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal quote [Row:"+e.state.rowNum+"]");throw new Error("CSVDataError: Illegal state [Row:"+e.state.rowNum+"]");default:throw new Error("CSVDataError: Unknown state [Row:"+e.state.rowNum+"]")}});""!==s&&n();return o},parseEntry:function(t,e){function n(){if(void 0===e.onParseValue)o.push(s);else{var t=e.onParseValue(s,e.state);t!==!1&&o.push(t)}s="";a=0;e.state.colNum++}var r=e.separator,i=e.delimiter;e.state.rowNum||(e.state.rowNum=1);e.state.colNum||(e.state.colNum=1);var o=[],a=0,s="";if(!e.match){var l=RegExp.escape(r),u=RegExp.escape(i),c=/(D|S|\n|\r|[^DS\r\n]+)/,f=c.source;f=f.replace(/S/g,l);f=f.replace(/D/g,u);e.match=RegExp(f,"gm")}t.replace(e.match,function(t){switch(a){case 0:if(t===r){s+="";n();break}if(t===i){a=1;break}if("\n"===t||"\r"===t)break;s+=t;a=3;break;case 1:if(t===i){a=2;break}s+=t;a=1;break;case 2:if(t===i){s+=t;a=1;break}if(t===r){n();break}if("\n"===t||"\r"===t)break;throw new Error("CSVDataError: Illegal State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");case 3:if(t===r){n();break}if("\n"===t||"\r"===t)break;if(t===i)throw new Error("CSVDataError: Illegal Quote [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");throw new Error("CSVDataError: Illegal Data [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]");default:throw new Error("CSVDataError: Unknown State [Row:"+e.state.rowNum+"][Col:"+e.state.colNum+"]")}});n();return o}},toArray:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;var o=void 0!==e.state?e.state:{},e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,state:o},a=r.csv.parsers.parseEntry(t,e);if(!i.callback)return a;i.callback("",a);return void 0},toArrays:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;var o=[],e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,start:e.start,end:e.end,state:{rowNum:1,colNum:1}};o=r.csv.parsers.parse(t,e);if(!i.callback)return o;i.callback("",o);return void 0},toObjects:function(t,e,n){var e=void 0!==e?e:{},i={};i.callback=void 0!==n&&"function"==typeof n?n:!1;i.separator="separator"in e?e.separator:r.csv.defaults.separator;i.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;i.headers="headers"in e?e.headers:r.csv.defaults.headers;e.start="start"in e?e.start:1;i.headers&&e.start++;e.end&&i.headers&&e.end++;var o=[],a=[],e={delimiter:i.delimiter,separator:i.separator,onParseEntry:e.onParseEntry,onParseValue:e.onParseValue,start:e.start,end:e.end,state:{rowNum:1,colNum:1},match:!1},s={delimiter:i.delimiter,separator:i.separator,start:1,end:1,state:{rowNum:1,colNum:1}},l=r.csv.parsers.splitLines(t,s),u=r.csv.toArray(l[0],e),o=r.csv.parsers.splitLines(t,e);e.state.colNum=1;e.state.rowNum=u?2:1;for(var c=0,f=o.length;f>c;c++){var h=r.csv.toArray(o[c],e),d={};for(var p in u)d[u[p]]=h[p];a.push(d);e.state.rowNum++}if(!i.callback)return a;i.callback("",a);return void 0},fromArrays:function(t,e,n){var e=void 0!==e?e:{},o={};o.callback=void 0!==n&&"function"==typeof n?n:!1;o.separator="separator"in e?e.separator:r.csv.defaults.separator;o.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;o.escaper="escaper"in e?e.escaper:r.csv.defaults.escaper;o.experimental="experimental"in e?e.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(t[i]);if(!o.callback)return a;o.callback("",a);return void 0},fromObjects2CSV:function(t,e,n){var e=void 0!==e?e:{},o={};o.callback=void 0!==n&&"function"==typeof n?n:!1;o.separator="separator"in e?e.separator:r.csv.defaults.separator;o.delimiter="delimiter"in e?e.delimiter:r.csv.defaults.delimiter;o.experimental="experimental"in e?e.experimental:!1;if(!o.experimental)throw new Error("not implemented");var a=[];for(i in t)a.push(arrays[i]);if(!o.callback)return a;o.callback("",a);return void 0}};r.csvEntry2Array=r.csv.toArray;r.csv2Array=r.csv.toArrays;r.csv2Dictionary=r.csv.toObjects},{jquery:19}],4:[function(t,e,n){function r(){this._events=this._events||{};this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r;r.EventEmitter=r;r.prototype._events=void 0;r.prototype._maxListeners=void 0;r.defaultMaxListeners=10;r.prototype.setMaxListeners=function(t){if(!o(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");this._maxListeners=t;return this};r.prototype.emit=function(t){var e,n,r,o,l,u;this._events||(this._events={});if("error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){e=arguments[1];if(e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}n=this._events[t];if(s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=arguments.length;o=new Array(r-1);for(l=1;r>l;l++)o[l-1]=arguments[l];n.apply(this,o)}else if(a(n)){r=arguments.length;o=new Array(r-1);for(l=1;r>l;l++)o[l-1]=arguments[l];u=n.slice();r=u.length;for(l=0;r>l;l++)u[l].apply(this,o)}return!0};r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");this._events||(this._events={});this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e);this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e;if(a(this._events[t])&&!this._events[t].warned){var n;n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners;if(n&&n>0&&this._events[t].length>n){this._events[t].warned=!0;console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length);"function"==typeof console.trace&&console.trace()}}return this};r.prototype.on=r.prototype.addListener;r.prototype.once=function(t,e){function n(){this.removeListener(t,n);if(!r){r=!0;e.apply(this,arguments)}}if(!i(e))throw TypeError("listener must be a function");var r=!1;n.listener=e;this.on(t,n);return this};r.prototype.removeListener=function(t,e){var n,r,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;n=this._events[t];o=n.length;r=-1;if(n===e||i(n.listener)&&n.listener===e){delete this._events[t];this._events.removeListener&&this.emit("removeListener",t,e)}else if(a(n)){for(s=o;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){r=s;break}if(0>r)return this;if(1===n.length){n.length=0;delete this._events[t]}else n.splice(r,1);this._events.removeListener&&this.emit("removeListener",t,e)}return this};r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener){0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this}if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener");this._events={};return this}n=this._events[t];if(i(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t];return this};r.prototype.listeners=function(t){var e;e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[];return e};r.listenerCount=function(t,e){var n;n=t._events&&t._events[e]?i(t._events[e])?1:t._events[e].length:0;return n}},{}],5:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){function e(t,e,r,i){var o=t.getLineHandle(e.line),l=e.ch-1,u=l>=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(r&&c>0!=(l==e.ch))return null;var f=t.getTokenTypeAt(a(e.line,l+1)),h=n(t,a(e.line,l+(c>0?1:0)),c,f||null,i);return null==h?null:{from:a(e.line,l),to:h&&h.pos,match:h&&h.ch==u.charAt(0),forward:c>0}}function n(t,e,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),h=e.line;h!=f;h+=n){var d=t.getLine(h);if(d){var p=n>0?0:d.length-1,g=n>0?d.length:-1;if(!(d.length>o)){h==e.line&&(p=e.ch-(0>n?1:0));for(;p!=g;p+=n){var m=d.charAt(p);if(c.test(m)&&(void 0===r||t.getTokenTypeAt(a(h,p+1))==r)){var v=s[m];if(">"==v.charAt(1)==n>0)u.push(m);else{if(!u.length)return{pos:a(h,p),ch:m};u.pop()}}}}}}return h-n==(n>0?t.lastLine():t.firstLine())?!1:null}function r(t,n,r){for(var i=t.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=t.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&e(t,l[u].head,!1,r);if(c&&t.getLine(c.from.line).length<=i){var f=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";s.push(t.markText(c.from,a(c.from.line,c.from.ch+1),{className:f}));c.to&&t.getLine(c.to.line).length<=i&&s.push(t.markText(c.to,a(c.to.line,c.to.ch+1),{className:f}))}}if(s.length){o&&t.state.focused&&t.display.input.focus();var h=function(){t.operation(function(){for(var t=0;t<s.length;t++)s[t].clear()})};if(!n)return h;setTimeout(h,800)}}function i(t){t.operation(function(){if(l){l();l=null}l=r(t,!1,t.state.matchBrackets)})}var o=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=t.Pos,s={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&e.off("cursorActivity",i);if(n){e.state.matchBrackets="object"==typeof n?n:{};e.on("cursorActivity",i)}});t.defineExtension("matchBrackets",function(){r(this,!0)});t.defineExtension("findMatchingBracket",function(t,n,r){return e(this,t,n,r)});t.defineExtension("scanForBracket",function(t,e,r,i){return n(this,t,e,r,i)})})},{"../../lib/codemirror":10}],6:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.registerHelper("fold","brace",function(e,n){function r(r){for(var i=n.ch,l=0;;){var u=0>=i?-1:s.lastIndexOf(r,i-1);if(-1!=u){if(1==l&&u<n.ch)break;o=e.getTokenTypeAt(t.Pos(a,u+1));if(!/^(comment|string)/.test(o))return u+1;i=u-1}else{if(1==l)break;l=1;i=s.length}}}var i,o,a=n.line,s=e.getLine(a),l="{",u="}",i=r("{");if(null==i){l="[",u="]";i=r("[")}if(null!=i){var c,f,h=1,d=e.lastLine();t:for(var p=a;d>=p;++p)for(var g=e.getLine(p),m=p==a?i:0;;){var v=g.indexOf(l,m),y=g.indexOf(u,m);0>v&&(v=g.length);0>y&&(y=g.length);m=Math.min(v,y);if(m==g.length)break;if(e.getTokenTypeAt(t.Pos(p,m+1))==o)if(m==v)++h;else if(!--h){c=p;f=m;break t}++m}if(null!=c&&(a!=c||f!=i))return{from:t.Pos(a,i),to:t.Pos(c,f)}}});t.registerHelper("fold","import",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));if("keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(e.lastLine(),n+10);o>=i;++i){var a=e.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:t.Pos(i,s)}}}var i,n=n.line,o=r(n);if(!o||r(n-1)||(i=r(n-2))&&i.end.line==n-1)return null;for(var a=o.end;;){var s=r(a.line+1);if(null==s)break;a=s.end}return{from:e.clipPos(t.Pos(n,o.startCh+1)),to:a}});t.registerHelper("fold","include",function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1)));return"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var n=n.line,i=r(n);if(null==i||null!=r(n-1))return null;for(var o=n;;){var a=r(o+1);if(null==a)break;++o}return{from:t.Pos(n,i+1),to:e.clipPos(t.Pos(o))}})})},{"../../lib/codemirror":10}],7:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(e,i,o,a){function s(t){var n=l(e,i);if(!n||n.to.line-n.from.line<u)return null;for(var r=e.findMarksAt(n.from),o=0;o<r.length;++o)if(r[o].__isFold&&"fold"!==a){if(!t)return null;n.cleared=!0;r[o].clear()}return n}if(o&&o.call){var l=o;o=null}else var l=r(e,o,"rangeFinder");"number"==typeof i&&(i=t.Pos(i,0));var u=r(e,o,"minFoldSize"),c=s(!0);if(r(e,o,"scanUp"))for(;!c&&i.line>e.firstLine();){i=t.Pos(i.line-1,0);c=s(!1)}if(c&&!c.cleared&&"unfold"!==a){var f=n(e,o);t.on(f,"mousedown",function(e){h.clear();t.e_preventDefault(e)});var h=e.markText(c.from,c.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(n,r){t.signal(e,"unfold",e,n,r)});t.signal(e,"fold",e,c.from,c.to)}}function n(t,e){var n=r(t,e,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span");n.appendChild(i);n.className="CodeMirror-foldmarker"}return n}function r(t,e,n){if(e&&void 0!==e[n])return e[n];var r=t.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}t.newFoldFunction=function(t,n){return function(r,i){e(r,i,{rangeFinder:t,widget:n})}};t.defineExtension("foldCode",function(t,n,r){e(this,t,n,r)});t.defineExtension("isFolded",function(t){for(var e=this.findMarksAt(t),n=0;n<e.length;++n)if(e[n].__isFold)return!0});t.commands.toggleFold=function(t){t.foldCode(t.getCursor())};t.commands.fold=function(t){t.foldCode(t.getCursor(),null,"fold")};t.commands.unfold=function(t){t.foldCode(t.getCursor(),null,"unfold")};t.commands.foldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"fold")})};t.commands.unfoldAll=function(e){e.operation(function(){for(var n=e.firstLine(),r=e.lastLine();r>=n;n++)e.foldCode(t.Pos(n,0),null,"unfold")})};t.registerHelper("fold","combine",function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var r=0;r<t.length;++r){var i=t[r](e,n);if(i)return i}}});t.registerHelper("fold","auto",function(t,e){for(var n=t.getHelpers(e,"fold"),r=0;r<n.length;r++){var i=n[r](t,e);if(i)return i}});var i={rangeFinder:t.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};t.defineOption("foldOptions",null);t.defineExtension("foldOption",function(t,e){return r(this,t,e)})})},{"../../lib/codemirror":10}],8:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror"),e("./foldcode")):"function"==typeof t&&t.amd?t(["../../lib/codemirror","./foldcode"],i):i(CodeMirror)})(function(t){"use strict";function e(t){this.options=t;this.from=this.to=0}function n(t){t===!0&&(t={});null==t.gutter&&(t.gutter="CodeMirror-foldgutter");null==t.indicatorOpen&&(t.indicatorOpen="CodeMirror-foldgutter-open");null==t.indicatorFolded&&(t.indicatorFolded="CodeMirror-foldgutter-folded");return t}function r(t,e){for(var n=t.findMarksAt(f(e)),r=0;r<n.length;++r)if(n[r].__isFold&&n[r].find().from.line==e)return!0}function i(t){if("string"==typeof t){var e=document.createElement("div");e.className=t+" CodeMirror-guttermarker-subtle";return e}return t.cloneNode(!0)}function o(t,e,n){var o=t.state.foldGutter.options,a=e,s=t.foldOption(o,"minFoldSize"),l=t.foldOption(o,"rangeFinder");t.eachLine(e,n,function(e){var n=null;if(r(t,a))n=i(o.indicatorFolded);else{var u=f(a,0),c=l&&l(t,u);c&&c.to.line-c.from.line>=s&&(n=i(o.indicatorOpen))}t.setGutterMarker(e,o.gutter,n);++a})}function a(t){var e=t.getViewport(),n=t.state.foldGutter;if(n){t.operation(function(){o(t,e.from,e.to)});n.from=e.from;n.to=e.to}}function s(t,e,n){var r=t.state.foldGutter;if(r){var i=r.options;n==i.gutter&&t.foldCode(f(e,0),i.rangeFinder)}}function l(t){var e=t.state.foldGutter;if(e){var n=e.options;e.from=e.to=0;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){a(t)},n.foldOnChangeTimeSpan||600)}}function u(t){var e=t.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate);e.changeUpdate=setTimeout(function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?a(t):t.operation(function(){if(n.from<e.from){o(t,n.from,e.from);e.from=n.from}if(n.to>e.to){o(t,e.to,n.to);e.to=n.to}})},n.updateViewportTimeSpan||400)}}function c(t,e){var n=t.state.foldGutter;if(n){var r=e.line;r>=n.from&&r<n.to&&o(t,r,r+1)}}t.defineOption("foldGutter",!1,function(r,i,o){if(o&&o!=t.Init){r.clearGutter(r.state.foldGutter.options.gutter);r.state.foldGutter=null;r.off("gutterClick",s);r.off("change",l);r.off("viewportChange",u);r.off("fold",c);r.off("unfold",c);r.off("swapDoc",a)}if(i){r.state.foldGutter=new e(n(i));a(r);r.on("gutterClick",s);r.on("change",l);r.on("viewportChange",u);r.on("fold",c);r.on("unfold",c);r.on("swapDoc",a)}});var f=t.Pos})},{"../../lib/codemirror":10,"./foldcode":7}],9:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";function e(t,e){return t.line-e.line||t.ch-e.ch}function n(t,e,n,r){this.line=e;this.ch=n;this.cm=t;this.text=t.getLine(e);this.min=r?r.from:t.firstLine();this.max=r?r.to-1:t.lastLine()}function r(t,e){var n=t.cm.getTokenTypeAt(h(t.line,e));return n&&/\btag\b/.test(n)}function i(t){if(!(t.line>=t.max)){t.ch=0;t.text=t.cm.getLine(++t.line);return!0}}function o(t){if(!(t.line<=t.min)){t.text=t.cm.getLine(--t.line);t.ch=t.text.length;return!0}}function a(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(i(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),o=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return o?"selfClose":"regular"}t.ch=e+1}}function s(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){g.lastIndex=e;t.ch=e;var n=g.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function l(t){for(;;){g.lastIndex=t.ch;var e=g.exec(t.text);if(!e){if(i(t))continue;return}if(r(t,e.index+1)){t.ch=e.index+e[0].length;return e}t.ch=e.index+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(o(t))continue;return}if(r(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));t.ch=e+1;return i?"selfClose":"regular"}t.ch=e}}function c(t,e){for(var n=[];;){var r,i=l(t),o=t.line,s=t.ch-(i?i[0].length:0);if(!i||!(r=a(t)))return;if("selfClose"!=r)if(i[1]){for(var u=n.length-1;u>=0;--u)if(n[u]==i[2]){n.length=u;break}if(0>u&&(!e||e==i[2]))return{tag:i[2],from:h(o,s),to:h(t.line,t.ch)}}else n.push(i[2])}}function f(t,e){for(var n=[];;){var r=u(t);if(!r)return;if("selfClose"!=r){var i=t.line,o=t.ch,a=s(t);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(0>l&&(!e||e==a[2]))return{tag:a[2],from:h(t.line,t.ch),to:h(i,o)}}}else s(t)}}var h=t.Pos,d="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");t.registerHelper("fold","xml",function(t,e){for(var r=new n(t,e.line,0);;){var i,o=l(r);if(!o||r.line!=e.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var e=h(r.line,r.ch),s=c(r,o[2]);return s&&{from:e,to:s.from}}}});t.findMatchingTag=function(t,r,i){var o=new n(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var l=a(o),u=l&&h(o.line,o.ch),d=l&&s(o);if(l&&d&&!(e(o,r)>0)){var p={from:h(o.line,o.ch),to:u,tag:d[2]};if("selfClose"==l)return{open:p,close:null,at:"open"};if(d[1])return{open:f(o,d[2]),close:p,at:"close"};o=new n(t,u.line,u.ch,i);return{open:p,close:c(o,d[2]),at:"open"}}}};t.findEnclosingTag=function(t,e,r){for(var i=new n(t,e.line,e.ch,r);;){var o=f(i);if(!o)break;var a=new n(t,e.line,e.ch,r),s=c(a,o.tag);if(s)return{open:o,close:s}}};t.scanForClosingTag=function(t,e,r,i){var o=new n(t,e.line,e.ch,i?{from:0,to:i}:null);return c(o,r)}})},{"../../lib/codemirror":10}],10:[function(e,n,r){(function(e){if("object"==typeof r&&"object"==typeof n)n.exports=e();else{if("function"==typeof t&&t.amd)return t([],e);this.CodeMirror=e()}})(function(){"use strict";function t(n,r){if(!(this instanceof t))return new t(n,r);this.options=r=r?Si(r):{};Si(Ro,r,!1);d(r);var i=r.value;"string"==typeof i&&(i=new la(i,r.mode));this.doc=i;var o=this.display=new e(n,i);o.wrapper.CodeMirror=this;u(this);s(this);r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");r.autofocus&&!po&&Ae(this);v(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new mi,keySeq:null};no&&11>ro&&setTimeout(Ti(Le,this,!0),20);Pe(this);Ii();ie(this);this.curOp.forceUpdate=!0;Or(this,i);r.autofocus&&!po||Ni()==o.input?setTimeout(Ti(rn,this),20):on(this);for(var a in Fo)Fo.hasOwnProperty(a)&&Fo[a](this,r[a],Wo);C(this);r.finishInit&&r.finishInit(this);for(var l=0;l<Bo.length;++l)Bo[l](this);ae(this);io&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function e(t,e){var n=this,r=n.input=Di("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");io?r.style.width="1000px":r.setAttribute("wrap","off");ho&&(r.style.border="1px solid black");r.setAttribute("autocorrect","off");r.setAttribute("autocapitalize","off");r.setAttribute("spellcheck","false");n.inputDiv=Di("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");n.scrollbarFiller=Di("div",null,"CodeMirror-scrollbar-filler");n.scrollbarFiller.setAttribute("not-content","true");n.gutterFiller=Di("div",null,"CodeMirror-gutter-filler");n.gutterFiller.setAttribute("not-content","true");n.lineDiv=Di("div",null,"CodeMirror-code");n.selectionDiv=Di("div",null,null,"position: relative; z-index: 1");n.cursorDiv=Di("div",null,"CodeMirror-cursors");n.measure=Di("div",null,"CodeMirror-measure");n.lineMeasure=Di("div",null,"CodeMirror-measure");n.lineSpace=Di("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");n.mover=Di("div",[Di("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative");n.sizer=Di("div",[n.mover],"CodeMirror-sizer");n.sizerWidth=null;n.heightForcer=Di("div",null,null,"position: absolute; height: "+ya+"px; width: 1px;");n.gutters=Di("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=Di("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=Di("div",[n.inputDiv,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(no&&8>ro){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0}ho&&(r.style.width="0px");io||(n.scroller.draggable=!0);if(uo){n.inputDiv.style.height="1px";n.inputDiv.style.position="absolute"}t&&(t.appendChild?t.appendChild(n.wrapper):t(n.wrapper));n.viewFrom=n.viewTo=e.first;n.reportedViewFrom=n.reportedViewTo=e.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.prevInput="";n.alignWidgets=!1;n.pollingFast=!1;n.poll=new mi;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.inaccurateSelection=!1;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null}function n(e){e.doc.mode=t.getMode(e.options,e.doc.modeOption); r(e)}function r(t){t.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null)});t.doc.frontier=t.doc.first;Tt(t,100);t.state.modeGen++;t.curOp&&be(t)}function i(t){if(t.options.lineWrapping){ja(t.display.wrapper,"CodeMirror-wrap");t.display.sizer.style.minWidth="";t.display.sizerWidth=null}else{Pa(t.display.wrapper,"CodeMirror-wrap");h(t)}a(t);be(t);Vt(t);setTimeout(function(){y(t)},100)}function o(t){var e=ne(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/re(t.display)-3);return function(i){if(ur(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function a(t){var e=t.doc,n=o(t);e.iter(function(t){var e=n(t);e!=t.height&&zr(t,e)})}function s(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-");Vt(t)}function l(t){u(t);be(t);setTimeout(function(){x(t)},20)}function u(t){var e=t.display.gutters,n=t.options.gutters;Li(e);for(var r=0;r<n.length;++r){var i=n[r],o=e.appendChild(Di("div",null,"CodeMirror-gutter "+i));if("CodeMirror-linenumbers"==i){t.display.lineGutter=o;o.style.width=(t.display.lineNumWidth||1)+"px"}}e.style.display=r?"":"none";c(t)}function c(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function f(t){if(0==t.height)return 0;for(var e,n=t.text.length,r=t;e=nr(r);){var i=e.find(0,!0);r=i.from.line;n+=i.from.ch-i.to.ch}r=t;for(;e=rr(r);){var i=e.find(0,!0);n-=r.text.length-i.from.ch;r=i.to.line;n+=r.text.length-i.to.ch}return n}function h(t){var e=t.display,n=t.doc;e.maxLine=Rr(n,n.first);e.maxLineLength=f(e.maxLine);e.maxLineChanged=!0;n.iter(function(t){var n=f(t);if(n>e.maxLineLength){e.maxLineLength=n;e.maxLine=t}})}function d(t){var e=wi(t.gutters,"CodeMirror-linenumbers");if(-1==e&&t.lineNumbers)t.gutters=t.gutters.concat(["CodeMirror-linenumbers"]);else if(e>-1&&!t.lineNumbers){t.gutters=t.gutters.slice(0);t.gutters.splice(e,1)}}function p(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Lt(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Nt(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}function g(t,e,n){this.cm=n;var r=this.vert=Di("div",[Di("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Di("div",[Di("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");t(r);t(i);pa(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")});pa(i,"scroll",function(){i.clientWidth&&e(i.scrollLeft,"horizontal")});this.checkedOverlay=!1;no&&8>ro&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function v(e){if(e.display.scrollbars){e.display.scrollbars.clear();e.display.scrollbars.addClass&&Pa(e.display.wrapper,e.display.scrollbars.addClass)}e.display.scrollbars=new t.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);pa(t,"mousedown",function(){e.state.focused&&setTimeout(Ti(Ae,e),0)});t.setAttribute("not-content","true")},function(t,n){"horizontal"==n?Xe(e,t):Ve(e,t)},e);e.display.scrollbars.addClass&&ja(e.display.wrapper,e.display.scrollbars.addClass)}function y(t,e){e||(e=p(t));var n=t.display.barWidth,r=t.display.barHeight;b(t,e);for(var i=0;4>i&&n!=t.display.barWidth||r!=t.display.barHeight;i++){n!=t.display.barWidth&&t.options.lineWrapping&&N(t);b(t,p(t));n=t.display.barWidth;r=t.display.barHeight}}function b(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px";n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px";if(r.right&&r.bottom){n.scrollbarFiller.style.display="block";n.scrollbarFiller.style.height=r.bottom+"px";n.scrollbarFiller.style.width=r.right+"px"}else n.scrollbarFiller.style.display="";if(r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter){n.gutterFiller.style.display="block";n.gutterFiller.style.height=r.bottom+"px";n.gutterFiller.style.width=e.gutterWidth+"px"}else n.gutterFiller.style.display=""}function w(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Dt(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=Ur(e,r),a=Ur(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(o>s){o=s;a=Ur(e,Br(Rr(e,s))+t.wrapper.clientHeight)}else if(Math.min(l,e.lastLine())>=a){o=Ur(e,Br(Rr(e,l))-t.wrapper.clientHeight);a=l}}return{from:o,to:Math.max(a,o+1)}}function x(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=T(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){t.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}t.options.fixedGutter&&(e.gutters.style.left=r+i+"px")}}function C(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=S(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Di("div",[Di("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;r.lineGutter.style.width="";r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a);r.lineNumWidth=r.lineNumInnerWidth+a;r.lineNumChars=r.lineNumInnerWidth?n.length:-1;r.lineGutter.style.width=r.lineNumWidth+"px";c(t);return!0}return!1}function S(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function T(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function k(t,e,n){var r=t.display;this.viewport=e;this.visible=w(r,t.doc,e);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=Et(t);this.force=n;this.dims=P(t);this.events=[]}function M(t){var e=t.display;if(!e.scrollbarsClipped&&e.scroller.offsetWidth){e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth;e.heightForcer.style.height=Nt(t)+"px";e.sizer.style.marginBottom=-e.nativeBarWidth+"px";e.sizer.style.borderRightWidth=Nt(t)+"px";e.scrollbarsClipped=!0}}function _(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden){xe(t);return!1}if(!e.force&&e.visible.from>=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ke(t))return!1;if(C(t)){xe(t);e.dims=P(t)}var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom));n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo));if(xo){o=sr(t.doc,o);a=lr(t.doc,a)}var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Te(t,o,a);n.viewOffset=Br(Rr(t.doc,n.viewFrom));t.display.mover.style.top=n.viewOffset+"px";var l=ke(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Ni();l>4&&(n.lineDiv.style.display="none");j(t,n.updateLineNumbers,e.dims);l>4&&(n.lineDiv.style.display="");n.renderedView=n.view;u&&Ni()!=u&&u.offsetHeight&&u.focus();Li(n.cursorDiv);Li(n.selectionDiv);n.gutters.style.height=0;if(s){n.lastWrapHeight=e.wrapperHeight;n.lastWrapWidth=e.wrapperWidth;Tt(t,400)}n.updateLineNumbers=null;return!0}function D(t,e){for(var n=e.force,r=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Et(t))n=!0;else{n=!1;r&&null!=r.top&&(r={top:Math.min(t.doc.height+Lt(t.display)-Pt(t),r.top)});e.visible=w(t.display,t.doc,r);if(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break}if(!_(t,e))break;N(t);var o=p(t);wt(t);A(t,o);y(t,o)}e.signal(t,"update",t);if(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo){e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo);t.display.reportedViewFrom=t.display.viewFrom;t.display.reportedViewTo=t.display.viewTo}}function L(t,e){var n=new k(t,e);if(_(t,n)){N(t);D(t,n);var r=p(t);wt(t);A(t,r);y(t,r);n.finish()}}function A(t,e){t.display.sizer.style.minHeight=e.docHeight+"px";var n=e.docHeight+t.display.barHeight;t.display.heightForcer.style.top=n+"px";t.display.gutters.style.height=Math.max(n+Nt(t),e.clientHeight)+"px"}function N(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r<e.view.length;r++){var i,o=e.view[r];if(!o.hidden){if(no&&8>ro){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n;n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var l=o.line.height-i;2>i&&(i=ne(e));if(l>.001||-.001>l){zr(o.line,i);E(o.line);if(o.rest)for(var u=0;u<o.rest.length;u++)E(o.rest[u])}}}}function E(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e)t.widgets[e].height=t.widgets[e].node.offsetHeight}function P(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){n[t.options.gutters[a]]=o.offsetLeft+o.clientLeft+i;r[t.options.gutters[a]]=o.clientWidth}return{fixedPos:T(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function j(t,e,n){function r(e){var n=e.nextSibling;io&&go&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e);return n}for(var i=t.display,o=t.options.lineNumbers,a=i.lineDiv,s=a.firstChild,l=i.view,u=i.viewFrom,c=0;c<l.length;c++){var f=l[c];if(f.hidden);else if(f.node){for(;s!=f.node;)s=r(s);var h=o&&null!=e&&u>=e&&f.lineNumber;if(f.changes){wi(f.changes,"gutter")>-1&&(h=!1);I(t,f,u,n)}if(h){Li(f.lineNumber);f.lineNumber.appendChild(document.createTextNode(S(t.options,u)))}s=f.node.nextSibling}else{var d=U(t,f,u,n);a.insertBefore(d,s)}u+=f.size}for(;s;)s=r(s)}function I(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?F(t,e):"gutter"==o?z(t,e,n,r):"class"==o?W(e):"widget"==o&&q(e,r)}e.changes=null}function H(t){if(t.node==t.text){t.node=Di("div",null,null,"position: relative");t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text);t.node.appendChild(t.text);no&&8>ro&&(t.node.style.zIndex=2)}return t.node}function O(t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;e&&(e+=" CodeMirror-linebackground");if(t.background)if(e)t.background.className=e;else{t.background.parentNode.removeChild(t.background);t.background=null}else if(e){var n=H(t);t.background=n.insertBefore(Di("div",null,e),n.firstChild)}}function R(t,e){var n=t.display.externalMeasured;if(n&&n.line==e.line){t.display.externalMeasured=null;e.measure=n.measure;return n.built}return kr(t,e)}function F(t,e){var n=e.text.className,r=R(t,e);e.text==e.node&&(e.node=r.pre);e.text.parentNode.replaceChild(r.pre,e.text);e.text=r.pre;if(r.bgClass!=e.bgClass||r.textClass!=e.textClass){e.bgClass=r.bgClass;e.textClass=r.textClass;W(e)}else n&&(e.text.className=n)}function W(t){O(t);t.line.wrapClass?H(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function z(t,e,n,r){if(e.gutter){e.node.removeChild(e.gutter);e.gutter=null}var i=e.line.gutterMarkers;if(t.options.lineNumbers||i){var o=H(e),a=e.gutter=o.insertBefore(Di("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.text);e.line.gutterClass&&(a.className+=" "+e.line.gutterClass);!t.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(Di("div",S(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px")));if(i)for(var s=0;s<t.options.gutters.length;++s){var l=t.options.gutters[s],u=i.hasOwnProperty(l)&&i[l];u&&a.appendChild(Di("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function q(t,e){t.alignable&&(t.alignable=null);for(var n,r=t.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}B(t,e)}function U(t,e,n,r){var i=R(t,e);e.text=e.node=i.pre;i.bgClass&&(e.bgClass=i.bgClass);i.textClass&&(e.textClass=i.textClass);W(e);z(t,e,n,r);B(e,r);return e.node}function B(t,e){V(t.line,t,e,!0);if(t.rest)for(var n=0;n<t.rest.length;n++)V(t.rest[n],t,e,!1)}function V(t,e,n,r){if(t.widgets)for(var i=H(e),o=0,a=t.widgets;o<a.length;++o){var s=a[o],l=Di("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||l.setAttribute("cm-ignore-events","true");X(s,l,e,n);r&&s.above?i.insertBefore(l,e.gutter||e.text):i.appendChild(l);ci(s,"redraw")}}function X(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px";if(!t.coverGutter){i-=r.gutterTotalWidth;e.style.paddingLeft=r.gutterTotalWidth+"px"}e.style.width=i+"px"}if(t.coverGutter){e.style.zIndex=5;e.style.position="relative";t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px")}}function G(t){return Co(t.line,t.ch)}function Y(t,e){return So(t,e)<0?e:t}function $(t,e){return So(t,e)<0?t:e}function J(t,e){this.ranges=t;this.primIndex=e}function K(t,e){this.anchor=t;this.head=e}function Z(t,e){var n=t[e];t.sort(function(t,e){return So(t.from(),e.from())});e=wi(t,n);for(var r=1;r<t.length;r++){var i=t[r],o=t[r-1];if(So(o.to(),i.from())>=0){var a=$(o.from(),i.from()),s=Y(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;e>=r&&--e;t.splice(--r,2,new K(l?s:a,l?a:s))}}return new J(t,e)}function Q(t,e){return new J([new K(t,e||t)],0)}function tt(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function et(t,e){if(e.line<t.first)return Co(t.first,0);var n=t.first+t.size-1;return e.line>n?Co(n,Rr(t,n).text.length):nt(e,Rr(t,e.line).text.length)}function nt(t,e){var n=t.ch;return null==n||n>e?Co(t.line,e):0>n?Co(t.line,0):t}function rt(t,e){return e>=t.first&&e<t.first+t.size}function it(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=et(t,e[r]);return n}function ot(t,e,n,r){if(t.cm&&t.cm.display.shift||t.extend){var i=e.anchor;if(r){var o=So(n,i)<0;if(o!=So(r,i)<0){i=n;n=r}else o!=So(n,r)<0&&(n=r)}return new K(i,n)}return new K(r||n,n)}function at(t,e,n,r){ht(t,new J([ot(t,t.sel.primary(),e,n)],0),r)}function st(t,e,n){for(var r=[],i=0;i<t.sel.ranges.length;i++)r[i]=ot(t,t.sel.ranges[i],e[i],null);var o=Z(r,t.sel.primIndex);ht(t,o,n)}function lt(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n;ht(t,Z(i,t.sel.primIndex),r)}function ut(t,e,n,r){ht(t,Q(e,n),r)}function ct(t,e){var n={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new K(et(t,e[n].anchor),et(t,e[n].head))}};ma(t,"beforeSelectionChange",t,n);t.cm&&ma(t.cm,"beforeSelectionChange",t.cm,n);return n.ranges!=e.ranges?Z(n.ranges,n.ranges.length-1):e}function ft(t,e,n){var r=t.history.done,i=bi(r);if(i&&i.ranges){r[r.length-1]=e;dt(t,e,n)}else ht(t,e,n)}function ht(t,e,n){dt(t,e,n);Zr(t,t.sel,t.cm?t.cm.curOp.id:0/0,n)}function dt(t,e,n){(pi(t,"beforeSelectionChange")||t.cm&&pi(t.cm,"beforeSelectionChange"))&&(e=ct(t,e));var r=n&&n.bias||(So(e.primary().head,t.sel.primary().head)<0?-1:1);pt(t,mt(t,e,r,!0));n&&n.scroll===!1||!t.cm||kn(t.cm)}function pt(t,e){if(!e.equals(t.sel)){t.sel=e;if(t.cm){t.cm.curOp.updateInput=t.cm.curOp.selectionChanged=!0;di(t.cm)}ci(t,"cursorActivity",t)}}function gt(t){pt(t,mt(t,t.sel,null,!1),wa)}function mt(t,e,n,r){for(var i,o=0;o<e.ranges.length;o++){var a=e.ranges[o],s=vt(t,a.anchor,n,r),l=vt(t,a.head,n,r);if(i||s!=a.anchor||l!=a.head){i||(i=e.ranges.slice(0,o));i[o]=new K(s,l)}}return i?Z(i,e.primIndex):e}function vt(t,e,n,r){var i=!1,o=e,a=n||1;t.cantEdit=!1;t:for(;;){var s=Rr(t,o.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var u=s.markedSpans[l],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(r){ma(c,"beforeCursorEnter");if(c.explicitlyCleared){if(s.markedSpans){--l;continue}break}}if(!c.atomic)continue;var f=c.find(0>a?-1:1);if(0==So(f,o)){f.ch+=a;f.ch<0?f=f.line>t.first?et(t,Co(f.line-1)):null:f.ch>s.text.length&&(f=f.line<t.first+t.size-1?Co(f.line+1,0):null);if(!f){if(i){if(!r)return vt(t,e,n,!0);t.cantEdit=!0;return Co(t.first,0)}i=!0;f=e;a=-a}}o=f;continue t}}return o}}function yt(t){for(var e=t.display,n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++){var s=n.sel.ranges[a],l=s.empty();(l||t.options.showCursorWhenSelecting)&&xt(t,s,i);l||Ct(t,s,o)}if(t.options.moveInputWithCursor){var u=Kt(t,n.sel.primary().head,"div"),c=e.wrapper.getBoundingClientRect(),f=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,u.top+f.top-c.top));r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,u.left+f.left-c.left))}return r}function bt(t,e){Ai(t.display.cursorDiv,e.cursors);Ai(t.display.selectionDiv,e.selection);if(null!=e.teTop){t.display.inputDiv.style.top=e.teTop+"px";t.display.inputDiv.style.left=e.teLeft+"px"}}function wt(t){bt(t,yt(t))}function xt(t,e,n){var r=Kt(t,e.head,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(Di("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px";i.style.top=r.top+"px";i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px";if(r.other){var o=n.appendChild(Di("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=r.other.left+"px";o.style.top=r.other.top+"px";o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Ct(t,e,n){function r(t,e,n,r){0>e&&(e=0);e=Math.round(e);r=Math.round(r);s.appendChild(Di("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px; top: "+e+"px; width: "+(null==n?c-t:n)+"px; height: "+(r-e)+"px"))}function i(e,n,i){function o(n,r){return Jt(t,Co(e,n),"div",f,r)}var s,l,f=Rr(a,e),h=f.text.length;Wi(Vr(f),n||0,null==i?h:i,function(t,e,a){var f,d,p,g=o(t,"left");if(t==e){f=g;d=p=g.left}else{f=o(e-1,"right");if("rtl"==a){var m=g;g=f;f=m}d=g.left;p=f.right}null==n&&0==t&&(d=u);if(f.top-g.top>3){r(d,g.top,null,g.bottom);d=u;g.bottom<f.top&&r(d,g.bottom,null,f.top)}null==i&&e==h&&(p=c);(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g);(!l||f.bottom>l.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f);u+1>d&&(d=u);r(d,f.top,p-d,f.bottom)});return{start:s,end:l}}var o=t.display,a=t.doc,s=document.createDocumentFragment(),l=At(t.display),u=l.left,c=Math.max(o.sizerWidth,Et(t)-o.sizer.offsetLeft)-l.right,f=e.from(),h=e.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Rr(a,f.line),p=Rr(a,h.line),g=or(d)==or(p),m=i(f.line,f.ch,g?d.text.length+1:null).end,v=i(h.line,g?0:null,h.ch).start;if(g)if(m.top<v.top-2){r(m.right,m.top,null,m.bottom);r(u,v.top,v.left,v.bottom)}else r(m.right,m.top,v.left-m.right,m.bottom);m.bottom<v.top&&r(u,m.bottom,null,v.top)}n.appendChild(s)}function St(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="";t.options.cursorBlinkRate>0?e.blinker=setInterval(function(){e.cursorDiv.style.visibility=(n=!n)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Tt(t,e){t.doc.mode.startState&&t.doc.frontier<t.display.viewTo&&t.state.highlight.set(e,Ti(kt,t))}function kt(t){var e=t.doc;e.frontier<e.first&&(e.frontier=e.first);if(!(e.frontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=Xo(e.mode,_t(t,e.frontier)),i=[];e.iter(e.frontier,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(e.frontier>=t.display.viewFrom){var a=o.styles,s=xr(t,o,r,!0);o.styles=s.styles;var l=o.styleClasses,u=s.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!c&&f<a.length;++f)c=a[f]!=o.styles[f];c&&i.push(e.frontier);o.stateAfter=Xo(e.mode,r)}else{Sr(t,o.text,r);o.stateAfter=e.frontier%5==0?Xo(e.mode,r):null}++e.frontier;if(+new Date>n){Tt(t,t.options.workDelay);return!0}});i.length&&de(t,function(){for(var e=0;e<i.length;e++)we(t,i[e],"text")})}}function Mt(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Rr(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var u=Sa(l.text,null,t.options.tabSize);if(null==i||r>u){i=s-1;r=u}}return i}function _t(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return!0;var o=Mt(t,e,n),a=o>r.first&&Rr(r,o-1).stateAfter;a=a?Xo(r.mode,a):Go(r.mode);r.iter(o,e,function(n){Sr(t,n.text,a);var s=o==e-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=s?Xo(r.mode,a):null;++o});n&&(r.frontier=o);return a}function Dt(t){return t.lineSpace.offsetTop}function Lt(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function At(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=Ai(t.measure,Di("pre","x")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r);return r}function Nt(t){return ya-t.display.nativeBarWidth}function Et(t){return t.display.scroller.clientWidth-Nt(t)-t.display.barWidth}function Pt(t){return t.display.scroller.clientHeight-Nt(t)-t.display.barHeight}function jt(t,e,n){var r=t.options.lineWrapping,i=r&&Et(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function It(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var r=0;r<t.rest.length;r++)if(qr(t.rest[r])>n)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Ht(t,e){e=or(e);var n=qr(e),r=t.display.externalMeasured=new ve(t.doc,e,n);r.lineN=n;var i=r.built=kr(t,r);r.text=i.pre;Ai(t.display.lineMeasure,i.pre);return r}function Ot(t,e,n,r){return Wt(t,Ft(t,e),n,r)}function Rt(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Ce(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function Ft(t,e){var n=qr(e),r=Rt(t,n);r&&!r.text?r=null:r&&r.changes&&I(t,r,n,P(t));r||(r=Ht(t,e));var i=It(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Wt(t,e,n,r,i){e.before&&(n=-1);var o,a=n+(r||"");if(e.cache.hasOwnProperty(a))o=e.cache[a];else{e.rect||(e.rect=e.view.text.getBoundingClientRect());if(!e.hasHeights){jt(t,e.view,e.rect);e.hasHeights=!0}o=zt(t,e,n,r);o.bogus||(e.cache[a]=o)}return{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function zt(t,e,n,r){for(var i,o,a,s,l=e.map,u=0;u<l.length;u+=3){var c=l[u],f=l[u+1];if(c>n){o=0;a=1;s="left"}else if(f>n){o=n-c;a=o+1}else if(u==l.length-3||n==f&&l[u+3]>n){a=f-c;o=a-1;n>=f&&(s="right")}if(null!=o){i=l[u+2];c==f&&r==(i.insertLeft?"left":"right")&&(s=r);if("left"==r&&0==o)for(;u&&l[u-2]==l[u-3]&&l[u-1].insertLeft;){i=l[(u-=3)+2];s="left"}if("right"==r&&o==f-c)for(;u<l.length-3&&l[u+3]==l[u+4]&&!l[u+5].insertLeft;){i=l[(u+=3)+2];s="right"}break}}var h;if(3==i.nodeType){for(var u=0;4>u;u++){for(;o&&_i(e.line.text.charAt(c+o));)--o;for(;f>c+a&&_i(e.line.text.charAt(c+a));)++a;if(no&&9>ro&&0==o&&a==f-c)h=i.parentNode.getBoundingClientRect();else if(no&&t.options.lineWrapping){var d=Ma(i,o,a).getClientRects();h=d.length?d["right"==r?d.length-1:0]:_o}else h=Ma(i,o,a).getBoundingClientRect()||_o;if(h.left||h.right||0==o)break;a=o;o-=1;s="right"}no&&11>ro&&(h=qt(t.display.measure,h))}else{o>0&&(s=r="right");var d;h=t.options.lineWrapping&&(d=i.getClientRects()).length>1?d["right"==r?d.length-1:0]:i.getBoundingClientRect()}if(no&&9>ro&&!o&&(!h||!h.left&&!h.right)){var p=i.parentNode.getClientRects()[0];h=p?{left:p.left,right:p.left+re(t.display),top:p.top,bottom:p.bottom}:_o}for(var g=h.top-e.rect.top,m=h.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,u=0;u<y.length-1&&!(v<y[u]);u++);var b=u?y[u-1]:0,w=y[u],x={left:("right"==s?h.right:h.left)-e.rect.left,right:("left"==s?h.left:h.right)-e.rect.left,top:b,bottom:w};h.left||h.right||(x.bogus=!0);if(!t.options.singleCursorHeightPerLine){x.rtop=g;x.rbottom=m}return x}function qt(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fi(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function Ut(t){if(t.measure){t.measure.cache={};t.measure.heights=null;if(t.rest)for(var e=0;e<t.rest.length;e++)t.measure.caches[e]={}}}function Bt(t){t.display.externalMeasure=null;Li(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)Ut(t.display.view[e])}function Vt(t){Bt(t);t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null;t.options.lineWrapping||(t.display.maxLineChanged=!0);t.display.lineNumChars=null}function Xt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Gt(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yt(t,e,n,r){if(e.widgets)for(var i=0;i<e.widgets.length;++i)if(e.widgets[i].above){var o=hr(e.widgets[i]);n.top+=o;n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Br(e);"local"==r?a+=Dt(t.display):a-=t.display.viewOffset;if("page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:Gt());var l=s.left+("window"==r?0:Xt());n.left+=l;n.right+=l}n.top+=a;n.bottom+=a;return n}function $t(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n){r-=Xt();i-=Gt()}else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left;i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Jt(t,e,n,r,i){r||(r=Rr(t.doc,e.line));return Yt(t,r,Ot(t,r,e.ch,i),n)}function Kt(t,e,n,r,i,o){function a(e,a){var s=Wt(t,i,e,a?"right":"left",o);a?s.left=s.right:s.right=s.left;return Yt(t,r,s,n)}function s(t,e){var n=l[e],r=n.level%2;if(t==zi(n)&&e&&n.level<l[e-1].level){n=l[--e];t=qi(n)-(n.level%2?0:1);r=!0}else if(t==qi(n)&&e<l.length-1&&n.level<l[e+1].level){n=l[++e];t=zi(n)-n.level%2;r=!1}return r&&t==n.to&&t>n.from?a(t-1):a(t,r)}r=r||Rr(t.doc,e.line);i||(i=Ft(t,r));var l=Vr(r),u=e.ch;if(!l)return a(u);var c=$i(l,u),f=s(u,c);null!=qa&&(f.other=s(u,qa));return f}function Zt(t,e){var n=0,e=et(t.doc,e);t.options.lineWrapping||(n=re(t.display)*e.ch);var r=Rr(t.doc,e.line),i=Br(r)+Dt(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Qt(t,e,n,r){var i=Co(t,e);i.xRel=r;n&&(i.outside=!0);return i}function te(t,e,n){var r=t.doc;n+=t.display.viewOffset;if(0>n)return Qt(r.first,0,!0,-1);var i=Ur(r,n),o=r.first+r.size-1;if(i>o)return Qt(r.first+r.size-1,Rr(r,o).text.length,!0,1);0>e&&(e=0);for(var a=Rr(r,i);;){var s=ee(t,a,i,e,n),l=rr(a),u=l&&l.find(0,!0);if(!l||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=qr(a=u.to.line)}}function ee(t,e,n,r,i){function o(r){var i=Kt(t,Co(n,r),"line",e,u);s=!0;if(a>i.bottom)return i.left-l;if(a<i.top)return i.left+l;s=!1;return i.left}var a=i-Br(e),s=!1,l=2*t.display.wrapper.clientWidth,u=Ft(t,e),c=Vr(e),f=e.text.length,h=Ui(e),d=Bi(e),p=o(h),g=s,m=o(d),v=s;if(r>m)return Qt(n,d,v,1);for(;;){if(c?d==h||d==Ki(e,h,1):1>=d-h){for(var y=p>r||m-r>=r-p?h:d,b=r-(y==h?p:m);_i(e.text.charAt(y));)++y;var w=Qt(n,y,y==h?g:v,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(f/2),C=h+x;if(c){C=h;for(var S=0;x>S;++S)C=Ki(e,C,1)}var T=o(C);if(T>r){d=C;m=T;(v=s)&&(m+=1e3);f=x}else{h=C;p=T;g=s;f-=x}}}function ne(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==To){To=Di("pre");for(var e=0;49>e;++e){To.appendChild(document.createTextNode("x"));To.appendChild(Di("br"))}To.appendChild(document.createTextNode("x"))}Ai(t.measure,To);var n=To.offsetHeight/50;n>3&&(t.cachedTextHeight=n);Li(t.measure);return n||1}function re(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=Di("span","xxxxxxxxxx"),n=Di("pre",[e]);Ai(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;i>2&&(t.cachedCharWidth=i);return i||10}function ie(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Lo};Do?Do.ops.push(t.curOp):t.curOp.ownsGroup=Do={ops:[t.curOp],delayedCallbacks:[]}}function oe(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n]();for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(n<e.length)}function ae(t){var e=t.curOp,n=e.ownsGroup;if(n)try{oe(n)}finally{Do=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;se(n)}}function se(t){for(var e=t.ops,n=0;n<e.length;n++)le(e[n]);for(var n=0;n<e.length;n++)ue(e[n]);for(var n=0;n<e.length;n++)ce(e[n]);for(var n=0;n<e.length;n++)fe(e[n]);for(var n=0;n<e.length;n++)he(e[n])}function le(t){var e=t.cm,n=e.display;M(e);t.updateMaxLine&&h(e);t.mustUpdate=t.viewChanged||t.forceUpdate||null!=t.scrollTop||t.scrollToPos&&(t.scrollToPos.from.line<n.viewFrom||t.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping;t.update=t.mustUpdate&&new k(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function ue(t){t.updatedDisplay=t.mustUpdate&&_(t.cm,t.update)}function ce(t){var e=t.cm,n=e.display;t.updatedDisplay&&N(e);t.barMeasure=p(e);if(n.maxLineChanged&&!e.options.lineWrapping){t.adjustWidthTo=Ot(e,n.maxLine,n.maxLine.text.length).left+3;e.display.sizerWidth=t.adjustWidthTo;t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Nt(e)+e.display.barWidth);t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Et(e))}(t.updatedDisplay||t.selectionChanged)&&(t.newSelectionNodes=yt(e))}function fe(t){var e=t.cm;if(null!=t.adjustWidthTo){e.display.sizer.style.minWidth=t.adjustWidthTo+"px";t.maxScrollLeft<e.doc.scrollLeft&&Xe(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0);e.display.maxLineChanged=!1}t.newSelectionNodes&&bt(e,t.newSelectionNodes);t.updatedDisplay&&A(e,t.barMeasure);(t.updatedDisplay||t.startHeight!=e.doc.height)&&y(e,t.barMeasure);t.selectionChanged&&St(e);e.state.focused&&t.updateInput&&Le(e,t.typing)}function he(t){var e=t.cm,n=e.display,r=e.doc;t.updatedDisplay&&D(e,t.update);null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null);if(null!=t.scrollTop&&(n.scroller.scrollTop!=t.scrollTop||t.forceScroll)){r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,t.scrollTop));n.scrollbars.setScrollTop(r.scrollTop);n.scroller.scrollTop=r.scrollTop}if(null!=t.scrollLeft&&(n.scroller.scrollLeft!=t.scrollLeft||t.forceScroll)){r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-Et(e),t.scrollLeft));n.scrollbars.setScrollLeft(r.scrollLeft);n.scroller.scrollLeft=r.scrollLeft;x(e)}if(t.scrollToPos){var i=xn(e,et(r,t.scrollToPos.from),et(r,t.scrollToPos.to),t.scrollToPos.margin);t.scrollToPos.isCursor&&e.state.focused&&wn(e,i)}var o=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||ma(o[s],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&ma(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop);t.changeObjs&&ma(e,"changes",e,t.changeObjs); t.update&&t.update.finish()}function de(t,e){if(t.curOp)return e();ie(t);try{return e()}finally{ae(t)}}function pe(t,e){return function(){if(t.curOp)return e.apply(t,arguments);ie(t);try{return e.apply(t,arguments)}finally{ae(t)}}}function ge(t){return function(){if(this.curOp)return t.apply(this,arguments);ie(this);try{return t.apply(this,arguments)}finally{ae(this)}}}function me(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);ie(e);try{return t.apply(this,arguments)}finally{ae(e)}}}function ve(t,e,n){this.line=e;this.rest=ar(e);this.size=this.rest?qr(bi(this.rest))-n+1:1;this.node=this.text=null;this.hidden=ur(t,e)}function ye(t,e,n){for(var r,i=[],o=e;n>o;o=r){var a=new ve(t.doc,Rr(t.doc,o),o);r=o+a.size;i.push(a)}return i}function be(t,e,n,r){null==e&&(e=t.doc.first);null==n&&(n=t.doc.first+t.doc.size);r||(r=0);var i=t.display;r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e);t.curOp.viewChanged=!0;if(e>=i.viewTo)xo&&sr(t.doc,e)<i.viewTo&&xe(t);else if(n<=i.viewFrom)if(xo&&lr(t.doc,n+r)>i.viewFrom)xe(t);else{i.viewFrom+=r;i.viewTo+=r}else if(e<=i.viewFrom&&n>=i.viewTo)xe(t);else if(e<=i.viewFrom){var o=Se(t,n,n+r,1);if(o){i.view=i.view.slice(o.index);i.viewFrom=o.lineN;i.viewTo+=r}else xe(t)}else if(n>=i.viewTo){var o=Se(t,e,e,-1);if(o){i.view=i.view.slice(0,o.index);i.viewTo=o.lineN}else xe(t)}else{var a=Se(t,e,e,-1),s=Se(t,n,n+r,1);if(a&&s){i.view=i.view.slice(0,a.index).concat(ye(t,a.lineN,s.lineN)).concat(i.view.slice(s.index));i.viewTo+=r}else xe(t)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:e<l.lineN+l.size&&(i.externalMeasured=null))}function we(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null);if(!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Ce(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==wi(a,n)&&a.push(n)}}}function xe(t){t.display.viewFrom=t.display.viewTo=t.doc.first;t.display.view=[];t.display.viewOffset=0}function Ce(t,e){if(e>=t.display.viewTo)return null;e-=t.display.viewFrom;if(0>e)return null;for(var n=t.display.view,r=0;r<n.length;r++){e-=n[r].size;if(0>e)return r}}function Se(t,e,n,r){var i,o=Ce(t,e),a=t.display.view;if(!xo||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=0,l=t.display.viewFrom;o>s;s++)l+=a[s].size;if(l!=e){if(r>0){if(o==a.length-1)return null;i=l+a[o].size-e;o++}else i=l-e;e+=i;n+=i}for(;sr(t.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size;o+=r}return{index:o,lineN:n}}function Te(t,e,n){var r=t.display,i=r.view;if(0==i.length||e>=r.viewTo||n<=r.viewFrom){r.view=ye(t,e,n);r.viewFrom=e}else{r.viewFrom>e?r.view=ye(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Ce(t,e)));r.viewFrom=e;r.viewTo<n?r.view=r.view.concat(ye(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ce(t,n)))}r.viewTo=n}function ke(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Me(t){t.display.pollingFast||t.display.poll.set(t.options.pollInterval,function(){De(t);t.state.focused&&Me(t)})}function _e(t){function e(){var r=De(t);if(r||n){t.display.pollingFast=!1;Me(t)}else{n=!0;t.display.poll.set(60,e)}}var n=!1;t.display.pollingFast=!0;t.display.poll.set(20,e)}function De(t){var e=t.display.input,n=t.display.prevInput,r=t.doc;if(!t.state.focused||Ra(e)&&!n||Ee(t)||t.options.disableInput||t.state.keySeq)return!1;if(t.state.pasteIncoming&&t.state.fakedLastChar){e.value=e.value.substring(0,e.value.length-1);t.state.fakedLastChar=!1}var i=e.value;if(i==n&&!t.somethingSelected())return!1;if(no&&ro>=9&&t.display.inputHasSelection===i||go&&/[\uf700-\uf7ff]/.test(i)){Le(t);return!1}var o=!t.curOp;o&&ie(t);t.display.shift=!1;8203!=i.charCodeAt(0)||r.sel!=t.display.selForContextMenu||n||(n="​");for(var a=0,s=Math.min(n.length,i.length);s>a&&n.charCodeAt(a)==i.charCodeAt(a);)++a;var l=i.slice(a),u=Oa(l),c=null;t.state.pasteIncoming&&r.sel.ranges.length>1&&(Ao&&Ao.join("\n")==l?c=r.sel.ranges.length%Ao.length==0&&xi(Ao,Oa):u.length==r.sel.ranges.length&&(c=xi(u,function(t){return[t]})));for(var f=r.sel.ranges.length-1;f>=0;f--){var h=r.sel.ranges[f],d=h.from(),p=h.to();a<n.length?d=Co(d.line,d.ch-(n.length-a)):t.state.overwrite&&h.empty()&&!t.state.pasteIncoming&&(p=Co(p.line,Math.min(Rr(r,p.line).text.length,p.ch+bi(u).length)));var g=t.curOp.updateInput,m={from:d,to:p,text:c?c[f%c.length]:u,origin:t.state.pasteIncoming?"paste":t.state.cutIncoming?"cut":"+input"};dn(t.doc,m);ci(t,"inputRead",t,m);if(l&&!t.state.pasteIncoming&&t.options.electricChars&&t.options.smartIndent&&h.head.ch<100&&(!f||r.sel.ranges[f-1].head.line!=h.head.line)){var v=t.getModeAt(h.head),y=Oo(m);if(v.electricChars){for(var b=0;b<v.electricChars.length;b++)if(l.indexOf(v.electricChars.charAt(b))>-1){_n(t,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Rr(r,y.line).text.slice(0,y.ch))&&_n(t,y.line,"smart")}}kn(t);t.curOp.updateInput=g;t.curOp.typing=!0;i.length>1e3||i.indexOf("\n")>-1?e.value=t.display.prevInput="":t.display.prevInput=i;o&&ae(t);t.state.pasteIncoming=t.state.cutIncoming=!1;return!0}function Le(t,e){if(!t.display.contextMenuPending){var n,r,i=t.doc;if(t.somethingSelected()){t.display.prevInput="";var o=i.sel.primary();n=Fa&&(o.to().line-o.from().line>100||(r=t.getSelection()).length>1e3);var a=n?"-":r||t.getSelection();t.display.input.value=a;t.state.focused&&ka(t.display.input);no&&ro>=9&&(t.display.inputHasSelection=a)}else if(!e){t.display.prevInput=t.display.input.value="";no&&ro>=9&&(t.display.inputHasSelection=null)}t.display.inaccurateSelection=n}}function Ae(t){if("nocursor"!=t.options.readOnly&&(!po||Ni()!=t.display.input))try{t.display.input.focus()}catch(e){}}function Ne(t){if(!t.state.focused){Ae(t);rn(t)}}function Ee(t){return t.options.readOnly||t.doc.cantEdit}function Pe(t){function e(e){hi(t,e)||da(e)}function n(e){if(t.somethingSelected()){Ao=t.getSelections();if(r.inaccurateSelection){r.prevInput="";r.inaccurateSelection=!1;r.input.value=Ao.join("\n");ka(r.input)}}else{for(var n=[],i=[],o=0;o<t.doc.sel.ranges.length;o++){var a=t.doc.sel.ranges[o].head.line,s={anchor:Co(a,0),head:Co(a+1,0)};i.push(s);n.push(t.getRange(s.anchor,s.head))}if("cut"==e.type)t.setSelections(i,null,wa);else{r.prevInput="";r.input.value=n.join("\n");ka(r.input)}Ao=n}"cut"==e.type&&(t.state.cutIncoming=!0)}var r=t.display;pa(r.scroller,"mousedown",pe(t,Oe));no&&11>ro?pa(r.scroller,"dblclick",pe(t,function(e){if(!hi(t,e)){var n=He(t,e);if(n&&!qe(t,e)&&!Ie(t.display,e)){fa(e);var r=t.findWordAt(n);at(t.doc,r.anchor,r.head)}}})):pa(r.scroller,"dblclick",function(e){hi(t,e)||fa(e)});pa(r.lineSpace,"selectstart",function(t){Ie(r,t)||fa(t)});bo||pa(r.scroller,"contextmenu",function(e){an(t,e)});pa(r.scroller,"scroll",function(){if(r.scroller.clientHeight){Ve(t,r.scroller.scrollTop);Xe(t,r.scroller.scrollLeft,!0);ma(t,"scroll",t)}});pa(r.scroller,"mousewheel",function(e){Ge(t,e)});pa(r.scroller,"DOMMouseScroll",function(e){Ge(t,e)});pa(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0});pa(r.input,"keyup",function(e){en.call(t,e)});pa(r.input,"input",function(){no&&ro>=9&&t.display.inputHasSelection&&(t.display.inputHasSelection=null);De(t)});pa(r.input,"keydown",pe(t,Qe));pa(r.input,"keypress",pe(t,nn));pa(r.input,"focus",Ti(rn,t));pa(r.input,"blur",Ti(on,t));if(t.options.dragDrop){pa(r.scroller,"dragstart",function(e){Be(t,e)});pa(r.scroller,"dragenter",e);pa(r.scroller,"dragover",e);pa(r.scroller,"drop",pe(t,Ue))}pa(r.scroller,"paste",function(e){if(!Ie(r,e)){t.state.pasteIncoming=!0;Ae(t);_e(t)}});pa(r.input,"paste",function(){if(io&&!t.state.fakedLastChar&&!(new Date-t.state.lastMiddleDown<200)){var e=r.input.selectionStart,n=r.input.selectionEnd;r.input.value+="$";r.input.selectionEnd=n;r.input.selectionStart=e;t.state.fakedLastChar=!0}t.state.pasteIncoming=!0;_e(t)});pa(r.input,"cut",n);pa(r.input,"copy",n);uo&&pa(r.sizer,"mouseup",function(){Ni()==r.input&&r.input.blur();Ae(t)})}function je(t){var e=t.display;if(e.lastWrapHeight!=e.wrapper.clientHeight||e.lastWrapWidth!=e.wrapper.clientWidth){e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null;e.scrollbarsClipped=!1;t.setSize()}}function Ie(t,e){for(var n=li(e);n!=t.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==t.sizer&&n!=t.mover)return!0}function He(t,e,n,r){var i=t.display;if(!n&&"true"==li(e).getAttribute("not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left;a=e.clientY-s.top}catch(e){return null}var l,u=te(t,o,a);if(r&&1==u.xRel&&(l=Rr(t.doc,u.line).text).length==u.ch){var c=Sa(l,l.length,t.options.tabSize)-l.length;u=Co(u.line,Math.max(0,Math.round((o-At(t.display).left)/re(t.display))-c))}return u}function Oe(t){if(!hi(this,t)){var e=this,n=e.display;n.shift=t.shiftKey;if(Ie(n,t)){if(!io){n.scroller.draggable=!1;setTimeout(function(){n.scroller.draggable=!0},100)}}else if(!qe(e,t)){var r=He(e,t);window.focus();switch(ui(t)){case 1:r?Re(e,t,r):li(t)==n.scroller&&fa(t);break;case 2:io&&(e.state.lastMiddleDown=+new Date);r&&at(e.doc,r);setTimeout(Ti(Ae,e),20);fa(t);break;case 3:bo&&an(e,t)}}}}function Re(t,e,n){setTimeout(Ti(Ne,t),0);var r,i=+new Date;if(Mo&&Mo.time>i-400&&0==So(Mo.pos,n))r="triple";else if(ko&&ko.time>i-400&&0==So(ko.pos,n)){r="double";Mo={time:i,pos:n}}else{r="single";ko={time:i,pos:n}}var o,a=t.doc.sel,s=go?e.metaKey:e.ctrlKey;t.options.dragDrop&&Ha&&!Ee(t)&&"single"==r&&(o=a.contains(n))>-1&&!a.ranges[o].empty()?Fe(t,e,n,s):We(t,e,n,r,s)}function Fe(t,e,n,r){var i=t.display,o=pe(t,function(a){io&&(i.scroller.draggable=!1);t.state.draggingText=!1;ga(document,"mouseup",o);ga(i.scroller,"drop",o);if(Math.abs(e.clientX-a.clientX)+Math.abs(e.clientY-a.clientY)<10){fa(a);r||at(t.doc,n);Ae(t);no&&9==ro&&setTimeout(function(){document.body.focus();Ae(t)},20)}});io&&(i.scroller.draggable=!0);t.state.draggingText=o;i.scroller.dragDrop&&i.scroller.dragDrop();pa(document,"mouseup",o);pa(i.scroller,"drop",o)}function We(t,e,n,r,i){function o(e){if(0!=So(m,e)){m=e;if("rect"==r){for(var i=[],o=t.options.tabSize,a=Sa(Rr(u,n.line).text,n.ch,o),s=Sa(Rr(u,e.line).text,e.ch,o),l=Math.min(a,s),d=Math.max(a,s),p=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));g>=p;p++){var v=Rr(u,p).text,y=vi(v,l,o);l==d?i.push(new K(Co(p,y),Co(p,y))):v.length>y&&i.push(new K(Co(p,y),Co(p,vi(v,d,o))))}i.length||i.push(new K(n,n));ht(u,Z(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1});t.scrollIntoView(e)}else{var b=c,w=b.anchor,x=e;if("single"!=r){if("double"==r)var C=t.findWordAt(e);else var C=new K(Co(e.line,0),et(u,Co(e.line+1,0)));if(So(C.anchor,w)>0){x=C.head;w=$(b.from(),C.anchor)}else{x=C.anchor;w=Y(b.to(),C.head)}}var i=h.ranges.slice(0);i[f]=new K(et(u,w),x);ht(u,Z(i,f),xa)}}}function a(e){var n=++y,i=He(t,e,!0,"rect"==r);if(i)if(0!=So(i,m)){Ne(t);o(i);var s=w(l,u);(i.line>=s.to||i.line<s.from)&&setTimeout(pe(t,function(){y==n&&a(e)}),150)}else{var c=e.clientY<v.top?-20:e.clientY>v.bottom?20:0;c&&setTimeout(pe(t,function(){if(y==n){l.scroller.scrollTop+=c;a(e)}}),50)}}function s(e){y=1/0;fa(e);Ae(t);ga(document,"mousemove",b);ga(document,"mouseup",x);u.history.lastSelOrigin=null}var l=t.display,u=t.doc;fa(e);var c,f,h=u.sel,d=h.ranges;if(i&&!e.shiftKey){f=u.sel.contains(n);c=f>-1?d[f]:new K(n,n)}else c=u.sel.primary();if(e.altKey){r="rect";i||(c=new K(n,n));n=He(t,e,!0,!0);f=-1}else if("double"==r){var p=t.findWordAt(n);c=t.display.shift||u.extend?ot(u,c,p.anchor,p.head):p}else if("triple"==r){var g=new K(Co(n.line,0),et(u,Co(n.line+1,0)));c=t.display.shift||u.extend?ot(u,c,g.anchor,g.head):g}else c=ot(u,c,n);if(i)if(-1==f){f=d.length;ht(u,Z(d.concat([c]),f),{scroll:!1,origin:"*mouse"})}else if(d.length>1&&d[f].empty()&&"single"==r){ht(u,Z(d.slice(0,f).concat(d.slice(f+1)),0));h=u.sel}else lt(u,f,c,xa);else{f=0;ht(u,new J([c],0),xa);h=u.sel}var m=n,v=l.wrapper.getBoundingClientRect(),y=0,b=pe(t,function(t){ui(t)?a(t):s(t)}),x=pe(t,s);pa(document,"mousemove",b);pa(document,"mouseup",x)}function ze(t,e,n,r,i){try{var o=e.clientX,a=e.clientY}catch(e){return!1}if(o>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&fa(e);var s=t.display,l=s.lineDiv.getBoundingClientRect();if(a>l.bottom||!pi(t,n))return si(e);a-=l.top-s.viewOffset;for(var u=0;u<t.options.gutters.length;++u){var c=s.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var f=Ur(t.doc,a),h=t.options.gutters[u];i(t,n,t,f,h,e);return si(e)}}}function qe(t,e){return ze(t,e,"gutterClick",!0,ci)}function Ue(t){var e=this;if(!hi(e,t)&&!Ie(e.display,t)){fa(t);no&&(No=+new Date);var n=He(e,t,!0),r=t.dataTransfer.files;if(n&&!Ee(e))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(t,r){var s=new FileReader;s.onload=pe(e,function(){o[r]=s.result;if(++a==i){n=et(e.doc,n);var t={from:n,to:n,text:Oa(o.join("\n")),origin:"paste"};dn(e.doc,t);ft(e.doc,Q(n,Oo(t)))}});s.readAsText(t)},l=0;i>l;++l)s(r[l],l);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1){e.state.draggingText(t);setTimeout(Ti(Ae,e),20);return}try{var o=t.dataTransfer.getData("Text");if(o){if(e.state.draggingText&&!(go?t.metaKey:t.ctrlKey))var u=e.listSelections();dt(e.doc,Q(n,n));if(u)for(var l=0;l<u.length;++l)bn(e.doc,"",u[l].anchor,u[l].head,"drag");e.replaceSelection(o,"around","paste");Ae(e)}}catch(t){}}}}function Be(t,e){if(no&&(!t.state.draggingText||+new Date-No<100))da(e);else if(!hi(t,e)&&!Ie(t.display,e)){e.dataTransfer.setData("Text",t.getSelection());if(e.dataTransfer.setDragImage&&!lo){var n=Di("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(so){n.width=n.height=1;t.display.wrapper.appendChild(n);n._top=n.offsetTop}e.dataTransfer.setDragImage(n,0,0);so&&n.parentNode.removeChild(n)}}}function Ve(t,e){if(!(Math.abs(t.doc.scrollTop-e)<2)){t.doc.scrollTop=e;Qi||L(t,{top:e});t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e);t.display.scrollbars.setScrollTop(e);Qi&&L(t);Tt(t,100)}}function Xe(t,e,n){if(!(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)){e=Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth);t.doc.scrollLeft=e;x(t);t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e);t.display.scrollbars.setScrollLeft(e)}}function Ge(t,e){var n=jo(e),r=n.x,i=n.y,o=t.display,a=o.scroller;if(r&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&go&&io)t:for(var s=e.target,l=o.view;s!=a;s=s.parentNode)for(var u=0;u<l.length;u++)if(l[u].node==s){t.display.currentWheelTarget=s;break t}if(!r||Qi||so||null==Po){if(i&&null!=Po){var c=i*Po,f=t.doc.scrollTop,h=f+o.wrapper.clientHeight;0>c?f=Math.max(0,f+c-50):h=Math.min(t.doc.height,h+c+50);L(t,{top:f,bottom:h})}if(20>Eo)if(null==o.wheelStartX){o.wheelStartX=a.scrollLeft;o.wheelStartY=a.scrollTop;o.wheelDX=r;o.wheelDY=i;setTimeout(function(){if(null!=o.wheelStartX){var t=a.scrollLeft-o.wheelStartX,e=a.scrollTop-o.wheelStartY,n=e&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(n){Po=(Po*Eo+n)/(Eo+1);++Eo}}},200)}else{o.wheelDX+=r;o.wheelDY+=i}}else{i&&Ve(t,Math.max(0,Math.min(a.scrollTop+i*Po,a.scrollHeight-a.clientHeight)));Xe(t,Math.max(0,Math.min(a.scrollLeft+r*Po,a.scrollWidth-a.clientWidth)));fa(e);o.wheelStartX=null}}}function Ye(t,e,n){if("string"==typeof e){e=Yo[e];if(!e)return!1}t.display.pollingFast&&De(t)&&(t.display.pollingFast=!1);var r=t.display.shift,i=!1;try{Ee(t)&&(t.state.suppressEdits=!0);n&&(t.display.shift=!1);i=e(t)!=ba}finally{t.display.shift=r;t.state.suppressEdits=!1}return i}function $e(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=Jo(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&Jo(e,t.options.extraKeys,n,t)||Jo(e,t.options.keyMap,n,t)}function Je(t,e,n,r){var i=t.state.keySeq;if(i){if(Ko(e))return"handled";Io.set(50,function(){if(t.state.keySeq==i){t.state.keySeq=null;Le(t)}});e=i+" "+e}var o=$e(t,e,r);"multi"==o&&(t.state.keySeq=e);"handled"==o&&ci(t,"keyHandled",t,e,n);if("handled"==o||"multi"==o){fa(n);St(t)}if(i&&!o&&/\'$/.test(e)){fa(n);return!0}return!!o}function Ke(t,e){var n=Zo(e,!0);return n?e.shiftKey&&!t.state.keySeq?Je(t,"Shift-"+n,e,function(e){return Ye(t,e,!0)})||Je(t,n,e,function(e){return("string"==typeof e?/^go[A-Z]/.test(e):e.motion)?Ye(t,e):void 0}):Je(t,n,e,function(e){return Ye(t,e)}):!1}function Ze(t,e,n){return Je(t,"'"+n+"'",e,function(e){return Ye(t,e,!0)})}function Qe(t){var e=this;Ne(e);if(!hi(e,t)){no&&11>ro&&27==t.keyCode&&(t.returnValue=!1);var n=t.keyCode;e.display.shift=16==n||t.shiftKey;var r=Ke(e,t);if(so){Ho=r?n:null;!r&&88==n&&!Fa&&(go?t.metaKey:t.ctrlKey)&&e.replaceSelection("",null,"cut")}18!=n||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||tn(e)}}function tn(t){function e(t){if(18==t.keyCode||!t.altKey){Pa(n,"CodeMirror-crosshair");ga(document,"keyup",e);ga(document,"mouseover",e)}}var n=t.display.lineDiv;ja(n,"CodeMirror-crosshair");pa(document,"keyup",e);pa(document,"mouseover",e)}function en(t){16==t.keyCode&&(this.doc.sel.shift=!1);hi(this,t)}function nn(t){var e=this;if(!(hi(e,t)||t.ctrlKey&&!t.altKey||go&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(so&&n==Ho){Ho=null;fa(t)}else if(!(so&&(!t.which||t.which<10)||uo)||!Ke(e,t)){var i=String.fromCharCode(null==r?n:r);if(!Ze(e,t,i)){no&&ro>=9&&(e.display.inputHasSelection=null);_e(e)}}}}function rn(t){if("nocursor"!=t.options.readOnly){if(!t.state.focused){ma(t,"focus",t);t.state.focused=!0;ja(t.display.wrapper,"CodeMirror-focused");if(!t.curOp&&t.display.selForContextMenu!=t.doc.sel){Le(t);io&&setTimeout(Ti(Le,t,!0),0)}}Me(t);St(t)}}function on(t){if(t.state.focused){ma(t,"blur",t);t.state.focused=!1;Pa(t.display.wrapper,"CodeMirror-focused")}clearInterval(t.display.blinker);setTimeout(function(){t.state.focused||(t.display.shift=!1)},150)}function an(t,e){function n(){if(null!=i.input.selectionStart){var e=t.somethingSelected(),n=i.input.value="​"+(e?i.input.value:"");i.prevInput=e?"":"​";i.input.selectionStart=1;i.input.selectionEnd=n.length;i.selForContextMenu=t.doc.sel}}function r(){i.contextMenuPending=!1;i.inputDiv.style.position="relative";i.input.style.cssText=l;no&&9>ro&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a);Me(t);if(null!=i.input.selectionStart){(!no||no&&9>ro)&&n();var e=0,r=function(){i.selForContextMenu==t.doc.sel&&0==i.input.selectionStart?pe(t,Yo.selectAll)(t):e++<10?i.detectingSelectAll=setTimeout(r,500):Le(t)};i.detectingSelectAll=setTimeout(r,200)}}if(!hi(t,e,"contextmenu")){var i=t.display;if(!Ie(i,e)&&!sn(t,e)){var o=He(t,e),a=i.scroller.scrollTop;if(o&&!so){var s=t.options.resetSelectionOnContextMenu;s&&-1==t.doc.sel.contains(o)&&pe(t,ht)(t.doc,Q(o),wa);var l=i.input.style.cssText;i.inputDiv.style.position="absolute";i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(no?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(io)var u=window.scrollY;Ae(t);io&&window.scrollTo(null,u);Le(t);t.somethingSelected()||(i.input.value=i.prevInput=" ");i.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);no&&ro>=9&&n();if(bo){da(e);var c=function(){ga(window,"mouseup",c);setTimeout(r,20)};pa(window,"mouseup",c)}else setTimeout(r,50)}}}}function sn(t,e){return pi(t,"gutterContextMenu")?ze(t,e,"gutterContextMenu",!1,ma):!1}function ln(t,e){if(So(t,e.from)<0)return t;if(So(t,e.to)<=0)return Oo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;t.line==e.to.line&&(r+=Oo(e).ch-e.to.ch);return Co(n,r)}function un(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new K(ln(i.anchor,e),ln(i.head,e)))}return Z(n,t.sel.primIndex)}function cn(t,e,n){return t.line==e.line?Co(n.line,t.ch-e.ch+n.ch):Co(n.line+(t.line-e.line),t.ch)}function fn(t,e,n){for(var r=[],i=Co(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=cn(s.from,i,o),u=cn(Oo(s),i,o);i=s.to;o=u;if("around"==n){var c=t.sel.ranges[a],f=So(c.head,c.anchor)<0;r[a]=new K(f?u:l,f?l:u)}else r[a]=new K(l,l)}return new J(r,t.sel.primIndex)}function hn(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){this.canceled=!0}};n&&(r.update=function(e,n,r,i){e&&(this.from=et(t,e));n&&(this.to=et(t,n));r&&(this.text=r);void 0!==i&&(this.origin=i)});ma(t,"beforeChange",t,r);t.cm&&ma(t.cm,"beforeChange",t.cm,r);return r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function dn(t,e,n){if(t.cm){if(!t.cm.curOp)return pe(t.cm,dn)(t,e,n);if(t.cm.state.suppressEdits)return}if(pi(t,"beforeChange")||t.cm&&pi(t.cm,"beforeChange")){e=hn(t,e,!0);if(!e)return}var r=wo&&!n&&$n(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)pn(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text});else pn(t,e)}function pn(t,e){if(1!=e.text.length||""!=e.text[0]||0!=So(e.from,e.to)){var n=un(t,e);Jr(t,e,n,t.cm?t.cm.curOp.id:0/0);vn(t,e,n,Xn(t,e));var r=[];Hr(t,function(t,n){if(!n&&-1==wi(r,t.history)){ai(t.history,e);r.push(t.history)}vn(t,e,null,Xn(t,e))})}}function gn(t,e,n){if(!t.cm||!t.cm.state.suppressEdits){for(var r,i=t.history,o=t.sel,a="undo"==e?i.done:i.undone,s="undo"==e?i.undone:i.done,l=0;l<a.length;l++){r=a[l];if(n?r.ranges&&!r.equals(t.sel):!r.ranges)break}if(l!=a.length){i.lastOrigin=i.lastSelOrigin=null;for(;;){r=a.pop();if(!r.ranges)break;Qr(r,s);if(n&&!r.equals(t.sel)){ht(t,r,{clearRedo:!1});return}o=r}var u=[];Qr(o,s);s.push({changes:u,generation:i.generation});i.generation=r.generation||++i.maxGeneration;for(var c=pi(t,"beforeChange")||t.cm&&pi(t.cm,"beforeChange"),l=r.changes.length-1;l>=0;--l){var f=r.changes[l];f.origin=e;if(c&&!hn(t,f,!1)){a.length=0;return}u.push(Gr(t,f));var h=l?un(t,f):bi(a);vn(t,f,h,Yn(t,f));!l&&t.cm&&t.cm.scrollIntoView({from:f.from,to:Oo(f)});var d=[];Hr(t,function(t,e){if(!e&&-1==wi(d,t.history)){ai(t.history,f);d.push(t.history)}vn(t,f,null,Yn(t,f))})}}}}function mn(t,e){if(0!=e){t.first+=e;t.sel=new J(xi(t.sel.ranges,function(t){return new K(Co(t.anchor.line+e,t.anchor.ch),Co(t.head.line+e,t.head.ch))}),t.sel.primIndex);if(t.cm){be(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)we(t.cm,r,"gutter")}}}function vn(t,e,n,r){if(t.cm&&!t.cm.curOp)return pe(t.cm,vn)(t,e,n,r);if(e.to.line<t.first)mn(t,e.text.length-1-(e.to.line-e.from.line));else if(!(e.from.line>t.lastLine())){if(e.from.line<t.first){var i=e.text.length-1-(t.first-e.from.line);mn(t,i);e={from:Co(t.first,0),to:Co(e.to.line+i,e.to.ch),text:[bi(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:Co(o,Rr(t,o).text.length),text:[e.text[0]],origin:e.origin});e.removed=Fr(t,e.from,e.to);n||(n=un(t,e));t.cm?yn(t.cm,e,r):Pr(t,e,r);dt(t,n,wa)}}function yn(t,e,n){var r=t.doc,i=t.display,a=e.from,s=e.to,l=!1,u=a.line;if(!t.options.lineWrapping){u=qr(or(Rr(r,a.line)));r.iter(u,s.line+1,function(t){if(t==i.maxLine){l=!0;return!0}})}r.sel.contains(e.from,e.to)>-1&&di(t);Pr(r,e,n,o(t));if(!t.options.lineWrapping){r.iter(u,a.line+e.text.length,function(t){var e=f(t);if(e>i.maxLineLength){i.maxLine=t;i.maxLineLength=e;i.maxLineChanged=!0;l=!1}});l&&(t.curOp.updateMaxLine=!0)}r.frontier=Math.min(r.frontier,a.line);Tt(t,400);var c=e.text.length-(s.line-a.line)-1;e.full?be(t):a.line!=s.line||1!=e.text.length||Er(t.doc,e)?be(t,a.line,s.line+1,c):we(t,a.line,"text");var h=pi(t,"changes"),d=pi(t,"change");if(d||h){var p={from:a,to:s,text:e.text,removed:e.removed,origin:e.origin};d&&ci(t,"change",t,p);h&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(p)}t.display.selForContextMenu=null}function bn(t,e,n,r,i){r||(r=n);if(So(r,n)<0){var o=r;r=n;n=o}"string"==typeof e&&(e=Oa(e));dn(t,{from:n,to:r,text:e,origin:i})}function wn(t,e){if(!hi(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(null!=i&&!fo){var o=Di("div","​",null,"position: absolute; top: "+(e.top-n.viewOffset-Dt(t.display))+"px; height: "+(e.bottom-e.top+Nt(t)+n.barHeight)+"px; left: "+e.left+"px; width: 2px;");t.display.lineSpace.appendChild(o);o.scrollIntoView(i);t.display.lineSpace.removeChild(o)}}}function xn(t,e,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=Kt(t,e),s=n&&n!=e?Kt(t,n):a,l=Sn(t,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),u=t.doc.scrollTop,c=t.doc.scrollLeft;if(null!=l.scrollTop){Ve(t,l.scrollTop);Math.abs(t.doc.scrollTop-u)>1&&(o=!0)}if(null!=l.scrollLeft){Xe(t,l.scrollLeft);Math.abs(t.doc.scrollLeft-c)>1&&(o=!0)}if(!o)break}return a}function Cn(t,e,n,r,i){var o=Sn(t,e,n,r,i);null!=o.scrollTop&&Ve(t,o.scrollTop);null!=o.scrollLeft&&Xe(t,o.scrollLeft)}function Sn(t,e,n,r,i){var o=t.display,a=ne(t.display);0>n&&(n=0);var s=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:o.scroller.scrollTop,l=Pt(t),u={};i-n>l&&(i=n+l);var c=t.doc.height+Lt(o),f=a>n,h=i>c-a;if(s>n)u.scrollTop=f?0:n;else if(i>s+l){var d=Math.min(n,(h?c:i)-l);d!=s&&(u.scrollTop=d)}var p=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:o.scroller.scrollLeft,g=Et(t)-(t.options.fixedGutter?o.gutters.offsetWidth:0),m=r-e>g;m&&(r=e+g);10>e?u.scrollLeft=0:p>e?u.scrollLeft=Math.max(0,e-(m?0:10)):r>g+p-3&&(u.scrollLeft=r+(m?0:10)-g);return u}function Tn(t,e,n){(null!=e||null!=n)&&Mn(t);null!=e&&(t.curOp.scrollLeft=(null==t.curOp.scrollLeft?t.doc.scrollLeft:t.curOp.scrollLeft)+e);null!=n&&(t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+n)}function kn(t){Mn(t);var e=t.getCursor(),n=e,r=e;if(!t.options.lineWrapping){n=e.ch?Co(e.line,e.ch-1):e;r=Co(e.line,e.ch+1)}t.curOp.scrollToPos={from:n,to:r,margin:t.options.cursorScrollMargin,isCursor:!0}}function Mn(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Zt(t,e.from),r=Zt(t,e.to),i=Sn(t,Math.min(n.left,r.left),Math.min(n.top,r.top)-e.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+e.margin);t.scrollTo(i.scrollLeft,i.scrollTop)}}function _n(t,e,n,r){var i,o=t.doc;null==n&&(n="add");"smart"==n&&(o.mode.indent?i=_t(t,e):n="prev");var a=t.options.tabSize,s=Rr(o,e),l=Sa(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n){u=o.mode.indent(i,s.text.slice(c.length),s.text);if(u==ba||u>150){if(!r)return;n="prev"}}}else{u=0;n="not"}"prev"==n?u=e>o.first?Sa(Rr(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n);u=Math.max(0,u);var f="",h=0;if(t.options.indentWithTabs)for(var d=Math.floor(u/a);d;--d){h+=a;f+=" "}u>h&&(f+=yi(u-h));if(f!=c)bn(o,f,Co(e,0),Co(e,c.length),"+input");else for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==e&&p.head.ch<c.length){var h=Co(e,c.length);lt(o,d,new K(h,h));break}}s.stateAfter=null}function Dn(t,e,n,r){var i=e,o=e;"number"==typeof e?o=Rr(t,tt(t,e)):i=qr(e);if(null==i)return null;r(o,i)&&t.cm&&we(t.cm,i,n);return o}function Ln(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&So(o.from,bi(r).to)<=0;){var a=r.pop();if(So(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}de(t,function(){for(var e=r.length-1;e>=0;e--)bn(t.doc,"",r[e].from,r[e].to,"+delete");kn(t)})}function An(t,e,n,r,i){function o(){var e=s+n;if(e<t.first||e>=t.first+t.size)return f=!1;s=e;return c=Rr(t,e)}function a(t){var e=(i?Ki:Zi)(c,l,n,!0);if(null==e){if(t||!o())return f=!1;l=i?(0>n?Bi:Ui)(c):0>n?c.text.length:0}else l=e;return!0}var s=e.line,l=e.ch,u=n,c=Rr(t,s),f=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var h=null,d="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),g=!0;!(0>n)||a(!g);g=!1){var m=c.text.charAt(l)||"\n",v=ki(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";!d||g||v||(v="s");if(h&&h!=v){if(0>n){n=1;a()}break}v&&(h=v);if(n>0&&!a(!g))break}var y=vt(t,Co(s,l),u,!0);f||(y.hitSide=!0);return y}function Nn(t,e,n,r){var i,o=t.doc,a=e.left;if("page"==r){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=e.top+n*(s-(0>n?1.5:.5)*ne(t.display))}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;;){var l=te(t,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function En(e,n,r,i){t.defaults[e]=n;r&&(Fo[e]=i?function(t,e,n){n!=Wo&&r(t,e,n)}:r)}function Pn(t){for(var e,n,r,i,o=t.split(/-(?!$)/),t=o[o.length-1],a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}e&&(t="Alt-"+t);n&&(t="Ctrl-"+t);i&&(t="Cmd-"+t);r&&(t="Shift-"+t);return t}function jn(t){return"string"==typeof t?$o[t]:t}function In(t,e,n,r,i){if(r&&r.shared)return Hn(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return pe(t.cm,In)(t,e,n,r,i);var o=new ta(t,i),a=So(e,n);r&&Si(r,o,!1);if(a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith){o.collapsed=!0;o.widgetNode=Di("span",[o.replacedWith],"CodeMirror-widget");r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true");r.insertLeft&&(o.widgetNode.insertLeft=!0)}if(o.collapsed){if(ir(t,e.line,e,n,o)||e.line!=n.line&&ir(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");xo=!0}o.addToHistory&&Jr(t,{from:e,to:n,origin:"markText"},t.sel,0/0);var s,l=e.line,u=t.cm;t.iter(l,n.line+1,function(t){u&&o.collapsed&&!u.options.lineWrapping&&or(t)==u.display.maxLine&&(s=!0);o.collapsed&&l!=e.line&&zr(t,0);Un(t,new Wn(o,l==e.line?e.ch:null,l==n.line?n.ch:null));++l});o.collapsed&&t.iter(e.line,n.line+1,function(e){ur(t,e)&&zr(e,0)});o.clearOnEnter&&pa(o,"beforeCursorEnter",function(){o.clear()});if(o.readOnly){wo=!0;(t.history.done.length||t.history.undone.length)&&t.clearHistory()}if(o.collapsed){o.id=++ea;o.atomic=!0}if(u){s&&(u.curOp.updateMaxLine=!0);if(o.collapsed)be(u,e.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=e.line;c<=n.line;c++)we(u,c,"text");o.atomic&&gt(u.doc);ci(u,"markerAdded",u,o)}return o}function Hn(t,e,n,r,i){r=Si(r);r.shared=!1;var o=[In(t,e,n,r,i)],a=o[0],s=r.widgetNode;Hr(t,function(t){s&&(r.widgetNode=s.cloneNode(!0));o.push(In(t,et(t,e),et(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=bi(o)});return new na(o,a)}function On(t){return t.findMarks(Co(t.first,0),t.clipPos(Co(t.lastLine())),function(t){return t.parent})}function Rn(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(So(o,a)){var s=In(t,o,a,r.primary,r.primary.type);r.markers.push(s);s.parent=r}}}function Fn(t){for(var e=0;e<t.length;e++){var n=t[e],r=[n.primary.doc];Hr(n.primary.doc,function(t){r.push(t)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];if(-1==wi(r,o.doc)){o.parent=null;n.markers.splice(i--,1)}}}}function Wn(t,e,n){this.marker=t;this.from=e;this.to=n}function zn(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function qn(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Un(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e];e.marker.attachLine(t)}function Bn(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);if(s||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new Wn(a,o.from,l?null:o.to))}}return r}function Vn(t,e,n){if(t)for(var r,i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);if(s||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){ var l=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new Wn(a,l?null:o.from-e,null==o.to?null:o.to-e))}}return r}function Xn(t,e){if(e.full)return null;var n=rt(t,e.from.line)&&Rr(t,e.from.line).markedSpans,r=rt(t,e.to.line)&&Rr(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==So(e.from,e.to),s=Bn(n,i,a),l=Vn(r,o,a),u=1==e.text.length,c=bi(e.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=zn(l,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(l)for(var f=0;f<l.length;++f){var h=l[f];null!=h.to&&(h.to+=c);if(null==h.from){var d=zn(s,h.marker);if(!d){h.from=c;u&&(s||(s=[])).push(h)}}else{h.from+=c;u&&(s||(s=[])).push(h)}}s&&(s=Gn(s));l&&l!=s&&(l=Gn(l));var p=[s];if(!u){var g,m=e.text.length-2;if(m>0&&s)for(var f=0;f<s.length;++f)null==s[f].to&&(g||(g=[])).push(new Wn(s[f].marker,null,null));for(var f=0;m>f;++f)p.push(g);p.push(l)}return p}function Gn(t){for(var e=0;e<t.length;++e){var n=t[e];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&t.splice(e--,1)}return t.length?t:null}function Yn(t,e){var n=ni(t,e),r=Xn(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function $n(t,e,n){var r=null;t.iter(e.line,n.line+1,function(t){if(t.markedSpans)for(var e=0;e<t.markedSpans.length;++e){var n=t.markedSpans[e].marker;!n.readOnly||r&&-1!=wi(r,n)||(r||(r=[])).push(n)}});if(!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(So(u.to,s.from)<0||So(u.from,s.to)>0)){var c=[l,1],f=So(u.from,s.from),h=So(u.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from});(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to});i.splice.apply(i,c);l+=c.length-1}}return i}function Jn(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function Kn(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function Zn(t){return t.inclusiveLeft?-1:0}function Qn(t){return t.inclusiveRight?1:0}function tr(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=So(r.from,i.from)||Zn(t)-Zn(e);if(o)return-o;var a=So(r.to,i.to)||Qn(t)-Qn(e);return a?a:e.id-t.id}function er(t,e){var n,r=xo&&t.markedSpans;if(r)for(var i,o=0;o<r.length;++o){i=r[o];i.marker.collapsed&&null==(e?i.from:i.to)&&(!n||tr(n,i.marker)<0)&&(n=i.marker)}return n}function nr(t){return er(t,!0)}function rr(t){return er(t,!1)}function ir(t,e,n,r,i){var o=Rr(t,e),a=xo&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=So(u.from,n)||Zn(l.marker)-Zn(i),f=So(u.to,r)||Qn(l.marker)-Qn(i);if(!(c>=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(So(u.to,n)>0||l.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(So(u.from,r)<0||l.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function or(t){for(var e;e=nr(t);)t=e.find(-1,!0).line;return t}function ar(t){for(var e,n;e=rr(t);){t=e.find(1,!0).line;(n||(n=[])).push(t)}return n}function sr(t,e){var n=Rr(t,e),r=or(n);return n==r?e:qr(r)}function lr(t,e){if(e>t.lastLine())return e;var n,r=Rr(t,e);if(!ur(t,r))return e;for(;n=rr(r);)r=n.find(1,!0).line;return qr(r)+1}function ur(t,e){var n=xo&&e.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&cr(t,e,r))return!0}}}function cr(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return cr(t,r.line,zn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i,o=0;o<e.markedSpans.length;++o){i=e.markedSpans[o];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&cr(t,e,i))return!0}}function fr(t,e,n){Br(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Tn(t,null,n)}function hr(t){if(null!=t.height)return t.height;if(!Aa(document.body,t.node)){var e="position: relative;";t.coverGutter&&(e+="margin-left: -"+t.cm.display.gutters.offsetWidth+"px;");t.noHScroll&&(e+="width: "+t.cm.display.wrapper.clientWidth+"px;");Ai(t.cm.display.measure,Di("div",[t.node],null,e))}return t.height=t.node.offsetHeight}function dr(t,e,n,r){var i=new ra(t,n,r);i.noHScroll&&(t.display.alignWidgets=!0);Dn(t.doc,e,"widget",function(e){var n=e.widgets||(e.widgets=[]);null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i);i.line=e;if(!ur(t.doc,e)){var r=Br(e)<t.doc.scrollTop;zr(e,e.height+hr(i));r&&Tn(t,null,i.height);t.curOp.forceUpdate=!0}return!0});return i}function pr(t,e,n,r){t.text=e;t.stateAfter&&(t.stateAfter=null);t.styles&&(t.styles=null);null!=t.order&&(t.order=null);Jn(t);Kn(t,n);var i=r?r(t):1;i!=t.height&&zr(t,i)}function gr(t){t.parent=null;Jn(t)}function mr(t,e){if(t)for(;;){var n=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;t=t.slice(0,n.index)+t.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(e[r])||(e[r]+=" "+n[2])}return t}function vr(e,n){if(e.blankLine)return e.blankLine(n);if(e.innerMode){var r=t.innerMode(e,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function yr(e,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=t.innerMode(e,r).mode);var a=e.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}function br(t,e,n,r){function i(t){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:t?Xo(a.mode,c):c}}var o,a=t.doc,s=a.mode;e=et(a,e);var l,u=Rr(a,e.line),c=_t(t,e.line,n),f=new Qo(u.text,t.options.tabSize);r&&(l=[]);for(;(r||f.pos<e.ch)&&!f.eol();){f.start=f.pos;o=yr(s,f,c);r&&l.push(i(!0))}return r?l:i()}function wr(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,u=0,c=null,f=new Qo(e,t.options.tabSize),h=t.options.addModeClass&&[null];""==e&&mr(vr(n,r),o);for(;!f.eol();){if(f.pos>t.options.maxHighlightLength){s=!1;a&&Sr(t,e,r,f.pos);f.pos=e.length;l=null}else l=mr(yr(n,f,r,h),o);if(h){var d=h[0].name;d&&(l="m-"+(l?d+" "+l:d))}if(!s||c!=l){for(;u<f.start;){u=Math.min(f.start,u+5e4);i(u,c)}c=l}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e4);i(p,c);u=p}}function xr(t,e,n,r){var i=[t.state.modeGen],o={};wr(t,e.text,t.doc.mode,n,function(t,e){i.push(t,e)},o,r);for(var a=0;a<t.state.overlays.length;++a){var s=t.state.overlays[a],l=1,u=0;wr(t,e.text,s.mode,!0,function(t,e){for(var n=l;t>u;){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r);l+=2;u=Math.min(t,r)}if(e)if(s.opaque){i.splice(n,l-n,t,"cm-overlay "+e);l=n+2}else for(;l>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+e}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Cr(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=xr(t,e,e.stateAfter=_t(t,qr(e)));e.styles=r.styles;r.classes?e.styleClasses=r.classes:e.styleClasses&&(e.styleClasses=null);n===t.doc.frontier&&t.doc.frontier++}return e.styles}function Sr(t,e,n,r){var i=t.doc.mode,o=new Qo(e,t.options.tabSize);o.start=o.pos=r||0;""==e&&vr(i,n);for(;!o.eol()&&o.pos<=t.options.maxHighlightLength;){yr(i,o,n);o.start=o.pos}}function Tr(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?aa:oa;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function kr(t,e){var n=Di("span",null,null,io?"padding-right: .1px":null),r={pre:Di("pre",[n]),content:n,col:0,pos:0,cm:t};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o,a=i?e.rest[i-1]:e.line;r.pos=0;r.addToken=_r;(no||io)&&t.getOption("lineWrapping")&&(r.addToken=Dr(r.addToken));Ri(t.display.measure)&&(o=Vr(a))&&(r.addToken=Lr(r.addToken,o));r.map=[];var s=e!=t.display.externalMeasured&&qr(a);Nr(a,r,Cr(t,a,s));if(a.styleClasses){a.styleClasses.bgClass&&(r.bgClass=Pi(a.styleClasses.bgClass,r.bgClass||""));a.styleClasses.textClass&&(r.textClass=Pi(a.styleClasses.textClass,r.textClass||""))}0==r.map.length&&r.map.push(0,0,r.content.appendChild(Oi(t.display.measure)));if(0==i){e.measure.map=r.map;e.measure.cache={}}else{(e.measure.maps||(e.measure.maps=[])).push(r.map);(e.measure.caches||(e.measure.caches=[])).push({})}}io&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack");ma(t,"renderLine",t,e.line,r.pre);r.pre.className&&(r.textClass=Pi(r.pre.className,r.textClass||""));return r}function Mr(t){var e=Di("span","•","cm-invalidchar");e.title="\\u"+t.charCodeAt(0).toString(16);e.setAttribute("aria-label",e.title);return e}function _r(t,e,n,r,i,o,a){if(e){var s=t.cm.options.specialChars,l=!1;if(s.test(e))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(e),h=f?f.index-c:e.length-c;if(h){var d=document.createTextNode(e.slice(c,c+h));u.appendChild(no&&9>ro?Di("span",[d]):d);t.map.push(t.pos,t.pos+h,d);t.col+=h;t.pos+=h}if(!f)break;c+=h+1;if(" "==f[0]){var p=t.cm.options.tabSize,g=p-t.col%p,d=u.appendChild(Di("span",yi(g),"cm-tab"));d.setAttribute("role","presentation");t.col+=g}else{var d=t.cm.options.specialCharPlaceholder(f[0]);u.appendChild(no&&9>ro?Di("span",[d]):d);t.col+=1}t.map.push(t.pos,t.pos+1,d);t.pos++}else{t.col+=e.length;var u=document.createTextNode(e);t.map.push(t.pos,t.pos+e.length,u);no&&9>ro&&(l=!0);t.pos+=e.length}if(n||r||i||l||a){var m=n||"";r&&(m+=r);i&&(m+=i);var v=Di("span",[u],m,a);o&&(v.title=o);return t.content.appendChild(v)}t.content.appendChild(u)}}function Dr(t){function e(t){for(var e=" ",n=0;n<t.length-2;++n)e+=n%2?" ":" ";e+=" ";return e}return function(n,r,i,o,a,s){t(n,r.replace(/ {3,}/g,e),i,o,a,s)}}function Lr(t,e){return function(n,r,i,o,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var l=n.pos,u=l+r.length;;){for(var c=0;c<e.length;c++){var f=e[c];if(f.to>l&&f.from<=l)break}if(f.to>=u)return t(n,r,i,o,a,s);t(n,r.slice(0,f.to-l),i,o,null,s);o=null;r=r.slice(f.to-l);l=f.to}}}function Ar(t,e,n,r){var i=!r&&n.widgetNode;if(i){t.map.push(t.pos,t.pos+e,i);t.content.appendChild(i)}t.pos+=e}function Nr(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=f=s="";h=null;v=1/0;for(var y=[],b=0;b<r.length;++b){var w=r[b],x=w.marker;if(w.from<=p&&(null==w.to||w.to>p)){if(null!=w.to&&v>w.to){v=w.to;u=""}x.className&&(l+=" "+x.className);x.css&&(s=x.css);x.startStyle&&w.from==p&&(c+=" "+x.startStyle);x.endStyle&&w.to==v&&(u+=" "+x.endStyle);x.title&&!f&&(f=x.title);x.collapsed&&(!h||tr(h.marker,x)<0)&&(h=w)}else w.from>p&&v>w.from&&(v=w.from);"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(h&&(h.from||0)==p){Ar(e,(null==h.to?d+1:h.to)-p,h.marker,null==h.from);if(null==h.to)return}if(!h&&y.length)for(var b=0;b<y.length;++b)Ar(e,0,y[b])}if(p>=d)break;for(var C=Math.min(d,v);;){if(m){var S=p+m.length;if(!h){var T=S>C?m.slice(0,C-p):m;e.addToken(e,T,a?a+l:l,c,p+T.length==v?u:"",f,s)}if(S>=C){m=m.slice(C-p);p=C;break}p=S;c=""}m=i.slice(o,o=n[g++]);a=Tr(n[g++],e.cm.options)}}else for(var g=1;g<n.length;g+=2)e.addToken(e,i.slice(o,o=n[g]),Tr(n[g+1],e.cm.options))}function Er(t,e){return 0==e.from.ch&&0==e.to.ch&&""==bi(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function Pr(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){pr(t,n,i,r);ci(t,"change",t,e)}function a(t,e){for(var n=t,o=[];e>n;++n)o.push(new ia(u[n],i(n),r));return o}var s=e.from,l=e.to,u=e.text,c=Rr(t,s.line),f=Rr(t,l.line),h=bi(u),d=i(u.length-1),p=l.line-s.line;if(e.full){t.insert(0,a(0,u.length));t.remove(u.length,t.size-u.length)}else if(Er(t,e)){var g=a(0,u.length-1);o(f,f.text,d);p&&t.remove(s.line,p);g.length&&t.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(l.ch),d);else{var g=a(1,u.length-1);g.push(new ia(h+c.text.slice(l.ch),d,r));o(c,c.text.slice(0,s.ch)+u[0],i(0));t.insert(s.line+1,g)}else if(1==u.length){o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(l.ch),i(0));t.remove(s.line+1,p)}else{o(c,c.text.slice(0,s.ch)+u[0],i(0));o(f,h+f.text.slice(l.ch),d);var g=a(1,u.length-1);p>1&&t.remove(s.line+1,p-1);t.insert(s.line+1,g)}ci(t,"change",t,e)}function jr(t){this.lines=t;this.parent=null;for(var e=0,n=0;e<t.length;++e){t[e].parent=this;n+=t[e].height}this.height=n}function Ir(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize();n+=i.height;i.parent=this}this.size=e;this.height=n;this.parent=null}function Hr(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;if(!n||l){e(s.doc,l);r(s.doc,t,l)}}}}r(t,null,!0)}function Or(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e;e.cm=t;a(t);n(t);t.options.lineWrapping||h(t);t.options.mode=e.modeOption;be(t)}function Rr(t,e){e-=t.first;if(0>e||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>e){n=i;break}e-=o}return n.lines[e]}function Fr(t,e,n){var r=[],i=e.line;t.iter(e.line,n.line+1,function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch));i==e.line&&(o=o.slice(e.ch));r.push(o);++i});return r}function Wr(t,e,n){var r=[];t.iter(e,n,function(t){r.push(t.text)});return r}function zr(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function qr(t){if(null==t.parent)return null;for(var e=t.parent,n=wi(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;r.children[i]!=e;++i)n+=r.children[i].chunkSize();return n+e.first}function Ur(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(o>e){t=i;continue t}e-=o;n+=i.chunkSize()}return n}while(!t.lines);for(var r=0;r<t.lines.length;++r){var a=t.lines[r],s=a.height;if(s>e)break;e-=s}return n+r}function Br(t){t=or(t);for(var e=0,n=t.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;e+=a.height}return e}function Vr(t){var e=t.order;null==e&&(e=t.order=Ua(t.text));return e}function Xr(t){this.done=[];this.undone=[];this.undoDepth=1/0;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=t||1}function Gr(t,e){var n={from:G(e.from),to:Oo(e),text:Fr(t,e.from,e.to)};ti(t,n,e.from.line,e.to.line+1);Hr(t,function(t){ti(t,n,e.from.line,e.to.line+1)},!0);return n}function Yr(t){for(;t.length;){var e=bi(t);if(!e.ranges)break;t.pop()}}function $r(t,e){if(e){Yr(t.done);return bi(t.done)}if(t.done.length&&!bi(t.done).ranges)return bi(t.done);if(t.done.length>1&&!t.done[t.done.length-2].ranges){t.done.pop();return bi(t.done)}}function Jr(t,e,n,r){var i=t.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&t.cm&&i.lastModTime>a-t.cm.options.historyEventDelay||"*"==e.origin.charAt(0)))&&(o=$r(i,i.lastOp==r))){var s=bi(o.changes);0==So(e.from,e.to)&&0==So(e.from,s.to)?s.to=Oo(e):o.changes.push(Gr(t,e))}else{var l=bi(i.done);l&&l.ranges||Qr(t.sel,i.done);o={changes:[Gr(t,e)],generation:i.generation};i.done.push(o);for(;i.done.length>i.undoDepth;){i.done.shift();i.done[0].ranges||i.done.shift()}}i.done.push(n);i.generation=++i.maxGeneration;i.lastModTime=i.lastSelTime=a;i.lastOp=i.lastSelOp=r;i.lastOrigin=i.lastSelOrigin=e.origin;s||ma(t,"historyAdded")}function Kr(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Zr(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Kr(t,o,bi(i.done),e))?i.done[i.done.length-1]=e:Qr(e,i.done);i.lastSelTime=+new Date;i.lastSelOrigin=o;i.lastSelOp=n;r&&r.clearRedo!==!1&&Yr(i.undone)}function Qr(t,e){var n=bi(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ti(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans);++o})}function ei(t){if(!t)return null;for(var e,n=0;n<t.length;++n)t[n].marker.explicitlyCleared?e||(e=t.slice(0,n)):e&&e.push(t[n]);return e?e.length?e:null:t}function ni(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=0,i=[];r<e.text.length;++r)i.push(ei(n[r]));return i}function ri(t,e,n){for(var r=0,i=[];r<t.length;++r){var o=t[r];if(o.ranges)i.push(n?J.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var u,c=a[l];s.push({from:c.from,to:c.to,text:c.text});if(e)for(var f in c)if((u=f.match(/^spans_(\d+)$/))&&wi(e,Number(u[1]))>-1){bi(s)[f]=c[f];delete c[f]}}}}return i}function ii(t,e,n,r){if(n<t.line)t.line+=r;else if(e<t.line){t.line=e;t.ch=0}}function oi(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){if(!o.copied){o=t[i]=o.deepCopy();o.copied=!0}for(var s=0;s<o.ranges.length;s++){ii(o.ranges[s].anchor,e,n,r);ii(o.ranges[s].head,e,n,r)}}else{for(var s=0;s<o.changes.length;++s){var l=o.changes[s];if(n<l.from.line){l.from=Co(l.from.line+r,l.from.ch);l.to=Co(l.to.line+r,l.to.ch)}else if(e<=l.to.line){a=!1;break}}if(!a){t.splice(0,i+1);i=0}}}}function ai(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;oi(t.done,n,r,i);oi(t.undone,n,r,i)}function si(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function li(t){return t.target||t.srcElement}function ui(t){var e=t.which;null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2));go&&t.ctrlKey&&1==e&&(e=3);return e}function ci(t,e){function n(t){return function(){t.apply(null,o)}}var r=t._handlers&&t._handlers[e];if(r){var i,o=Array.prototype.slice.call(arguments,2);if(Do)i=Do.delayedCallbacks;else if(va)i=va;else{i=va=[];setTimeout(fi,0)}for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function fi(){var t=va;va=null;for(var e=0;e<t.length;++e)t[e]()}function hi(t,e,n){"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}});ma(t,n||e.type,t,e);return si(e)||e.codemirrorIgnore}function di(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==wi(n,e[r])&&n.push(e[r])}function pi(t,e){var n=t._handlers&&t._handlers[e];return n&&n.length>0}function gi(t){t.prototype.on=function(t,e){pa(this,t,e)};t.prototype.off=function(t,e){ga(this,t,e)}}function mi(){this.id=null}function vi(t,e,n){for(var r=0,i=0;;){var o=t.indexOf(" ",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);i+=o-r;i+=n-i%n;r=o+1;if(i>=e)return r}}function yi(t){for(;Ta.length<=t;)Ta.push(bi(Ta)+" ");return Ta[t]}function bi(t){return t[t.length-1]}function wi(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}function xi(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function Ci(t,e){var n;if(Object.create)n=Object.create(t);else{var r=function(){};r.prototype=t;n=new r}e&&Si(e,n);return n}function Si(t,e,n){e||(e={});for(var r in t)!t.hasOwnProperty(r)||n===!1&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function Ti(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function ki(t,e){return e?e.source.indexOf("\\w")>-1&&Da(t)?!0:e.test(t):Da(t)}function Mi(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}function _i(t){return t.charCodeAt(0)>=768&&La.test(t)}function Di(t,e,n,r){var i=document.createElement(t);n&&(i.className=n);r&&(i.style.cssText=r);if("string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function Li(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function Ai(t,e){return Li(t).appendChild(e)}function Ni(){return document.activeElement}function Ei(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function Pi(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!Ei(n[r]).test(e)&&(e+=" "+n[r]);return e}function ji(t){if(document.body.getElementsByClassName)for(var e=document.body.getElementsByClassName("CodeMirror"),n=0;n<e.length;n++){var r=e[n].CodeMirror;r&&t(r)}}function Ii(){if(!Ia){Hi();Ia=!0}}function Hi(){var t;pa(window,"resize",function(){null==t&&(t=setTimeout(function(){t=null;ji(je)},100))});pa(window,"blur",function(){ji(on)})}function Oi(t){if(null==Na){var e=Di("span","​");Ai(t,Di("span",[e,document.createTextNode("x")]));0!=t.firstChild.offsetHeight&&(Na=e.offsetWidth<=1&&e.offsetHeight>2&&!(no&&8>ro))}return Na?Di("span","​"):Di("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Ri(t){if(null!=Ea)return Ea;var e=Ai(t,document.createTextNode("AخA")),n=Ma(e,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ma(e,1,2).getBoundingClientRect();return Ea=r.right-n.right<3}function Fi(t){if(null!=Wa)return Wa;var e=Ai(t,Di("span","x")),n=e.getBoundingClientRect(),r=Ma(e,0,1).getBoundingClientRect();return Wa=Math.abs(n.left-r.left)>1}function Wi(t,e,n,r){if(!t)return r(e,n,"ltr");for(var i=!1,o=0;o<t.length;++o){var a=t[o];if(a.from<n&&a.to>e||e==n&&a.to==e){r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr");i=!0}}i||r(e,n,"ltr")}function zi(t){return t.level%2?t.to:t.from}function qi(t){return t.level%2?t.from:t.to}function Ui(t){var e=Vr(t);return e?zi(e[0]):0}function Bi(t){var e=Vr(t);return e?qi(bi(e)):t.text.length}function Vi(t,e){var n=Rr(t.doc,e),r=or(n);r!=n&&(e=qr(r));var i=Vr(r),o=i?i[0].level%2?Bi(r):Ui(r):0;return Co(e,o)}function Xi(t,e){for(var n,r=Rr(t.doc,e);n=rr(r);){r=n.find(1,!0).line;e=null}var i=Vr(r),o=i?i[0].level%2?Ui(r):Bi(r):r.text.length;return Co(null==e?qr(r):e,o)}function Gi(t,e){var n=Vi(t,e.line),r=Rr(t.doc,n.line),i=Vr(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return Co(n.line,a?0:o)}return n}function Yi(t,e,n){var r=t[0].level;return e==r?!0:n==r?!1:n>e}function $i(t,e){qa=null;for(var n,r=0;r<t.length;++r){var i=t[r];if(i.from<e&&i.to>e)return r;if(i.from==e||i.to==e){if(null!=n){if(Yi(t,i.level,t[n].level)){i.from!=i.to&&(qa=n);return r}i.from!=i.to&&(qa=r);return n}n=r}}return n}function Ji(t,e,n,r){if(!r)return e+n;do e+=n;while(e>0&&_i(t.text.charAt(e)));return e}function Ki(t,e,n,r){var i=Vr(t);if(!i)return Zi(t,e,n,r);for(var o=$i(i,e),a=i[o],s=Ji(t,e,a.level%2?-n:n,r);;){if(s>a.from&&s<a.to)return s;if(s==a.from||s==a.to){if($i(i,s)==o)return s;a=i[o+=n];return n>0==a.level%2?a.to:a.from}a=i[o+=n];if(!a)return null;s=n>0==a.level%2?Ji(t,a.to,-1,r):Ji(t,a.from,1,r)}}function Zi(t,e,n,r){var i=e+n;if(r)for(;i>0&&_i(t.text.charAt(i));)i+=n;return 0>i||i>t.text.length?null:i}var Qi=/gecko\/\d/i.test(navigator.userAgent),to=/MSIE \d/.test(navigator.userAgent),eo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),no=to||eo,ro=no&&(to?document.documentMode||6:eo[1]),io=/WebKit\//.test(navigator.userAgent),oo=io&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ao=/Chrome\//.test(navigator.userAgent),so=/Opera\//.test(navigator.userAgent),lo=/Apple Computer/.test(navigator.vendor),uo=/KHTML\//.test(navigator.userAgent),co=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),fo=/PhantomJS/.test(navigator.userAgent),ho=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),po=ho||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),go=ho||/Mac/.test(navigator.platform),mo=/win/i.test(navigator.platform),vo=so&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);vo&&(vo=Number(vo[1]));if(vo&&vo>=15){so=!1;io=!0}var yo=go&&(oo||so&&(null==vo||12.11>vo)),bo=Qi||no&&ro>=9,wo=!1,xo=!1;g.prototype=Si({update:function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block";this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(e){this.horiz.style.display="block";this.horiz.style.right=n?r+"px":"0";this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=t.scrollWidth-t.clientWidth+o+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&t.clientHeight>0){0==r&&this.overlayHack();this.checkedOverlay=!0}return{right:n?r:0,bottom:e?r:0}},setScrollLeft:function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t)},setScrollTop:function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t)},overlayHack:function(){var t=go&&!co?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=t;var e=this,n=function(t){li(t)!=e.vert&&li(t)!=e.horiz&&pe(e.cm,Oe)(t)};pa(this.vert,"mousedown",n);pa(this.horiz,"mousedown",n)},clear:function(){var t=this.horiz.parentNode;t.removeChild(this.horiz);t.removeChild(this.vert)}},g.prototype);m.prototype=Si({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype);t.scrollbarModel={"native":g,"null":m};k.prototype.signal=function(t,e){pi(t,e)&&this.events.push(arguments)};k.prototype.finish=function(){for(var t=0;t<this.events.length;t++)ma.apply(null,this.events[t])};var Co=t.Pos=function(t,e){if(!(this instanceof Co))return new Co(t,e);this.line=t;this.ch=e},So=t.cmpPos=function(t,e){return t.line-e.line||t.ch-e.ch};J.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(0!=So(n.anchor,r.anchor)||0!=So(n.head,r.head))return!1}return!0},deepCopy:function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new K(G(this.ranges[e].anchor),G(this.ranges[e].head));return new J(t,this.primIndex)},somethingSelected:function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},contains:function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(So(e,r.from())>=0&&So(t,r.to())<=0)return n}return-1}};K.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var To,ko,Mo,_o={left:0,right:0,top:0,bottom:0},Do=null,Lo=0,Ao=null,No=0,Eo=0,Po=null;no?Po=-.53:Qi?Po=15:ao?Po=-.7:lo&&(Po=-1/3);var jo=function(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail);null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta);return{x:e,y:n}};t.wheelEventPixels=function(t){var e=jo(t);e.x*=Po;e.y*=Po;return e};var Io=new mi,Ho=null,Oo=t.changeEnd=function(t){return t.text?Co(t.from.line+t.text.length-1,bi(t.text).length+(1==t.text.length?t.from.ch:0)):t.to};t.prototype={constructor:t,focus:function(){window.focus();Ae(this);_e(this)},setOption:function(t,e){var n=this.options,r=n[t];if(n[t]!=e||"mode"==t){n[t]=e;Fo.hasOwnProperty(t)&&pe(this,Fo[t])(this,e,r)}},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](jn(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;n<e.length;++n)if(e[n]==t||e[n].name==t){e.splice(n,1);return!0}},addOverlay:ge(function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:e,opaque:n&&n.opaque});this.state.modeGen++;be(this)}),removeOverlay:ge(function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t){e.splice(n,1);this.state.modeGen++;be(this);return}}}),indentLine:ge(function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract");rt(this.doc,t)&&_n(this,t,e,n)}),indentSelection:ge(function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty()){if(i.head.line>n){_n(this,i.head.line,t,!0);n=i.head.line;r==this.doc.sel.primIndex&&kn(this)}}else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;n>l;++l)_n(this,l,t);var u=this.doc.sel.ranges;0==o.ch&&e.length==u.length&&u[r].from().ch>0&&lt(this.doc,r,new K(o,u[r].to()),wa)}}}),getTokenAt:function(t,e){return br(this,t,e)},getLineTokens:function(t,e){return br(this,Co(t),e,!0)},getTokenTypeAt:function(t){t=et(this.doc,t);var e,n=Cr(this,Rr(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("cm-overlay "):-1;return 0>s?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var n=[];if(!Vo.hasOwnProperty(e))return Vo;var r=Vo[e],i=this.getModeAt(t);if("string"==typeof i[e])r[i[e]]&&n.push(r[i[e]]);else if(i[e])for(var o=0;o<i[e].length;o++){var a=r[i[e][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==wi(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(t,e){var n=this.doc;t=tt(n,null==t?n.first+n.size-1:t);return _t(this,t+1,e)},cursorCoords:function(t,e){var n,r=this.doc.sel.primary();n=null==t?r.head:"object"==typeof t?et(this.doc,t):t?r.from():r.to();return Kt(this,n,e||"page")},charCoords:function(t,e){return Jt(this,et(this.doc,t),e||"page")},coordsChar:function(t,e){t=$t(this,t,e||"page");return te(this,t.left,t.top)},lineAtHeight:function(t,e){t=$t(this,{top:t,left:0},e||"page").top;return Ur(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e){var n=!1,r=this.doc.first+this.doc.size-1;if(t<this.doc.first)t=this.doc.first;else if(t>r){t=r;n=!0}var i=Rr(this.doc,t);return Yt(this,i,{top:0,left:0},e||"page").top+(n?this.doc.height-Br(i):0)},defaultTextHeight:function(){return ne(this.display)},defaultCharWidth:function(){return re(this.display)},setGutterMarker:ge(function(t,e,n){return Dn(this.doc,t,"gutter",function(t){var r=t.gutterMarkers||(t.gutterMarkers={});r[e]=n;!n&&Mi(r)&&(t.gutterMarkers=null);return!0})}),clearGutter:ge(function(t){var e=this,n=e.doc,r=n.first;n.iter(function(n){if(n.gutterMarkers&&n.gutterMarkers[t]){n.gutterMarkers[t]=null;we(e,r,"gutter");Mi(n.gutterMarkers)&&(n.gutterMarkers=null)}++r})}),addLineWidget:ge(function(t,e,n){return dr(this,t,e,n)}),removeLineWidget:function(t){t.clear()},lineInfo:function(t){if("number"==typeof t){if(!rt(this.doc,t))return null;var e=t;t=Rr(this.doc,t);if(!t)return null}else{var e=qr(t);if(null==e)return null}return{line:e,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=Kt(this,et(this.doc,t));var a=t.bottom,s=t.left;e.style.position="absolute";e.setAttribute("cm-ignore-events","true");o.sizer.appendChild(e);if("over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom);s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px";e.style.left=e.style.right="";if("right"==i){s=o.sizer.clientWidth-e.offsetWidth;e.style.right="0px"; }else{"left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2);e.style.left=s+"px"}n&&Cn(this,s,a,s+e.offsetWidth,a+e.offsetHeight)},triggerOnKeyDown:ge(Qe),triggerOnKeyPress:ge(nn),triggerOnKeyUp:en,execCommand:function(t){return Yo.hasOwnProperty(t)?Yo[t](this):void 0},findPosH:function(t,e,n,r){var i=1;if(0>e){i=-1;e=-e}for(var o=0,a=et(this.doc,t);e>o;++o){a=An(this.doc,a,i,n,r);if(a.hitSide)break}return a},moveH:ge(function(t,e){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?An(n.doc,r.head,t,e,n.options.rtlMoveVisually):0>t?r.from():r.to()},Ca)}),deleteH:ge(function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ln(this,function(n){var i=An(r,n.head,t,e,!1);return 0>t?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(t,e,n,r){var i=1,o=r;if(0>e){i=-1;e=-e}for(var a=0,s=et(this.doc,t);e>a;++a){var l=Kt(this,s,"div");null==o?o=l.left:l.left=o;s=Nn(this,l,i,n);if(s.hitSide)break}return s},moveV:ge(function(t,e){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(a){if(o)return 0>t?a.from():a.to();var s=Kt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn);i.push(s.left);var l=Nn(n,s,t,e);"page"==e&&a==r.sel.primary()&&Tn(n,null,Jt(n,l,"div").top-s.top);return l},Ca);if(i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(t){var e=this.doc,n=Rr(e,t.line).text,r=t.ch,i=t.ch;if(n){var o=this.getHelper(t,"wordChars");(t.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),s=ki(a,o)?function(t){return ki(t,o)}:/\s/.test(a)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!ki(t)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new K(Co(t.line,r),Co(t.line,i))},toggleOverwrite:function(t){if(null==t||t!=this.state.overwrite){(this.state.overwrite=!this.state.overwrite)?ja(this.display.cursorDiv,"CodeMirror-overwrite"):Pa(this.display.cursorDiv,"CodeMirror-overwrite");ma(this,"overwriteToggle",this,this.state.overwrite)}},hasFocus:function(){return Ni()==this.display.input},scrollTo:ge(function(t,e){(null!=t||null!=e)&&Mn(this);null!=t&&(this.curOp.scrollLeft=t);null!=e&&(this.curOp.scrollTop=e)}),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Nt(this)-this.display.barHeight,width:t.scrollWidth-Nt(this)-this.display.barWidth,clientHeight:Pt(this),clientWidth:Et(this)}},scrollIntoView:ge(function(t,e){if(null==t){t={from:this.doc.sel.primary().head,to:null};null==e&&(e=this.options.cursorScrollMargin)}else"number"==typeof t?t={from:Co(t,0),to:null}:null==t.from&&(t={from:t,to:null});t.to||(t.to=t.from);t.margin=e||0;if(null!=t.from.line){Mn(this);this.curOp.scrollToPos=t}else{var n=Sn(this,Math.min(t.from.left,t.to.left),Math.min(t.from.top,t.to.top)-t.margin,Math.max(t.from.right,t.to.right),Math.max(t.from.bottom,t.to.bottom)+t.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:ge(function(t,e){function n(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t}var r=this;null!=t&&(r.display.wrapper.style.width=n(t));null!=e&&(r.display.wrapper.style.height=n(e));r.options.lineWrapping&&Bt(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){we(r,i,"widget");break}++i});r.curOp.forceUpdate=!0;ma(r,"refresh",this)}),operation:function(t){return de(this,t)},refresh:ge(function(){var t=this.display.cachedTextHeight;be(this);this.curOp.forceUpdate=!0;Vt(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);c(this);(null==t||Math.abs(t-ne(this.display))>.5)&&a(this);ma(this,"refresh",this)}),swapDoc:ge(function(t){var e=this.doc;e.cm=null;Or(this,t);Vt(this);Le(this);this.scrollTo(t.scrollLeft,t.scrollTop);this.curOp.forceScroll=!0;ci(this,"swapDoc",this,e);return e}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};gi(t);var Ro=t.defaults={},Fo=t.optionHandlers={},Wo=t.Init={toString:function(){return"CodeMirror.Init"}};En("value","",function(t,e){t.setValue(e)},!0);En("mode",null,function(t,e){t.doc.modeOption=e;n(t)},!0);En("indentUnit",2,n,!0);En("indentWithTabs",!1);En("smartIndent",!0);En("tabSize",4,function(t){r(t);Vt(t);be(t)},!0);En("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e){t.options.specialChars=new RegExp(e.source+(e.test(" ")?"":"| "),"g");t.refresh()},!0);En("specialCharPlaceholder",Mr,function(t){t.refresh()},!0);En("electricChars",!0);En("rtlMoveVisually",!mo);En("wholeLineUpdateBefore",!0);En("theme","default",function(t){s(t);l(t)},!0);En("keyMap","default",function(e,n,r){var i=jn(n),o=r!=t.Init&&jn(r);o&&o.detach&&o.detach(e,i);i.attach&&i.attach(e,o||null)});En("extraKeys",null);En("lineWrapping",!1,i,!0);En("gutters",[],function(t){d(t.options);l(t)},!0);En("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?T(t.display)+"px":"0";t.refresh()},!0);En("coverGutterNextToScrollbar",!1,function(t){y(t)},!0);En("scrollbarStyle","native",function(t){v(t);y(t);t.display.scrollbars.setScrollTop(t.doc.scrollTop);t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0);En("lineNumbers",!1,function(t){d(t.options);l(t)},!0);En("firstLineNumber",1,l,!0);En("lineNumberFormatter",function(t){return t},l,!0);En("showCursorWhenSelecting",!1,wt,!0);En("resetSelectionOnContextMenu",!0);En("readOnly",!1,function(t,e){if("nocursor"==e){on(t);t.display.input.blur();t.display.disabled=!0}else{t.display.disabled=!1;e||Le(t)}});En("disableInput",!1,function(t,e){e||Le(t)},!0);En("dragDrop",!0);En("cursorBlinkRate",530);En("cursorScrollMargin",0);En("cursorHeight",1,wt,!0);En("singleCursorHeightPerLine",!0,wt,!0);En("workTime",100);En("workDelay",100);En("flattenSpans",!0,r,!0);En("addModeClass",!1,r,!0);En("pollInterval",100);En("undoDepth",200,function(t,e){t.doc.history.undoDepth=e});En("historyEventDelay",1250);En("viewportMargin",10,function(t){t.refresh()},!0);En("maxHighlightLength",1e4,r,!0);En("moveInputWithCursor",!0,function(t,e){e||(t.display.inputDiv.style.top=t.display.inputDiv.style.left=0)});En("tabindex",null,function(t,e){t.display.input.tabIndex=e||""});En("autofocus",null);var zo=t.modes={},qo=t.mimeModes={};t.defineMode=function(e,n){t.defaults.mode||"null"==e||(t.defaults.mode=e);arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2));zo[e]=n};t.defineMIME=function(t,e){qo[t]=e};t.resolveMode=function(e){if("string"==typeof e&&qo.hasOwnProperty(e))e=qo[e];else if(e&&"string"==typeof e.name&&qo.hasOwnProperty(e.name)){var n=qo[e.name];"string"==typeof n&&(n={name:n});e=Ci(n,e);e.name=n.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return t.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}};t.getMode=function(e,n){var n=t.resolveMode(n),r=zo[n.name];if(!r)return t.getMode(e,"text/plain");var i=r(e,n);if(Uo.hasOwnProperty(n.name)){var o=Uo[n.name];for(var a in o)if(o.hasOwnProperty(a)){i.hasOwnProperty(a)&&(i["_"+a]=i[a]);i[a]=o[a]}}i.name=n.name;n.helperType&&(i.helperType=n.helperType);if(n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i};t.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}});t.defineMIME("text/plain","null");var Uo=t.modeExtensions={};t.extendMode=function(t,e){var n=Uo.hasOwnProperty(t)?Uo[t]:Uo[t]={};Si(e,n)};t.defineExtension=function(e,n){t.prototype[e]=n};t.defineDocExtension=function(t,e){la.prototype[t]=e};t.defineOption=En;var Bo=[];t.defineInitHook=function(t){Bo.push(t)};var Vo=t.helpers={};t.registerHelper=function(e,n,r){Vo.hasOwnProperty(e)||(Vo[e]=t[e]={_global:[]});Vo[e][n]=r};t.registerGlobalHelper=function(e,n,r,i){t.registerHelper(e,n,i);Vo[e]._global.push({pred:r,val:i})};var Xo=t.copyState=function(t,e){if(e===!0)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([]));n[r]=i}return n},Go=t.startState=function(t,e,n){return t.startState?t.startState(e,n):!0};t.innerMode=function(t,e){for(;t.innerMode;){var n=t.innerMode(e);if(!n||n.mode==t)break;e=n.state;t=n.mode}return n||{mode:t,state:e}};var Yo=t.commands={selectAll:function(t){t.setSelection(Co(t.firstLine(),0),Co(t.lastLine()),wa)},singleSelection:function(t){t.setSelection(t.getCursor("anchor"),t.getCursor("head"),wa)},killLine:function(t){Ln(t,function(e){if(e.empty()){var n=Rr(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:Co(e.head.line+1,0)}:{from:e.head,to:Co(e.head.line,n)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){Ln(t,function(e){return{from:Co(e.from().line,0),to:et(t.doc,Co(e.to().line+1,0))}})},delLineLeft:function(t){Ln(t,function(t){return{from:Co(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(t){Ln(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return{from:r,to:e.from()}})},delWrappedLineRight:function(t){Ln(t,function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}})},undo:function(t){t.undo()},redo:function(t){t.redo()},undoSelection:function(t){t.undoSelection()},redoSelection:function(t){t.redoSelection()},goDocStart:function(t){t.extendSelection(Co(t.firstLine(),0))},goDocEnd:function(t){t.extendSelection(Co(t.lastLine()))},goLineStart:function(t){t.extendSelectionsBy(function(e){return Vi(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){t.extendSelectionsBy(function(e){return Gi(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){t.extendSelectionsBy(function(e){return Xi(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")},Ca)},goLineLeft:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")},Ca)},goLineLeftSmart:function(t){t.extendSelectionsBy(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?Gi(t,e.head):r},Ca)},goLineUp:function(t){t.moveV(-1,"line")},goLineDown:function(t){t.moveV(1,"line")},goPageUp:function(t){t.moveV(-1,"page")},goPageDown:function(t){t.moveV(1,"page")},goCharLeft:function(t){t.moveH(-1,"char")},goCharRight:function(t){t.moveH(1,"char")},goColumnLeft:function(t){t.moveH(-1,"column")},goColumnRight:function(t){t.moveH(1,"column")},goWordLeft:function(t){t.moveH(-1,"word")},goGroupRight:function(t){t.moveH(1,"group")},goGroupLeft:function(t){t.moveH(-1,"group")},goWordRight:function(t){t.moveH(1,"word")},delCharBefore:function(t){t.deleteH(-1,"char")},delCharAfter:function(t){t.deleteH(1,"char")},delWordBefore:function(t){t.deleteH(-1,"word")},delWordAfter:function(t){t.deleteH(1,"word")},delGroupBefore:function(t){t.deleteH(-1,"group")},delGroupAfter:function(t){t.deleteH(1,"group")},indentAuto:function(t){t.indentSelection("smart")},indentMore:function(t){t.indentSelection("add")},indentLess:function(t){t.indentSelection("subtract")},insertTab:function(t){t.replaceSelection(" ")},insertSoftTab:function(t){for(var e=[],n=t.listSelections(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Sa(t.getLine(o.line),o.ch,r);e.push(new Array(r-a%r+1).join(" "))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){de(t,function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++){var i=e[r].head,o=Rr(t.doc,i.line).text;if(o){i.ch==o.length&&(i=new Co(i.line,i.ch-1));if(i.ch>0){i=new Co(i.line,i.ch+1);t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Co(i.line,i.ch-2),i,"+transpose")}else if(i.line>t.doc.first){var a=Rr(t.doc,i.line-1).text;a&&t.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Co(i.line-1,a.length-1),Co(i.line,1),"+transpose")}}n.push(new K(i,i))}t.setSelections(n)})},newlineAndIndent:function(t){de(t,function(){for(var e=t.listSelections().length,n=0;e>n;n++){var r=t.listSelections()[n];t.replaceRange("\n",r.anchor,r.head,"+input");t.indentLine(r.from().line+1,null,!0);kn(t)}})},toggleOverwrite:function(t){t.toggleOverwrite()}},$o=t.keyMap={};$o.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};$o.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};$o.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};$o["default"]=go?$o.macDefault:$o.pcDefault;t.normalizeKeyMap=function(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=xi(n.split(" "),Pn),o=0;o<i.length;o++){var a,s;if(o==i.length-1){s=n;a=r}else{s=i.slice(0,o+1).join(" ");a="..."}var l=e[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else e[s]=a}delete t[n]}for(var u in e)t[u]=e[u];return t};var Jo=t.lookupKey=function(t,e,n,r){e=jn(e);var i=e.call?e.call(t,r):e[t];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return Jo(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=Jo(t,e.fallthrough[o],n,r);if(a)return a}}},Ko=t.isModifierKey=function(t){var e="string"==typeof t?t:za[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e},Zo=t.keyName=function(t,e){if(so&&34==t.keyCode&&t["char"])return!1;var n=za[t.keyCode],r=n;if(null==r||t.altGraphKey)return!1;t.altKey&&"Alt"!=n&&(r="Alt-"+r);(yo?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r);(yo?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r);!e&&t.shiftKey&&"Shift"!=n&&(r="Shift-"+r);return r};t.fromTextArea=function(e,n){function r(){e.value=u.getValue()}n=n?Si(n):{};n.value=e.value;!n.tabindex&&e.tabindex&&(n.tabindex=e.tabindex);!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder);if(null==n.autofocus){var i=Ni();n.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}if(e.form){pa(e.form,"submit",r);if(!n.leaveSubmitMethodAlone){var o=e.form,a=o.submit;try{var s=o.submit=function(){r();o.submit=a;o.submit();o.submit=s}}catch(l){}}}n.finishInit=function(t){t.save=r;t.getTextArea=function(){return e};t.toTextArea=function(){t.toTextArea=isNaN;r();e.parentNode.removeChild(t.getWrapperElement());e.style.display="";if(e.form){ga(e.form,"submit",r);"function"==typeof e.form.submit&&(e.form.submit=a)}}};e.style.display="none";var u=t(function(t){e.parentNode.insertBefore(t,e.nextSibling)},n);return u};var Qo=t.StringStream=function(t,e){this.pos=this.start=0;this.string=t;this.tabSize=e||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};Qo.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t)var n=e==t;else var n=e&&(t.test?t.test(e):t(e));if(n){++this.pos;return e}},eatWhile:function(t){for(var e=this.pos;this.eat(t););return this.pos>e},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1){this.pos=e;return!0}},backUp:function(t){this.pos-=t},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=Sa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?Sa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Sa(this.string,null,this.tabSize)-(this.lineStart?Sa(this.string,this.lineStart,this.tabSize):0)},match:function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);if(r&&r.index>0)return null;r&&e!==!1&&(this.pos+=r[0].length);return r}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t)){e!==!1&&(this.pos+=t.length);return!0}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}};var ta=t.TextMarker=function(t,e){this.lines=[];this.type=e;this.doc=t};gi(ta);ta.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;e&&ie(t);if(pi(this,"clear")){var n=this.find();n&&ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=zn(a.markedSpans,this);if(t&&!this.collapsed)we(t,qr(a),"text");else if(t){null!=s.to&&(i=qr(a));null!=s.from&&(r=qr(a))}a.markedSpans=qn(a.markedSpans,s);null==s.from&&this.collapsed&&!ur(this.doc,a)&&t&&zr(a,ne(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=or(this.lines[o]),u=f(l);if(u>t.display.maxLineLength){t.display.maxLine=l;t.display.maxLineLength=u;t.display.maxLineChanged=!0}}null!=r&&t&&this.collapsed&&be(t,r,i+1);this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;t&&gt(t.doc)}t&&ci(t,"markerCleared",t,this);e&&ae(t);this.parent&&this.parent.clear()}};ta.prototype.find=function(t,e){null==t&&"bookmark"==this.type&&(t=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=zn(o.markedSpans,this);if(null!=a.from){n=Co(e?o:qr(o),a.from);if(-1==t)return n}if(null!=a.to){r=Co(e?o:qr(o),a.to);if(1==t)return r}}return n&&{from:n,to:r}};ta.prototype.changed=function(){var t=this.find(-1,!0),e=this,n=this.doc.cm;t&&n&&de(n,function(){var r=t.line,i=qr(t.line),o=Rt(n,i);if(o){Ut(o);n.curOp.selectionChanged=n.curOp.forceUpdate=!0}n.curOp.updateMaxLine=!0;if(!ur(e.doc,r)&&null!=e.height){var a=e.height;e.height=null;var s=hr(e)-a;s&&zr(r,r.height+s)}})};ta.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=wi(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)};ta.prototype.detachLine=function(t){this.lines.splice(wi(this.lines,t),1);if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}};var ea=0,na=t.SharedTextMarker=function(t,e){this.markers=t;this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};gi(na);na.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();ci(this,"clear")}};na.prototype.find=function(t,e){return this.primary.find(t,e)};var ra=t.LineWidget=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=t;this.node=e};gi(ra);ra.prototype.clear=function(){var t=this.cm,e=this.line.widgets,n=this.line,r=qr(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=hr(this);de(t,function(){fr(t,n,-o);we(t,r,"widget");zr(n,Math.max(0,n.height-o))})}};ra.prototype.changed=function(){var t=this.height,e=this.cm,n=this.line;this.height=null;var r=hr(this)-t;r&&de(e,function(){e.curOp.forceUpdate=!0;fr(e,n,r);zr(n,n.height+r)})};var ia=t.Line=function(t,e,n){this.text=t;Kn(this,e);this.height=n?n(this):1};gi(ia);ia.prototype.lineNo=function(){return qr(this)};var oa={},aa={};jr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;r>n;++n){var i=this.lines[n];this.height-=i.height;gr(i);ci(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){this.height+=n;this.lines=this.lines.slice(0,t).concat(e).concat(this.lines.slice(t));for(var r=0;r<e.length;++r)e[r].parent=this},iterN:function(t,e,n){for(var r=t+e;r>t;++t)if(n(this.lines[t]))return!0}};Ir.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>t){var o=Math.min(e,i-t),a=r.height;r.removeInner(t,o);this.height-=a-r.height;if(i==o){this.children.splice(n--,1);r.parent=null}if(0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof jr))){var s=[];this.collapse(s);this.children=[new jr(s)];this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length;this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=t){i.insertInner(t,e,n);if(i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new jr(a);i.height-=s.height;this.children.splice(r+1,0,s);s.parent=this}this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new Ir(e);if(t.parent){t.size-=n.size;t.height-=n.height;var r=wi(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new Ir(t.children);i.parent=t;t.children=[i,n];t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>t){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var sa=0,la=t.Doc=function(t,e,n){if(!(this instanceof la))return new la(t,e,n);null==n&&(n=0);Ir.call(this,[new jr([new ia("",null)])]);this.first=n;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=n;var r=Co(n,0);this.sel=Q(r);this.history=new Xr(null);this.id=++sa;this.modeOption=e;"string"==typeof t&&(t=Oa(t));Pr(this,{from:r,to:r,text:t});ht(this,Q(r),wa)};la.prototype=Ci(Ir.prototype,{constructor:la,iter:function(t,e,n){n?this.iterN(t-this.first,e-t,n):this.iterN(this.first,this.first+this.size,t)},insert:function(t,e){for(var n=0,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=Wr(this,this.first,this.first+this.size);return t===!1?e:e.join(t||"\n")},setValue:me(function(t){var e=Co(this.first,0),n=this.first+this.size-1;dn(this,{from:e,to:Co(n,Rr(this,n).text.length),text:Oa(t),origin:"setValue",full:!0},!0);ht(this,Q(e))}),replaceRange:function(t,e,n,r){e=et(this,e);n=n?et(this,n):e;bn(this,t,e,n,r)},getRange:function(t,e,n){var r=Fr(this,et(this,t),et(this,e));return n===!1?r:r.join(n||"\n")},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){return rt(this,t)?Rr(this,t):void 0},getLineNumber:function(t){return qr(t)},getLineHandleVisualStart:function(t){"number"==typeof t&&(t=Rr(this,t));return or(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return et(this,t)},getCursor:function(t){var e,n=this.sel.primary();e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||t===!1?n.to():n.from();return e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:me(function(t,e,n){ut(this,et(this,"number"==typeof t?Co(t,e||0):t),null,n)}),setSelection:me(function(t,e,n){ut(this,et(this,t),et(this,e||t),n)}),extendSelection:me(function(t,e,n){at(this,et(this,t),e&&et(this,e),n)}),extendSelections:me(function(t,e){st(this,it(this,t,e))}),extendSelectionsBy:me(function(t,e){st(this,xi(this.sel.ranges,t),e)}),setSelections:me(function(t,e,n){if(t.length){for(var r=0,i=[];r<t.length;r++)i[r]=new K(et(this,t[r].anchor),et(this,t[r].head));null==e&&(e=Math.min(t.length-1,this.sel.primIndex));ht(this,Z(i,e),n)}}),addSelection:me(function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new K(et(this,t),et(this,e||t)));ht(this,Z(r,r.length-1),n)}),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=Fr(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return t===!1?e:e.join(t||"\n")},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Fr(this,n[r].from(),n[r].to());t!==!1&&(i=i.join(t||"\n"));e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:me(function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:Oa(t[o]),origin:n}}for(var s=e&&"end"!=e&&fn(this,r,e),o=r.length-1;o>=0;o--)dn(this,r[o]);s?ft(this,s):this.cm&&kn(this.cm)}),undo:me(function(){gn(this,"undo")}),redo:me(function(){gn(this,"redo")}),undoSelection:me(function(){gn(this,"undo",!0)}),redoSelection:me(function(){gn(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var r=0;r<t.undone.length;r++)t.undone[r].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){this.history=new Xr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null);return this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:ri(this.history.done),undone:ri(this.history.undone)}},setHistory:function(t){var e=this.history=new Xr(this.history.maxGeneration);e.done=ri(t.done.slice(0),null,!0);e.undone=ri(t.undone.slice(0),null,!0)},addLineClass:me(function(t,e,n){return Dn(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(Ei(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0})}),removeLineClass:me(function(t,e,n){return Dn(this,t,"gutter"==e?"gutter":"class",function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(Ei(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(t,e,n){return In(this,et(this,t),et(this,e),n,"range")},setBookmark:function(t,e){var n={replacedWith:e&&(null==e.nodeType?e.widget:e),insertLeft:e&&e.insertLeft,clearWhenEmpty:!1,shared:e&&e.shared};t=et(this,t);return In(this,t,t,n,"bookmark")},findMarksAt:function(t){t=et(this,t);var e=[],n=Rr(this,t.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=et(this,t);e=et(this,e);var r=[],i=t.line;this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];i==t.line&&t.ch>l.to||null==l.from&&i!=t.line||i==e.line&&l.from>e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i});return r},getAllMarks:function(){var t=[];this.iter(function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)});return t},posFromIndex:function(t){var e,n=this.first;this.iter(function(r){var i=r.text.length+1;if(i>t){e=t;return!0}t-=i;++n});return et(this,Co(n,e))},indexFromPos:function(t){t=et(this,t);var e=t.ch;if(t.line<this.first||t.ch<0)return 0;this.iter(this.first,t.line,function(t){e+=t.text.length+1});return e},copy:function(t){var e=new la(Wr(this,this.first,this.first+this.size),this.modeOption,this.first);e.scrollTop=this.scrollTop;e.scrollLeft=this.scrollLeft;e.sel=this.sel;e.extend=!1;if(t){e.history.undoDepth=this.history.undoDepth;e.setHistory(this.getHistory())}return e},linkedDoc:function(t){t||(t={});var e=this.first,n=this.first+this.size;null!=t.from&&t.from>e&&(e=t.from);null!=t.to&&t.to<n&&(n=t.to);var r=new la(Wr(this,e,n),t.mode||this.modeOption,e);t.sharedHist&&(r.history=this.history);(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist});r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}];Rn(r,On(this));return r},unlinkDoc:function(e){e instanceof t&&(e=e.doc);if(this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==e){this.linked.splice(n,1);e.unlinkDoc(this);Fn(On(this));break}}if(e.history==this.history){var i=[e.id];Hr(e,function(t){i.push(t.id)},!0);e.history=new Xr(null);e.history.done=ri(this.history.done,i);e.history.undone=ri(this.history.undone,i)}},iterLinkedDocs:function(t){Hr(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});la.prototype.eachLine=la.prototype.iter;var ua="iter insert remove copy getEditor".split(" ");for(var ca in la.prototype)la.prototype.hasOwnProperty(ca)&&wi(ua,ca)<0&&(t.prototype[ca]=function(t){return function(){return t.apply(this.doc,arguments)}}(la.prototype[ca]));gi(la);var fa=t.e_preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},ha=t.e_stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},da=t.e_stop=function(t){fa(t);ha(t)},pa=t.on=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={}),i=r[e]||(r[e]=[]);i.push(n)}},ga=t.off=function(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers&&t._handlers[e]; if(!r)return;for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},ma=t.signal=function(t,e){var n=t._handlers&&t._handlers[e];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},va=null,ya=30,ba=t.Pass={toString:function(){return"CodeMirror.Pass"}},wa={scroll:!1},xa={origin:"*mouse"},Ca={origin:"+move"};mi.prototype.set=function(t,e){clearTimeout(this.id);this.id=setTimeout(e,t)};var Sa=t.countColumn=function(t,e,n,r,i){if(null==e){e=t.search(/[^\s\u00a0]/);-1==e&&(e=t.length)}for(var o=r||0,a=i||0;;){var s=t.indexOf(" ",o);if(0>s||s>=e)return a+(e-o);a+=s-o;a+=n-a%n;o=s+1}},Ta=[""],ka=function(t){t.select()};ho?ka=function(t){t.selectionStart=0;t.selectionEnd=t.value.length}:no&&(ka=function(t){try{t.select()}catch(e){}});var Ma,_a=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Da=t.isWordChar=function(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||_a.test(t))},La=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ma=document.createRange?function(t,e,n){var r=document.createRange();r.setEnd(t,n);r.setStart(t,e);return r}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}r.collapse(!0);r.moveEnd("character",n);r.moveStart("character",e);return r};var Aa=t.contains=function(t,e){if(t.contains)return t.contains(e);for(;e=e.parentNode;){11==e.nodeType&&(e=e.host);if(e==t)return!0}};no&&11>ro&&(Ni=function(){try{return document.activeElement}catch(t){return document.body}});var Na,Ea,Pa=t.rmClass=function(t,e){var n=t.className,r=Ei(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}},ja=t.addClass=function(t,e){var n=t.className;Ei(e).test(n)||(t.className+=(n?" ":"")+e)},Ia=!1,Ha=function(){if(no&&9>ro)return!1;var t=Di("div");return"draggable"in t||"dragDrop"in t}(),Oa=t.splitLines=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;r>=e;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");if(-1!=a){n.push(o.slice(0,a));e+=a+1}else{n.push(o);e=i+1}}return n}:function(t){return t.split(/\r\n?|\n/)},Ra=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(e){return!1}}:function(t){try{var e=t.ownerDocument.selection.createRange()}catch(n){}return e&&e.parentElement()==t?0!=e.compareEndPoints("StartToEnd",e):!1},Fa=function(){var t=Di("div");if("oncopy"in t)return!0;t.setAttribute("oncopy","return;");return"function"==typeof t.oncopy}(),Wa=null,za={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};t.keyNames=za;(function(){for(var t=0;10>t;t++)za[t+48]=za[t+96]=String(t);for(var t=65;90>=t;t++)za[t]=String.fromCharCode(t);for(var t=1;12>=t;t++)za[t+111]=za[t+63235]="F"+t})();var qa,Ua=function(){function t(t){return 247>=t?n.charAt(t):t>=1424&&1524>=t?"R":t>=1536&&1773>=t?r.charAt(t-1536):t>=1774&&2220>=t?"r":t>=8192&&8203>=t?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t;this.from=e;this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,u="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],h=0;c>h;++h)f.push(r=t(n.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=u;c>h;++h){var r=f[h];if("1"==r&&"r"==p)f[h]="n";else if(a.test(r)){p=r;"r"==r&&(f[h]="R")}}for(var h=1,d=f[0];c-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d);d=r}for(var h=0;c>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var g=h+1;c>g&&"%"==f[g];++g);for(var m=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",v=h;g>v;++v)f[v]=m;h=g-1}}for(var h=0,p=u;c>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),m=y||b?"L":"R",v=h;g>v;++v)f[v]=m;h=g-1}for(var w,x=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);x.push(new e(0,C,h))}else{var S=h,T=x.length;for(++h;c>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(l.test(f[v])){v>S&&x.splice(T,0,new e(1,S,v));var k=v;for(++v;h>v&&l.test(f[v]);++v);x.splice(T,0,new e(2,k,v));S=v}else++v;h>S&&x.splice(T,0,new e(1,S,h))}if(1==x[0].level&&(w=n.match(/^\s+/))){x[0].from=w[0].length;x.unshift(new e(0,0,w[0].length))}if(1==bi(x).level&&(w=n.match(/\s+$/))){bi(x).to-=w[0].length;x.push(new e(0,c-w[0].length,c))}x[0].level!=bi(x).level&&x.push(new e(x[0].level,c,c));return x}}();t.version="4.13.0";return t})},{}],11:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("javascript",function(e,n){function r(t){for(var e,n=!1,r=!1;null!=(e=t.next());){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function i(t,e,n){gt=t;mt=n;return e}function o(t,e){var n=t.next();if('"'==n||"'"==n){e.tokenize=a(n);return e.tokenize(t,e)}if("."==n&&t.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==n&&t.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return i(n);if("="==n&&t.eat(">"))return i("=>","operator");if("0"==n&&t.eat(/x/i)){t.eatWhile(/[\da-f]/i);return i("number","number")}if(/\d/.test(n)){t.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return i("number","number")}if("/"==n){if(t.eat("*")){e.tokenize=s;return s(t,e)}if(t.eat("/")){t.skipToEnd();return i("comment","comment")}if("operator"==e.lastType||"keyword c"==e.lastType||"sof"==e.lastType||/^[\[{}\(,;:]$/.test(e.lastType)){r(t);t.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return i("regexp","string-2")}t.eatWhile(Tt);return i("operator","operator",t.current())}if("`"==n){e.tokenize=l;return l(t,e)}if("#"==n){t.skipToEnd();return i("error","error")}if(Tt.test(n)){t.eatWhile(Tt);return i("operator","operator",t.current())}if(Ct.test(n)){t.eatWhile(Ct);var o=t.current(),u=St.propertyIsEnumerable(o)&&St[o];return u&&"."!=e.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(t){return function(e,n){var r,a=!1;if(bt&&"@"==e.peek()&&e.match(kt)){n.tokenize=o;return i("jsonld-keyword","meta")}for(;null!=(r=e.next())&&(r!=t||a);)a=!a&&"\\"==r;a||(n.tokenize=o);return i("string","string")}}function s(t,e){for(var n,r=!1;n=t.next();){if("/"==n&&r){e.tokenize=o;break}r="*"==n}return i("comment","comment")}function l(t,e){for(var n,r=!1;null!=(n=t.next());){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",t.current())}function u(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=t.string.charAt(o),s=Mt.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ct.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(e.fatArrowAt=o)}}function c(t,e,n,r,i,o){this.indented=t;this.column=e;this.type=n;this.prev=i;this.info=o;null!=r&&(this.align=r)}function f(t,e){for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==e)return!0}function h(t,e,n,r,i){var o=t.cc;Dt.state=t;Dt.stream=i;Dt.marked=null,Dt.cc=o;Dt.style=e;t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);for(;;){var a=o.length?o.pop():wt?C:x;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Dt.marked?Dt.marked:"variable"==n&&f(t,r)?"variable-2":e}}}function d(){for(var t=arguments.length-1;t>=0;t--)Dt.cc.push(arguments[t])}function p(){d.apply(null,arguments);return!0}function g(t){function e(e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}var r=Dt.state;if(r.context){Dt.marked="def";if(e(r.localVars))return;r.localVars={name:t,next:r.localVars}}else{if(e(r.globalVars))return;n.globalVars&&(r.globalVars={name:t,next:r.globalVars})}}function m(){Dt.state.context={prev:Dt.state.context,vars:Dt.state.localVars};Dt.state.localVars=Lt}function v(){Dt.state.localVars=Dt.state.context.vars;Dt.state.context=Dt.state.context.prev}function y(t,e){var n=function(){var n=Dt.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new c(r,Dt.stream.column(),t,null,n.lexical,e)};n.lex=!0;return n}function b(){var t=Dt.state;if(t.lexical.prev){")"==t.lexical.type&&(t.indented=t.lexical.indented);t.lexical=t.lexical.prev}}function w(t){function e(n){return n==t?p():";"==t?d():p(e)}return e}function x(t,e){if("var"==t)return p(y("vardef",e.length),U,w(";"),b);if("keyword a"==t)return p(y("form"),C,x,b);if("keyword b"==t)return p(y("form"),x,b);if("{"==t)return p(y("}"),W,b);if(";"==t)return p();if("if"==t){"else"==Dt.state.lexical.info&&Dt.state.cc[Dt.state.cc.length-1]==b&&Dt.state.cc.pop()();return p(y("form"),C,x,b,Y)}return"function"==t?p(tt):"for"==t?p(y("form"),$,x,b):"variable"==t?p(y("stat"),P):"switch"==t?p(y("form"),C,y("}","switch"),w("{"),W,b,b):"case"==t?p(C,w(":")):"default"==t?p(w(":")):"catch"==t?p(y("form"),m,w("("),et,w(")"),x,b,v):"module"==t?p(y("form"),m,at,v,b):"class"==t?p(y("form"),nt,b):"export"==t?p(y("form"),st,b):"import"==t?p(y("form"),lt,b):d(y("stat"),C,w(";"),b)}function C(t){return T(t,!1)}function S(t){return T(t,!0)}function T(t,e){if(Dt.state.fatArrowAt==Dt.stream.start){var n=e?E:N;if("("==t)return p(m,y(")"),R(B,")"),b,w("=>"),n,v);if("variable"==t)return d(m,B,w("=>"),n,v)}var r=e?D:_;return _t.hasOwnProperty(t)?p(r):"function"==t?p(tt,r):"keyword c"==t?p(e?M:k):"("==t?p(y(")"),k,dt,w(")"),b,r):"operator"==t||"spread"==t?p(e?S:C):"["==t?p(y("]"),ft,b,r):"{"==t?F(I,"}",null,r):"quasi"==t?d(L,r):p()}function k(t){return t.match(/[;\}\)\],]/)?d():d(C)}function M(t){return t.match(/[;\}\)\],]/)?d():d(S)}function _(t,e){return","==t?p(C):D(t,e,!1)}function D(t,e,n){var r=0==n?_:D,i=0==n?C:S;return"=>"==t?p(m,n?E:N,v):"operator"==t?/\+\+|--/.test(e)?p(r):"?"==e?p(C,w(":"),i):p(i):"quasi"==t?d(L,r):";"!=t?"("==t?F(S,")","call",r):"."==t?p(j,r):"["==t?p(y("]"),k,w("]"),b,r):void 0:void 0}function L(t,e){return"quasi"!=t?d():"${"!=e.slice(e.length-2)?p(L):p(C,A)}function A(t){if("}"==t){Dt.marked="string-2";Dt.state.tokenize=l;return p(L)}}function N(t){u(Dt.stream,Dt.state);return d("{"==t?x:C)}function E(t){u(Dt.stream,Dt.state);return d("{"==t?x:S)}function P(t){return":"==t?p(b,x):d(_,w(";"),b)}function j(t){if("variable"==t){Dt.marked="property";return p()}}function I(t,e){if("variable"==t||"keyword"==Dt.style){Dt.marked="property";return p("get"==e||"set"==e?H:O)}if("number"==t||"string"==t){Dt.marked=bt?"property":Dt.style+" property";return p(O)}return"jsonld-keyword"==t?p(O):"["==t?p(C,w("]"),O):void 0}function H(t){if("variable"!=t)return d(O);Dt.marked="property";return p(tt)}function O(t){return":"==t?p(S):"("==t?d(tt):void 0}function R(t,e){function n(r){if(","==r){var i=Dt.state.lexical;"call"==i.info&&(i.pos=(i.pos||0)+1);return p(t,n)}return r==e?p():p(w(e))}return function(r){return r==e?p():d(t,n)}}function F(t,e,n){for(var r=3;r<arguments.length;r++)Dt.cc.push(arguments[r]);return p(y(e,n),R(t,e),b)}function W(t){return"}"==t?p():d(x,W)}function z(t){return xt&&":"==t?p(q):void 0}function q(t){if("variable"==t){Dt.marked="variable-3";return p()}}function U(){return d(B,z,X,G)}function B(t,e){if("variable"==t){g(e);return p()}return"["==t?F(B,"]"):"{"==t?F(V,"}"):void 0}function V(t,e){if("variable"==t&&!Dt.stream.match(/^\s*:/,!1)){g(e);return p(X)}"variable"==t&&(Dt.marked="property");return p(w(":"),B,X)}function X(t,e){return"="==e?p(S):void 0}function G(t){return","==t?p(U):void 0}function Y(t,e){return"keyword b"==t&&"else"==e?p(y("form","else"),x,b):void 0}function $(t){return"("==t?p(y(")"),J,w(")"),b):void 0}function J(t){return"var"==t?p(U,w(";"),Z):";"==t?p(Z):"variable"==t?p(K):d(C,w(";"),Z)}function K(t,e){if("in"==e||"of"==e){Dt.marked="keyword";return p(C)}return p(_,Z)}function Z(t,e){if(";"==t)return p(Q);if("in"==e||"of"==e){Dt.marked="keyword";return p(C)}return d(C,w(";"),Q)}function Q(t){")"!=t&&p(C)}function tt(t,e){if("*"==e){Dt.marked="keyword";return p(tt)}if("variable"==t){g(e);return p(tt)}return"("==t?p(m,y(")"),R(et,")"),b,x,v):void 0}function et(t){return"spread"==t?p(et):d(B,z)}function nt(t,e){if("variable"==t){g(e);return p(rt)}}function rt(t,e){return"extends"==e?p(C,rt):"{"==t?p(y("}"),it,b):void 0}function it(t,e){if("variable"==t||"keyword"==Dt.style){Dt.marked="property";return"get"==e||"set"==e?p(ot,tt,it):p(tt,it)}if("*"==e){Dt.marked="keyword";return p(it)}return";"==t?p(it):"}"==t?p():void 0}function ot(t){if("variable"!=t)return d();Dt.marked="property";return p()}function at(t,e){if("string"==t)return p(x);if("variable"==t){g(e);return p(ct)}}function st(t,e){if("*"==e){Dt.marked="keyword";return p(ct,w(";"))}if("default"==e){Dt.marked="keyword";return p(C,w(";"))}return d(x)}function lt(t){return"string"==t?p():d(ut,ct)}function ut(t,e){if("{"==t)return F(ut,"}");"variable"==t&&g(e);return p()}function ct(t,e){if("from"==e){Dt.marked="keyword";return p(C)}}function ft(t){return"]"==t?p():d(S,ht)}function ht(t){return"for"==t?d(dt,w("]")):","==t?p(R(M,"]")):d(R(S,"]"))}function dt(t){return"for"==t?p($,dt):"if"==t?p(C,dt):void 0}function pt(t,e){return"operator"==t.lastType||","==t.lastType||Tt.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}var gt,mt,vt=e.indentUnit,yt=n.statementIndent,bt=n.jsonld,wt=n.json||bt,xt=n.typescript,Ct=n.wordCharacters||/[\w$\xa1-\uffff]/,St=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("operator"),o={type:"atom",style:"atom"},a={"if":t("if"),"while":e,"with":e,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"debugger":r,"var":t("var"),"const":t("var"),let:t("var"),"function":t("function"),"catch":t("catch"),"for":t("for"),"switch":t("switch"),"case":t("case"),"default":t("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":t("this"),module:t("module"),"class":t("class"),"super":t("atom"),"yield":r,"export":t("export"),"import":t("import"),"extends":r};if(xt){var s={type:"variable",style:"variable-3"},l={"interface":t("interface"),"extends":t("extends"),constructor:t("constructor"),"public":t("public"),"private":t("private"),"protected":t("protected"),"static":t("static"),string:s,number:s,bool:s,any:s};for(var u in l)a[u]=l[u]}return a}(),Tt=/[+\-*&%=<>!?|~^]/,kt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Mt="([{}])",_t={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Dt={state:null,column:null,marked:null,cc:null},Lt={name:"this",next:{name:"arguments"}};b.lex=!0;return{startState:function(t){var e={tokenize:o,lastType:"sof",cc:[],lexical:new c((t||0)-vt,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars);return e},token:function(t,e){if(t.sol()){e.lexical.hasOwnProperty("align")||(e.lexical.align=!1);e.indented=t.indentation();u(t,e)}if(e.tokenize!=s&&t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"==gt)return n;e.lastType="operator"!=gt||"++"!=mt&&"--"!=mt?gt:"incdec";return h(e,n,gt,mt,t)},indent:function(e,r){if(e.tokenize==s)return t.Pass;if(e.tokenize!=o)return 0;var i=r&&r.charAt(0),a=e.lexical;if(!/^\s*else\b/.test(r))for(var l=e.cc.length-1;l>=0;--l){var u=e.cc[l];if(u==b)a=a.prev;else if(u!=Y)break}"stat"==a.type&&"}"==i&&(a=a.prev);yt&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,f=i==c;return"vardef"==c?a.indented+("operator"==e.lastType||","==e.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+vt:"stat"==c?a.indented+(pt(e,r)?yt||vt:0):"switch"!=a.info||f||0==n.doubleIndentSwitch?a.align?a.column+(f?0:1):a.indented+(f?0:vt):a.indented+(/^(?:case|default)\b/.test(r)?vt:2*vt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:wt?null:"/*",blockCommentEnd:wt?null:"*/",lineComment:wt?null:"//",fold:"brace",helperType:wt?"json":"javascript",jsonldMode:bt,jsonMode:wt}});t.registerHelper("wordChars","javascript",/[\w$]/);t.defineMIME("text/javascript","javascript");t.defineMIME("text/ecmascript","javascript");t.defineMIME("application/javascript","javascript");t.defineMIME("application/x-javascript","javascript");t.defineMIME("application/ecmascript","javascript");t.defineMIME("application/json",{name:"javascript",json:!0});t.defineMIME("application/x-json",{name:"javascript",json:!0});t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0});t.defineMIME("text/typescript",{name:"javascript",typescript:!0});t.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":10}],12:[function(e,n,r){(function(i){"object"==typeof r&&"object"==typeof n?i(e("../../lib/codemirror")):"function"==typeof t&&t.amd?t(["../../lib/codemirror"],i):i(CodeMirror)})(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){e.tokenize=n;return n(t,e)}var r=t.next();if("<"==r){if(t.eat("!")){if(t.eat("["))return t.match("CDATA[")?n(a("atom","]]>")):null;if(t.match("--"))return n(a("comment","-->"));if(t.match("DOCTYPE",!0,!0)){t.eatWhile(/[\w\._\-]/);return n(s(1))}return null}if(t.eat("?")){t.eatWhile(/[\w\._\-]/);e.tokenize=a("meta","?>");return"meta"}S=t.eat("/")?"closeTag":"openTag";e.tokenize=i;return"tag bracket"}if("&"==r){var o;o=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";");return o?"atom":"error"}t.eatWhile(/[^&<]/);return null}function i(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">")){e.tokenize=r;S=">"==n?"endTag":"selfcloseTag";return"tag bracket"}if("="==n){S="equals";return null}if("<"==n){e.tokenize=r;e.state=f;e.tagName=e.tagStart=null;var i=e.tokenize(t,e);return i?i+" tag error":"tag error"}if(/[\'\"]/.test(n)){e.tokenize=o(n);e.stringStartCol=t.column();return e.tokenize(t,e)}t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}function o(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=i;break}return"string"};e.isInAttribute=!0;return e}function a(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=r;break}n.next()}return t}}function s(t){return function(e,n){for(var i;null!=(i=e.next());){if("<"==i){n.tokenize=s(t+1);return n.tokenize(e,n)}if(">"==i){if(1==t){n.tokenize=r;break}n.tokenize=s(t-1);return n.tokenize(e,n)}}return"meta"}}function l(t,e,n){this.prev=t.context;this.tagName=e;this.indent=t.indented;this.startOfLine=n;(k.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function u(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;n=t.context.tagName;if(!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(e))return;u(t)}}function f(t,e,n){if("openTag"==t){n.tagStart=e.column();return h}return"closeTag"==t?d:f}function h(t,e,n){if("word"==t){n.tagName=e.current();T="tag";return m}T="error";return h}function d(t,e,n){if("word"==t){var r=e.current();n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&u(n);if(n.context&&n.context.tagName==r){T="tag";return p}T="tag error";return g}T="error";return g}function p(t,e,n){if("endTag"!=t){T="error";return p}u(n);return f}function g(t,e,n){T="error";return p(t,e,n)}function m(t,e,n){if("word"==t){T="attribute";return v}if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;n.tagName=n.tagStart=null;if("selfcloseTag"==t||k.autoSelfClosers.hasOwnProperty(r))c(n,r);else{c(n,r);n.context=new l(n,r,i==n.indented)}return f}T="error";return m}function v(t,e,n){if("equals"==t)return y;k.allowMissing||(T="error");return m(t,e,n)}function y(t,e,n){if("string"==t)return b;if("word"==t&&k.allowUnquoted){T="string";return m}T="error";return m(t,e,n)}function b(t,e,n){return"string"==t?b:m(t,e,n)}var w=e.indentUnit,x=n.multilineTagIndentFactor||1,C=n.multilineTagIndentPastTag;null==C&&(C=!0);var S,T,k=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){!e.tagName&&t.sol()&&(e.indented=t.indentation());if(t.eatSpace())return null;S=null;var n=e.tokenize(t,e);if((n||S)&&"comment"!=n){T=null;e.state=e.state(S||n,t,e);T&&(n="error"==T?n+" error":T)}return n},indent:function(e,n,o){var a=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(a&&a.noIndent)return t.Pass;if(e.tokenize!=i&&e.tokenize!=r)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return C?e.tagStart+e.tagName.length+2:e.tagStart+w*x;if(M&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;a;){if(a.tagName==s[2]){a=a.prev;break}if(!k.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(s)for(;a;){var l=k.contextGrabbers[a.tagName];if(!l||!l.hasOwnProperty(s[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+w:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}});t.defineMIME("text/xml","xml");t.defineMIME("application/xml","xml");t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],13:[function(e,n,r){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function a(t){return!isNaN(t)}function s(t){return{left:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){arguments.length<3&&(r=0);arguments.length<4&&(i=e.length);for(;i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function l(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function c(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===va||t[0]===ya?ya+t:t}function d(t){return(t+="")[0]===ya?t.slice(1):t}function p(t){return h(t)in this._}function g(t){return(t=h(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(d(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function w(t){return t}function x(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function C(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=ba.length;r>n;++n){var i=ba[n]+e;if(i in t)return i}}function S(){}function T(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new f;e.on=function(e,i){var o,a=r.get(e);if(arguments.length<2)return a&&a.on;if(a){a.on=null;n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1));r.remove(e)}i&&n.push(r.set(e,{on:i}));return t};return e}function M(){ia.event.preventDefault()}function _(){for(var t,e=ia.event;t=e.sourceEvent;)e=t;return e}function D(t){for(var e=new T,n=0,r=arguments.length;++n<r;)e[arguments[n]]=k(e);e.of=function(n,r){return function(i){try{var o=i.sourceEvent=ia.event;i.target=t;ia.event=i;e[i.type].apply(n,r)}finally{ia.event=o}}};return e}function L(t){xa(t,ka);return t}function A(t){return"function"==typeof t?t:function(){return Ca(t,this)}}function N(t){return"function"==typeof t?t:function(){return Sa(t,this)}}function E(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}t=ia.ns.qualify(t);return null==e?t.local?r:n:"function"==typeof e?t.local?s:a:t.local?o:i}function P(t){return t.trim().replace(/\s+/g," ")}function j(t){return new RegExp("(?:^|\\s+)"+ia.requote(t)+"(?:\\s+|$)","g")}function I(t){return(t+"").trim().split(/^|\s+/)}function H(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=I(t).map(O);var i=t.length;return"function"==typeof e?r:n}function O(t){var e=j(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";if(r){e.lastIndex=0;e.test(i)||n.setAttribute("class",P(i+" "+t))}else n.setAttribute("class",P(i.replace(e," ")))}}function R(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function F(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function W(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ia.ns.qualify(t)).local?n:e}function z(){var t=this.parentNode;t&&t.removeChild(this)}function q(t){return{__data__:t}}function U(t){return function(){return Ta(this,t)}}function B(t){arguments.length||(t=i);return function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,n);return t}function X(t){xa(t,_a);return t}function G(t){var e,n;return function(r,i,o){var a,s=t[o].update,l=s.length;o!=n&&(n=o,e=0);i>=e&&(e=i+1);for(;!(a=s[e])&&++e<l;);return a}}function Y(t,e,n){function r(){var e=this[a];if(e){this.removeEventListener(t,e,e.$);delete this[a]}}function i(){var i=l(e,aa(arguments));r.call(this);this.addEventListener(t,this[a]=i,i.$=n);i._=e}function o(){var e,n=new RegExp("^__on([^.]+)"+ia.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];this.removeEventListener(e[1],i,i.$);delete this[r]}}var a="__on"+t,s=t.indexOf("."),l=$;s>0&&(t=t.slice(0,s));var u=Da.get(t);u&&(t=u,l=J);return s?e?i:r:e?S:o}function $(t,e){return function(n){var r=ia.event;ia.event=n;e[0]=this.__data__;try{t.apply(this,e)}finally{ia.event=r}}}function J(t,e){var n=$(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function K(t){var n=".dragsuppress-"+ ++Aa,i="click"+n,o=ia.select(r(t)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);null==La&&(La="onselectstart"in t?!1:C(t.style,"userSelect"));if(La){var a=e(t).style,s=a[La];a[La]="none"}return function(t){o.on(n,null);La&&(a[La]=s);if(t){var e=function(){o.on(i,null)};o.on(i,function(){M();e()},!0);setTimeout(e,0)}}}function Z(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Na){var o=r(t);if(o.scrollX||o.scrollY){n=ia.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=n[0][0].getScreenCTM();Na=!(a.f||a.e);n.remove()}}Na?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY);i=i.matrixTransform(t.getScreenCTM().inverse());return[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function Q(){return ia.event.changedTouches[0].identifier}function tt(t){return t>0?1:0>t?-1:0}function et(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function nt(t){return t>1?0:-1>t?ja:Math.acos(t); }function rt(t){return t>1?Oa:-1>t?-Oa:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function at(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ut(t,e,n){return this instanceof ut?void(this.h=+t,this.s=+e,this.l=+n):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):St(""+t,Tt,ut):new ut(t,e,n)}function ct(t,e,n){function r(t){t>360?t-=360:0>t&&(t+=360);return 60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;t=isNaN(t)?0:(t%=360)<0?t+360:t;e=isNaN(e)?0:0>e?0:e>1?1:e;n=0>n?0:n>1?1:n;a=.5>=n?n*(1+e):n+e-n*e;o=2*n-a;return new bt(i(t+120),i(t),i(t-120))}function ft(t,e,n){return this instanceof ft?void(this.h=+t,this.c=+e,this.l=+n):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof dt?gt(t.l,t.a,t.b):gt((t=kt((t=ia.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,n)}function ht(t,e,n){isNaN(t)&&(t=0);isNaN(e)&&(e=0);return new dt(n,Math.cos(t*=Ra)*e,Math.sin(t)*e)}function dt(t,e,n){return this instanceof dt?void(this.l=+t,this.a=+e,this.b=+n):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):kt((t=bt(t)).r,t.g,t.b):new dt(t,e,n)}function pt(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;i=mt(i)*$a;r=mt(r)*Ja;o=mt(o)*Ka;return new bt(yt(3.2404542*i-1.5371385*r-.4985314*o),yt(-.969266*i+1.8760108*r+.041556*o),yt(.0556434*i-.2040259*r+1.0572252*o))}function gt(t,e,n){return t>0?new ft(Math.atan2(n,e)*Fa,Math.sqrt(e*e+n*n),t):new ft(0/0,0/0,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function vt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,n){return this instanceof bt?void(this.r=~~t,this.g=~~e,this.b=~~n):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):St(""+t,bt,ct):new bt(t,e,n)}function wt(t){return new bt(t>>16,t>>8&255,255&t)}function xt(t){return wt(t)+""}function Ct(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function St(t,e,n){var r,i,o,a=0,s=0,l=0;r=/([a-z]+)\((.*)\)/i.exec(t);if(r){i=r[2].split(",");switch(r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(_t(i[0]),_t(i[1]),_t(i[2]))}}if(o=ts.get(t.toLowerCase()))return e(o.r,o.g,o.b);if(null!=t&&"#"===t.charAt(0)&&!isNaN(o=parseInt(t.slice(1),16)))if(4===t.length){a=(3840&o)>>4;a=a>>4|a;s=240&o;s=s>>4|s;l=15&o;l=l<<4|l}else if(7===t.length){a=(16711680&o)>>16;s=(65280&o)>>8;l=255&o}return e(a,s,l)}function Tt(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,l=(a+o)/2;if(s){i=.5>l?s/(a+o):s/(2-a-o);r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4;r*=60}else{r=0/0;i=l>0&&1>l?0:r}return new ut(r,i,l)}function kt(t,e,n){t=Mt(t);e=Mt(e);n=Mt(n);var r=vt((.4124564*t+.3575761*e+.1804375*n)/$a),i=vt((.2126729*t+.7151522*e+.072175*n)/Ja),o=vt((.0193339*t+.119192*e+.9503041*n)/Ka);return dt(116*i-16,500*(r-i),200*(i-o))}function Mt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _t(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Dt(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,n,r){2===arguments.length&&"function"==typeof n&&(r=n,n=null);return At(e,n,t,r)}}function At(t,e,n,r){function i(){var t,e=l.status;if(!e&&Et(l)||e>=200&&300>e||304===e){try{t=n.call(o,l)}catch(r){a.error.call(o,r);return}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=ia.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,u=null;!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest);"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()};l.onprogress=function(t){var e=ia.event;ia.event=t;try{a.progress.call(o,l)}finally{ia.event=e}};o.header=function(t,e){t=(t+"").toLowerCase();if(arguments.length<2)return s[t];null==e?delete s[t]:s[t]=e+"";return o};o.mimeType=function(t){if(!arguments.length)return e;e=null==t?null:t+"";return o};o.responseType=function(t){if(!arguments.length)return u;u=t;return o};o.response=function(t){n=t;return o};["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(aa(arguments)))}});o.send=function(n,r,i){2===arguments.length&&"function"==typeof r&&(i=r,r=null);l.open(n,t,!0);null==e||"accept"in s||(s.accept=e+",*/*");if(l.setRequestHeader)for(var c in s)l.setRequestHeader(c,s[c]);null!=e&&l.overrideMimeType&&l.overrideMimeType(e);null!=u&&(l.responseType=u);null!=i&&o.on("error",i).on("load",function(t){i(null,t)});a.beforesend.call(o,l);l.send(null==r?null:r);return o};o.abort=function(){l.abort();return o};ia.rebind(o,a,"on");return null==r?o:o.get(Nt(r))}function Nt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Et(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(){var t=jt(),e=It()-t;if(e>24){if(isFinite(e)){clearTimeout(is);is=setTimeout(Pt,e)}rs=0}else{rs=1;as(Pt)}}function jt(){var t=Date.now();os=es;for(;os;){t>=os.t&&(os.f=os.c(t-os.t));os=os.n}return t}function It(){for(var t,e=es,n=1/0;e;)if(e.f)e=t?t.n=e.n:es=e.n;else{e.t<n&&(n=e.t);e=(t=e).n}ns=t;return n}function Ht(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ot(t,e){var n=Math.pow(10,3*ma(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function Rt(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,s=r[0],l=0;i>0&&s>0;){l+s+1>e&&(s=Math.max(1,e-l));o.push(t.substring(i-=s,i+s));if((l+=s+1)>e)break;s=r[a=(a+1)%r.length]}return o.reverse().join(n)}:w;return function(t){var n=ls.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",l=n[4]||"",u=n[5],c=+n[6],f=n[7],h=n[8],d=n[9],p=1,g="",m="",v=!1,y=!0;h&&(h=+h.substring(1));if(u||"0"===r&&"="===a){u=r="0";a="="}switch(d){case"n":f=!0;d="g";break;case"%":p=100;m="%";d="f";break;case"p":p=100;m="%";d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0;h=0;break;case"s":p=-1;d="r"}"$"===l&&(g=i[0],m=i[1]);"r"!=d||h||(d="g");null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):("e"==d||"f"==d)&&(h=Math.max(0,Math.min(20,h))));d=us.get(d)||Ft;var b=u&&f;return function(t){var n=m;if(v&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var l=ia.formatPrefix(t,h);t=l.scale(t);n=l.symbol+m}else t*=p;t=d(t,h);var w,x,C=t.lastIndexOf(".");if(0>C){var S=y?t.lastIndexOf("e"):-1;0>S?(w=t,x=""):(w=t.substring(0,S),x=t.substring(S))}else{w=t.substring(0,C);x=e+t.substring(C+1)}!u&&f&&(w=o(w,1/0));var T=g.length+w.length+x.length+(b?0:i.length),k=c>T?new Array(T=c-T+1).join(r):"";b&&(w=o(k+w,k.length?c-x.length:1/0));i+=g;t=w+x;return("<"===a?i+t+k:">"===a?k+i+t:"^"===a?k.substring(0,T>>=1)+i+t+k.substring(T):i+(b?t:k+t))+n}}}function Ft(t){return t+""}function Wt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function zt(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){e(n=t(new fs(n-1)),1);return n}function o(t,n){e(t=new fs(+t),n);return t}function a(t,r,o){var a=i(t),s=[];if(o>1)for(;r>a;){n(a)%o||s.push(new Date(+a));e(a,1)}else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{fs=Wt;var r=new Wt;r._=t;return a(r,e,n)}finally{fs=Date}}t.floor=t;t.round=r;t.ceil=i;t.offset=o;t.range=a;var l=t.utc=qt(t);l.floor=l;l.round=qt(r);l.ceil=qt(i);l.offset=qt(o);l.range=s;return t}function qt(t){return function(e,n){try{fs=Wt;var r=new Wt;r._=e;return t(r,n)._}finally{fs=Date}}}function Ut(t){function e(t){function e(e){for(var n,i,o,a=[],s=-1,l=0;++s<r;)if(37===t.charCodeAt(s)){a.push(t.slice(l,s));null!=(i=ds[n=t.charAt(++s)])&&(n=t.charAt(++s));(o=D[n])&&(n=o(e,null==i?"e"===n?" ":"0":i));a.push(n);l=s+1}a.push(t.slice(l,s));return a.join("")}var r=t.length;e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=n(r,t,e,0);if(i!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var o=null!=r.Z&&fs!==Wt,a=new(o?Wt:fs);if("j"in r)a.setFullYear(r.y,0,r.j);else if("w"in r&&("W"in r||"U"in r)){a.setFullYear(r.y,0,1);a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)}else a.setFullYear(r.y,r.m,r.d);a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L);return o?a._:a};e.toString=function(){return t};return e}function n(t,e,n,r){for(var i,o,a,s=0,l=e.length,u=n.length;l>s;){if(r>=u)return-1;i=e.charCodeAt(s++);if(37===i){a=e.charAt(s++);o=L[a in ds?e.charAt(s++):a];if(!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.w=S.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=x.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){M.lastIndex=0;var r=M.exec(e.slice(n));return r?(t.m=_.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){T.lastIndex=0;var r=T.exec(e.slice(n));return r?(t.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,D.c.toString(),e,r)}function l(t,e,r){return n(t,D.x.toString(),e,r)}function u(t,e,r){return n(t,D.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,g=t.days,m=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{fs=Wt;var e=new fs;e._=t;return r(e)}finally{fs=Date}}var r=e(t);n.parse=function(t){try{fs=Wt;var e=r.parse(t);return e&&e._}finally{fs=Date}};n.toString=r.toString;return n};e.multi=e.utc.multi=ue;var b=ia.map(),w=Vt(g),x=Xt(g),C=Vt(m),S=Xt(m),T=Vt(v),k=Xt(v),M=Vt(y),_=Xt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var D={a:function(t){return m[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Bt(t.getDate(),e,2)},e:function(t,e){return Bt(t.getDate(),e,2)},H:function(t,e){return Bt(t.getHours(),e,2)},I:function(t,e){return Bt(t.getHours()%12||12,e,2)},j:function(t,e){return Bt(1+cs.dayOfYear(t),e,3)},L:function(t,e){return Bt(t.getMilliseconds(),e,3)},m:function(t,e){return Bt(t.getMonth()+1,e,2)},M:function(t,e){return Bt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Bt(t.getSeconds(),e,2)},U:function(t,e){return Bt(cs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Bt(cs.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Bt(t.getFullYear()%100,e,2)},Y:function(t,e){return Bt(t.getFullYear()%1e4,e,4)},Z:se,"%":function(){return"%"}},L={a:r,A:i,b:o,B:a,c:s,d:ee,e:ee,H:re,I:re,j:ne,L:ae,m:te,M:ie,p:c,S:oe,U:Yt,w:Gt,W:$t,x:l,X:u,y:Kt,Y:Jt,Z:Zt,"%":le};return e}function Bt(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Vt(t){return new RegExp("^(?:"+t.map(ia.requote).join("|")+")","i")}function Xt(t){for(var e=new f,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Gt(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Yt(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function $t(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Jt(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Kt(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.y=Qt(+r[0]),n+r[0].length):-1}function Zt(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Qt(t){return t+(t>68?1900:2e3)}function te(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function ee(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ne(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function re(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ie(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function oe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ae(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function se(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=ma(e)/60|0,i=ma(e)%60;return n+Bt(r,"0",2)+Bt(i,"0",2)}function le(t,e,n){gs.lastIndex=0;var r=gs.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ue(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function ce(){}function fe(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function he(t,e){t&&bs.hasOwnProperty(t.type)&&bs[t.type](t,e)}function de(t,e,n){var r,i=-1,o=t.length-n;e.lineStart();for(;++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function pe(t,e){var n=-1,r=t.length;e.polygonStart();for(;++n<r;)de(t[n],e,1);e.polygonEnd()}function ge(){function t(t,e){t*=Ra;e=e*Ra/2+ja/4;var n=t-r,a=n>=0?1:-1,s=a*n,l=Math.cos(e),u=Math.sin(e),c=o*u,f=i*l+c*Math.cos(s),h=c*a*Math.sin(s);xs.add(Math.atan2(h,f));r=t,i=l,o=u}var e,n,r,i,o;Cs.point=function(a,s){Cs.point=t;r=(e=a)*Ra,i=Math.cos(s=(n=s)*Ra/2+ja/4),o=Math.sin(s)};Cs.lineEnd=function(){t(e,n)}}function me(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function be(t,e){t[0]+=e[0];t[1]+=e[1];t[2]+=e[2]}function we(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function xe(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e;t[1]/=e;t[2]/=e}function Ce(t){return[Math.atan2(t[1],t[0]),rt(t[2])]}function Se(t,e){return ma(t[0]-e[0])<Ea&&ma(t[1]-e[1])<Ea}function Te(t,e){t*=Ra;var n=Math.cos(e*=Ra);ke(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function ke(t,e,n){++Ss;ks+=(t-ks)/Ss;Ms+=(e-Ms)/Ss;_s+=(n-_s)/Ss}function Me(){function t(t,i){t*=Ra;var o=Math.cos(i*=Ra),a=o*Math.cos(t),s=o*Math.sin(t),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=n*l-r*s)*u+(u=r*a-e*l)*u+(u=e*s-n*a)*u),e*a+n*s+r*l);Ts+=u;Ds+=u*(e+(e=a));Ls+=u*(n+(n=s));As+=u*(r+(r=l));ke(e,n,r)}var e,n,r;js.point=function(i,o){i*=Ra;var a=Math.cos(o*=Ra);e=a*Math.cos(i);n=a*Math.sin(i);r=Math.sin(o);js.point=t;ke(e,n,r)}}function _e(){js.point=Te}function De(){function t(t,e){t*=Ra;var n=Math.cos(e*=Ra),a=n*Math.cos(t),s=n*Math.sin(t),l=Math.sin(e),u=i*l-o*s,c=o*a-r*l,f=r*s-i*a,h=Math.sqrt(u*u+c*c+f*f),d=r*a+i*s+o*l,p=h&&-nt(d)/h,g=Math.atan2(h,d);Ns+=p*u;Es+=p*c;Ps+=p*f;Ts+=g;Ds+=g*(r+(r=a));Ls+=g*(i+(i=s));As+=g*(o+(o=l));ke(r,i,o)}var e,n,r,i,o;js.point=function(a,s){e=a,n=s;js.point=t;a*=Ra;var l=Math.cos(s*=Ra);r=l*Math.cos(a);i=l*Math.sin(a);o=Math.sin(s);ke(r,i,o)};js.lineEnd=function(){t(e,n);js.lineEnd=_e;js.point=Te}}function Le(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])});return n}function Ae(){return!0}function Ne(t,e,n,r,i){var o=[],a=[];t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Se(n,r)){i.lineStart();for(var s=0;e>s;++s)i.point((n=t[s])[0],n[1]);i.lineEnd()}else{var l=new Pe(n,t,null,!0),u=new Pe(n,null,l,!1);l.o=u;o.push(l);a.push(u);l=new Pe(r,t,null,!1);u=new Pe(r,null,l,!0);l.o=u;o.push(l);a.push(u)}}});a.sort(e);Ee(o);Ee(a);if(o.length){for(var s=0,l=n,u=a.length;u>s;++s)a[s].e=l=!l;for(var c,f,h=o[0];;){for(var d=h,p=!0;d.v;)if((d=d.n)===h)return;c=d.z;i.lineStart();do{d.v=d.o.v=!0;if(d.e){if(p)for(var s=0,u=c.length;u>s;++s)i.point((f=c[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(p){c=d.p.z;for(var s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1])}else r(d.x,d.p.x,-1,i);d=d.p}d=d.o;c=d.z;p=!p}while(!d.v);i.lineEnd()}}}function Ee(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;){i.n=n=t[r];n.p=i;i=n}i.n=n=t[0];n.p=i}}function Pe(t,e,n,r){this.x=t;this.z=e;this.o=n;this.e=r;this.v=!1;this.n=this.p=null}function je(t,e,n,r){return function(i,o){function a(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function s(t,e){var n=i(t,e);m.point(n[0],n[1])}function l(){y.point=s;m.lineStart()}function u(){y.point=a;m.lineEnd()}function c(t,e){g.push([t,e]);var n=i(t,e);w.point(n[0],n[1])}function f(){w.lineStart();g=[]}function h(){c(g[0][0],g[0][1]);w.lineEnd();var t,e=w.clean(),n=b.buffer(),r=n.length;g.pop();p.push(g);g=null;if(r)if(1&e){t=n[0];var i,r=t.length-1,a=-1;if(r>0){x||(o.polygonStart(),x=!0);o.lineStart();for(;++a<r;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else{r>1&&2&e&&n.push(n.pop().concat(n.shift()));d.push(n.filter(Ie))}}var d,p,g,m=e(o),v=i.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:u,polygonStart:function(){y.point=c;y.lineStart=f;y.lineEnd=h;d=[];p=[]},polygonEnd:function(){y.point=a;y.lineStart=l;y.lineEnd=u;d=ia.merge(d);var t=ze(v,p);if(d.length){x||(o.polygonStart(),x=!0);Ne(d,Oe,t,n,o)}else if(t){x||(o.polygonStart(),x=!0);o.lineStart();n(null,null,1,o);o.lineEnd()}x&&(o.polygonEnd(),x=!1);d=p=null},sphere:function(){o.polygonStart();o.lineStart();n(null,null,1,o);o.lineEnd();o.polygonEnd()}},b=He(),w=e(b),x=!1;return y}}function Ie(t){return t.length>1}function He(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:S,buffer:function(){var n=e;e=[];t=null;return n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Oe(t,e){return((t=t.x)[0]<0?t[1]-Oa-Ea:Oa-t[1])-((e=e.x)[0]<0?e[1]-Oa-Ea:Oa-e[1])}function Re(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart();e=1},point:function(o,a){var s=o>0?ja:-ja,l=ma(o-n);if(ma(l-ja)<Ea){t.point(n,r=(r+a)/2>0?Oa:-Oa);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);t.point(o,r);e=0}else if(i!==s&&l>=ja){ma(n-i)<Ea&&(n-=i*Ea);ma(o-s)<Ea&&(o-=s*Ea);r=Fe(n,r,o,a);t.point(i,r);t.lineEnd();t.lineStart();t.point(s,r);e=0}t.point(n=o,r=a);i=s},lineEnd:function(){t.lineEnd();n=r=0/0},clean:function(){return 2-e}}}function Fe(t,e,n,r){var i,o,a=Math.sin(t-n);return ma(a)>Ea?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function We(t,e,n,r){var i;if(null==t){i=n*Oa;r.point(-ja,i);r.point(0,i);r.point(ja,i);r.point(ja,0);r.point(ja,-i);r.point(0,-i);r.point(-ja,-i);r.point(-ja,0);r.point(-ja,i)}else if(ma(t[0]-e[0])>Ea){var o=t[0]<e[0]?ja:-ja;i=n*o/2;r.point(-o,i);r.point(0,i);r.point(o,i)}else r.point(e[0],e[1])}function ze(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;xs.reset();for(var s=0,l=e.length;l>s;++s){var u=e[s],c=u.length;if(c)for(var f=u[0],h=f[0],d=f[1]/2+ja/4,p=Math.sin(d),g=Math.cos(d),m=1;;){m===c&&(m=0);t=u[m];var v=t[0],y=t[1]/2+ja/4,b=Math.sin(y),w=Math.cos(y),x=v-h,C=x>=0?1:-1,S=C*x,T=S>ja,k=p*b;xs.add(Math.atan2(k*C*Math.sin(S),g*w+k*Math.cos(S)));o+=T?x+C*Ia:x;if(T^h>=n^v>=n){var M=ye(me(f),me(t));xe(M);var _=ye(i,M);xe(_);var D=(T^x>=0?-1:1)*rt(_[2]);(r>D||r===D&&(M[0]||M[1]))&&(a+=T^x>=0?1:-1)}if(!m++)break;h=v,p=b,g=w,f=t}}return(-Ea>o||Ea>o&&0>xs)^1&a}function qe(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,l,u,c;return{lineStart:function(){u=l=!1;c=1},point:function(f,h){var d,p=[f,h],g=e(f,h),m=a?g?0:i(f,h):g?i(f+(0>f?ja:-ja),h):0;!n&&(u=l=g)&&t.lineStart();if(g!==l){d=r(n,p);if(Se(n,d)||Se(p,d)){p[0]+=Ea;p[1]+=Ea;g=e(p[0],p[1])}}if(g!==l){c=0;if(g){t.lineStart();d=r(p,n);t.point(d[0],d[1])}else{d=r(n,p);t.point(d[0],d[1]);t.lineEnd()}n=d}else if(s&&n&&a^g){var v;if(!(m&o)&&(v=r(p,n,!0))){c=0;if(a){t.lineStart();t.point(v[0][0],v[0][1]);t.point(v[1][0],v[1][1]);t.lineEnd()}else{t.point(v[1][0],v[1][1]);t.lineEnd();t.lineStart();t.point(v[0][0],v[0][1])}}}!g||n&&Se(n,p)||t.point(p[0],p[1]);n=p,l=g,o=m},lineEnd:function(){l&&t.lineEnd();n=null},clean:function(){return c|(u&&l)<<1}}}function r(t,e,n){var r=me(t),i=me(e),a=[1,0,0],s=ye(r,i),l=ve(s,s),u=s[0],c=l-u*u;if(!c)return!n&&t;var f=o*l/c,h=-o*u/c,d=ye(a,s),p=we(a,f),g=we(s,h);be(p,g);var m=d,v=ve(p,m),y=ve(m,m),b=v*v-y*(ve(p,p)-1);if(!(0>b)){var w=Math.sqrt(b),x=we(m,(-v-w)/y);be(x,p);x=Ce(x);if(!n)return x;var C,S=t[0],T=e[0],k=t[1],M=e[1];S>T&&(C=S,S=T,T=C);var _=T-S,D=ma(_-ja)<Ea,L=D||Ea>_;!D&&k>M&&(C=k,k=M,M=C);if(L?D?k+M>0^x[1]<(ma(x[0]-S)<Ea?k:M):k<=x[1]&&x[1]<=M:_>ja^(S<=x[0]&&x[0]<=T)){var A=we(m,(-v+w)/y);be(A,p);return[x,Ce(A)]}}}function i(e,n){var r=a?t:ja-t,i=0;-r>e?i|=1:e>r&&(i|=2);-r>n?i|=4:n>r&&(i|=8);return i}var o=Math.cos(t),a=o>0,s=ma(o)>Ea,l=mn(t,6*Ra);return je(e,n,l,a?[0,-t]:[-ja,t-ja])}function Ue(t,e,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=s.x,f=s.y,h=0,d=1,p=c-l,g=f-u;o=t-l;if(p||!(o>0)){o/=p;if(0>p){if(h>o)return;d>o&&(d=o)}else if(p>0){if(o>d)return;o>h&&(h=o)}o=n-l;if(p||!(0>o)){o/=p;if(0>p){if(o>d)return;o>h&&(h=o)}else if(p>0){if(h>o)return;d>o&&(d=o)}o=e-u;if(g||!(o>0)){o/=g;if(0>g){if(h>o)return;d>o&&(d=o)}else if(g>0){if(o>d)return;o>h&&(h=o)}o=r-u;if(g||!(0>o)){o/=g;if(0>g){if(o>d)return;o>h&&(h=o)}else if(g>0){if(h>o)return;d>o&&(d=o)}h>0&&(i.a={x:l+h*p,y:u+h*g});1>d&&(i.b={x:l+d*p,y:u+d*g});return i}}}}}}function Be(t,e,n,r){function i(r,i){return ma(r[0]-t)<Ea?i>0?0:3:ma(r[0]-n)<Ea?i>0?2:1:ma(r[1]-e)<Ea?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,n=m.length,r=t[1],i=0;n>i;++i)for(var o,a=1,s=m[i],l=s.length,u=s[0];l>a;++a){o=s[a];u[1]<=r?o[1]>r&&et(u,o,t)>0&&++e:o[1]<=r&&et(u,o,t)<0&&--e;u=o}return 0!==e}function u(o,s,l,u){var c=0,f=0;if(null==o||(c=i(o,l))!==(f=i(s,l))||a(o,s)<0^l>0){do u.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+l+4)%4)!==f)}else u.point(s[0],s[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&s.point(t,e)}function h(){L.point=p;m&&m.push(v=[]);T=!0;S=!1;x=C=0/0}function d(){if(g){p(y,b);w&&S&&_.rejoin();g.push(_.buffer())}L.point=f;S&&s.lineEnd()}function p(t,e){t=Math.max(-Hs,Math.min(Hs,t));e=Math.max(-Hs,Math.min(Hs,e));var n=c(t,e);m&&v.push([t,e]);if(T){y=t,b=e,w=n;T=!1;if(n){s.lineStart();s.point(t,e)}}else if(n&&S)s.point(t,e);else{var r={a:{x:x,y:C},b:{x:t,y:e}};if(D(r)){if(!S){s.lineStart();s.point(r.a.x,r.a.y)}s.point(r.b.x,r.b.y);n||s.lineEnd();k=!1}else if(n){s.lineStart();s.point(t,e);k=!1}}x=t,C=e,S=n}var g,m,v,y,b,w,x,C,S,T,k,M=s,_=He(),D=Ue(t,e,n,r),L={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=_;g=[];m=[];k=!0},polygonEnd:function(){s=M;g=ia.merge(g);var e=l([t,r]),n=k&&e,i=g.length;if(n||i){s.polygonStart();if(n){s.lineStart();u(null,null,1,s);s.lineEnd()}i&&Ne(g,o,e,u,s);s.polygonEnd()}g=m=v=null}};return L}}function Ve(t){var e=0,n=ja/3,r=ln(t),i=r(e,n);i.parallels=function(t){return arguments.length?r(e=t[0]*ja/180,n=t[1]*ja/180):[e/ja*180,n/ja*180]};return i}function Xe(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,rt((o-(t*t+n*n)*i*i)/(2*i))]};return n}function Ge(){function t(t,e){Rs+=i*t-r*e;r=t,i=e}var e,n,r,i;Us.point=function(o,a){Us.point=t;e=r=o,n=i=a};Us.lineEnd=function(){t(e,n)}}function Ye(t,e){Fs>t&&(Fs=t);t>zs&&(zs=t);Ws>e&&(Ws=e);e>qs&&(qs=e)}function $e(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e);s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Je(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r;s.point=t},pointRadius:function(t){o=Je(t);return s},result:function(){if(a.length){var t=a.join("");a=[];return t}}};return s}function Je(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ke(t,e){ks+=t;Ms+=e;++_s}function Ze(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Ds+=a*(e+t)/2;Ls+=a*(n+r)/2;As+=a;Ke(e=t,n=r)}var e,n;Vs.point=function(r,i){Vs.point=t;Ke(e=r,n=i)}}function Qe(){Vs.point=Ke}function tn(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Ds+=a*(r+t)/2;Ls+=a*(i+e)/2;As+=a;a=i*t-r*e;Ns+=a*(r+t);Es+=a*(i+e);Ps+=3*a;Ke(r=t,i=e)}var e,n,r,i;Vs.point=function(o,a){Vs.point=t;Ke(e=r=o,n=i=a)};Vs.lineEnd=function(){t(e,n)}}function en(t){function e(e,n){t.moveTo(e+a,n);t.arc(e,n,a,0,Ia)}function n(e,n){t.moveTo(e,n);s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i;s.point=e},pointRadius:function(t){a=t;return s},result:S};return s}function nn(t){function e(t){return(s?r:n)(t)}function n(e){return an(e,function(n,r){n=t(n,r);e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r);e.point(n[0],n[1])}function r(){b=0/0;T.point=o;e.lineStart()}function o(n,r){var o=me([n,r]),a=t(n,r);i(b,w,y,x,C,S,b=a[0],w=a[1],y=n,x=o[0],C=o[1],S=o[2],s,e);e.point(b,w)}function a(){T.point=n;e.lineEnd()}function l(){r();T.point=u;T.lineEnd=c}function u(t,e){o(f=t,h=e),d=b,p=w,g=x,m=C,v=S;T.point=o}function c(){i(b,w,y,x,C,S,d,p,f,g,m,v,s,e);T.lineEnd=a;a()}var f,h,d,p,g,m,v,y,b,w,x,C,S,T={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart();T.lineStart=l},polygonEnd:function(){e.polygonEnd();T.lineStart=r}};return T}function i(e,n,r,s,l,u,c,f,h,d,p,g,m,v){var y=c-e,b=f-n,w=y*y+b*b;if(w>4*o&&m--){var x=s+d,C=l+p,S=u+g,T=Math.sqrt(x*x+C*C+S*S),k=Math.asin(S/=T),M=ma(ma(S)-1)<Ea||ma(r-h)<Ea?(r+h)/2:Math.atan2(C,x),_=t(M,k),D=_[0],L=_[1],A=D-e,N=L-n,E=b*A-y*N;if(E*E/w>o||ma((y*A+b*N)/w-.5)>.3||a>s*d+l*p+u*g){i(e,n,r,s,l,u,D,L,M,x/=T,C/=T,S,m,v);v.point(D,L);i(D,L,M,x,C,S,c,f,h,d,p,g,m,v)}}}var o=.5,a=Math.cos(30*Ra),s=16;e.precision=function(t){if(!arguments.length)return Math.sqrt(o);s=(o=t*t)>0&&16;return e};return e}function rn(t){var e=nn(function(e,n){return t([e*Fa,n*Fa])});return function(t){return un(e(t))}}function on(t){this.stream=t}function an(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sn(t){return ln(function(){return t})()}function ln(t){function e(t){t=s(t[0]*Ra,t[1]*Ra);return[t[0]*h+l,u-t[1]*h]}function n(t){t=s.invert((t[0]-l)/h,(u-t[1])/h);return t&&[t[0]*Fa,t[1]*Fa]}function r(){s=Le(a=hn(v,y,b),o);var t=o(g,m);l=d-t[0]*h;u=p+t[1]*h;return i()}function i(){c&&(c.valid=!1,c=null);return e}var o,a,s,l,u,c,f=nn(function(t,e){t=o(t,e);return[t[0]*h+l,u-t[1]*h]}),h=150,d=480,p=250,g=0,m=0,v=0,y=0,b=0,x=Is,C=w,S=null,T=null;e.stream=function(t){c&&(c.valid=!1);c=un(x(a,f(C(t))));c.valid=!0;return c};e.clipAngle=function(t){if(!arguments.length)return S;x=null==t?(S=t,Is):qe((S=+t)*Ra);return i()};e.clipExtent=function(t){if(!arguments.length)return T;T=t;C=t?Be(t[0][0],t[0][1],t[1][0],t[1][1]):w;return i()};e.scale=function(t){if(!arguments.length)return h;h=+t;return r()};e.translate=function(t){if(!arguments.length)return[d,p];d=+t[0];p=+t[1];return r()};e.center=function(t){if(!arguments.length)return[g*Fa,m*Fa];g=t[0]%360*Ra;m=t[1]%360*Ra;return r()};e.rotate=function(t){if(!arguments.length)return[v*Fa,y*Fa,b*Fa];v=t[0]%360*Ra;y=t[1]%360*Ra;b=t.length>2?t[2]%360*Ra:0;return r()};ia.rebind(e,f,"precision");return function(){o=t.apply(this,arguments);e.invert=o.invert&&n;return r()}}function un(t){return an(t,function(e,n){t.point(e*Ra,n*Ra)})}function cn(t,e){return[t,e]}function fn(t,e){return[t>ja?t-Ia:-ja>t?t+Ia:t,e]}function hn(t,e,n){return t?e||n?Le(pn(t),gn(e,n)):pn(t):e||n?gn(e,n):fn}function dn(t){return function(e,n){return e+=t,[e>ja?e-Ia:-ja>e?e+Ia:e,n]}}function pn(t){var e=dn(t);e.invert=dn(-t);return e}function gn(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*r+s*i;return[Math.atan2(l*o-c*a,s*r-u*i),rt(c*o+l*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,l=Math.sin(t)*n,u=Math.sin(e),c=u*o-l*a;return[Math.atan2(l*o+u*a,s*r+c*i),rt(c*r-s*i)]};return n}function mn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){var l=a*e;if(null!=i){i=vn(n,i);o=vn(n,o);(a>0?o>i:i>o)&&(i+=a*Ia)}else{i=t+a*Ia;o=t-.5*l}for(var u,c=i;a>0?c>o:o>c;c-=l)s.point((u=Ce([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function vn(t,e){var n=me(e);n[0]-=t;xe(n);var r=nt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Ea)%(2*Math.PI)}function yn(t,e,n){var r=ia.range(t,e-Ea,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function bn(t,e,n){var r=ia.range(t,e-Ea,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function wn(t){return t.source}function xn(t){return t.target}function Cn(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),s=Math.sin(r),l=i*Math.cos(t),u=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(st(r-e)+i*a*st(n-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,n=Math.sin(h-t)*d,r=n*l+e*c,i=n*u+e*f,a=n*o+e*s;return[Math.atan2(i,r)*Fa,Math.atan2(a,Math.sqrt(r*r+i*i))*Fa]}:function(){return[t*Fa,e*Fa]};p.distance=h;return p}function Sn(){function t(t,i){var o=Math.sin(i*=Ra),a=Math.cos(i),s=ma((t*=Ra)-e),l=Math.cos(s);Xs+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*l)*s),n*o+r*a*l);e=t,n=o,r=a}var e,n,r;Gs.point=function(i,o){e=i*Ra,n=Math.sin(o*=Ra),r=Math.cos(o);Gs.point=t};Gs.lineEnd=function(){Gs.point=Gs.lineEnd=S}}function Tn(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]};return n}function kn(t,e){function n(t,e){a>0?-Oa+Ea>e&&(e=-Oa+Ea):e>Oa-Ea&&(e=Oa-Ea);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(ja/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;if(!o)return _n;n.invert=function(t,e){var n=a-e,r=tt(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Oa]};return n}function Mn(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;if(ma(i)<Ea)return cn;n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-tt(i)*Math.sqrt(t*t+n*n)]};return n}function _n(t,e){return[t,Math.log(Math.tan(ja/4+e/2))]}function Dn(t){var e,n=sn(t),r=n.scale,i=n.translate,o=n.clipExtent;n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t};n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var s=ja*r(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a};return n.clipExtent(null)}function Ln(t,e){return[Math.log(Math.tan(ja/4+e/2)),-t]}function An(t){return t[0]}function Nn(t){return t[1]}function En(t){for(var e=t.length,n=[0,1],r=2,i=2;e>i;i++){for(;r>1&&et(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Pn(t,e){return t[0]-e[0]||t[1]-e[1]}function jn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function In(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,l=t[1],u=n[1],c=e[1]-l,f=r[1]-u,h=(s*(l-u)-f*(i-o))/(f*a-s*c);return[i+h*a,l+h*c]}function Hn(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function On(){ir(this);this.edge=this.site=this.circle=null}function Rn(t){var e=ol.pop()||new On;e.site=t;return e}function Fn(t){ $n(t);nl.remove(t);ol.push(t);ir(t)}function Wn(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,s=[t];Fn(t);for(var l=o;l.circle&&ma(n-l.circle.x)<Ea&&ma(r-l.circle.cy)<Ea;){o=l.P;s.unshift(l);Fn(l);l=o}s.unshift(l);$n(l);for(var u=a;u.circle&&ma(n-u.circle.x)<Ea&&ma(r-u.circle.cy)<Ea;){a=u.N;s.push(u);Fn(u);u=a}s.push(u);$n(u);var c,f=s.length;for(c=1;f>c;++c){u=s[c];l=s[c-1];er(u.edge,l.site,u.site,i)}l=s[0];u=s[f-1];u.edge=Qn(l.site,u.site,null,i);Yn(l);Yn(u)}function zn(t){for(var e,n,r,i,o=t.x,a=t.y,s=nl._;s;){r=qn(s,a)-o;if(r>Ea)s=s.L;else{i=o-Un(s,a);if(!(i>Ea)){if(r>-Ea){e=s.P;n=s}else if(i>-Ea){e=s;n=s.N}else e=n=s;break}if(!s.R){e=s;break}s=s.R}}var l=Rn(t);nl.insert(e,l);if(e||n)if(e!==n)if(n){$n(e);$n(n);var u=e.site,c=u.x,f=u.y,h=t.x-c,d=t.y-f,p=n.site,g=p.x-c,m=p.y-f,v=2*(h*m-d*g),y=h*h+d*d,b=g*g+m*m,w={x:(m*y-d*b)/v+c,y:(h*b-g*y)/v+f};er(n.edge,u,p,w);l.edge=Qn(u,t,null,w);n.edge=Qn(t,p,null,w);Yn(e);Yn(n)}else l.edge=Qn(e.site,l.site);else{$n(e);n=Rn(e.site);nl.insert(l,n);l.edge=n.edge=Qn(e.site,l.site);Yn(e);Yn(n)}}function qn(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-(1/0);n=a.site;var s=n.x,l=n.y,u=l-e;if(!u)return s;var c=s-r,f=1/o-1/u,h=c/u;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*u)-l+u/2+i-o/2)))/f+r:(r+s)/2}function Un(t,e){var n=t.N;if(n)return qn(n,e);var r=t.site;return r.y===e?r.x:1/0}function Bn(t){this.site=t;this.edges=[]}function Vn(t){for(var e,n,r,i,o,a,s,l,u,c,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],g=el,m=g.length;m--;){o=g[m];if(o&&o.prepare()){s=o.edges;l=s.length;a=0;for(;l>a;){c=s[a].end(),r=c.x,i=c.y;u=s[++a%l].start(),e=u.x,n=u.y;if(ma(r-e)>Ea||ma(i-n)>Ea){s.splice(a,0,new nr(tr(o.site,c,ma(r-f)<Ea&&p-i>Ea?{x:f,y:ma(e-f)<Ea?n:p}:ma(i-p)<Ea&&h-r>Ea?{x:ma(n-p)<Ea?e:h,y:p}:ma(r-h)<Ea&&i-d>Ea?{x:h,y:ma(e-h)<Ea?n:d}:ma(i-d)<Ea&&r-f>Ea?{x:ma(n-d)<Ea?e:f,y:d}:null),o.site,null));++l}}}}}function Xn(t,e){return e.angle-t.angle}function Gn(){ir(this);this.x=this.y=this.arc=this.site=this.cy=null}function Yn(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,s=i.y,l=r.x-a,u=r.y-s,c=o.x-a,f=o.y-s,h=2*(l*f-u*c);if(!(h>=-Pa)){var d=l*l+u*u,p=c*c+f*f,g=(f*d-u*p)/h,m=(l*p-c*d)/h,f=m+s,v=al.pop()||new Gn;v.arc=t;v.site=i;v.x=g+a;v.y=f+Math.sqrt(g*g+m*m);v.cy=f;t.circle=v;for(var y=null,b=il._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}il.insert(y,v);y||(rl=v)}}}}function $n(t){var e=t.circle;if(e){e.P||(rl=e.N);il.remove(e);al.push(e);ir(e);t.circle=null}}function Jn(t){for(var e,n=tl,r=Ue(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;){e=n[i];if(!Kn(e,t)||!r(e)||ma(e.a.x-e.b.x)<Ea&&ma(e.a.y-e.b.y)<Ea){e.a=e.b=null;n.splice(i,1)}}}function Kn(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],s=e[1][0],l=e[0][1],u=e[1][1],c=t.l,f=t.r,h=c.x,d=c.y,p=f.x,g=f.y,m=(h+p)/2,v=(d+g)/2;if(g===d){if(a>m||m>=s)return;if(h>p){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else{r=(h-p)/(g-d);i=v-r*m;if(-1>r||r>1)if(h>p){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(g>d){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}}t.a=o;t.b=n;return!0}function Zn(t,e){this.l=t;this.r=e;this.a=this.b=null}function Qn(t,e,n,r){var i=new Zn(t,e);tl.push(i);n&&er(i,t,e,n);r&&er(i,e,t,r);el[t.i].edges.push(new nr(i,t,e));el[e.i].edges.push(new nr(i,e,t));return i}function tr(t,e,n){var r=new Zn(t,null);r.a=e;r.b=n;tl.push(r);return r}function er(t,e,n,r){if(t.a||t.b)t.l===n?t.b=r:t.a=r;else{t.a=r;t.l=e;t.r=n}}function nr(t,e,n){var r=t.a,i=t.b;this.edge=t;this.site=e;this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function rr(){this._=null}function ir(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function or(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.R=r.L;n.R&&(n.R.U=n);r.L=n}function ar(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r;r.U=i;n.U=r;n.L=r.R;n.L&&(n.L.U=n);r.R=n}function sr(t){for(;t.L;)t=t.L;return t}function lr(t,e){var n,r,i,o=t.sort(ur).pop();tl=[];el=new Array(t.length);nl=new rr;il=new rr;for(;;){i=rl;if(o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x)){if(o.x!==n||o.y!==r){el[o.i]=new Bn(o);zn(o);n=o.x,r=o.y}o=t.pop()}else{if(!i)break;Wn(i.arc)}}e&&(Jn(e),Vn(e));var a={cells:el,edges:tl};nl=il=tl=el=null;return a}function ur(t,e){return e.y-t.y||e.x-t.x}function cr(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function fr(t){return t.x}function hr(t){return t.y}function dr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),l=e.nodes;l[0]&&pr(t,l[0],n,r,a,s);l[1]&&pr(t,l[1],a,r,i,s);l[2]&&pr(t,l[2],n,s,a,o);l[3]&&pr(t,l[3],a,s,i,o)}}function gr(t,e,n,r,i,o,a){var s,l=1/0;(function u(t,c,f,h,d){if(!(c>o||f>a||r>h||i>d)){if(p=t.point){var p,g=e-t.x,m=n-t.y,v=g*g+m*m;if(l>v){var y=Math.sqrt(l=v);r=e-y,i=n-y;o=e+y,a=n+y;s=p}}for(var b=t.nodes,w=.5*(c+h),x=.5*(f+d),C=e>=w,S=n>=x,T=S<<1|C,k=T+4;k>T;++T)if(t=b[3&T])switch(3&T){case 0:u(t,c,f,w,x);break;case 1:u(t,w,f,h,x);break;case 2:u(t,c,x,w,d);break;case 3:u(t,w,x,h,d)}}})(t,r,i,o,a);return s}function mr(t,e){t=ia.rgb(t);e=ia.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,s=e.b-i;return function(t){return"#"+Ct(Math.round(n+o*t))+Ct(Math.round(r+a*t))+Ct(Math.round(i+s*t))}}function vr(t,e){var n,r={},i={};for(n in t)n in e?r[n]=wr(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function yr(t,e){t=+t,e=+e;return function(n){return t*(1-n)+e*n}}function br(t,e){var n,r,i,o=ll.lastIndex=ul.lastIndex=0,a=-1,s=[],l=[];t+="",e+="";for(;(n=ll.exec(t))&&(r=ul.exec(e));){if((i=r.index)>o){i=e.slice(o,i);s[a]?s[a]+=i:s[++a]=i}if((n=n[0])===(r=r[0]))s[a]?s[a]+=r:s[++a]=r;else{s[++a]=null;l.push({i:a,x:yr(n,r)})}o=ul.lastIndex}if(o<e.length){i=e.slice(o);s[a]?s[a]+=i:s[++a]=i}return s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var n,r=0;e>r;++r)s[(n=l[r]).i]=n.x(t);return s.join("")})}function wr(t,e){for(var n,r=ia.interpolators.length;--r>=0&&!(n=ia.interpolators[r](t,e)););return n}function xr(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(wr(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;s>n;++n)i[n]=r[n](t);return i}}function Cr(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function Sr(t){return function(e){return 1-t(1-e)}}function Tr(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function kr(t){return t*t}function Mr(t){return t*t*t}function _r(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Dr(t){return function(e){return Math.pow(e,t)}}function Lr(t){return 1-Math.cos(t*Oa)}function Ar(t){return Math.pow(2,10*(t-1))}function Nr(t){return 1-Math.sqrt(1-t*t)}function Er(t,e){var n;arguments.length<2&&(e=.45);arguments.length?n=e/Ia*Math.asin(1/t):(t=1,n=e/4);return function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Ia/e)}}function Pr(t){t||(t=1.70158);return function(e){return e*e*((t+1)*e-t)}}function jr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Ir(t,e){t=ia.hcl(t);e=ia.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.c:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ht(n+o*t,r+a*t,i+s*t)+""}}function Hr(t,e){t=ia.hsl(t);e=ia.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;isNaN(a)&&(a=0,r=isNaN(r)?e.s:r);isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360);return function(t){return ct(n+o*t,r+a*t,i+s*t)+""}}function Or(t,e){t=ia.lab(t);e=ia.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return pt(n+o*t,r+a*t,i+s*t)+""}}function Rr(t,e){e-=t;return function(n){return Math.round(t+e*n)}}function Fr(t){var e=[t.a,t.b],n=[t.c,t.d],r=zr(e),i=Wr(e,n),o=zr(qr(n,e,-i))||0;if(e[0]*n[1]<n[0]*e[1]){e[0]*=-1;e[1]*=-1;r*=-1;i*=-1}this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Fa;this.translate=[t.e,t.f];this.scale=[r,o];this.skew=o?Math.atan2(i,o)*Fa:0}function Wr(t,e){return t[0]*e[0]+t[1]*e[1]}function zr(t){var e=Math.sqrt(Wr(t,t));if(e){t[0]/=e;t[1]/=e}return e}function qr(t,e,n){t[0]+=n*e[0];t[1]+=n*e[1];return t}function Ur(t,e){var n,r=[],i=[],o=ia.transform(t),a=ia.transform(e),s=o.translate,l=a.translate,u=o.rotate,c=a.rotate,f=o.skew,h=a.skew,d=o.scale,p=a.scale;if(s[0]!=l[0]||s[1]!=l[1]){r.push("translate(",null,",",null,")");i.push({i:1,x:yr(s[0],l[0])},{i:3,x:yr(s[1],l[1])})}else r.push(l[0]||l[1]?"translate("+l+")":"");if(u!=c){u-c>180?c+=360:c-u>180&&(u+=360);i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:yr(u,c)})}else c&&r.push(r.pop()+"rotate("+c+")");f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:yr(f,h)}):h&&r.push(r.pop()+"skewX("+h+")");if(d[0]!=p[0]||d[1]!=p[1]){n=r.push(r.pop()+"scale(",null,",",null,")");i.push({i:n-4,x:yr(d[0],p[0])},{i:n-2,x:yr(d[1],p[1])})}else(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")");n=i.length;return function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}}function Br(t,e){e=(e-=t=+t)||1/e;return function(n){return(n-t)/e}}function Vr(t,e){e=(e-=t=+t)||1/e;return function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Xr(t){for(var e=t.source,n=t.target,r=Yr(e,n),i=[e];e!==r;){e=e.parent;i.push(e)}for(var o=i.length;n!==r;){i.splice(o,0,n);n=n.parent}return i}function Gr(t){for(var e=[],n=t.parent;null!=n;){e.push(t);t=n;n=n.parent}e.push(t);return e}function Yr(t,e){if(t===e)return t;for(var n=Gr(t),r=Gr(e),i=n.pop(),o=r.pop(),a=null;i===o;){a=i;i=n.pop();o=r.pop()}return a}function $r(t){t.fixed|=2}function Jr(t){t.fixed&=-7}function Kr(t){t.fixed|=4;t.px=t.x,t.py=t.y}function Zr(t){t.fixed&=-5}function Qr(t,e,n){var r=0,i=0;t.charge=0;if(!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;){o=a[l];if(null!=o){Qr(o,e,n);t.charge+=o.charge;r+=o.charge*o.cx;i+=o.charge*o.cy}}if(t.point){if(!t.leaf){t.point.x+=Math.random()-.5;t.point.y+=Math.random()-.5}var u=e*n[t.point.index];t.charge+=t.pointCharge=u;r+=u*t.point.x;i+=u*t.point.y}t.cx=r/t.charge;t.cy=i/t.charge}function ti(t,e){ia.rebind(t,e,"sort","children","value");t.nodes=t;t.links=ai;return t}function ei(t,e){for(var n=[t];null!=(t=n.pop());){e(t);if((i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}}function ni(t,e){for(var n=[t],r=[];null!=(t=n.pop());){r.push(t);if((o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a])}for(;null!=(t=r.pop());)e(t)}function ri(t){return t.children}function ii(t){return t.value}function oi(t,e){return e.value-t.value}function ai(t){return ia.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function si(t){return t.x}function li(t){return t.y}function ui(t,e,n){t.y0=e;t.y=n}function ci(t){return ia.range(t.length)}function fi(t){for(var e=-1,n=t[0].length,r=[];++e<n;)r[e]=0;return r}function hi(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)if((e=t[n][1])>i){r=n;i=e}return r}function di(t){return t.reduce(pi,0)}function pi(t,e){return t+e[1]}function gi(t,e){return mi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function mi(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function vi(t){return[ia.min(t),ia.max(t)]}function yi(t,e){return t.value-e.value}function bi(t,e){var n=t._pack_next;t._pack_next=e;e._pack_prev=t;e._pack_next=n;n._pack_prev=e}function wi(t,e){t._pack_next=e;e._pack_prev=t}function xi(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function Ci(t){function e(t){c=Math.min(t.x-t.r,c);f=Math.max(t.x+t.r,f);h=Math.min(t.y-t.r,h);d=Math.max(t.y+t.r,d)}if((n=t.children)&&(u=n.length)){var n,r,i,o,a,s,l,u,c=1/0,f=-(1/0),h=1/0,d=-(1/0);n.forEach(Si);r=n[0];r.x=-r.r;r.y=0;e(r);if(u>1){i=n[1];i.x=i.r;i.y=0;e(i);if(u>2){o=n[2];Mi(r,i,o);e(o);bi(r,o);r._pack_prev=o;bi(o,i);i=r._pack_next;for(a=3;u>a;a++){Mi(r,i,o=n[a]);var p=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(xi(s,o)){p=1;break}if(1==p)for(l=r._pack_prev;l!==s._pack_prev&&!xi(l,o);l=l._pack_prev,m++);if(p){m>g||g==m&&i.r<r.r?wi(r,i=s):wi(r=l,i);a--}else{bi(r,o);i=o;e(o)}}}}var v=(c+f)/2,y=(h+d)/2,b=0;for(a=0;u>a;a++){o=n[a];o.x-=v;o.y-=y;b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y))}t.r=b;n.forEach(Ti)}}function Si(t){t._pack_next=t._pack_prev=t}function Ti(t){delete t._pack_next;delete t._pack_prev}function ki(t,e,n,r){var i=t.children;t.x=e+=r*t.x;t.y=n+=r*t.y;t.r*=r;if(i)for(var o=-1,a=i.length;++o<a;)ki(i[o],e,n,r)}function Mi(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,s=i*i+o*o;a*=a;r*=r;var l=.5+(r-a)/(2*s),u=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=t.x+l*i+u*o;n.y=t.y+l*o-u*i}else{n.x=t.x+r;n.y=t.y}}function _i(t,e){return t.parent==e.parent?1:2}function Di(t){var e=t.children;return e.length?e[0]:t.t}function Li(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function Ai(t,e,n){var r=n/(e.i-t.i);e.c-=r;e.s+=n;t.c+=r;e.z+=n;e.m+=n}function Ni(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;){e=i[o];e.z+=n;e.m+=n;n+=e.s+(r+=e.c)}}function Ei(t,e,n){return t.a.parent===e.parent?t.a:n}function Pi(t){return 1+ia.max(t,function(t){return t.y})}function ji(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ii(t){var e=t.children;return e&&e.length?Ii(e[0]):t}function Hi(t){var e,n=t.children;return n&&(e=n.length)?Hi(n[e-1]):t}function Oi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ri(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];if(0>i){n+=i/2;i=0}if(0>o){r+=o/2;o=0}return{x:n,y:r,dx:i,dy:o}}function Fi(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Wi(t){return t.rangeExtent?t.rangeExtent():Fi(t.range())}function zi(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function qi(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];if(o>a){n=r,r=i,i=n;n=o,o=a,a=n}t[r]=e.floor(o);t[i]=e.ceil(a);return t}function Ui(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:wl}function Bi(t,e,n,r){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;if(t[s]<t[0]){t=t.slice().reverse();e=e.slice().reverse()}for(;++a<=s;){i.push(n(t[a-1],t[a]));o.push(r(e[a-1],e[a]))}return function(e){var n=ia.bisect(t,e,1,s)-1;return o[n](i[n](e))}}function Vi(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?Bi:zi,l=r?Vr:Br;a=i(t,e,l,n);s=i(e,t,l,wr);return o}function o(t){return a(t)}var a,s;o.invert=function(t){return s(t)};o.domain=function(e){if(!arguments.length)return t;t=e.map(Number);return i()};o.range=function(t){if(!arguments.length)return e;e=t;return i()};o.rangeRound=function(t){return o.range(t).interpolate(Rr)};o.clamp=function(t){if(!arguments.length)return r;r=t;return i()};o.interpolate=function(t){if(!arguments.length)return n;n=t;return i()};o.ticks=function(e){return $i(t,e)};o.tickFormat=function(e,n){return Ji(t,e,n)};o.nice=function(e){Gi(t,e);return i()};o.copy=function(){return Vi(t,e,n,r)};return i()}function Xi(t,e){return ia.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Gi(t,e){return qi(t,Ui(Yi(t,e)[2]))}function Yi(t,e){null==e&&(e=10);var n=Fi(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2);n[0]=Math.ceil(n[0]/i)*i;n[1]=Math.floor(n[1]/i)*i+.5*i;n[2]=i;return n}function $i(t,e){return ia.range.apply(ia,Yi(t,e))}function Ji(t,e,n){var r=Yi(t,e);if(n){var i=ls.exec(n);i.shift();if("s"===i[8]){var o=ia.formatPrefix(Math.max(ma(r[0]),ma(r[1])));i[7]||(i[7]="."+Ki(o.scale(r[2])));i[8]="f";n=ia.format(i.join(""));return function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Zi(i[8],r));n=i.join("")}else n=",."+Ki(r[2])+"f";return ia.format(n)}function Ki(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Zi(t,e){var n=Ki(e[2]);return t in xl?Math.abs(n-Ki(Math.max(ma(e[0]),ma(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qi(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}a.invert=function(e){return o(t.invert(e))};a.domain=function(e){if(!arguments.length)return r;n=e[0]>=0;t.domain((r=e.map(Number)).map(i));return a};a.base=function(n){if(!arguments.length)return e;e=+n;t.domain(r.map(i));return a};a.nice=function(){var e=qi(r.map(i),n?Math:Sl);t.domain(e);r=e.map(o);return a};a.ticks=function(){var t=Fi(r),a=[],s=t[0],l=t[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(c-u)){if(n){for(;c>u;u++)for(var h=1;f>h;h++)a.push(o(u)*h);a.push(o(u))}else{a.push(o(u));for(;u++<c;)for(var h=f-1;h>0;h--)a.push(o(u)*h)}for(u=0;a[u]<s;u++);for(c=a.length;a[c-1]>l;c--);a=a.slice(u,c)}return a};a.tickFormat=function(t,e){if(!arguments.length)return Cl;arguments.length<2?e=Cl:"function"!=typeof e&&(e=ia.format(e));var r,s=Math.max(.1,t/a.ticks().length),l=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(l(i(t)+r))<=s?e(t):""}};a.copy=function(){return Qi(t.copy(),e,n,r)};return Xi(a,t)}function to(t,e,n){function r(e){return t(i(e))}var i=eo(e),o=eo(1/e);r.invert=function(e){return o(t.invert(e))};r.domain=function(e){if(!arguments.length)return n;t.domain((n=e.map(Number)).map(i));return r};r.ticks=function(t){return $i(n,t)};r.tickFormat=function(t,e){return Ji(n,t,e)};r.nice=function(t){return r.domain(Gi(n,t))};r.exponent=function(a){if(!arguments.length)return e;i=eo(e=a);o=eo(1/e);t.domain(n.map(i));return r};r.copy=function(){return to(t.copy(),e,n)};return Xi(r,t)}function eo(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function no(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return ia.range(t.length).map(function(t){return e+n*t})}var i,o,a;n.domain=function(r){if(!arguments.length)return t;t=[];i=new f;for(var o,a=-1,s=r.length;++a<s;)i.has(o=r[a])||i.set(o,t.push(o));return n[e.t].apply(n,e.a)};n.range=function(t){if(!arguments.length)return o;o=t;a=0;e={t:"range",a:arguments};return n};n.rangePoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=(l+u)/2,0):(u-l)/(t.length-1+s);o=r(l+c*s/2,c);a=0;e={t:"rangePoints",a:arguments};return n};n.rangeRoundPoints=function(i,s){arguments.length<2&&(s=0);var l=i[0],u=i[1],c=t.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(t.length-1+s)|0;o=r(l+Math.round(c*s/2+(u-l-(t.length-1+s)*c)/2),c);a=0;e={t:"rangeRoundPoints",a:arguments};return n};n.rangeBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=(f-c)/(t.length-s+2*l);o=r(c+h*l,h);u&&o.reverse();a=h*(1-s);e={t:"rangeBands",a:arguments};return n};n.rangeRoundBands=function(i,s,l){arguments.length<2&&(s=0);arguments.length<3&&(l=s);var u=i[1]<i[0],c=i[u-0],f=i[1-u],h=Math.floor((f-c)/(t.length-s+2*l));o=r(c+Math.round((f-c-(t.length-s)*h)/2),h);u&&o.reverse();a=Math.round(h*(1-s));e={t:"rangeRoundBands",a:arguments};return n};n.rangeBand=function(){return a};n.rangeExtent=function(){return Fi(e.a[0])};n.copy=function(){return no(t,e)};return n.domain(t)}function ro(t,e){function n(){var n=0,i=e.length;s=[];for(;++n<i;)s[n-1]=ia.quantile(t,n/i);return r}function r(t){return isNaN(t=+t)?void 0:e[ia.bisect(s,t)]}var s;r.domain=function(e){if(!arguments.length)return t;t=e.map(o).filter(a).sort(i);return n()};r.range=function(t){if(!arguments.length)return e;e=t;return n()};r.quantiles=function(){return s};r.invertExtent=function(n){n=e.indexOf(n);return 0>n?[0/0,0/0]:[n>0?s[n-1]:t[0],n<s.length?s[n]:t[t.length-1]]};r.copy=function(){return ro(t,e)};return n()}function io(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){o=n.length/(e-t);a=n.length-1;return r}var o,a;r.domain=function(n){if(!arguments.length)return[t,e];t=+n[0];e=+n[n.length-1];return i()};r.range=function(t){if(!arguments.length)return n;n=t;return i()};r.invertExtent=function(e){e=n.indexOf(e);e=0>e?0/0:e/o+t;return[e,e+1/o]};r.copy=function(){return io(t,e,n)};return i()}function oo(t,e){function n(n){return n>=n?e[ia.bisect(t,n)]:void 0}n.domain=function(e){if(!arguments.length)return t;t=e;return n};n.range=function(t){if(!arguments.length)return e;e=t;return n};n.invertExtent=function(n){n=e.indexOf(n);return[t[n-1],t[n]]};n.copy=function(){return oo(t,e)};return n}function ao(t){function e(t){return+t}e.invert=e;e.domain=e.range=function(n){if(!arguments.length)return t;t=n.map(e);return e};e.ticks=function(e){return $i(t,e)};e.tickFormat=function(e,n){return Ji(t,e,n)};e.copy=function(){return ao(t)};return e}function so(){return 0}function lo(t){return t.innerRadius}function uo(t){return t.outerRadius}function co(t){return t.startAngle}function fo(t){return t.endAngle}function ho(t){return t&&t.padAngle}function po(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function go(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=t[0]+l,f=t[1]+u,h=e[0]+l,d=e[1]+u,p=(c+h)/2,g=(f+d)/2,m=h-c,v=d-f,y=m*m+v*v,b=n-r,w=c*d-h*f,x=(0>v?-1:1)*Math.sqrt(b*b*y-w*w),C=(w*v-m*x)/y,S=(-w*m-v*x)/y,T=(w*v+m*x)/y,k=(-w*m+v*x)/y,M=C-p,_=S-g,D=T-p,L=k-g;M*M+_*_>D*D+L*L&&(C=T,S=k);return[[C-l,S-u],[C*n/b,S*n/b]]}function mo(t){function e(e){function a(){u.push("M",o(t(c),s))}for(var l,u=[],c=[],f=-1,h=e.length,d=Dt(n),p=Dt(r);++f<h;)if(i.call(this,l=e[f],f))c.push([+d.call(this,l,f),+p.call(this,l,f)]);else if(c.length){a();c=[]}c.length&&a();return u.length?u.join(""):null}var n=An,r=Nn,i=Ae,o=vo,a=o.key,s=.7;e.x=function(t){if(!arguments.length)return n;n=t;return e};e.y=function(t){if(!arguments.length)return r;r=t;return e};e.defined=function(t){if(!arguments.length)return i;i=t;return e};e.interpolate=function(t){if(!arguments.length)return a;a="function"==typeof t?o=t:(o=Ll.get(t)||vo).key;return e};e.tension=function(t){if(!arguments.length)return s;s=t;return e};return e}function vo(t){return t.join("L")}function yo(t){return vo(t)+"Z"}function bo(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")}function wo(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function xo(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function Co(t,e){return t.length<4?vo(t):t[1]+ko(t.slice(1,-1),Mo(t,e))}function So(t,e){return t.length<3?vo(t):t[0]+ko((t.push(t[0]),t),Mo([t[t.length-2]].concat(t,[t[1]]),e))}function To(t,e){return t.length<3?vo(t):t[0]+ko(t,Mo(t,e))}function ko(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return vo(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],s=a,l=1;if(n){r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1];i=t[1];l=2}if(e.length>1){s=e[1];o=t[l];l++;r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<e.length;u++,l++){o=t[l];s=e[u];r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}}if(n){var c=t[l];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function Mo(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;){n=o;o=a;a=t[s];r.push([i*(a[0]-n[0]),i*(a[1]-n[1])])}return r}function _o(t){if(t.length<3)return vo(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],s=[o,o,o,r[1]],l=[i,",",o,"L",No(El,a),",",No(El,s)];t.push(t[n-1]);for(;++e<=n;){r=t[e];a.shift();a.push(r[0]);s.shift();s.push(r[1]);Eo(l,a,s)}t.pop();l.push("L",r);return l.join("")}function Do(t){if(t.length<4)return vo(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;){e=t[r];o.push(e[0]);a.push(e[1])}n.push(No(El,o)+","+No(El,a));--r;for(;++r<i;){e=t[r];o.shift();o.push(e[0]);a.shift();a.push(e[1]);Eo(n,o,a)}return n.join("")}function Lo(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],s=[];++r<4;){n=t[r%i];a.push(n[0]);s.push(n[1])}e=[No(El,a),",",No(El,s)];--r;for(;++r<o;){n=t[r%i];a.shift();a.push(n[0]);s.shift();s.push(n[1]);Eo(e,a,s)}return e.join("")}function Ao(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],s=t[n][0]-o,l=t[n][1]-a,u=-1;++u<=n;){r=t[u];i=u/n;r[0]=e*r[0]+(1-e)*(o+i*s);r[1]=e*r[1]+(1-e)*(a+i*l)}return _o(t)}function No(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Eo(t,e,n){t.push("C",No(Al,e),",",No(Al,n),",",No(Nl,e),",",No(Nl,n),",",No(El,e),",",No(El,n))}function Po(t,e){return(e[1]-t[1])/(e[0]-t[0])}function jo(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=Po(i,o);++e<n;)r[e]=(a+(a=Po(i=o,o=t[e+1])))/2;r[e]=a;return r}function Io(t){for(var e,n,r,i,o=[],a=jo(t),s=-1,l=t.length-1;++s<l;){e=Po(t[s],t[s+1]);if(ma(e)<Ea)a[s]=a[s+1]=0;else{n=a[s]/e;r=a[s+1]/e;i=n*n+r*r;if(i>9){i=3*e/Math.sqrt(i);a[s]=i*n;a[s+1]=i*r}}}s=-1;for(;++s<=l;){i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s]));o.push([i||0,a[s]*i||0])}return o}function Ho(t){return t.length<3?vo(t):t[0]+ko(t,Io(t))}function Oo(t){for(var e,n,r,i=-1,o=t.length;++i<o;){e=t[i];n=e[0];r=e[1]-Oa;e[0]=n*Math.cos(r);e[1]=n*Math.sin(r)}return t}function Ro(t){function e(e){function l(){g.push("M",s(t(v),f),c,u(t(m.reverse()),f),"Z")}for(var h,d,p,g=[],m=[],v=[],y=-1,b=e.length,w=Dt(n),x=Dt(i),C=n===r?function(){return d}:Dt(r),S=i===o?function(){return p}:Dt(o);++y<b;)if(a.call(this,h=e[y],y)){m.push([d=+w.call(this,h,y),p=+x.call(this,h,y)]);v.push([+C.call(this,h,y),+S.call(this,h,y)])}else if(m.length){l();m=[];v=[]}m.length&&l();return g.length?g.join(""):null}var n=An,r=An,i=0,o=Nn,a=Ae,s=vo,l=s.key,u=s,c="L",f=.7;e.x=function(t){if(!arguments.length)return r;n=r=t;return e};e.x0=function(t){if(!arguments.length)return n;n=t;return e};e.x1=function(t){if(!arguments.length)return r;r=t;return e};e.y=function(t){if(!arguments.length)return o;i=o=t;return e};e.y0=function(t){if(!arguments.length)return i;i=t;return e};e.y1=function(t){if(!arguments.length)return o;o=t;return e};e.defined=function(t){if(!arguments.length)return a;a=t;return e};e.interpolate=function(t){if(!arguments.length)return l;l="function"==typeof t?s=t:(s=Ll.get(t)||vo).key;u=s.reverse||s;c=s.closed?"M":"L";return e};e.tension=function(t){if(!arguments.length)return f;f=t;return e};return e}function Fo(t){return t.radius}function Wo(t){return[t.x,t.y]}function zo(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Oa;return[n*Math.cos(r),n*Math.sin(r)]}}function qo(){return 64}function Uo(){return"circle"}function Bo(t){var e=Math.sqrt(t/ja);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Vo(t){return function(){var e,n;if((e=this[t])&&(n=e[e.active])){--e.count?delete e[e.active]:delete this[t];e.active+=.5;n.event&&n.event.interrupt.call(this,this.__data__,n.index)}}}function Xo(t,e,n){xa(t,Fl);t.namespace=e;t.id=n;return t}function Go(t,e,n,r){var i=t.id,o=t.namespace;return V(t,"function"==typeof n?function(t,a,s){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,s)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function Yo(t){null==t&&(t="");return function(){this.textContent=t}}function $o(t){return null==t?"__transition__":"__transition_"+t+"__"}function Jo(t,e,n,r,i){var o=t[n]||(t[n]={active:0,count:0}),a=o[r];if(!a){var s=i.time;a=o[r]={tween:new f,time:s,delay:i.delay,duration:i.duration,ease:i.ease,index:e};i=null;++o.count;ia.timer(function(i){function l(n){if(o.active>r)return c();var i=o[o.active];if(i){--o.count;delete o[o.active];i.event&&i.event.interrupt.call(t,t.__data__,i.index)}o.active=r;a.event&&a.event.start.call(t,t.__data__,e);a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)});h=a.ease;f=a.duration;ia.timer(function(){p.c=u(n||1)?Ae:u;return 1},0,s)}function u(n){if(o.active!==r)return 1;for(var i=n/f,s=h(i),l=g.length;l>0;)g[--l].call(t,s);if(i>=1){a.event&&a.event.end.call(t,t.__data__,e);return c()}}function c(){--o.count?delete o[r]:delete t[n];return 1}var f,h,d=a.delay,p=os,g=[];p.t=d+s;if(i>=d)return l(i-d);p.c=l;return void 0},0,s)}}function Ko(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Zo(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Qo(t){return t.toISOString()}function ta(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=ia.bisect(Yl,i);return o==Yl.length?[e.year,Yi(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/Yl[o-1]<Yl[o]/i?o-1:o]:[Kl,Yi(t,n)[2]]}r.invert=function(e){return ea(t.invert(e))};r.domain=function(e){if(!arguments.length)return t.domain().map(ea);t.domain(e);return r};r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,ea(+n+1),e).length}var o=r.domain(),a=Fi(o),s=null==t?i(a,10):"number"==typeof t&&i(a,t);s&&(t=s[0],e=s[1]);return r.domain(qi(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=ea(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=ea(+e+1);return e}}:t))};r.ticks=function(t,e){var n=Fi(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];o&&(t=o[0],e=o[1]);return t.range(n[0],ea(+n[1]+1),1>e?1:e)};r.tickFormat=function(){return n};r.copy=function(){return ta(t.copy(),e,n)};return Xi(r,t)}function ea(t){return new Date(t)}function na(t){return JSON.parse(t.responseText)}function ra(t){var e=sa.createRange();e.selectNode(sa.body);return e.createContextualFragment(t.responseText)}var ia={version:"3.5.5"},oa=[].slice,aa=function(t){return oa.call(t)},sa=this.document;if(sa)try{aa(sa.documentElement.childNodes)[0].nodeType}catch(la){aa=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}Date.now||(Date.now=function(){return+new Date});if(sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ua){var ca=this.Element.prototype,fa=ca.setAttribute,ha=ca.setAttributeNS,da=this.CSSStyleDeclaration.prototype,pa=da.setProperty;ca.setAttribute=function(t,e){fa.call(this,t,e+"")};ca.setAttributeNS=function(t,e,n){ha.call(this,t,e,n+"")};da.setProperty=function(t,e,n){pa.call(this,t,e+"",n)}}ia.ascending=i;ia.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0};ia.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n};ia.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n};ia.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=t[o])){n>r&&(n=r);r>i&&(i=r)}}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)if(null!=(r=e.call(t,t[o],o))){n>r&&(n=r);r>i&&(i=r)}}return[n,i]};ia.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)a(n=+t[o])&&(r+=n);else for(;++o<i;)a(n=+e.call(t,t[o],o))&&(r+=n);return r};ia.mean=function(t,e){var n,r=0,i=t.length,s=-1,l=i;if(1===arguments.length)for(;++s<i;)a(n=o(t[s]))?r+=n:--l;else for(;++s<i;)a(n=o(e.call(t,t[s],s)))?r+=n:--l;return l?r/l:void 0};ia.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i};ia.median=function(t,e){var n,r=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)a(n=o(t[l]))&&r.push(n);else for(;++l<s;)a(n=o(e.call(t,t[l],l)))&&r.push(n);return r.length?ia.quantile(r.sort(i),.5):void 0};ia.variance=function(t,e){ var n,r,i=t.length,s=0,l=0,u=-1,c=0;if(1===arguments.length){for(;++u<i;)if(a(n=o(t[u]))){r=n-s;s+=r/++c;l+=r*(n-s)}}else for(;++u<i;)if(a(n=o(e.call(t,t[u],u)))){r=n-s;s+=r/++c;l+=r*(n-s)}return c>1?l/(c-1):void 0};ia.deviation=function(){var t=ia.variance.apply(this,arguments);return t?Math.sqrt(t):t};var ga=s(i);ia.bisectLeft=ga.left;ia.bisect=ia.bisectRight=ga.right;ia.bisector=function(t){return s(1===t.length?function(e,n){return i(t(e),n)}:t)};ia.shuffle=function(t,e,n){if((o=arguments.length)<3){n=t.length;2>o&&(e=0)}for(var r,i,o=n-e;o;){i=Math.random()*o--|0;r=t[o+e],t[o+e]=t[i+e],t[i+e]=r}return t};ia.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r};ia.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o};ia.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=ia.min(arguments,l),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n};ia.transpose=function(t){return ia.zip.apply(ia,t)};ia.keys=function(t){var e=[];for(var n in t)e.push(n);return e};ia.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e};ia.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};ia.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;n=new Array(a);for(;--i>=0;){r=t[i];e=r.length;for(;--e>=0;)n[--a]=r[e]}return n};var ma=Math.abs;ia.range=function(t,e,n){if(arguments.length<3){n=1;if(arguments.length<2){e=t;t=0}}if((e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=u(ma(n)),a=-1;t*=o,e*=o,n*=o;if(0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i};ia.map=function(t,e){var n=new f;if(t instanceof f)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var va="__proto__",ya="\x00";c(f,{has:p,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:g,keys:m,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}});ia.nest=function(){function t(e,a,s){if(s>=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var l,u,c,h,d=-1,p=a.length,g=o[s++],m=new f;++d<p;)(h=m.get(l=g(u=a[d])))?h.push(u):m.set(l,[u]);if(e){u=e();c=function(n,r){u.set(n,t(e,r,s))}}else{u={};c=function(n,r){u[n]=t(e,r,s)}}m.forEach(c);return u}function e(t,n){if(n>=o.length)return t;var r=[],i=a[n++];t.forEach(function(t,i){r.push({key:t,values:e(i,n)})});return i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];i.map=function(e,n){return t(n,e,0)};i.entries=function(n){return e(t(ia.map,n,0),0)};i.key=function(t){o.push(t);return i};i.sortKeys=function(t){a[o.length-1]=t;return i};i.sortValues=function(t){n=t;return i};i.rollup=function(t){r=t;return i};return i};ia.set=function(t){var e=new b;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e};c(b,{has:p,add:function(t){this._[h(t+="")]=!0;return t},remove:g,values:m,size:v,empty:y,forEach:function(t){for(var e in this._)t.call(this,d(e))}});ia.behavior={};ia.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=x(t,e,e[n]);return t};var ba=["webkit","ms","moz","Moz","o","O"];ia.dispatch=function(){for(var t=new T,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=k(t);return t};T.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0){r=t.slice(n+1);t=t.slice(0,n)}if(t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}};ia.event=null;ia.requote=function(t){return t.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},Ca=function(t,e){return e.querySelector(t)},Sa=function(t,e){return e.querySelectorAll(t)},Ta=function(t,e){var n=t.matches||t[C(t,"matchesSelector")];Ta=function(t,e){return n.call(t,e)};return Ta(t,e)};if("function"==typeof Sizzle){Ca=function(t,e){return Sizzle(t,e)[0]||null};Sa=Sizzle;Ta=Sizzle.matchesSelector}ia.selection=function(){return ia.select(sa.documentElement)};var ka=ia.selection.prototype=[];ka.select=function(t){var e,n,r,i,o=[];t=A(t);for(var a=-1,s=this.length;++a<s;){o.push(e=[]);e.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;)if(i=r[l]){e.push(n=t.call(i,i.__data__,l,a));n&&"__data__"in i&&(n.__data__=i.__data__)}else e.push(null)}return L(o)};ka.selectAll=function(t){var e,n,r=[];t=N(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,l=a.length;++s<l;)if(n=a[s]){r.push(e=aa(t.call(n,n.__data__,s,i)));e.parentNode=n}return L(r)};var Ma={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/"};ia.ns={prefix:Ma,qualify:function(t){var e=t.indexOf(":"),n=t;if(e>=0){n=t.slice(0,e);t=t.slice(e+1)}return Ma.hasOwnProperty(n)?{space:Ma[n],local:t}:t}};ka.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();t=ia.ns.qualify(t);return t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(E(e,t[e]));return this}return this.each(E(t,e))};ka.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=I(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else{e=n.getAttribute("class");for(;++i<r;)if(!j(t[i]).test(e))return!1}return!0}for(e in t)this.each(H(e,t[e]));return this}return this.each(H(t,e))};ka.style=function(t,e,n){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.each(R(n,t[n],e));return this}if(2>i){var o=this.node();return r(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(R(t,e,n))};ka.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))};ka.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent};ka.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML};ka.append=function(t){t=W(t);return this.select(function(){return this.appendChild(t.apply(this,arguments))})};ka.insert=function(t,e){t=W(t);e=A(e);return this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})};ka.remove=function(){return this.each(z)};ka.data=function(t,e){function n(t,n){var r,i,o,a=t.length,c=n.length,h=Math.min(a,c),d=new Array(c),p=new Array(c),g=new Array(a);if(e){var m,v=new f,y=new Array(a);for(r=-1;++r<a;){v.has(m=e.call(i=t[r],i.__data__,r))?g[r]=i:v.set(m,i);y[r]=m}for(r=-1;++r<c;){if(i=v.get(m=e.call(n,o=n[r],r))){if(i!==!0){d[r]=i;i.__data__=o}}else p[r]=q(o);v.set(m,!0)}for(r=-1;++r<a;)v.get(y[r])!==!0&&(g[r]=t[r])}else{for(r=-1;++r<h;){i=t[r];o=n[r];if(i){i.__data__=o;d[r]=i}else p[r]=q(o)}for(;c>r;++r)p[r]=q(n[r]);for(;a>r;++r)g[r]=t[r]}p.update=d;p.parentNode=d.parentNode=g.parentNode=t.parentNode;s.push(p);l.push(d);u.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){t=new Array(a=(r=this[0]).length);for(;++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var s=X([]),l=L([]),u=L([]);if("function"==typeof t)for(;++o<a;)n(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)n(r=this[o],t);l.enter=function(){return s};l.exit=function(){return u};return l};ka.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")};ka.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);e.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return L(i)};ka.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)if(n=r[i]){o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o);o=n}return this};ka.sort=function(t){t=B.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()};ka.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})};ka.call=function(t){var e=aa(arguments);t.apply(e[0]=this,e);return this};ka.empty=function(){return!this.node()};ka.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null};ka.size=function(){var t=0;V(this,function(){++t});return t};var _a=[];ia.selection.enter=X;ia.selection.enter.prototype=_a;_a.append=ka.append;_a.empty=ka.empty;_a.node=ka.node;_a.call=ka.call;_a.size=ka.size;_a.select=function(t){for(var e,n,r,i,o,a=[],s=-1,l=this.length;++s<l;){r=(i=this[s]).update;a.push(e=[]);e.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)if(o=i[u]){e.push(r[u]=n=t.call(i.parentNode,o.__data__,u,s));n.__data__=o.__data__}else e.push(null)}return L(a)};_a.insert=function(t,e){arguments.length<2&&(e=G(this));return ka.insert.call(this,t,e)};ia.select=function(t){var n;if("string"==typeof t){n=[Ca(t,sa)];n.parentNode=sa.documentElement}else{n=[t];n.parentNode=e(t)}return L([n])};ia.selectAll=function(t){var e;if("string"==typeof t){e=aa(Sa(t,sa));e.parentNode=sa.documentElement}else{e=t;e.parentNode=null}return L([e])};ka.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(Y(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(Y(t,e,n))};var Da=ia.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&Da.forEach(function(t){"on"+t in sa&&Da.remove(t)});var La,Aa=0;ia.mouse=function(t){return Z(t,_())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ia.touch=function(t,e,n){arguments.length<3&&(n=e,e=_().changedTouches);if(e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return Z(t,r)};ia.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,r,o,a){return function(){function s(){var t,n,r=e(h,g);if(r){t=r[0]-b[0];n=r[1]-b[1];p|=t|n;b=r;d({type:"drag",x:r[0]+u[0],y:r[1]+u[1],dx:t,dy:n})}}function l(){if(e(h,g)){v.on(o+m,null).on(a+m,null);y(p&&ia.event.target===f);d({type:"dragend"})}}var u,c=this,f=ia.event.target,h=c.parentNode,d=n.of(c,arguments),p=0,g=t(),m=".drag"+(null==g?"":"-"+g),v=ia.select(r(f)).on(o+m,s).on(a+m,l),y=K(f),b=e(h,g);if(i){u=i.apply(c,arguments);u=[u.x-b[0],u.y-b[1]]}else u=[0,0];d({type:"dragstart"})}}var n=D(t,"drag","dragstart","dragend"),i=null,o=e(S,ia.mouse,r,"mousemove","mouseup"),a=e(Q,ia.touch,w,"touchmove","touchend");t.origin=function(e){if(!arguments.length)return i;i=e;return t};return ia.rebind(t,n,"on")};ia.touches=function(t,e){arguments.length<2&&(e=_().touches);return e?aa(e).map(function(e){var n=Z(t,e);n.identifier=e.identifier;return n}):[]};var Ea=1e-6,Pa=Ea*Ea,ja=Math.PI,Ia=2*ja,Ha=Ia-Ea,Oa=ja/2,Ra=ja/180,Fa=180/ja,Wa=Math.SQRT2,za=2,qa=4;ia.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=ot(g),a=o/(za*h)*(n*at(Wa*e+g)-it(g));return[r+a*u,i+a*c,o*n/ot(Wa*e+g)]}return[r+t*u,i+t*c,o*Math.exp(Wa*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],l=e[2],u=a-r,c=s-i,f=u*u+c*c,h=Math.sqrt(f),d=(l*l-o*o+qa*f)/(2*o*za*h),p=(l*l-o*o-qa*f)/(2*l*za*h),g=Math.log(Math.sqrt(d*d+1)-d),m=Math.log(Math.sqrt(p*p+1)-p),v=m-g,y=(v||Math.log(l/o))/Wa;n.duration=1e3*y;return n};ia.behavior.zoom=function(){function t(t){t.on(N,f).on(Ba+".zoom",d).on("dblclick.zoom",p).on(j,h)}function e(t){return[(t[0]-T.x)/T.k,(t[1]-T.y)/T.k]}function n(t){return[t[0]*T.k+T.x,t[1]*T.k+T.y]}function i(t){T.k=Math.max(_[0],Math.min(_[1],t))}function o(t,e){e=n(e);T.x+=t[0]-e[0];T.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:T.x,y:T.y,k:T.k};i(Math.pow(2,a));o(m=n,r);e=ia.select(e);L>0&&(e=e.transition().duration(L));e.call(t.event)}function s(){x&&x.domain(w.range().map(function(t){return(t-T.x)/T.k}).map(w.invert));S&&S.domain(C.range().map(function(t){return(t-T.y)/T.k}).map(C.invert))}function l(t){A++||t({type:"zoomstart"})}function u(t){s();t({type:"zoom",scale:T.k,translate:[T.x,T.y]})}function c(t){--A||t({type:"zoomend"});m=null}function f(){function t(){f=1;o(ia.mouse(i),d);u(s)}function n(){h.on(E,null).on(P,null);p(f&&ia.event.target===a);c(s)}var i=this,a=ia.event.target,s=I.of(i,arguments),f=0,h=ia.select(r(i)).on(E,t).on(P,n),d=e(ia.mouse(i)),p=K(i);Rl.call(i);l(s)}function h(){function t(){var t=ia.touches(p);d=T.k;t.forEach(function(t){t.identifier in m&&(m[t.identifier]=e(t))});return t}function n(){var e=ia.event.target;ia.select(e).on(w,r).on(x,s);C.push(e);for(var n=ia.event.changedTouches,i=0,o=n.length;o>i;++i)m[n[i].identifier]=null;var l=t(),u=Date.now();if(1===l.length){if(500>u-b){var c=l[0];a(p,c,m[c.identifier],Math.floor(Math.log(T.k)/Math.LN2)+1);M()}b=u}else if(l.length>1){var c=l[0],f=l[1],h=c[0]-f[0],d=c[1]-f[1];v=h*h+d*d}}function r(){var t,e,n,r,a=ia.touches(p);Rl.call(p);for(var s=0,l=a.length;l>s;++s,r=null){n=a[s];if(r=m[n.identifier]){if(e)break;t=n,e=r}}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2];e=[(e[0]+r[0])/2,(e[1]+r[1])/2];i(f*d)}b=null;o(t,e);u(g)}function s(){if(ia.event.touches.length){for(var e=ia.event.changedTouches,n=0,r=e.length;r>n;++n)delete m[e[n].identifier];for(var i in m)return void t()}ia.selectAll(C).on(y,null);S.on(N,f).on(j,h);k();c(g)}var d,p=this,g=I.of(p,arguments),m={},v=0,y=".zoom-"+ia.event.changedTouches[0].identifier,w="touchmove"+y,x="touchend"+y,C=[],S=ia.select(p),k=K(p);n();l(g);S.on(N,null).on(j,n)}function d(){var t=I.of(this,arguments);y?clearTimeout(y):(g=e(m=v||ia.mouse(this)),Rl.call(this),l(t));y=setTimeout(function(){y=null;c(t)},50);M();i(Math.pow(2,.002*Ua())*T.k);o(m,g);u(t)}function p(){var t=ia.mouse(this),n=Math.log(T.k)/Math.LN2;a(this,t,e(t),ia.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,m,v,y,b,w,x,C,S,T={x:0,y:0,k:1},k=[960,500],_=Va,L=250,A=0,N="mousedown.zoom",E="mousemove.zoom",P="mouseup.zoom",j="touchstart.zoom",I=D(t,"zoomstart","zoom","zoomend");Ba||(Ba="onwheel"in sa?(Ua=function(){return-ia.event.deltaY*(ia.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Ua=function(){return ia.event.wheelDelta},"mousewheel"):(Ua=function(){return-ia.event.detail},"MozMousePixelScroll"));t.event=function(t){t.each(function(){var t=I.of(this,arguments),e=T;if(Hl)ia.select(this).transition().each("start.zoom",function(){T=this.__chart__||{x:0,y:0,k:1};l(t)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=m?m[0]:n/2,o=m?m[1]:r/2,a=ia.interpolateZoom([(i-T.x)/T.k,(o-T.y)/T.k,n/T.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=T={x:i-r[0]*s,y:o-r[1]*s,k:s};u(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)});else{this.__chart__=T;l(t);u(t);c(t)}})};t.translate=function(e){if(!arguments.length)return[T.x,T.y];T={x:+e[0],y:+e[1],k:T.k};s();return t};t.scale=function(e){if(!arguments.length)return T.k;T={x:T.x,y:T.y,k:+e};s();return t};t.scaleExtent=function(e){if(!arguments.length)return _;_=null==e?Va:[+e[0],+e[1]];return t};t.center=function(e){if(!arguments.length)return v;v=e&&[+e[0],+e[1]];return t};t.size=function(e){if(!arguments.length)return k;k=e&&[+e[0],+e[1]];return t};t.duration=function(e){if(!arguments.length)return L;L=+e;return t};t.x=function(e){if(!arguments.length)return x;x=e;w=e.copy();T={x:0,y:0,k:1};return t};t.y=function(e){if(!arguments.length)return S;S=e;C=e.copy();T={x:0,y:0,k:1};return t};return ia.rebind(t,I,"on")};var Ua,Ba,Va=[0,1/0];ia.color=lt;lt.prototype.toString=function(){return this.rgb()+""};ia.hsl=ut;var Xa=ut.prototype=new lt;Xa.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);return new ut(this.h,this.s,this.l/t)};Xa.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new ut(this.h,this.s,t*this.l)};Xa.rgb=function(){return ct(this.h,this.s,this.l)};ia.hcl=ft;var Ga=ft.prototype=new lt;Ga.brighter=function(t){return new ft(this.h,this.c,Math.min(100,this.l+Ya*(arguments.length?t:1)))};Ga.darker=function(t){return new ft(this.h,this.c,Math.max(0,this.l-Ya*(arguments.length?t:1)))};Ga.rgb=function(){return ht(this.h,this.c,this.l).rgb()};ia.lab=dt;var Ya=18,$a=.95047,Ja=1,Ka=1.08883,Za=dt.prototype=new lt;Za.brighter=function(t){return new dt(Math.min(100,this.l+Ya*(arguments.length?t:1)),this.a,this.b)};Za.darker=function(t){return new dt(Math.max(0,this.l-Ya*(arguments.length?t:1)),this.a,this.b)};Za.rgb=function(){return pt(this.l,this.a,this.b)};ia.rgb=bt;var Qa=bt.prototype=new lt;Qa.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;if(!e&&!n&&!r)return new bt(i,i,i);e&&i>e&&(e=i);n&&i>n&&(n=i);r&&i>r&&(r=i);return new bt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))};Qa.darker=function(t){t=Math.pow(.7,arguments.length?t:1);return new bt(t*this.r,t*this.g,t*this.b)};Qa.hsl=function(){return Tt(this.r,this.g,this.b)};Qa.toString=function(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)};var ts=ia.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,rebeccapurple:6697881,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});ts.forEach(function(t,e){ts.set(t,wt(e))});ia.functor=Dt;ia.xhr=Lt(w);ia.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=At(t,e,null==n?r:i(n),o);a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n};return a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})};n.parseRows=function(t,e){function n(){if(c>=u)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<u;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);if(13===r){i=!0;10===t.charCodeAt(n+2)&&++c}else 10===r&&(i=!0);return t.slice(e+1,n).replace(/""/g,'"')}for(;u>c;){var r=t.charCodeAt(c++),s=1;if(10===r)i=!0;else if(13===r){i=!0;10===t.charCodeAt(c)&&(++c,++s)}else if(r!==l)continue;return t.slice(e,c-s)}return t.slice(e)}for(var r,i,o={},a={},s=[],u=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;){h.push(r);r=n()}e&&null==(h=e(h,f++))||s.push(h)}return s};n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new b,i=[];e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))});return[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")};n.formatRows=function(t){return t.map(o).join("\n")};return n};ia.csv=ia.dsv(",","text/csv");ia.tsv=ia.dsv(" ","text/tab-separated-values");var es,ns,rs,is,os,as=this[C(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ia.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0);3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};ns?ns.n=o:es=o;ns=o;if(!rs){is=clearTimeout(is);rs=1;as(Pt)}};ia.timer.flush=function(){jt();It()};ia.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var ss=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ot);ia.formatPrefix=function(t,e){var n=0;if(t){0>t&&(t*=-1);e&&(t=ia.round(t,Ht(t,e)));n=1+Math.floor(1e-12+Math.log(t)/Math.LN10);n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))}return ss[8+n/3]};var ls=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,us=ia.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ia.round(t,Ht(t,e))).toFixed(Math.max(0,Math.min(20,Ht(t*(1+1e-15),e))))}}),cs=ia.time={},fs=Date;Wt.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(){hs.setUTCDate.apply(this._,arguments)},setDay:function(){hs.setUTCDay.apply(this._,arguments)},setFullYear:function(){hs.setUTCFullYear.apply(this._,arguments)},setHours:function(){hs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){hs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){hs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){hs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){hs.setUTCSeconds.apply(this._,arguments)},setTime:function(){hs.setTime.apply(this._,arguments)}};var hs=Date.prototype;cs.year=zt(function(t){t=cs.day(t);t.setMonth(0,1);return t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()});cs.years=cs.year.range;cs.years.utc=cs.year.utc.range;cs.day=zt(function(t){var e=new fs(2e3,0);e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate());return e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1});cs.days=cs.day.range;cs.days.utc=cs.day.utc.range;cs.dayOfYear=function(t){var e=cs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)};["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=cs[t]=zt(function(t){(t=cs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7);return t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});cs[t+"s"]=n.range;cs[t+"s"].utc=n.utc.range;cs[t+"OfYear"]=function(t){var n=cs.year(t).getDay();return Math.floor((cs.dayOfYear(t)+(n+e)%7)/7)}});cs.week=cs.sunday;cs.weeks=cs.sunday.range;cs.weeks.utc=cs.sunday.utc.range;cs.weekOfYear=cs.sundayOfYear;var ds={"-":"",_:" ",0:"0"},ps=/^\s*\d+/,gs=/^%/;ia.locale=function(t){return{numberFormat:Rt(t),timeFormat:Ut(t)}};var ms=ia.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"]});ia.format=ms.numberFormat;ia.geo={};ce.prototype={s:0,t:0,add:function(t){fe(t,this.t,vs);fe(vs.s,this.s,this);this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new ce;ia.geo.stream=function(t,e){t&&ys.hasOwnProperty(t.type)?ys[t.type](t,e):he(t,e)};var ys={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)he(n[r].geometry,e)}},bs={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates;e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){de(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)de(n[r],e,0)},Polygon:function(t,e){pe(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)pe(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)he(n[r],e)}};ia.geo.area=function(t){ws=0;ia.geo.stream(t,Cs);return ws};var ws,xs=new ce,Cs={sphere:function(){ws+=4*ja},point:S,lineStart:S,lineEnd:S,polygonStart:function(){xs.reset();Cs.lineStart=ge},polygonEnd:function(){var t=2*xs;ws+=0>t?4*ja+t:t;Cs.lineStart=Cs.lineEnd=Cs.point=S}};ia.geo.bounds=function(){function t(t,e){b.push(w=[c=t,h=t]);f>e&&(f=e);e>d&&(d=e)}function e(e,n){var r=me([e*Ra,n*Ra]);if(v){var i=ye(v,r),o=[i[1],-i[0],0],a=ye(o,i);xe(a);a=Ce(a);var l=e-p,u=l>0?1:-1,g=a[0]*Fa*u,m=ma(l)>180;if(m^(g>u*p&&u*e>g)){var y=a[1]*Fa;y>d&&(d=y)}else if(g=(g+360)%360-180,m^(g>u*p&&u*e>g)){var y=-a[1]*Fa;f>y&&(f=y)}else{f>n&&(f=n);n>d&&(d=n)}if(m)p>e?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e);else if(h>=c){c>e&&(c=e);e>h&&(h=e)}else e>p?s(c,e)>s(c,h)&&(h=e):s(e,h)>s(c,h)&&(c=e)}else t(e,n);v=r,p=e}function n(){x.point=e}function r(){w[0]=c,w[1]=h;x.point=t;v=null}function i(t,n){if(v){var r=t-p;y+=ma(r)>180?r+(r>0?360:-360):r}else g=t,m=n;Cs.point(t,n);e(t,n)}function o(){Cs.lineStart()}function a(){i(g,m);Cs.lineEnd();ma(y)>Ea&&(c=-(h=180));w[0]=c,w[1]=h;v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function u(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,d,p,g,m,v,y,b,w,x={point:t,lineStart:n,lineEnd:r,polygonStart:function(){x.point=i;x.lineStart=o;x.lineEnd=a;y=0;Cs.polygonStart()},polygonEnd:function(){Cs.polygonEnd();x.point=t;x.lineStart=n;x.lineEnd=r;0>xs?(c=-(h=180),f=-(d=90)):y>Ea?d=90:-Ea>y&&(f=-90);w[0]=c,w[1]=h}};return function(t){d=h=-(c=f=1/0);b=[];ia.geo.stream(t,x);var e=b.length;if(e){b.sort(l);for(var n,r=1,i=b[0],o=[i];e>r;++r){n=b[r];if(u(n[0],i)||u(n[1],i)){s(i[0],n[1])>s(i[0],i[1])&&(i[1]=n[1]);s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])}else o.push(i=n)}for(var a,n,p=-(1/0),e=o.length-1,r=0,i=o[e];e>=r;i=n,++r){n=o[r];(a=s(i[1],n[0]))>p&&(p=a,c=n[0],h=i[1])}}b=w=null;return c===1/0||f===1/0?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,d]]}}();ia.geo.centroid=function(t){Ss=Ts=ks=Ms=_s=Ds=Ls=As=Ns=Es=Ps=0;ia.geo.stream(t,js);var e=Ns,n=Es,r=Ps,i=e*e+n*n+r*r;if(Pa>i){e=Ds,n=Ls,r=As;Ea>Ts&&(e=ks,n=Ms,r=_s);i=e*e+n*n+r*r;if(Pa>i)return[0/0,0/0]}return[Math.atan2(n,e)*Fa,rt(r/Math.sqrt(i))*Fa]};var Ss,Ts,ks,Ms,_s,Ds,Ls,As,Ns,Es,Ps,js={sphere:S,point:Te,lineStart:Me,lineEnd:_e,polygonStart:function(){js.lineStart=De},polygonEnd:function(){js.lineStart=Me}},Is=je(Ae,Re,We,[-ja,-ja/2]),Hs=1e9;ia.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){i&&(i.valid=!1);i=o(t);i.valid=!0;return i},extent:function(s){if(!arguments.length)return[[t,e],[n,r]];o=Be(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]);i&&(i.valid=!1,i=null);return a}};return a.extent([[0,0],[960,500]])};(ia.geo.conicEqualArea=function(){return Ve(Xe)}).raw=Xe;ia.geo.albers=function(){return ia.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};ia.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];e=null;(n(o,a),e)||(r(o,a),e)||i(o,a);return e}var e,n,r,i,o=ia.geo.albers(),a=ia.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=ia.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?s:o).invert(t)};t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,i){e.point(t,i);n.point(t,i);r.point(t,i)},sphere:function(){e.sphere();n.sphere();r.sphere()},lineStart:function(){e.lineStart();n.lineStart();r.lineStart()},lineEnd:function(){e.lineEnd();n.lineEnd();r.lineEnd()},polygonStart:function(){e.polygonStart();n.polygonStart();r.polygonStart()},polygonEnd:function(){e.polygonEnd();n.polygonEnd();r.polygonEnd()}}};t.precision=function(e){if(!arguments.length)return o.precision();o.precision(e);a.precision(e);s.precision(e);return t};t.scale=function(e){if(!arguments.length)return o.scale();o.scale(e);a.scale(.35*e);s.scale(e);return t.translate(o.translate())};t.translate=function(e){if(!arguments.length)return o.translate();var u=o.scale(),c=+e[0],f=+e[1];n=o.translate(e).clipExtent([[c-.455*u,f-.238*u],[c+.455*u,f+.238*u]]).stream(l).point;r=a.translate([c-.307*u,f+.201*u]).clipExtent([[c-.425*u+Ea,f+.12*u+Ea],[c-.214*u-Ea,f+.234*u-Ea]]).stream(l).point;i=s.translate([c-.205*u,f+.212*u]).clipExtent([[c-.214*u+Ea,f+.166*u+Ea],[c-.115*u-Ea,f+.234*u-Ea]]).stream(l).point;return t};return t.scale(1070)};var Os,Rs,Fs,Ws,zs,qs,Us={point:S,lineStart:S,lineEnd:S,polygonStart:function(){Rs=0;Us.lineStart=Ge},polygonEnd:function(){Us.lineStart=Us.lineEnd=Us.point=S;Os+=ma(Rs/2)}},Bs={point:Ye,lineStart:S,lineEnd:S,polygonStart:S,polygonEnd:S},Vs={point:Ke,lineStart:Ze, lineEnd:Qe,polygonStart:function(){Vs.lineStart=tn},polygonEnd:function(){Vs.point=Ke;Vs.lineStart=Ze;Vs.lineEnd=Qe}};ia.geo.path=function(){function t(t){if(t){"function"==typeof s&&o.pointRadius(+s.apply(this,arguments));a&&a.valid||(a=i(o));ia.geo.stream(t,a)}return o.result()}function e(){a=null;return t}var n,r,i,o,a,s=4.5;t.area=function(t){Os=0;ia.geo.stream(t,i(Us));return Os};t.centroid=function(t){ks=Ms=_s=Ds=Ls=As=Ns=Es=Ps=0;ia.geo.stream(t,i(Vs));return Ps?[Ns/Ps,Es/Ps]:As?[Ds/As,Ls/As]:_s?[ks/_s,Ms/_s]:[0/0,0/0]};t.bounds=function(t){zs=qs=-(Fs=Ws=1/0);ia.geo.stream(t,i(Bs));return[[Fs,Ws],[zs,qs]]};t.projection=function(t){if(!arguments.length)return n;i=(n=t)?t.stream||rn(t):w;return e()};t.context=function(t){if(!arguments.length)return r;o=null==(r=t)?new $e:new en(t);"function"!=typeof s&&o.pointRadius(s);return e()};t.pointRadius=function(e){if(!arguments.length)return s;s="function"==typeof e?e:(o.pointRadius(+e),+e);return t};return t.projection(ia.geo.albersUsa()).context(null)};ia.geo.transform=function(t){return{stream:function(e){var n=new on(e);for(var r in t)n[r]=t[r];return n}}};on.prototype={point:function(t,e){this.stream.point(t,e)},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()}};ia.geo.projection=sn;ia.geo.projectionMutator=ln;(ia.geo.equirectangular=function(){return sn(cn)}).raw=cn.invert=cn;ia.geo.rotation=function(t){function e(e){e=t(e[0]*Ra,e[1]*Ra);return e[0]*=Fa,e[1]*=Fa,e}t=hn(t[0]%360*Ra,t[1]*Ra,t.length>2?t[2]*Ra:0);e.invert=function(e){e=t.invert(e[0]*Ra,e[1]*Ra);return e[0]*=Fa,e[1]*=Fa,e};return e};fn.invert=cn;ia.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=hn(-t[0]*Ra,-t[1]*Ra,0).invert,i=[];n(null,null,1,{point:function(t,n){i.push(t=e(t,n));t[0]*=Fa,t[1]*=Fa}});return{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;t.origin=function(e){if(!arguments.length)return r;r=e;return t};t.angle=function(r){if(!arguments.length)return e;n=mn((e=+r)*Ra,i*Ra);return t};t.precision=function(r){if(!arguments.length)return i;n=mn(e*Ra,(i=+r)*Ra);return t};return t.angle(90)};ia.geo.distance=function(t,e){var n,r=(e[0]-t[0])*Ra,i=t[1]*Ra,o=e[1]*Ra,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=u*c-l*f*s)*n),l*c+u*f*s)};ia.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ia.range(Math.ceil(o/m)*m,i,m).map(h).concat(ia.range(Math.ceil(u/v)*v,l,v).map(d)).concat(ia.range(Math.ceil(r/p)*p,n,p).filter(function(t){return ma(t%m)>Ea}).map(c)).concat(ia.range(Math.ceil(s/g)*g,a,g).filter(function(t){return ma(t%v)>Ea}).map(f))}var n,r,i,o,a,s,l,u,c,f,h,d,p=10,g=p,m=90,v=360,y=2.5;t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})};t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(d(l).slice(1),h(i).reverse().slice(1),d(u).reverse().slice(1))]}};t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()};t.majorExtent=function(e){if(!arguments.length)return[[o,u],[i,l]];o=+e[0][0],i=+e[1][0];u=+e[0][1],l=+e[1][1];o>i&&(e=o,o=i,i=e);u>l&&(e=u,u=l,l=e);return t.precision(y)};t.minorExtent=function(e){if(!arguments.length)return[[r,s],[n,a]];r=+e[0][0],n=+e[1][0];s=+e[0][1],a=+e[1][1];r>n&&(e=r,r=n,n=e);s>a&&(e=s,s=a,a=e);return t.precision(y)};t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()};t.majorStep=function(e){if(!arguments.length)return[m,v];m=+e[0],v=+e[1];return t};t.minorStep=function(e){if(!arguments.length)return[p,g];p=+e[0],g=+e[1];return t};t.precision=function(e){if(!arguments.length)return y;y=+e;c=yn(s,a,90);f=bn(r,n,y);h=yn(u,l,90);d=bn(o,i,y);return t};return t.majorExtent([[-180,-90+Ea],[180,90-Ea]]).minorExtent([[-180,-80-Ea],[180,80+Ea]])};ia.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=wn,i=xn;t.distance=function(){return ia.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))};t.source=function(n){if(!arguments.length)return r;r=n,e="function"==typeof n?null:n;return t};t.target=function(e){if(!arguments.length)return i;i=e,n="function"==typeof e?null:e;return t};t.precision=function(){return arguments.length?t:0};return t};ia.geo.interpolate=function(t,e){return Cn(t[0]*Ra,t[1]*Ra,e[0]*Ra,e[1]*Ra)};ia.geo.length=function(t){Xs=0;ia.geo.stream(t,Gs);return Xs};var Xs,Gs={sphere:S,point:S,lineStart:Sn,lineEnd:S,polygonStart:S,polygonEnd:S},Ys=Tn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ia.geo.azimuthalEqualArea=function(){return sn(Ys)}).raw=Ys;var $s=Tn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},w);(ia.geo.azimuthalEquidistant=function(){return sn($s)}).raw=$s;(ia.geo.conicConformal=function(){return Ve(kn)}).raw=kn;(ia.geo.conicEquidistant=function(){return Ve(Mn)}).raw=Mn;var Js=Tn(function(t){return 1/t},Math.atan);(ia.geo.gnomonic=function(){return sn(Js)}).raw=Js;_n.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Oa]};(ia.geo.mercator=function(){return Dn(_n)}).raw=_n;var Ks=Tn(function(){return 1},Math.asin);(ia.geo.orthographic=function(){return sn(Ks)}).raw=Ks;var Zs=Tn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ia.geo.stereographic=function(){return sn(Zs)}).raw=Zs;Ln.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Oa]};(ia.geo.transverseMercator=function(){var t=Dn(Ln),e=t.center,n=t.rotate;t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90])}).raw=Ln;ia.geom={};ia.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=Dt(n),o=Dt(r),a=t.length,s=[],l=[];for(e=0;a>e;e++)s.push([+i.call(this,t[e],e),+o.call(this,t[e],e),e]);s.sort(Pn);for(e=0;a>e;e++)l.push([s[e][0],-s[e][1]]);var u=En(s),c=En(l),f=c[0]===u[0],h=c[c.length-1]===u[u.length-1],d=[];for(e=u.length-1;e>=0;--e)d.push(t[s[u[e]][2]]);for(e=+f;e<c.length-h;++e)d.push(t[s[c[e]][2]]);return d}var n=An,r=Nn;if(arguments.length)return e(t);e.x=function(t){return arguments.length?(n=t,e):n};e.y=function(t){return arguments.length?(r=t,e):r};return e};ia.geom.polygon=function(t){xa(t,Qs);return t};var Qs=ia.geom.polygon.prototype=[];Qs.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;){t=r;r=this[e];i+=t[1]*r[0]-t[0]*r[1]}return.5*i};Qs.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,s=this[i-1];arguments.length||(t=-1/(6*this.area()));for(;++r<i;){e=s;s=this[r];n=e[0]*s[1]-s[0]*e[1];o+=(e[0]+s[0])*n;a+=(e[1]+s[1])*n}return[o*t,a*t]};Qs.clip=function(t){for(var e,n,r,i,o,a,s=Hn(t),l=-1,u=this.length-Hn(this),c=this[u-1];++l<u;){e=t.slice();t.length=0;i=this[l];o=e[(r=e.length-s)-1];n=-1;for(;++n<r;){a=e[n];if(jn(a,c,i)){jn(o,c,i)||t.push(In(o,a,c,i));t.push(a)}else jn(o,c,i)&&t.push(In(o,a,c,i));o=a}s&&t.push(t[0]);c=i}return t};var tl,el,nl,rl,il,ol=[],al=[];Bn.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;){t=e[n].edge;t.b&&t.a||e.splice(n,1)}e.sort(Xn);return e.length};nr.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}};rr.prototype={insert:function(t,e){var n,r,i;if(t){e.P=t;e.N=t.N;t.N&&(t.N.P=e);t.N=e;if(t.R){t=t.R;for(;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else if(this._){t=sr(this._);e.P=null;e.N=t;t.P=t.L=e;n=t}else{e.P=e.N=null;this._=e;n=null}e.L=e.R=null;e.U=n;e.C=!0;t=e;for(;n&&n.C;){r=n.U;if(n===r.L){i=r.R;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.R){or(this,n);t=n;n=t.U}n.C=!1;r.C=!0;ar(this,r)}}else{i=r.L;if(i&&i.C){n.C=i.C=!1;r.C=!0;t=r}else{if(t===n.L){ar(this,n);t=n;n=t.U}n.C=!1;r.C=!0;or(this,r)}}n=t.U}this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P);t.P&&(t.P.N=t.N);t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;n=o?a?sr(a):o:a;i?i.L===t?i.L=n:i.R=n:this._=n;if(o&&a){r=n.C;n.C=t.C;n.L=o;o.U=n;if(n!==a){i=n.U;n.U=t.U;t=n.R;i.L=t;n.R=a;a.U=n}else{n.U=i;i=n;t=n.R}}else{r=t.C;t=n}t&&(t.U=i);if(!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){e=i.R;if(e.C){e.C=!1;i.C=!0;or(this,i);e=i.R}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.R||!e.R.C){e.L.C=!1;e.C=!0;ar(this,e);e=i.R}e.C=i.C;i.C=e.R.C=!1;or(this,i);t=this._;break}}else{e=i.L;if(e.C){e.C=!1;i.C=!0;ar(this,i);e=i.L}if(e.L&&e.L.C||e.R&&e.R.C){if(!e.L||!e.L.C){e.R.C=!1;e.C=!0;or(this,e);e=i.L}e.C=i.C;i.C=e.L.C=!1;ar(this,i);t=this._;break}}e.C=!0;t=i;i=i.U}while(!t.C);t&&(t.C=!1)}}};ia.geom.voronoi=function(t){function e(t){var e=new Array(t.length),r=s[0][0],i=s[0][1],o=s[1][0],a=s[1][1];lr(n(t),s).cells.forEach(function(n,s){var l=n.edges,u=n.site,c=e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=r&&u.x<=o&&u.y>=i&&u.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];c.point=t[s]});return e}function n(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/Ea)*Ea,y:Math.round(a(t,e)/Ea)*Ea,i:e}})}var r=An,i=Nn,o=r,a=i,s=sl;if(t)return e(t);e.links=function(t){return lr(n(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})};e.triangles=function(t){var e=[];lr(n(t)).cells.forEach(function(n,r){for(var i,o,a=n.site,s=n.edges.sort(Xn),l=-1,u=s.length,c=s[u-1].edge,f=c.l===a?c.r:c.l;++l<u;){i=c;o=f;c=s[l].edge;f=c.l===a?c.r:c.l;r<o.i&&r<f.i&&cr(a,o,f)<0&&e.push([t[r],t[o.i],t[f.i]])}});return e};e.x=function(t){return arguments.length?(o=Dt(r=t),e):r};e.y=function(t){return arguments.length?(a=Dt(i=t),e):i};e.clipExtent=function(t){if(!arguments.length)return s===sl?null:s;s=null==t?sl:t;return e};e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===sl?null:s&&s[1]};return e};var sl=[[-1e6,-1e6],[1e6,1e6]];ia.geom.delaunay=function(t){return ia.geom.voronoi().triangles(t)};ia.geom.quadtree=function(t,e,n,r,i){function o(t){function o(t,e,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(ma(l-n)+ma(c-r)<.01)u(t,e,n,r,i,o,a,s);else{var f=t.point;t.x=t.y=t.point=null;u(t,f,l,c,i,o,a,s);u(t,e,n,r,i,o,a,s)}else t.x=n,t.y=r,t.point=e}else u(t,e,n,r,i,o,a,s)}function u(t,e,n,r,i,a,s,l){var u=.5*(i+s),c=.5*(a+l),f=n>=u,h=r>=c,d=h<<1|f;t.leaf=!1;t=t.nodes[d]||(t.nodes[d]=dr());f?i=u:s=u;h?a=c:l=c;o(t,e,n,r,i,a,s,l)}var c,f,h,d,p,g,m,v,y,b=Dt(s),w=Dt(l);if(null!=e)g=e,m=n,v=r,y=i;else{v=y=-(g=m=1/0);f=[],h=[];p=t.length;if(a)for(d=0;p>d;++d){c=t[d];c.x<g&&(g=c.x);c.y<m&&(m=c.y);c.x>v&&(v=c.x);c.y>y&&(y=c.y);f.push(c.x);h.push(c.y)}else for(d=0;p>d;++d){var x=+b(c=t[d],d),C=+w(c,d);g>x&&(g=x);m>C&&(m=C);x>v&&(v=x);C>y&&(y=C);f.push(x);h.push(C)}}var S=v-g,T=y-m;S>T?y=m+S:v=g+T;var k=dr();k.add=function(t){o(k,t,+b(t,++d),+w(t,d),g,m,v,y)};k.visit=function(t){pr(t,k,g,m,v,y)};k.find=function(t){return gr(k,t[0],t[1],g,m,v,y)};d=-1;if(null==e){for(;++d<p;)o(k,t[d],f[d],h[d],g,m,v,y);--d}else t.forEach(k.add);f=h=t=c=null;return k}var a,s=An,l=Nn;if(a=arguments.length){s=fr;l=hr;if(3===a){i=n;r=e;n=e=0}return o(t)}o.x=function(t){return arguments.length?(s=t,o):s};o.y=function(t){return arguments.length?(l=t,o):l};o.extent=function(t){if(!arguments.length)return null==e?null:[[e,n],[r,i]];null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]);return o};o.size=function(t){if(!arguments.length)return null==e?null:[r-e,i-n];null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]);return o};return o};ia.interpolateRgb=mr;ia.interpolateObject=vr;ia.interpolateNumber=yr;ia.interpolateString=br;var ll=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ul=new RegExp(ll.source,"g");ia.interpolate=wr;ia.interpolators=[function(t,e){var n=typeof e;return("string"===n?ts.has(e)||/^(#|rgb\(|hsl\()/.test(e)?mr:br:e instanceof lt?mr:Array.isArray(e)?xr:"object"===n&&isNaN(e)?vr:yr)(t,e)}];ia.interpolateArray=xr;var cl=function(){return w},fl=ia.map({linear:cl,poly:Dr,quad:function(){return kr},cubic:function(){return Mr},sin:function(){return Lr},exp:function(){return Ar},circle:function(){return Nr},elastic:Er,back:Pr,bounce:function(){return jr}}),hl=ia.map({"in":w,out:Sr,"in-out":Tr,"out-in":function(t){return Tr(Sr(t))}});ia.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";n=fl.get(n)||cl;r=hl.get(r)||w;return Cr(r(n.apply(null,oa.call(arguments,1))))};ia.interpolateHcl=Ir;ia.interpolateHsl=Hr;ia.interpolateLab=Or;ia.interpolateRound=Rr;ia.transform=function(t){var e=sa.createElementNS(ia.ns.prefix.svg,"g");return(ia.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Fr(n?n.matrix:dl)})(t)};Fr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};ia.interpolateTransform=Ur;ia.layout={};ia.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Xr(t[n]));return e}};ia.layout.chord=function(){function t(){var t,u,f,h,d,p={},g=[],m=ia.range(o),v=[];n=[];r=[];t=0,h=-1;for(;++h<o;){u=0,d=-1;for(;++d<o;)u+=i[h][d];g.push(u);v.push(ia.range(o));t+=u}a&&m.sort(function(t,e){return a(g[t],g[e])});s&&v.forEach(function(t,e){t.sort(function(t,n){return s(i[e][t],i[e][n])})});t=(Ia-c*o)/t;u=0,h=-1;for(;++h<o;){f=u,d=-1;for(;++d<o;){var y=m[h],b=v[y][d],w=i[y][b],x=u,C=u+=w*t;p[y+"-"+b]={index:y,subindex:b,startAngle:x,endAngle:C,value:w}}r[y]={index:y,startAngle:f,endAngle:u,value:(u-f)/t};u+=c}h=-1;for(;++h<o;){d=h-1;for(;++d<o;){var S=p[h+"-"+d],T=p[d+"-"+h];(S.value||T.value)&&n.push(S.value<T.value?{source:T,target:S}:{source:S,target:T})}}l&&e()}function e(){n.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,s,l,u={},c=0;u.matrix=function(t){if(!arguments.length)return i;o=(i=t)&&i.length;n=r=null;return u};u.padding=function(t){if(!arguments.length)return c;c=t;n=r=null;return u};u.sortGroups=function(t){if(!arguments.length)return a;a=t;n=r=null;return u};u.sortSubgroups=function(t){if(!arguments.length)return s;s=t;n=null;return u};u.sortChords=function(t){if(!arguments.length)return l;l=t;n&&e();return u};u.chords=function(){n||t();return n};u.groups=function(){r||t();return r};return u};ia.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=i-n,l=o*o+a*a;if(l>s*s/m){if(p>l){var u=e.charge/l;t.px-=o*u;t.py-=a*u}return!0}if(e.point&&l&&p>l){var u=e.pointCharge/l;t.px-=o*u;t.py-=a*u}}return!e.charge}}function e(t){t.px=ia.event.x,t.py=ia.event.y;s.resume()}var n,r,i,o,a,s={},l=ia.dispatch("start","tick","end"),u=[1,1],c=.9,f=pl,h=gl,d=-30,p=ml,g=.1,m=.64,v=[],y=[];s.tick=function(){if((r*=.99)<.005){l.end({type:"end",alpha:r=0});return!0}var e,n,s,f,h,p,m,b,w,x=v.length,C=y.length;for(n=0;C>n;++n){s=y[n];f=s.source;h=s.target;b=h.x-f.x;w=h.y-f.y;if(p=b*b+w*w){p=r*o[n]*((p=Math.sqrt(p))-i[n])/p;b*=p;w*=p;h.x-=b*(m=f.weight/(h.weight+f.weight));h.y-=w*m;f.x+=b*(m=1-m);f.y+=w*m}}if(m=r*g){b=u[0]/2;w=u[1]/2;n=-1;if(m)for(;++n<x;){s=v[n];s.x+=(b-s.x)*m;s.y+=(w-s.y)*m}}if(d){Qr(e=ia.geom.quadtree(v),r,a);n=-1;for(;++n<x;)(s=v[n]).fixed||e.visit(t(s))}n=-1;for(;++n<x;){s=v[n];if(s.fixed){s.x=s.px;s.y=s.py}else{s.x-=(s.px-(s.px=s.x))*c;s.y-=(s.py-(s.py=s.y))*c}}l.tick({type:"tick",alpha:r})};s.nodes=function(t){if(!arguments.length)return v;v=t;return s};s.links=function(t){if(!arguments.length)return y;y=t;return s};s.size=function(t){if(!arguments.length)return u;u=t;return s};s.linkDistance=function(t){if(!arguments.length)return f;f="function"==typeof t?t:+t;return s};s.distance=s.linkDistance;s.linkStrength=function(t){if(!arguments.length)return h;h="function"==typeof t?t:+t;return s};s.friction=function(t){if(!arguments.length)return c;c=+t;return s};s.charge=function(t){if(!arguments.length)return d;d="function"==typeof t?t:+t;return s};s.chargeDistance=function(t){if(!arguments.length)return Math.sqrt(p);p=t*t;return s};s.gravity=function(t){if(!arguments.length)return g;g=+t;return s};s.theta=function(t){if(!arguments.length)return Math.sqrt(m);m=t*t;return s};s.alpha=function(t){if(!arguments.length)return r;t=+t;if(r)r=t>0?t:0;else if(t>0){l.start({type:"start",alpha:r=t});ia.timer(s.tick)}return s};s.start=function(){function t(t,r){if(!n){n=new Array(l);for(s=0;l>s;++s)n[s]=[];for(s=0;c>s;++s){var i=y[s];n[i.source.index].push(i.target);n[i.target.index].push(i.source)}}for(var o,a=n[e],s=-1,u=a.length;++s<u;)if(!isNaN(o=a[s][t]))return o;return Math.random()*r}var e,n,r,l=v.length,c=y.length,p=u[0],g=u[1];for(e=0;l>e;++e){(r=v[e]).index=e;r.weight=0}for(e=0;c>e;++e){r=y[e];"number"==typeof r.source&&(r.source=v[r.source]);"number"==typeof r.target&&(r.target=v[r.target]);++r.source.weight;++r.target.weight}for(e=0;l>e;++e){r=v[e];isNaN(r.x)&&(r.x=t("x",p));isNaN(r.y)&&(r.y=t("y",g));isNaN(r.px)&&(r.px=r.x);isNaN(r.py)&&(r.py=r.y)}i=[];if("function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;o=[];if("function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;a=[];if("function"==typeof d)for(e=0;l>e;++e)a[e]=+d.call(this,v[e],e);else for(e=0;l>e;++e)a[e]=d;return s.resume()};s.resume=function(){return s.alpha(.1)};s.stop=function(){return s.alpha(0)};s.drag=function(){n||(n=ia.behavior.drag().origin(w).on("dragstart.force",$r).on("drag.force",e).on("dragend.force",Jr));if(!arguments.length)return n;this.on("mouseover.force",Kr).on("mouseout.force",Zr).call(n);return void 0};return ia.rebind(s,l,"on")};var pl=20,gl=1,ml=1/0;ia.layout.hierarchy=function(){function t(i){var o,a=[i],s=[];i.depth=0;for(;null!=(o=a.pop());){s.push(o);if((u=n.call(t,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;){a.push(c=u[l]);c.parent=o;c.depth=o.depth+1}r&&(o.value=0);o.children=u}else{r&&(o.value=+r.call(t,o,o.depth)||0);delete o.children}}ni(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e);r&&(i=t.parent)&&(i.value+=t.value)});return s}var e=oi,n=ri,r=ii;t.sort=function(n){if(!arguments.length)return e;e=n;return t};t.children=function(e){if(!arguments.length)return n;n=e;return t};t.value=function(e){if(!arguments.length)return r;r=e;return t};t.revalue=function(e){if(r){ei(e,function(t){t.children&&(t.value=0)});ni(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0);(n=e.parent)&&(n.value+=e.value)})}return e};return t};ia.layout.partition=function(){function t(e,n,r,i){var o=e.children;e.x=n;e.y=e.depth*i;e.dx=r;e.dy=i;if(o&&(a=o.length)){var a,s,l,u=-1;r=e.value?r/e.value:0;for(;++u<a;){t(s=o[u],n,l=s.value*r,i);n+=l}}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);t(a[0],0,i[0],i[1]/e(a[0]));return a}var r=ia.layout.hierarchy(),i=[1,1];n.size=function(t){if(!arguments.length)return i;i=t;return n};return ti(n,r)};ia.layout.pie=function(){function t(a){var s,l=a.length,u=a.map(function(n,r){return+e.call(t,n,r)}),c=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof i?i.apply(this,arguments):i)-c,h=Math.min(Math.abs(f)/l,+("function"==typeof o?o.apply(this,arguments):o)),d=h*(0>f?-1:1),p=(f-l*d)/ia.sum(u),g=ia.range(l),m=[];null!=n&&g.sort(n===vl?function(t,e){return u[e]-u[t]}:function(t,e){return n(a[t],a[e])});g.forEach(function(t){m[t]={data:a[t],value:s=u[t],startAngle:c,endAngle:c+=s*p+d,padAngle:h}});return m}var e=Number,n=vl,r=0,i=Ia,o=0;t.value=function(n){if(!arguments.length)return e;e=n;return t};t.sort=function(e){if(!arguments.length)return n;n=e;return t};t.startAngle=function(e){if(!arguments.length)return r;r=e;return t};t.endAngle=function(e){if(!arguments.length)return i;i=e;return t};t.padAngle=function(e){if(!arguments.length)return o;o=e;return t};return t};var vl={};ia.layout.stack=function(){function t(s,l){if(!(h=s.length))return s;var u=s.map(function(n,r){return e.call(t,n,r)}),c=u.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),f=n.call(t,c,l);u=ia.permute(u,f);c=ia.permute(c,f);var h,d,p,g,m=r.call(t,c,l),v=u[0].length;for(p=0;v>p;++p){i.call(t,u[0][p],g=m[p],c[0][p][1]);for(d=1;h>d;++d)i.call(t,u[d][p],g+=c[d-1][p][1],c[d][p][1])}return s}var e=w,n=ci,r=fi,i=ui,o=si,a=li;t.values=function(n){if(!arguments.length)return e;e=n;return t};t.order=function(e){if(!arguments.length)return n;n="function"==typeof e?e:yl.get(e)||ci;return t};t.offset=function(e){if(!arguments.length)return r;r="function"==typeof e?e:bl.get(e)||fi;return t};t.x=function(e){if(!arguments.length)return o;o=e;return t};t.y=function(e){if(!arguments.length)return a;a=e;return t};t.out=function(e){if(!arguments.length)return i;i=e;return t};return t};var yl=ia.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(hi),o=t.map(di),a=ia.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,l=0,u=[],c=[];for(e=0;r>e;++e){n=a[e];if(l>s){s+=o[n];u.push(n)}else{l+=o[n];c.push(n)}}return c.reverse().concat(u)},reverse:function(t){return ia.range(t.length).reverse()},"default":ci}),bl=ia.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],s=0,l=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>s&&(s=r);a.push(r)}for(n=0;o>n;++n)l[n]=(s-a[n])/2;return l},wiggle:function(t){var e,n,r,i,o,a,s,l,u,c=t.length,f=t[0],h=f.length,d=[];d[0]=l=u=0;for(n=1;h>n;++n){for(e=0,i=0;c>e;++e)i+=t[e][n][1];for(e=0,o=0,s=f[n][0]-f[n-1][0];c>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/s;o+=a*t[e][n][1]}d[n]=l-=i?o/i*s:0;u>l&&(u=l)}for(n=0;h>n;++n)d[n]-=u;return d},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:fi});ia.layout.histogram=function(){function t(t,o){for(var a,s,l=[],u=t.map(n,this),c=r.call(this,u,o),f=i.call(this,c,u,o),o=-1,h=u.length,d=f.length-1,p=e?1:1/h;++o<d;){a=l[o]=[];a.dx=f[o+1]-(a.x=f[o]);a.y=0}if(d>0){o=-1;for(;++o<h;){s=u[o];if(s>=c[0]&&s<=c[1]){a=l[ia.bisect(f,s,1,d)-1];a.y+=p;a.push(t[o])}}}return l}var e=!0,n=Number,r=vi,i=gi;t.value=function(e){if(!arguments.length)return n;n=e;return t};t.range=function(e){if(!arguments.length)return r;r=Dt(e);return t};t.bins=function(e){if(!arguments.length)return i;i="number"==typeof e?function(t){return mi(t,e)}:Dt(e);return t};t.frequency=function(n){if(!arguments.length)return e;e=!!n;return t};return t};ia.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),s=a[0],l=i[0],u=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};s.x=s.y=0;ni(s,function(t){t.r=+c(t.value)});ni(s,Ci);if(r){var f=r*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;ni(s,function(t){t.r+=f});ni(s,Ci);ni(s,function(t){t.r-=f})}ki(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u));return a}var e,n=ia.layout.hierarchy().sort(yi),r=0,i=[1,1];t.size=function(e){if(!arguments.length)return i;i=e;return t};t.radius=function(n){if(!arguments.length)return e;e=null==n||"function"==typeof n?n:+n;return t};t.padding=function(e){if(!arguments.length)return r;r=+e;return t};return ti(t,n)};ia.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);ni(h,n),h.parent.m=-h.z;ei(h,r);if(u)ei(f,o);else{var d=f,p=f,g=f;ei(f,function(t){t.x<d.x&&(d=t);t.x>p.x&&(p=t);t.depth>g.depth&&(g=t)});var m=s(d,p)/2-d.x,v=l[0]/(p.x+s(p,d)/2+m),y=l[1]/(g.depth||1);ei(f,function(t){t.x=(t.x+m)*v;t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,s=o.length;s>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){Ni(t);var o=(e[0].z+e[e.length-1].z)/2;if(r){t.z=r.z+s(t._,r._);t.m=t.z-o}else t.z=o}else r&&(t.z=r.z+s(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,l=i.parent.children[0],u=i.m,c=o.m,f=a.m,h=l.m;a=Li(a),i=Di(i),a&&i;){l=Di(l);o=Li(o);o.a=t;r=a.z+f-i.z-u+s(a._,i._);if(r>0){Ai(Ei(a,t,n),t,r);u+=r;c+=r}f+=a.m;u+=i.m;h+=l.m;c+=o.m}if(a&&!Li(o)){o.t=a;o.m+=f-c}if(i&&!Di(l)){l.t=i;l.m+=u-h;n=t}}return n}function o(t){t.x*=l[0];t.y=t.depth*l[1]}var a=ia.layout.hierarchy().sort(null).value(null),s=_i,l=[1,1],u=null;t.separation=function(e){if(!arguments.length)return s;s=e;return t};t.size=function(e){if(!arguments.length)return u?null:l;u=null==(l=e)?o:null;return t};t.nodeSize=function(e){if(!arguments.length)return u?l:null;u=null==(l=e)?null:o;return t};return ti(t,a)};ia.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],u=0;ni(l,function(t){var e=t.children;if(e&&e.length){t.x=ji(e);t.y=Pi(e)}else{t.x=a?u+=n(t,a):0;t.y=0;a=t}});var c=Ii(l),f=Hi(l),h=c.x-n(c,f)/2,d=f.x+n(f,c)/2;ni(l,i?function(t){t.x=(t.x-l.x)*r[0];t.y=(l.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(d-h)*r[0];t.y=(1-(l.y?t.y/l.y:1))*r[1]});return s}var e=ia.layout.hierarchy().sort(null).value(null),n=_i,r=[1,1],i=!1;t.separation=function(e){if(!arguments.length)return n;n=e;return t};t.size=function(e){if(!arguments.length)return i?null:r;i=null==(r=e);return t};t.nodeSize=function(e){if(!arguments.length)return i?r:null;i=null!=(r=e);return t};return ti(t,e)};ia.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;){r=(n=t[i]).value*(0>e?0:e);n.area=isNaN(r)||0>=r?0:r}}function e(n){var o=n.children;if(o&&o.length){var a,s,l,u=f(n),c=[],h=o.slice(),p=1/0,g="slice"===d?u.dx:"dice"===d?u.dy:"slice-dice"===d?1&n.depth?u.dy:u.dx:Math.min(u.dx,u.dy);t(h,u.dx*u.dy/n.value);c.area=0;for(;(l=h.length)>0;){c.push(a=h[l-1]);c.area+=a.area;if("squarify"!==d||(s=r(c,g))<=p){h.pop();p=s}else{c.area-=c.pop().area;i(c,g,u,!1);g=Math.min(u.dx,u.dy);c.length=c.area=0;p=1/0}}if(c.length){i(c,g,u,!0);c.length=c.area=0}o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),s=r.slice(),l=[];t(s,a.dx*a.dy/e.value);l.area=0;for(;o=s.pop();){l.push(o);l.area+=o.area;if(null!=o.z){i(l,o.z?a.dx:a.dy,a,!s.length);l.length=l.area=0}}r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++a<s;)if(n=t[a].area){o>n&&(o=n);n>i&&(i=n)}r*=r;e*=e;return r?Math.max(e*i*p/r,r/(e*o*p)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,u=n.y,c=e?l(t.area/e):0;if(e==n.dx){(r||c>n.dy)&&(c=n.dy);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dy=c;s+=i.dx=Math.min(n.x+n.dx-s,c?l(i.area/c):0)}i.z=!0;i.dx+=n.x+n.dx-s;n.y+=c;n.dy-=c}else{(r||c>n.dx)&&(c=n.dx);for(;++o<a;){i=t[o];i.x=s;i.y=u;i.dx=c;u+=i.dy=Math.min(n.y+n.dy-u,c?l(i.area/c):0)}i.z=!1;i.dy+=n.y+n.dy-u;n.x+=c;n.dx-=c}}function o(r){var i=a||s(r),o=i[0];o.x=0;o.y=0;o.dx=u[0];o.dy=u[1];a&&s.revalue(o);t([o],o.dx*o.dy/o.value);(a?n:e)(o);h&&(a=i);return i}var a,s=ia.layout.hierarchy(),l=Math.round,u=[1,1],c=null,f=Oi,h=!1,d="squarify",p=.5*(1+Math.sqrt(5));o.size=function(t){if(!arguments.length)return u;u=t;return o};o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?Oi(e):Ri(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Ri(e,t)}if(!arguments.length)return c;var r;f=null==(c=t)?Oi:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n;return o};o.round=function(t){if(!arguments.length)return l!=Number;l=t?Math.round:Number;return o};o.sticky=function(t){if(!arguments.length)return h;h=t;a=null;return o};o.ratio=function(t){if(!arguments.length)return p;p=t;return o};o.mode=function(t){if(!arguments.length)return d;d=t+"";return o};return ti(o,s)};ia.random={normal:function(t,e){var n=arguments.length;2>n&&(e=1);1>n&&(t=0);return function(){var n,r,i;do{n=2*Math.random()-1;r=2*Math.random()-1;i=n*n+r*r}while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ia.random.normal.apply(ia,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ia.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}};ia.scale={};var wl={floor:w,ceil:w};ia.scale.linear=function(){return Vi([0,1],[0,1],wr,!1)};var xl={s:1,g:1,p:1,r:1,e:1};ia.scale.log=function(){return Qi(ia.scale.linear().domain([0,1]),10,!0,[1,10])};var Cl=ia.format(".0e"),Sl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ia.scale.pow=function(){return to(ia.scale.linear(),1,[0,1])};ia.scale.sqrt=function(){return ia.scale.pow().exponent(.5)};ia.scale.ordinal=function(){return no([],{t:"range",a:[[]]})};ia.scale.category10=function(){return ia.scale.ordinal().range(Tl)};ia.scale.category20=function(){return ia.scale.ordinal().range(kl)};ia.scale.category20b=function(){return ia.scale.ordinal().range(Ml)};ia.scale.category20c=function(){return ia.scale.ordinal().range(_l)};var Tl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xt),kl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xt),Ml=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xt),_l=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xt);ia.scale.quantile=function(){return ro([],[])};ia.scale.quantize=function(){return io(0,1,[0,1])};ia.scale.threshold=function(){return oo([.5],[0,1])};ia.scale.identity=function(){return ao([0,1])};ia.svg={};ia.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),u=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Oa,f=s.apply(this,arguments)-Oa,h=Math.abs(f-c),d=c>f?0:1;t>u&&(p=u,u=t,t=p);if(h>=Ha)return e(u,d)+(t?e(t,1-d):"")+"Z";var p,g,m,v,y,b,w,x,C,S,T,k,M=0,_=0,D=[];if(v=(+l.apply(this,arguments)||0)/2){m=o===Dl?Math.sqrt(t*t+u*u):+o.apply(this,arguments);d||(_*=-1);u&&(_=rt(m/u*Math.sin(v)));t&&(M=rt(m/t*Math.sin(v)))}if(u){y=u*Math.cos(c+_);b=u*Math.sin(c+_);w=u*Math.cos(f-_);x=u*Math.sin(f-_);var L=Math.abs(f-c-2*_)<=ja?0:1;if(_&&po(y,b,w,x)===d^L){var A=(c+f)/2;y=u*Math.cos(A);b=u*Math.sin(A);w=x=null}}else y=b=0;if(t){C=t*Math.cos(f-M);S=t*Math.sin(f-M);T=t*Math.cos(c+M);k=t*Math.sin(c+M);var N=Math.abs(c-f+2*M)<=ja?0:1;if(M&&po(C,S,T,k)===1-d^N){var E=(c+f)/2;C=t*Math.cos(E);S=t*Math.sin(E);T=k=null}}else C=S=0;if((p=Math.min(Math.abs(u-t)/2,+i.apply(this,arguments)))>.001){g=u>t^d?0:1;var P=null==T?[C,S]:null==w?[y,b]:In([y,b],[T,k],[w,x],[C,S]),j=y-P[0],I=b-P[1],H=w-P[0],O=x-P[1],R=1/Math.sin(Math.acos((j*H+I*O)/(Math.sqrt(j*j+I*I)*Math.sqrt(H*H+O*O)))/2),F=Math.sqrt(P[0]*P[0]+P[1]*P[1]);if(null!=w){var W=Math.min(p,(u-F)/(R+1)),z=go(null==T?[C,S]:[T,k],[y,b],u,W,d),q=go([w,x],[C,S],u,W,d);p===W?D.push("M",z[0],"A",W,",",W," 0 0,",g," ",z[1],"A",u,",",u," 0 ",1-d^po(z[1][0],z[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",W,",",W," 0 0,",g," ",q[0]):D.push("M",z[0],"A",W,",",W," 0 1,",g," ",q[0])}else D.push("M",y,",",b);if(null!=T){var U=Math.min(p,(t-F)/(R-1)),B=go([y,b],[T,k],t,-U,d),V=go([C,S],null==w?[y,b]:[w,x],t,-U,d);p===U?D.push("L",V[0],"A",U,",",U," 0 0,",g," ",V[1],"A",t,",",t," 0 ",d^po(V[1][0],V[1][1],B[1][0],B[1][1]),",",1-d," ",B[1],"A",U,",",U," 0 0,",g," ",B[0]):D.push("L",V[0],"A",U,",",U," 0 0,",g," ",B[0])}else D.push("L",C,",",S)}else{D.push("M",y,",",b);null!=w&&D.push("A",u,",",u," 0 ",L,",",d," ",w,",",x);D.push("L",C,",",S);null!=T&&D.push("A",t,",",t," 0 ",N,",",1-d," ",T,",",k)}D.push("Z");return D.join("")}function e(t,e){ return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=lo,r=uo,i=so,o=Dl,a=co,s=fo,l=ho;t.innerRadius=function(e){if(!arguments.length)return n;n=Dt(e);return t};t.outerRadius=function(e){if(!arguments.length)return r;r=Dt(e);return t};t.cornerRadius=function(e){if(!arguments.length)return i;i=Dt(e);return t};t.padRadius=function(e){if(!arguments.length)return o;o=e==Dl?Dl:Dt(e);return t};t.startAngle=function(e){if(!arguments.length)return a;a=Dt(e);return t};t.endAngle=function(e){if(!arguments.length)return s;s=Dt(e);return t};t.padAngle=function(e){if(!arguments.length)return l;l=Dt(e);return t};t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Oa;return[Math.cos(e)*t,Math.sin(e)*t]};return t};var Dl="auto";ia.svg.line=function(){return mo(w)};var Ll=ia.map({linear:vo,"linear-closed":yo,step:bo,"step-before":wo,"step-after":xo,basis:_o,"basis-open":Do,"basis-closed":Lo,bundle:Ao,cardinal:To,"cardinal-open":Co,"cardinal-closed":So,monotone:Ho});Ll.forEach(function(t,e){e.key=t;e.closed=/-closed$/.test(t)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],El=[0,1/6,2/3,1/6];ia.svg.line.radial=function(){var t=mo(Oo);t.radius=t.x,delete t.x;t.angle=t.y,delete t.y;return t};wo.reverse=xo;xo.reverse=wo;ia.svg.area=function(){return Ro(w)};ia.svg.area.radial=function(){var t=Ro(Oo);t.radius=t.x,delete t.x;t.innerRadius=t.x0,delete t.x0;t.outerRadius=t.x1,delete t.x1;t.angle=t.y,delete t.y;t.startAngle=t.y0,delete t.y0;t.endAngle=t.y1,delete t.y1;return t};ia.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),u=e(this,a,t,s);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(n(l,u)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,u.r,u.p0)+r(u.r,u.p1,u.a1-u.a0)+i(u.r,u.p1,l.r,l.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=s.call(t,i,r),a=l.call(t,i,r)-Oa,c=u.call(t,i,r)-Oa;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>ja)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=wn,a=xn,s=Fo,l=co,u=fo;t.radius=function(e){if(!arguments.length)return s;s=Dt(e);return t};t.source=function(e){if(!arguments.length)return o;o=Dt(e);return t};t.target=function(e){if(!arguments.length)return a;a=Dt(e);return t};t.startAngle=function(e){if(!arguments.length)return l;l=Dt(e);return t};t.endAngle=function(e){if(!arguments.length)return u;u=Dt(e);return t};return t};ia.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];l=l.map(r);return"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=wn,n=xn,r=Wo;t.source=function(n){if(!arguments.length)return e;e=Dt(n);return t};t.target=function(e){if(!arguments.length)return n;n=Dt(e);return t};t.projection=function(e){if(!arguments.length)return r;r=e;return t};return t};ia.svg.diagonal.radial=function(){var t=ia.svg.diagonal(),e=Wo,n=t.projection;t.projection=function(t){return arguments.length?n(zo(e=t)):e};return t};ia.svg.symbol=function(){function t(t,r){return(Pl.get(e.call(this,t,r))||Bo)(n.call(this,t,r))}var e=Uo,n=qo;t.type=function(n){if(!arguments.length)return e;e=Dt(n);return t};t.size=function(e){if(!arguments.length)return n;n=Dt(e);return t};return t};var Pl=ia.map({circle:Bo,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Il)),n=e*Il;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/jl),n=e*jl/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ia.svg.symbolTypes=Pl.keys();var jl=Math.sqrt(3),Il=Math.tan(30*Ra);ka.transition=function(t){for(var e,n,r=Hl||++Wl,i=$o(t),o=[],a=Ol||{time:Date.now(),ease:_r,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;){(n=u[c])&&Jo(n,c,i,r,a);e.push(n)}}return Xo(o,i,r)};ka.interrupt=function(t){return this.each(null==t?Rl:Vo($o(t)))};var Hl,Ol,Rl=Vo($o()),Fl=[],Wl=0;Fl.call=ka.call;Fl.empty=ka.empty;Fl.node=ka.node;Fl.size=ka.size;ia.transition=function(t,e){return t&&t.transition?Hl?t.transition(e):t:ia.selection().transition(t)};ia.transition.prototype=Fl;Fl.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=A(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var u=this[s],c=-1,f=u.length;++c<f;)if((r=u[c])&&(n=t.call(r,r.__data__,c,s))){"__data__"in r&&(n.__data__=r.__data__);Jo(n,c,o,i,r[o][i]);e.push(n)}else e.push(null)}return Xo(a,o,i)};Fl.selectAll=function(t){var e,n,r,i,o,a=this.id,s=this.namespace,l=[];t=N(t);for(var u=-1,c=this.length;++u<c;)for(var f=this[u],h=-1,d=f.length;++h<d;)if(r=f[h]){o=r[s][a];n=t.call(r,r.__data__,h,u);l.push(e=[]);for(var p=-1,g=n.length;++p<g;){(i=n[p])&&Jo(i,p,s,a,o);e.push(i)}}return Xo(l,s,a)};Fl.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=U(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],s=0,l=n.length;l>s;s++)(r=n[s])&&t.call(r,r.__data__,s,o)&&e.push(r)}return Xo(i,this.namespace,this.id)};Fl.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})};Fl.attr=function(t,e){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(s);return n!==t&&(e=a(n,t),function(t){this.setAttribute(s,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(s.space,s.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Ur:wr,s=ia.ns.qualify(t);return Go(this,"attr."+t,e,s.local?o:i)};Fl.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=ia.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)};Fl.style=function(t,e,n){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=r(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=wr(o,e),function(e){this.style.setProperty(t,i(e),n)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}return Go(this,"style."+t,e,o)};Fl.styleTween=function(t,e,n){function i(i,o){var a=e.call(this,i,o,r(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}}arguments.length<3&&(n="");return this.tween("style."+t,i)};Fl.text=function(t){return Go(this,"text",t,Yo)};Fl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})};Fl.ease=function(t){var e=this.id,n=this.namespace;if(arguments.length<1)return this.node()[n][e].ease;"function"!=typeof t&&(t=ia.ease.apply(ia,arguments));return V(this,function(r){r[n][e].ease=t})};Fl.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))};Fl.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))};Fl.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,o=Hl;try{Hl=n;V(this,function(e,i,o){Ol=e[r][n];t.call(e,e.__data__,i,o)})}finally{Ol=i;Hl=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=ia.dispatch("start","end","interrupt"))).on(t,e)});return this};Fl.transition=function(){for(var t,e,n,r,i=this.id,o=++Wl,a=this.namespace,s=[],l=0,u=this.length;u>l;l++){s.push(t=[]);for(var e=this[l],c=0,f=e.length;f>c;c++){if(n=e[c]){r=n[a][i];Jo(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})}t.push(n)}}return Xo(s,a,o)};ia.svg.axis=function(){function t(t){t.each(function(){var t,u=ia.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==l?f.ticks?f.ticks.apply(f,s):f.domain():l,d=null==e?f.tickFormat?f.tickFormat.apply(f,s):w:e,p=u.selectAll(".tick").data(h,f),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ea),m=ia.transition(p.exit()).style("opacity",Ea).remove(),v=ia.transition(p.order()).style("opacity",1),y=Math.max(i,0)+a,b=Wi(f),x=u.selectAll(".domain").data([0]),C=(x.enter().append("path").attr("class","domain"),ia.transition(x));g.append("line");g.append("text");var S,T,k,M,_=g.select("line"),D=v.select("line"),L=p.select("text").text(d),A=g.select("text"),N=v.select("text"),E="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r){t=Ko,S="x",k="y",T="x2",M="y2";L.attr("dy",0>E?"0em":".71em").style("text-anchor","middle");C.attr("d","M"+b[0]+","+E*o+"V0H"+b[1]+"V"+E*o)}else{t=Zo,S="y",k="x",T="y2",M="x2";L.attr("dy",".32em").style("text-anchor",0>E?"end":"start");C.attr("d","M"+E*o+","+b[0]+"H0V"+b[1]+"H"+E*o)}_.attr(M,E*i);A.attr(k,E*y);D.attr(T,0).attr(M,E*i);N.attr(S,0).attr(k,E*y);if(f.rangeBand){var P=f,j=P.rangeBand()/2;c=f=function(t){return P(t)+j}}else c.rangeBand?c=f:m.call(t,f,c);g.call(t,c,f);v.call(t,f,f)})}var e,n=ia.scale.linear(),r=zl,i=6,o=6,a=3,s=[10],l=null;t.scale=function(e){if(!arguments.length)return n;n=e;return t};t.orient=function(e){if(!arguments.length)return r;r=e in ql?e+"":zl;return t};t.ticks=function(){if(!arguments.length)return s;s=arguments;return t};t.tickValues=function(e){if(!arguments.length)return l;l=e;return t};t.tickFormat=function(n){if(!arguments.length)return e;e=n;return t};t.tickSize=function(e){var n=arguments.length;if(!n)return i;i=+e;o=+arguments[n-1];return t};t.innerTickSize=function(e){if(!arguments.length)return i;i=+e;return t};t.outerTickSize=function(e){if(!arguments.length)return o;o=+e;return t};t.tickPadding=function(e){if(!arguments.length)return a;a=+e;return t};t.tickSubdivide=function(){return arguments.length&&t};return t};var zl="bottom",ql={top:1,right:1,bottom:1,left:1};ia.svg.brush=function(){function t(r){r.each(function(){var r=ia.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=r.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");r.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=r.selectAll(".resize").data(g,w);s.exit().remove();s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Ul[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");s.style("display",t.empty()?"none":null);var l,f=ia.transition(r),h=ia.transition(a);if(u){l=Wi(u);h.attr("x",l[0]).attr("width",l[1]-l[0]);n(f)}if(c){l=Wi(c);h.attr("y",l[0]).attr("height",l[1]-l[0]);i(f)}e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",f[0]);t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]);t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){if(32==ia.event.keyCode){if(!L){b=null;N[0]-=f[1];N[1]-=h[1];L=2}M()}}function g(){if(32==ia.event.keyCode&&2==L){N[0]+=f[1];N[1]+=h[1];L=0;M()}}function m(){var t=ia.mouse(x),r=!1;if(w){t[0]+=w[0];t[1]+=w[1]}if(!L)if(ia.event.altKey){b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]);N[0]=f[+(t[0]<b[0])];N[1]=h[+(t[1]<b[1])]}else b=null;if(_&&v(t,u,0)){n(T);r=!0}if(D&&v(t,c,1)){i(T);r=!0}if(r){e(T);S({type:"brush",mode:L?"move":"resize"})}}function v(t,e,n){var r,i,o=Wi(e),l=o[0],u=o[1],c=N[n],g=n?h:f,m=g[1]-g[0];if(L){l-=c;u-=m+c}r=(n?p:d)?Math.max(l,Math.min(u,t[n])):t[n];if(L)i=(r+=c)+m;else{b&&(c=Math.max(l,Math.min(u,2*b[n]-r)));if(r>c){i=r;r=c}else i=c}if(g[0]!=r||g[1]!=i){n?s=null:a=null;g[0]=r;g[1]=i;return!0}}function y(){m();T.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null);ia.select("body").style("cursor",null);E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);A();S({type:"brushend"})}var b,w,x=this,C=ia.select(ia.event.target),S=l.of(x,arguments),T=ia.select(x),k=C.datum(),_=!/^(n|s)$/.test(k)&&u,D=!/^(e|w)$/.test(k)&&c,L=C.classed("extent"),A=K(x),N=ia.mouse(x),E=ia.select(r(x)).on("keydown.brush",o).on("keyup.brush",g);ia.event.changedTouches?E.on("touchmove.brush",m).on("touchend.brush",y):E.on("mousemove.brush",m).on("mouseup.brush",y);T.interrupt().selectAll("*").interrupt();if(L){N[0]=f[0]-N[0];N[1]=h[0]-N[1]}else if(k){var P=+/w$/.test(k),j=+/^n/.test(k);w=[f[1-P]-N[0],h[1-j]-N[1]];N[0]=f[P];N[1]=h[j]}else ia.event.altKey&&(b=N.slice());T.style("pointer-events","none").selectAll(".resize").style("display",null);ia.select("body").style("cursor",C.style("cursor"));S({type:"brushstart"});m()}var a,s,l=D(t,"brushstart","brush","brushend"),u=null,c=null,f=[0,0],h=[0,0],d=!0,p=!0,g=Bl[0];t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:f,y:h,i:a,j:s},n=this.__chart__||e;this.__chart__=e;if(Hl)ia.select(this).transition().each("start.brush",function(){a=n.i;s=n.j;f=n.x;h=n.y;t({type:"brushstart"})}).tween("brush:brush",function(){var n=xr(f,e.x),r=xr(h,e.y);a=s=null;return function(i){f=e.x=n(i);h=e.y=r(i);t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i;s=e.j;t({type:"brush",mode:"resize"});t({type:"brushend"})});else{t({type:"brushstart"});t({type:"brush",mode:"resize"});t({type:"brushend"})}})};t.x=function(e){if(!arguments.length)return u;u=e;g=Bl[!u<<1|!c];return t};t.y=function(e){if(!arguments.length)return c;c=e;g=Bl[!u<<1|!c];return t};t.clamp=function(e){if(!arguments.length)return u&&c?[d,p]:u?d:c?p:null;u&&c?(d=!!e[0],p=!!e[1]):u?d=!!e:c&&(p=!!e);return t};t.extent=function(e){var n,r,i,o,l;if(!arguments.length){if(u)if(a)n=a[0],r=a[1];else{n=f[0],r=f[1];u.invert&&(n=u.invert(n),r=u.invert(r));n>r&&(l=n,n=r,r=l)}if(c)if(s)i=s[0],o=s[1];else{i=h[0],o=h[1];c.invert&&(i=c.invert(i),o=c.invert(o));i>o&&(l=i,i=o,o=l)}return u&&c?[[n,i],[r,o]]:u?[n,r]:c&&[i,o]}if(u){n=e[0],r=e[1];c&&(n=n[0],r=r[0]);a=[n,r];u.invert&&(n=u(n),r=u(r));n>r&&(l=n,n=r,r=l);(n!=f[0]||r!=f[1])&&(f=[n,r])}if(c){i=e[0],o=e[1];u&&(i=i[1],o=o[1]);s=[i,o];c.invert&&(i=c(i),o=c(o));i>o&&(l=i,i=o,o=l);(i!=h[0]||o!=h[1])&&(h=[i,o])}return t};t.clear=function(){if(!t.empty()){f=[0,0],h=[0,0];a=s=null}return t};t.empty=function(){return!!u&&f[0]==f[1]||!!c&&h[0]==h[1]};return ia.rebind(t,l,"on")};var Ul={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=cs.format=ms.timeFormat,Xl=Vl.utc,Gl=Xl("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Qo:Gl;Qo.parse=function(t){var e=new Date(t);return isNaN(e)?null:e};Qo.toString=Gl.toString;cs.second=zt(function(t){return new fs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()});cs.seconds=cs.second.range;cs.seconds.utc=cs.second.utc.range;cs.minute=zt(function(t){return new fs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()});cs.minutes=cs.minute.range;cs.minutes.utc=cs.minute.utc.range;cs.hour=zt(function(t){var e=t.getTimezoneOffset()/60;return new fs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()});cs.hours=cs.hour.range;cs.hours.utc=cs.hour.utc.range;cs.month=zt(function(t){t=cs.day(t);t.setDate(1);return t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()});cs.months=cs.month.range;cs.months.utc=cs.month.utc.range;var Yl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],$l=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Jl=Vl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ae]]),Kl={range:function(t,e,n){return ia.range(Math.ceil(t/n)*n,+e,n).map(ea)},floor:w,ceil:w};$l.year=cs.year;cs.scale=function(){return ta(ia.scale.linear(),$l,Jl)};var Zl=$l.map(function(t){return[t[0].utc,t[1]]}),Ql=Xl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ae]]);Zl.year=cs.year.utc;cs.scale.utc=function(){return ta(ia.scale.linear(),Zl,Ql)};ia.text=Lt(function(t){return t.responseText});ia.json=function(t,e){return At(t,"application/json",na,e)};ia.html=function(t,e){return At(t,"text/html",ra,e)};ia.xml=Lt(function(t){return t.responseXML});"function"==typeof t&&t.amd?t(ia):"object"==typeof n&&n.exports&&(n.exports=ia);this.d3=ia}()},{}],14:[function(e,n,r){(function(i,o,a){(function(i){"use strict";"function"==typeof t&&t.amd?t("datatables",["jquery"],i):"object"==typeof r?n.exports=i(e("jquery")):jQuery&&!jQuery.fn.dataTable&&i(jQuery)})(function(t){"use strict";function e(n){var r,i,o="a aa ai ao as b fn i m o s ",a={};t.each(n,function(t,s){r=t.match(/^([^A-Z]+?)([A-Z])/);if(r&&-1!==o.indexOf(r[1]+" ")){i=t.replace(r[0],r[2].toLowerCase());a[i]=t;"o"===r[1]&&e(n[t])}});n._hungarianMap=a}function n(r,i,o){r._hungarianMap||e(r);var s;t.each(i,function(e,l){s=r._hungarianMap[e];if(s!==a&&(o||i[s]===a))if("o"===s.charAt(0)){i[s]||(i[s]={});t.extend(!0,i[s],i[e]);n(r[s],i[s],o)}else i[s]=i[e]})}function r(t){var e=Yt.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&Ot(t,t,"sZeroRecords","sEmptyTable");!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&Ot(t,t,"sZeroRecords","sLoadingRecords");t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var r=t.sDecimal;r&&Xt(r)}function s(t){ye(t,"ordering","bSort");ye(t,"orderMulti","bSortMulti");ye(t,"orderClasses","bSortClasses");ye(t,"orderCellsTop","bSortCellsTop");ye(t,"order","aaSorting");ye(t,"orderFixed","aaSortingFixed");ye(t,"paging","bPaginate");ye(t,"pagingType","sPaginationType");ye(t,"pageLength","iDisplayLength");ye(t,"searching","bFilter");var e=t.aoSearchCols;if(e)for(var r=0,i=e.length;i>r;r++)e[r]&&n(Yt.models.oSearch,e[r])}function l(e){ye(e,"orderable","bSortable");ye(e,"orderData","aDataSort");ye(e,"orderSequence","asSorting");ye(e,"orderDataType","sortDataType");var n=e.aDataSort;n&&!t.isArray(n)&&(e.aDataSort=[n])}function u(e){var n=e.oBrowser,r=t("<div/>").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(t("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t('<div class="test"/>').css({width:"100%",height:10}))).appendTo("body"),i=r.find(".test");n.bScrollOversize=100===i[0].offsetWidth;n.bScrollbarLeft=1!==Math.round(i.offset().left);r.remove()}function c(t,e,n,r,i,o){var s,l=r,u=!1;if(n!==a){s=n;u=!0}for(;l!==i;)if(t.hasOwnProperty(l)){s=u?e(s,t[l],l,t):t[l];u=!0;l+=o}return s}function f(e,n){var r=Yt.defaults.column,i=e.aoColumns.length,a=t.extend({},Yt.models.oColumn,r,{nTh:n?n:o.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[i],mData:r.mData?r.mData:i,idx:i});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[i]=t.extend({},Yt.models.oSearch,s[i]);h(e,i,t(n).data())}function h(e,r,i){var o=e.aoColumns[r],s=e.oClasses,u=t(o.nTh);if(!o.sWidthOrig){o.sWidthOrig=u.attr("width")||null;var c=(u.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);c&&(o.sWidthOrig=c[1])}if(i!==a&&null!==i){l(i);n(Yt.defaults.column,i);i.mDataProp===a||i.mData||(i.mData=i.mDataProp);i.sType&&(o._sManualType=i.sType);i.className&&!i.sClass&&(i.sClass=i.className);t.extend(o,i);Ot(o,i,"sWidth","sWidthOrig");i.iDataSort!==a&&(o.aDataSort=[i.iDataSort]);Ot(o,i,"aDataSort")}var f=o.mData,h=_(f),d=o.mRender?_(o.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};o._bAttrSrc=t.isPlainObject(f)&&(p(f.sort)||p(f.type)||p(f.filter));o.fnGetData=function(t,e,n){var r=h(t,e,a,n);return d&&e?d(r,e,t,n):r};o.fnSetData=function(t,e,n){return D(f)(t,e,n)};"number"!=typeof f&&(e._rowReadObject=!0);if(!e.oFeatures.bSort){o.bSortable=!1;u.addClass(s.sSortableNone)}var g=-1!==t.inArray("asc",o.asSorting),m=-1!==t.inArray("desc",o.asSorting);if(o.bSortable&&(g||m))if(g&&!m){o.sSortingClass=s.sSortableAsc;o.sSortingClassJUI=s.sSortJUIAscAllowed}else if(!g&&m){o.sSortingClass=s.sSortableDesc;o.sSortingClassJUI=s.sSortJUIDescAllowed}else{o.sSortingClass=s.sSortable;o.sSortingClassJUI=s.sSortJUI}else{o.sSortingClass=s.sSortableNone;o.sSortingClassJUI=""}}function d(t){if(t.oFeatures.bAutoWidth!==!1){var e=t.aoColumns;yt(t);for(var n=0,r=e.length;r>n;n++)e[n].nTh.style.width=e[n].sWidth}var i=t.oScroll;(""!==i.sY||""!==i.sX)&&mt(t);zt(t,null,"column-sizing",[t])}function p(t,e){var n=v(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function g(e,n){var r=v(e,"bVisible"),i=t.inArray(n,r);return-1!==i?i:null}function m(t){return v(t,"bVisible").length}function v(e,n){var r=[];t.map(e.aoColumns,function(t,e){t[n]&&r.push(e)});return r}function y(t){var e,n,r,i,o,s,l,u,c,f=t.aoColumns,h=t.aoData,d=Yt.ext.type.detect;for(e=0,n=f.length;n>e;e++){l=f[e];c=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,i=d.length;i>r;r++){for(o=0,s=h.length;s>o;o++){c[o]===a&&(c[o]=T(t,o,e,"type"));u=d[r](c[o],t);if(!u&&r!==d.length-1)break;if("html"===u)break}if(u){l.sType=u;break}}l.sType||(l.sType="string")}}}function b(e,n,r,i){var o,s,l,u,c,h,d,p=e.aoColumns;if(n)for(o=n.length-1;o>=0;o--){d=n[o];var g=d.targets!==a?d.targets:d.aTargets;t.isArray(g)||(g=[g]);for(l=0,u=g.length;u>l;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)f(e);i(g[l],d)}else if("number"==typeof g[l]&&g[l]<0)i(p.length+g[l],d);else if("string"==typeof g[l])for(c=0,h=p.length;h>c;c++)("_all"==g[l]||t(p[c].nTh).hasClass(g[l]))&&i(c,d)}if(r)for(o=0,s=r.length;s>o;o++)i(o,r[o])}function w(e,n,r,i){var o=e.aoData.length,a=t.extend(!0,{},Yt.models.oRow,{src:r?"dom":"data"});a._aData=n;e.aoData.push(a);for(var s=e.aoColumns,l=0,u=s.length;u>l;l++){r&&k(e,o,l,T(e,o,l));s[l].sType=null}e.aiDisplayMaster.push(o);(r||!e.oFeatures.bDeferRender)&&j(e,o,r,i);return o}function x(e,n){var r;n instanceof t||(n=t(n));return n.map(function(t,n){r=P(e,n);return w(e,r.data,n,r.cells)})}function C(t,e){return e._DT_RowIndex!==a?e._DT_RowIndex:null}function S(e,n,r){return t.inArray(r,e.aoData[n].anCells)}function T(t,e,n,r){var i=t.iDraw,o=t.aoColumns[n],s=t.aoData[e]._aData,l=o.sDefaultContent,u=o.fnGetData(s,r,{settings:t,row:e,col:n});if(u===a){if(t.iDrawError!=i&&null===l){Ht(t,0,"Requested unknown parameter "+("function"==typeof o.mData?"{function}":"'"+o.mData+"'")+" for row "+e,4);t.iDrawError=i}return l}if(u!==s&&null!==u||null===l){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"==r?"":u}function k(t,e,n,r){var i=t.aoColumns[n],o=t.aoData[e]._aData;i.fnSetData(o,r,{settings:t,row:e,col:n})}function M(e){return t.map(e.match(/(\\.|[^\.])+/g),function(t){return t.replace(/\\./g,".")})}function _(e){if(t.isPlainObject(e)){var n={};t.each(e,function(t,e){e&&(n[t]=_(e))});return function(t,e,r,i){var o=n[e]||n._;return o!==a?o(t,e,r,i):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,n,r,i){return e(t,n,r,i)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){return t[e]};var r=function(t,e,n){var i,o,s,l;if(""!==n)for(var u=M(n),c=0,f=u.length;f>c;c++){i=u[c].match(be);o=u[c].match(we);if(i){u[c]=u[c].replace(be,"");""!==u[c]&&(t=t[u[c]]);s=[];u.splice(0,c+1);l=u.join(".");for(var h=0,d=t.length;d>h;h++)s.push(r(t[h],e,l));var p=i[0].substring(1,i[0].length-1);t=""===p?s:s.join(p);break}if(o){u[c]=u[c].replace(we,"");t=t[u[c]]()}else{if(null===t||t[u[c]]===a)return a;t=t[u[c]]}}return t};return function(t,n){return r(t,n,e)}}function D(e){if(t.isPlainObject(e))return D(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,n,r){e(t,"set",n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,n){t[e]=n};var n=function(t,e,r){for(var i,o,s,l,u,c=M(r),f=c[c.length-1],h=0,d=c.length-1;d>h;h++){o=c[h].match(be);s=c[h].match(we);if(o){c[h]=c[h].replace(be,"");t[c[h]]=[];i=c.slice();i.splice(0,h+1);u=i.join(".");for(var p=0,g=e.length;g>p;p++){l={};n(l,e[p],u);t[c[h]].push(l)}return}if(s){c[h]=c[h].replace(we,"");t=t[c[h]](e)}(null===t[c[h]]||t[c[h]]===a)&&(t[c[h]]={});t=t[c[h]]}f.match(we)?t=t[f.replace(we,"")](e):t[f.replace(be,"")]=e};return function(t,r){return n(t,r,e)}}function L(t){return he(t.aoData,"_aData")}function A(t){t.aoData.length=0;t.aiDisplayMaster.length=0;t.aiDisplay.length=0}function N(t,e,n){for(var r=-1,i=0,o=t.length;o>i;i++)t[i]==e?r=i:t[i]>e&&t[i]--;-1!=r&&n===a&&t.splice(r,1)}function E(t,e,n,r){var i,o,s=t.aoData[e],l=function(n,r){for(;n.childNodes.length;)n.removeChild(n.firstChild);n.innerHTML=T(t,e,r,"display")};if("dom"!==n&&(n&&"auto"!==n||"dom"!==s.src)){var u=s.anCells;if(u)if(r!==a)l(u[r],r);else for(i=0,o=u.length;o>i;i++)l(u[i],i)}else s._aData=P(t,s,r,r===a?a:s._aData).data;s._aSortData=null;s._aFilterData=null;var c=t.aoColumns;if(r!==a)c[r].sType=null;else{for(i=0,o=c.length;o>i;i++)c[i].sType=null;I(s)}}function P(e,n,r,i){var o,s,l,u=[],c=n.firstChild,f=0,h=e.aoColumns,d=e._rowReadObject;i=i||d?{}:[];var p=function(t,e){if("string"==typeof t){var n=t.indexOf("@");if(-1!==n){var r=t.substring(n+1),o=D(t);o(i,e.getAttribute(r))}}},g=function(e){if(r===a||r===f){s=h[f];l=t.trim(e.innerHTML);if(s&&s._bAttrSrc){var n=D(s.mData._);n(i,l);p(s.mData.sort,e);p(s.mData.type,e);p(s.mData.filter,e)}else if(d){s._setter||(s._setter=D(s.mData));s._setter(i,l)}else i[f]=l}f++};if(c)for(;c;){o=c.nodeName.toUpperCase();if("TD"==o||"TH"==o){g(c);u.push(c)}c=c.nextSibling}else{u=n.anCells;for(var m=0,v=u.length;v>m;m++)g(u[m])}return{data:i,cells:u}}function j(t,e,n,r){var i,a,s,l,u,c=t.aoData[e],f=c._aData,h=[];if(null===c.nTr){i=n||o.createElement("tr");c.nTr=i;c.anCells=h;i._DT_RowIndex=e;I(c);for(l=0,u=t.aoColumns.length;u>l;l++){s=t.aoColumns[l];a=n?r[l]:o.createElement(s.sCellType);h.push(a);(!n||s.mRender||s.mData!==l)&&(a.innerHTML=T(t,e,l,"display"));s.sClass&&(a.className+=" "+s.sClass);s.bVisible&&!n?i.appendChild(a):!s.bVisible&&n&&a.parentNode.removeChild(a);s.fnCreatedCell&&s.fnCreatedCell.call(t.oInstance,a,T(t,e,l),f,e,l)}zt(t,"aoRowCreatedCallback",null,[i,f,e])}c.nTr.setAttribute("role","row")}function I(e){var n=e.nTr,r=e._aData;if(n){r.DT_RowId&&(n.id=r.DT_RowId);if(r.DT_RowClass){var i=r.DT_RowClass.split(" ");e.__rowc=e.__rowc?ve(e.__rowc.concat(i)):i;t(n).removeClass(e.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowAttr&&t(n).attr(r.DT_RowAttr);r.DT_RowData&&t(n).data(r.DT_RowData)}}function H(e){var n,r,i,o,a,s=e.nTHead,l=e.nTFoot,u=0===t("th, td",s).length,c=e.oClasses,f=e.aoColumns;u&&(o=t("<tr/>").appendTo(s));for(n=0,r=f.length;r>n;n++){a=f[n];i=t(a.nTh).addClass(a.sClass);u&&i.appendTo(o);if(e.oFeatures.bSort){i.addClass(a.sSortingClass);if(a.bSortable!==!1){i.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId);At(e,a.nTh,n)}}a.sTitle!=i.html()&&i.html(a.sTitle);Ut(e,"header")(e,i,a,c)}u&&z(e.aoHeader,s);t(s).find(">tr").attr("role","row");t(s).find(">tr>th, >tr>td").addClass(c.sHeaderTH);t(l).find(">tr>th, >tr>td").addClass(c.sFooterTH);if(null!==l){var h=e.aoFooter[0];for(n=0,r=h.length;r>n;n++){a=f[n];a.nTf=h[n].cell;a.sClass&&t(a.nTf).addClass(a.sClass)}}}function O(e,n,r){var i,o,s,l,u,c,f,h,d,p=[],g=[],m=e.aoColumns.length;if(n){r===a&&(r=!1);for(i=0,o=n.length;o>i;i++){p[i]=n[i].slice();p[i].nTr=n[i].nTr;for(s=m-1;s>=0;s--)e.aoColumns[s].bVisible||r||p[i].splice(s,1);g.push([])}for(i=0,o=p.length;o>i;i++){f=p[i].nTr;if(f)for(;c=f.firstChild;)f.removeChild(c);for(s=0,l=p[i].length;l>s;s++){h=1;d=1;if(g[i][s]===a){f.appendChild(p[i][s].cell);g[i][s]=1;for(;p[i+h]!==a&&p[i][s].cell==p[i+h][s].cell;){g[i+h][s]=1;h++}for(;p[i][s+d]!==a&&p[i][s].cell==p[i][s+d].cell;){for(u=0;h>u;u++)g[i+u][s+d]=1;d++}t(p[i][s].cell).attr("rowspan",h).attr("colspan",d)}}}}}function R(e){var n=zt(e,"aoPreDrawCallback","preDraw",[e]);if(-1===t.inArray(!1,n)){var r=[],i=0,o=e.asStripeClasses,s=o.length,l=(e.aoOpenRows.length,e.oLanguage),u=e.iInitDisplayStart,c="ssp"==Bt(e),f=e.aiDisplay;e.bDrawing=!0;if(u!==a&&-1!==u){e._iDisplayStart=c?u:u>=e.fnRecordsDisplay()?0:u;e.iInitDisplayStart=-1}var h=e._iDisplayStart,d=e.fnDisplayEnd();if(e.bDeferLoading){e.bDeferLoading=!1;e.iDraw++;pt(e,!1)}else if(c){if(!e.bDestroying&&!B(e))return}else e.iDraw++;if(0!==f.length)for(var p=c?0:h,g=c?e.aoData.length:d,v=p;g>v;v++){var y=f[v],b=e.aoData[y];null===b.nTr&&j(e,y);var w=b.nTr;if(0!==s){var x=o[i%s];if(b._sRowStripe!=x){t(w).removeClass(b._sRowStripe).addClass(x);b._sRowStripe=x}}zt(e,"aoRowCallback",null,[w,b._aData,i,v]);r.push(w);i++}else{var C=l.sZeroRecords;1==e.iDraw&&"ajax"==Bt(e)?C=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(C=l.sEmptyTable);r[0]=t("<tr/>",{"class":s?o[0]:""}).append(t("<td />",{valign:"top",colSpan:m(e),"class":e.oClasses.sRowEmpty}).html(C))[0]}zt(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],L(e),h,d,f]);zt(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],L(e),h,d,f]);var S=t(e.nTBody);S.children().detach();S.append(t(r));zt(e,"aoDrawCallback","draw",[e]);e.bSorted=!1;e.bFiltered=!1;e.bDrawing=!1}else pt(e,!1)}function F(t,e){var n=t.oFeatures,r=n.bSort,i=n.bFilter;r&&_t(t);i?$(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice();e!==!0&&(t._iDisplayStart=0);t._drawHold=e;R(t);t._drawHold=!1}function W(e){var n=e.oClasses,r=t(e.nTable),i=t("<div/>").insertBefore(r),o=e.oFeatures,a=t("<div/>",{id:e.sTableId+"_wrapper","class":n.sWrapper+(e.nTFoot?"":" "+n.sNoFooter)});e.nHolding=i[0];e.nTableWrapper=a[0];e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,u,c,f,h,d=e.sDom.split(""),p=0;p<d.length;p++){s=null;l=d[p];if("<"==l){u=t("<div/>")[0];c=d[p+1];if("'"==c||'"'==c){f="";h=2;for(;d[p+h]!=c;){f+=d[p+h];h++}"H"==f?f=n.sJUIHeader:"F"==f&&(f=n.sJUIFooter);if(-1!=f.indexOf(".")){var g=f.split(".");u.id=g[0].substr(1,g[0].length-1);u.className=g[1]}else"#"==f.charAt(0)?u.id=f.substr(1,f.length-1):u.className=f; p+=h}a.append(u);a=t(u)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=ct(e);else if("f"==l&&o.bFilter)s=Y(e);else if("r"==l&&o.bProcessing)s=dt(e);else if("t"==l)s=gt(e);else if("i"==l&&o.bInfo)s=it(e);else if("p"==l&&o.bPaginate)s=ft(e);else if(0!==Yt.ext.feature.length)for(var m=Yt.ext.feature,v=0,y=m.length;y>v;v++)if(l==m[v].cFeature){s=m[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]);b[l].push(s);a.append(s)}}i.replaceWith(a)}function z(e,n){var r,i,o,a,s,l,u,c,f,h,d,p=t(n).children("tr"),g=function(t,e,n){for(var r=t[e];r[n];)n++;return n};e.splice(0,e.length);for(o=0,l=p.length;l>o;o++)e.push([]);for(o=0,l=p.length;l>o;o++){r=p[o];c=0;i=r.firstChild;for(;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){f=1*i.getAttribute("colspan");h=1*i.getAttribute("rowspan");f=f&&0!==f&&1!==f?f:1;h=h&&0!==h&&1!==h?h:1;u=g(e,o,c);d=1===f?!0:!1;for(s=0;f>s;s++)for(a=0;h>a;a++){e[o+a][u+s]={cell:i,unique:d};e[o+a].nTr=r}}i=i.nextSibling}}}function q(t,e,n){var r=[];if(!n){n=t.aoHeader;if(e){n=[];z(n,e)}}for(var i=0,o=n.length;o>i;i++)for(var a=0,s=n[i].length;s>a;a++)!n[i][a].unique||r[a]&&t.bSortCellsTop||(r[a]=n[i][a].cell);return r}function U(e,n,r){zt(e,"aoServerParams","serverParams",[n]);if(n&&t.isArray(n)){var i={},o=/(.*?)\[\]$/;t.each(n,function(t,e){var n=e.name.match(o);if(n){var r=n[0];i[r]||(i[r]=[]);i[r].push(e.value)}else i[e.name]=e.value});n=i}var a,s=e.ajax,l=e.oInstance,u=function(t){zt(e,null,"xhr",[e,t,e.jqXHR]);r(t)};if(t.isPlainObject(s)&&s.data){a=s.data;var c=t.isFunction(a)?a(n,e):a;n=t.isFunction(a)&&c?c:t.extend(!0,n,c);delete s.data}var f={data:n,success:function(t){var n=t.error||t.sError;n&&Ht(e,0,n);e.json=t;u(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(n,r,i){var o=zt(e,null,"xhr",[e,null,e.jqXHR]);-1===t.inArray(!0,o)&&("parsererror"==r?Ht(e,0,"Invalid JSON response",1):4===n.readyState&&Ht(e,0,"Ajax error",7));pt(e,!1)}};e.oAjaxData=n;zt(e,null,"preXhr",[e,n]);if(e.fnServerData)e.fnServerData.call(l,e.sAjaxSource,t.map(n,function(t,e){return{name:e,value:t}}),u,e);else if(e.sAjaxSource||"string"==typeof s)e.jqXHR=t.ajax(t.extend(f,{url:s||e.sAjaxSource}));else if(t.isFunction(s))e.jqXHR=s.call(l,n,u,e);else{e.jqXHR=t.ajax(t.extend(f,s));s.data=a}}function B(t){if(t.bAjaxDataGet){t.iDraw++;pt(t,!0);U(t,V(t),function(e){X(t,e)});return!1}return!0}function V(e){var n,r,i,o,a=e.aoColumns,s=a.length,l=e.oFeatures,u=e.oPreviousSearch,c=e.aoPreSearchCols,f=[],h=Mt(e),d=e._iDisplayStart,p=l.bPaginate!==!1?e._iDisplayLength:-1,g=function(t,e){f.push({name:t,value:e})};g("sEcho",e.iDraw);g("iColumns",s);g("sColumns",he(a,"sName").join(","));g("iDisplayStart",d);g("iDisplayLength",p);var m={draw:e.iDraw,columns:[],order:[],start:d,length:p,search:{value:u.sSearch,regex:u.bRegex}};for(n=0;s>n;n++){i=a[n];o=c[n];r="function"==typeof i.mData?"function":i.mData;m.columns.push({data:r,name:i.sName,searchable:i.bSearchable,orderable:i.bSortable,search:{value:o.sSearch,regex:o.bRegex}});g("mDataProp_"+n,r);if(l.bFilter){g("sSearch_"+n,o.sSearch);g("bRegex_"+n,o.bRegex);g("bSearchable_"+n,i.bSearchable)}l.bSort&&g("bSortable_"+n,i.bSortable)}if(l.bFilter){g("sSearch",u.sSearch);g("bRegex",u.bRegex)}if(l.bSort){t.each(h,function(t,e){m.order.push({column:e.col,dir:e.dir});g("iSortCol_"+t,e.col);g("sSortDir_"+t,e.dir)});g("iSortingCols",h.length)}var v=Yt.ext.legacy.ajax;return null===v?e.sAjaxSource?f:m:v?f:m}function X(t,e){var n=function(t,n){return e[t]!==a?e[t]:e[n]},r=G(t,e),i=n("sEcho","draw"),o=n("iTotalRecords","recordsTotal"),s=n("iTotalDisplayRecords","recordsFiltered");if(i){if(1*i<t.iDraw)return;t.iDraw=1*i}A(t);t._iRecordsTotal=parseInt(o,10);t._iRecordsDisplay=parseInt(s,10);for(var l=0,u=r.length;u>l;l++)w(t,r[l]);t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=!1;R(t);t._bInitComplete||lt(t,e);t.bAjaxDataGet=!0;pt(t,!1)}function G(e,n){var r=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==a?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===r?n.aaData||n[r]:""!==r?_(r)(n):n}function Y(e){var n=e.oClasses,r=e.sTableId,i=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='<input type="search" class="'+n.sFilterInput+'"/>',u=i.sSearch;u=u.match(/_INPUT_/)?u.replace("_INPUT_",l):u+l;var c=t("<div/>",{id:s.f?null:r+"_filter","class":n.sFilter}).append(t("<label/>").append(u)),f=function(){var t=(s.f,this.value?this.value:"");if(t!=a.sSearch){$(e,{sSearch:t,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive});e._iDisplayStart=0;R(e)}},h=null!==e.searchDelay?e.searchDelay:"ssp"===Bt(e)?400:0,d=t("input",c).val(a.sSearch).attr("placeholder",i.sSearchPlaceholder).bind("keyup.DT search.DT input.DT paste.DT cut.DT",h?bt(f,h):f).bind("keypress.DT",function(t){return 13==t.keyCode?!1:void 0}).attr("aria-controls",r);t(e.nTable).on("search.dt.DT",function(t,n){if(e===n)try{d[0]!==o.activeElement&&d.val(a.sSearch)}catch(r){}});return c[0]}function $(t,e,n){var r=t.oPreviousSearch,i=t.aoPreSearchCols,o=function(t){r.sSearch=t.sSearch;r.bRegex=t.bRegex;r.bSmart=t.bSmart;r.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==a?!t.bEscapeRegex:t.bRegex};y(t);if("ssp"!=Bt(t)){Z(t,e.sSearch,n,s(e),e.bSmart,e.bCaseInsensitive);o(e);for(var l=0;l<i.length;l++)K(t,i[l].sSearch,l,s(i[l]),i[l].bSmart,i[l].bCaseInsensitive);J(t)}else o(e);t.bFiltered=!0;zt(t,null,"search",[t])}function J(t){for(var e,n,r=Yt.ext.search,i=t.aiDisplay,o=0,a=r.length;a>o;o++){for(var s=[],l=0,u=i.length;u>l;l++){n=i[l];e=t.aoData[n];r[o](t,e._aFilterData,n,e._aData,l)&&s.push(n)}i.length=0;i.push.apply(i,s)}}function K(t,e,n,r,i,o){if(""!==e)for(var a,s=t.aiDisplay,l=Q(e,r,i,o),u=s.length-1;u>=0;u--){a=t.aoData[s[u]]._aFilterData[n];l.test(a)||s.splice(u,1)}}function Z(t,e,n,r,i,o){var a,s,l,u=Q(e,r,i,o),c=t.oPreviousSearch.sSearch,f=t.aiDisplayMaster;0!==Yt.ext.search.length&&(n=!0);s=et(t);if(e.length<=0)t.aiDisplay=f.slice();else{(s||n||c.length>e.length||0!==e.indexOf(c)||t.bSorted)&&(t.aiDisplay=f.slice());a=t.aiDisplay;for(l=a.length-1;l>=0;l--)u.test(t.aoData[a[l]]._sFilterRow)||a.splice(l,1)}}function Q(e,n,r,i){e=n?e:tt(e);if(r){var o=t.map(e.match(/"[^"]+"|[^ ]+/g)||[""],function(t){if('"'===t.charAt(0)){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")});e="^(?=.*?"+o.join(")(?=.*?")+").*$"}return new RegExp(e,i?"i":"")}function tt(t){return t.replace(ie,"\\$1")}function et(t){var e,n,r,i,o,a,s,l,u=t.aoColumns,c=Yt.ext.type.search,f=!1;for(n=0,i=t.aoData.length;i>n;n++){l=t.aoData[n];if(!l._aFilterData){a=[];for(r=0,o=u.length;o>r;r++){e=u[r];if(e.bSearchable){s=T(t,n,r,"filter");c[e.sType]&&(s=c[e.sType](s));null===s&&(s="");"string"!=typeof s&&s.toString&&(s=s.toString())}else s="";if(s.indexOf&&-1!==s.indexOf("&")){xe.innerHTML=s;s=Ce?xe.textContent:xe.innerText}s.replace&&(s=s.replace(/[\r\n]/g,""));a.push(s)}l._aFilterData=a;l._sFilterRow=a.join(" ");f=!0}}return f}function nt(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function rt(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function it(e){var n=e.sTableId,r=e.aanFeatures.i,i=t("<div/>",{"class":e.oClasses.sInfo,id:r?null:n+"_info"});if(!r){e.aoDrawCallback.push({fn:ot,sName:"information"});i.attr("role","status").attr("aria-live","polite");t(e.nTable).attr("aria-describedby",n+"_info")}return i[0]}function ot(e){var n=e.aanFeatures.i;if(0!==n.length){var r=e.oLanguage,i=e._iDisplayStart+1,o=e.fnDisplayEnd(),a=e.fnRecordsTotal(),s=e.fnRecordsDisplay(),l=s?r.sInfo:r.sInfoEmpty;s!==a&&(l+=" "+r.sInfoFiltered);l+=r.sInfoPostFix;l=at(e,l);var u=r.fnInfoCallback;null!==u&&(l=u.call(e.oInstance,e,i,o,a,s,l));t(n).html(l)}}function at(t,e){var n=t.fnFormatNumber,r=t._iDisplayStart+1,i=t._iDisplayLength,o=t.fnRecordsDisplay(),a=-1===i;return e.replace(/_START_/g,n.call(t,r)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,o)).replace(/_PAGE_/g,n.call(t,a?1:Math.ceil(r/i))).replace(/_PAGES_/g,n.call(t,a?1:Math.ceil(o/i)))}function st(t){var e,n,r,i=t.iInitDisplayStart,o=t.aoColumns,a=t.oFeatures;if(t.bInitialised){W(t);H(t);O(t,t.aoHeader);O(t,t.aoFooter);pt(t,!0);a.bAutoWidth&&yt(t);for(e=0,n=o.length;n>e;e++){r=o[e];r.sWidth&&(r.nTh.style.width=Tt(r.sWidth))}F(t);var s=Bt(t);if("ssp"!=s)if("ajax"==s)U(t,[],function(n){var r=G(t,n);for(e=0;e<r.length;e++)w(t,r[e]);t.iInitDisplayStart=i;F(t);pt(t,!1);lt(t,n)},t);else{pt(t,!1);lt(t)}}else setTimeout(function(){st(t)},200)}function lt(t,e){t._bInitComplete=!0;e&&d(t);zt(t,"aoInitComplete","init",[t,e])}function ut(t,e){var n=parseInt(e,10);t._iDisplayLength=n;qt(t);zt(t,null,"length",[t,n])}function ct(e){for(var n=e.oClasses,r=e.sTableId,i=e.aLengthMenu,o=t.isArray(i[0]),a=o?i[0]:i,s=o?i[1]:i,l=t("<select/>",{name:r+"_length","aria-controls":r,"class":n.sLengthSelect}),u=0,c=a.length;c>u;u++)l[0][u]=new Option(s[u],a[u]);var f=t("<div><label/></div>").addClass(n.sLength);e.aanFeatures.l||(f[0].id=r+"_length");f.children().append(e.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML));t("select",f).val(e._iDisplayLength).bind("change.DT",function(n){ut(e,t(this).val());R(e)});t(e.nTable).bind("length.dt.DT",function(n,r,i){e===r&&t("select",f).val(i)});return f[0]}function ft(e){var n=e.sPaginationType,r=Yt.ext.pager[n],i="function"==typeof r,o=function(t){R(t)},a=t("<div/>").addClass(e.oClasses.sPaging+n)[0],s=e.aanFeatures;i||r.fnInit(e,a,o);if(!s.p){a.id=e.sTableId+"_paginate";e.aoDrawCallback.push({fn:function(t){if(i){var e,n,a=t._iDisplayStart,l=t._iDisplayLength,u=t.fnRecordsDisplay(),c=-1===l,f=c?0:Math.ceil(a/l),h=c?1:Math.ceil(u/l),d=r(f,h);for(e=0,n=s.p.length;n>e;e++)Ut(t,"pageButton")(t,s.p[e],e,d,f,h)}else r.fnUpdate(t,o)},sName:"pagination"})}return a}function ht(t,e,n){var r=t._iDisplayStart,i=t._iDisplayLength,o=t.fnRecordsDisplay();if(0===o||-1===i)r=0;else if("number"==typeof e){r=e*i;r>o&&(r=0)}else if("first"==e)r=0;else if("previous"==e){r=i>=0?r-i:0;0>r&&(r=0)}else"next"==e?o>r+i&&(r+=i):"last"==e?r=Math.floor((o-1)/i)*i:Ht(t,0,"Unknown paging action: "+e,5);var a=t._iDisplayStart!==r;t._iDisplayStart=r;if(a){zt(t,null,"page",[t]);n&&R(t)}return a}function dt(e){return t("<div/>",{id:e.aanFeatures.r?null:e.sTableId+"_processing","class":e.oClasses.sProcessing}).html(e.oLanguage.sProcessing).insertBefore(e.nTable)[0]}function pt(e,n){e.oFeatures.bProcessing&&t(e.aanFeatures.r).css("display",n?"block":"none");zt(e,null,"processing",[e,n])}function gt(e){var n=t(e.nTable);n.attr("role","grid");var r=e.oScroll;if(""===r.sX&&""===r.sY)return e.nTable;var i=r.sX,o=r.sY,a=e.oClasses,s=n.children("caption"),l=s.length?s[0]._captionSide:null,u=t(n[0].cloneNode(!1)),c=t(n[0].cloneNode(!1)),f=n.children("tfoot"),h="<div/>",d=function(t){return t?Tt(t):null};r.sX&&"100%"===n.attr("width")&&n.removeAttr("width");f.length||(f=null);var p=t(h,{"class":a.sScrollWrapper}).append(t(h,{"class":a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollHeadInner}).css({"box-sizing":"content-box",width:r.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append("top"===l?s:null).append(n.children("thead"))))).append(t(h,{"class":a.sScrollBody}).css({overflow:"auto",height:d(o),width:d(i)}).append(n));f&&p.append(t(h,{"class":a.sScrollFoot}).css({overflow:"hidden",border:0,width:i?d(i):"100%"}).append(t(h,{"class":a.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append("bottom"===l?s:null).append(n.children("tfoot")))));var g=p.children(),m=g[0],v=g[1],y=f?g[2]:null;i&&t(v).on("scroll.DT",function(t){var e=this.scrollLeft;m.scrollLeft=e;f&&(y.scrollLeft=e)});e.nScrollHead=m;e.nScrollBody=v;e.nScrollFoot=y;e.aoDrawCallback.push({fn:mt,sName:"scrolling"});return p[0]}function mt(e){var n,r,i,o,a,s,l,u,c,f=e.oScroll,h=f.sX,d=f.sXInner,g=f.sY,m=f.iBarWidth,v=t(e.nScrollHead),y=v[0].style,b=v.children("div"),w=b[0].style,x=b.children("table"),C=e.nScrollBody,S=t(C),T=C.style,k=t(e.nScrollFoot),M=k.children("div"),_=M.children("table"),D=t(e.nTHead),L=t(e.nTable),A=L[0],N=A.style,E=e.nTFoot?t(e.nTFoot):null,P=e.oBrowser,j=P.bScrollOversize,I=[],H=[],O=[],R=function(t){var e=t.style;e.paddingTop="0";e.paddingBottom="0";e.borderTopWidth="0";e.borderBottomWidth="0";e.height=0};L.children("thead, tfoot").remove();a=D.clone().prependTo(L);n=D.find("tr");i=a.find("tr");a.find("th, td").removeAttr("tabindex");if(E){s=E.clone().prependTo(L);r=E.find("tr");o=s.find("tr")}if(!h){T.width="100%";v[0].style.width="100%"}t.each(q(e,a),function(t,n){l=p(e,t);n.style.width=e.aoColumns[l].sWidth});E&&vt(function(t){t.style.width=""},o);f.bCollapse&&""!==g&&(T.height=S[0].offsetHeight+D[0].offsetHeight+"px");c=L.outerWidth();if(""===h){N.width="100%";j&&(L.find("tbody").height()>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Tt(L.outerWidth()-m))}else if(""!==d)N.width=Tt(d);else if(c==S.width()&&S.height()<L.height()){N.width=Tt(c-m);L.outerWidth()>c-m&&(N.width=Tt(c))}else N.width=Tt(c);c=L.outerWidth();vt(R,i);vt(function(e){O.push(e.innerHTML);I.push(Tt(t(e).css("width")))},i);vt(function(t,e){t.style.width=I[e]},n);t(i).height(0);if(E){vt(R,o);vt(function(e){H.push(Tt(t(e).css("width")))},o);vt(function(t,e){t.style.width=H[e]},r);t(o).height(0)}vt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+O[e]+"</div>";t.style.width=I[e]},i);E&&vt(function(t,e){t.innerHTML="";t.style.width=H[e]},o);if(L.outerWidth()<c){u=C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y")?c+m:c;j&&(C.scrollHeight>C.offsetHeight||"scroll"==S.css("overflow-y"))&&(N.width=Tt(u-m));(""===h||""!==d)&&Ht(e,1,"Possible column misalignment",6)}else u="100%";T.width=Tt(u);y.width=Tt(u);E&&(e.nScrollFoot.style.width=Tt(u));g||j&&(T.height=Tt(A.offsetHeight+m));if(g&&f.bCollapse){T.height=Tt(g);var F=h&&A.offsetWidth>C.offsetWidth?m:0;A.offsetHeight<C.offsetHeight&&(T.height=Tt(A.offsetHeight+F))}var W=L.outerWidth();x[0].style.width=Tt(W);w.width=Tt(W);var z=L.height()>C.clientHeight||"scroll"==S.css("overflow-y"),U="padding"+(P.bScrollbarLeft?"Left":"Right");w[U]=z?m+"px":"0px";if(E){_[0].style.width=Tt(W);M[0].style.width=Tt(W);M[0].style[U]=z?m+"px":"0px"}S.scroll();!e.bSorted&&!e.bFiltered||e._drawHold||(C.scrollTop=0)}function vt(t,e,n){for(var r,i,o=0,a=0,s=e.length;s>a;){r=e[a].firstChild;i=n?n[a].firstChild:null;for(;r;){if(1===r.nodeType){n?t(r,i,o):t(r,o);o++}r=r.nextSibling;i=n?i.nextSibling:null}a++}}function yt(e){var n,r,o,a,s,l=e.nTable,u=e.aoColumns,c=e.oScroll,f=c.sY,h=c.sX,p=c.sXInner,g=u.length,y=v(e,"bVisible"),b=t("th",e.nTHead),w=l.getAttribute("width"),x=l.parentNode,C=!1,S=l.style.width;S&&-1!==S.indexOf("%")&&(w=S);for(n=0;n<y.length;n++){r=u[y[n]];if(null!==r.sWidth){r.sWidth=wt(r.sWidthOrig,x);C=!0}}if(C||h||f||g!=m(e)||g!=b.length){var T=t(l).clone().css("visibility","hidden").removeAttr("id");T.find("tbody tr").remove();var k=t("<tr/>").appendTo(T.find("tbody"));T.find("tfoot th, tfoot td").css("width","");b=q(e,T.find("thead")[0]);for(n=0;n<y.length;n++){r=u[y[n]];b[n].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?Tt(r.sWidthOrig):""}if(e.aoData.length)for(n=0;n<y.length;n++){o=y[n];r=u[o];t(Ct(e,o)).clone(!1).append(r.sContentPadding).appendTo(k)}T.appendTo(x);if(h&&p)T.width(p);else if(h){T.css("width","auto");T.width()<x.offsetWidth&&T.width(x.offsetWidth)}else f?T.width(x.offsetWidth):w&&T.width(w);xt(e,T[0]);if(h){var M=0;for(n=0;n<y.length;n++){r=u[y[n]];s=t(b[n]).outerWidth();M+=null===r.sWidthOrig?s:parseInt(r.sWidth,10)+s-t(b[n]).width()}T.width(Tt(M));l.style.width=Tt(M)}for(n=0;n<y.length;n++){r=u[y[n]];a=t(b[n]).width();a&&(r.sWidth=Tt(a))}l.style.width=Tt(T.css("width"));T.remove()}else for(n=0;g>n;n++)u[n].sWidth=Tt(b.eq(n).width());w&&(l.style.width=Tt(w));if((w||h)&&!e._reszEvt){var _=function(){t(i).bind("resize.DT-"+e.sInstance,bt(function(){d(e)}))};e.oBrowser.bScrollOversize?setTimeout(_,1e3):_();e._reszEvt=!0}}function bt(t,e){var n,r,i=e!==a?e:200;return function(){var e=this,o=+new Date,s=arguments;if(n&&n+i>o){clearTimeout(r);r=setTimeout(function(){n=a;t.apply(e,s)},i)}else{n=o;t.apply(e,s)}}}function wt(e,n){if(!e)return 0;var r=t("<div/>").css("width",Tt(e)).appendTo(n||o.body),i=r[0].offsetWidth;r.remove();return i}function xt(e,n){var r=e.oScroll;if(r.sX||r.sY){var i=r.sX?0:r.iBarWidth;n.style.width=Tt(t(n).outerWidth()-i)}}function Ct(e,n){var r=St(e,n);if(0>r)return null;var i=e.aoData[r];return i.nTr?i.anCells[n]:t("<td/>").html(T(e,r,n,"display"))[0]}function St(t,e){for(var n,r=-1,i=-1,o=0,a=t.aoData.length;a>o;o++){n=T(t,o,e,"display")+"";n=n.replace(Se,"");if(n.length>r){r=n.length;i=o}}return i}function Tt(t){return null===t?"0px":"number"==typeof t?0>t?"0px":t+"px":t.match(/\d$/)?t+"px":t}function kt(){var e=Yt.__scrollbarWidth;if(e===a){var n=t("<p/>").css({position:"absolute",top:0,left:0,width:"100%",height:150,padding:0,overflow:"scroll",visibility:"hidden"}).appendTo("body");e=n[0].offsetWidth-n[0].clientWidth;Yt.__scrollbarWidth=e;n.remove()}return e}function Mt(e){var n,r,i,o,s,l,u,c=[],f=e.aoColumns,h=e.aaSortingFixed,d=t.isPlainObject(h),p=[],g=function(e){e.length&&!t.isArray(e[0])?p.push(e):p.push.apply(p,e)};t.isArray(h)&&g(h);d&&h.pre&&g(h.pre);g(e.aaSorting);d&&h.post&&g(h.post);for(n=0;n<p.length;n++){u=p[n][0];o=f[u].aDataSort;for(r=0,i=o.length;i>r;r++){s=o[r];l=f[s].sType||"string";p[n]._idx===a&&(p[n]._idx=t.inArray(p[n][1],f[s].asSorting));c.push({src:u,col:s,dir:p[n][1],index:p[n]._idx,type:l,formatter:Yt.ext.type.order[l+"-pre"]})}}return c}function _t(t){var e,n,r,i,o,a=[],s=Yt.ext.type.order,l=t.aoData,u=(t.aoColumns,0),c=t.aiDisplayMaster;y(t);o=Mt(t);for(e=0,n=o.length;n>e;e++){i=o[e];i.formatter&&u++;Et(t,i.col)}if("ssp"!=Bt(t)&&0!==o.length){for(e=0,r=c.length;r>e;e++)a[c[e]]=e;c.sort(u===o.length?function(t,e){var n,r,i,s,u,c=o.length,f=l[t]._aSortData,h=l[e]._aSortData;for(i=0;c>i;i++){u=o[i];n=f[u.col];r=h[u.col];s=r>n?-1:n>r?1:0;if(0!==s)return"asc"===u.dir?s:-s}n=a[t];r=a[e];return r>n?-1:n>r?1:0}:function(t,e){var n,r,i,u,c,f,h=o.length,d=l[t]._aSortData,p=l[e]._aSortData;for(i=0;h>i;i++){c=o[i];n=d[c.col];r=p[c.col];f=s[c.type+"-"+c.dir]||s["string-"+c.dir];u=f(n,r);if(0!==u)return u}n=a[t];r=a[e];return r>n?-1:n>r?1:0})}t.bSorted=!0}function Dt(t){for(var e,n,r=t.aoColumns,i=Mt(t),o=t.oLanguage.oAria,a=0,s=r.length;s>a;a++){var l=r[a],u=l.asSorting,c=l.sTitle.replace(/<.*?>/g,""),f=l.nTh;f.removeAttribute("aria-sort");if(l.bSortable){if(i.length>0&&i[0].col==a){f.setAttribute("aria-sort","asc"==i[0].dir?"ascending":"descending");n=u[i[0].index+1]||u[0]}else n=u[0];e=c+("asc"===n?o.sSortAscending:o.sSortDescending)}else e=c;f.setAttribute("aria-label",e)}}function Lt(e,n,r,i){var o,s=e.aoColumns[n],l=e.aaSorting,u=s.asSorting,c=function(e,n){var r=e._idx;r===a&&(r=t.inArray(e[1],u));return r+1<u.length?r+1:n?null:0};"number"==typeof l[0]&&(l=e.aaSorting=[l]);if(r&&e.oFeatures.bSortMulti){var f=t.inArray(n,he(l,"0"));if(-1!==f){o=c(l[f],!0);null===o&&1===l.length&&(o=0);if(null===o)l.splice(f,1);else{l[f][1]=u[o];l[f]._idx=o}}else{l.push([n,u[0],0]);l[l.length-1]._idx=0}}else if(l.length&&l[0][0]==n){o=c(l[0]);l.length=1;l[0][1]=u[o];l[0]._idx=o}else{l.length=0;l.push([n,u[0]]);l[0]._idx=0}F(e);"function"==typeof i&&i(e)}function At(t,e,n,r){var i=t.aoColumns[n];Ft(e,{},function(e){if(i.bSortable!==!1)if(t.oFeatures.bProcessing){pt(t,!0);setTimeout(function(){Lt(t,n,e.shiftKey,r);"ssp"!==Bt(t)&&pt(t,!1)},0)}else Lt(t,n,e.shiftKey,r)})}function Nt(e){var n,r,i,o=e.aLastSort,a=e.oClasses.sSortColumn,s=Mt(e),l=e.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,r=o.length;r>n;n++){i=o[n].src;t(he(e.aoData,"anCells",i)).removeClass(a+(2>n?n+1:3))}for(n=0,r=s.length;r>n;n++){i=s[n].src;t(he(e.aoData,"anCells",i)).addClass(a+(2>n?n+1:3))}}e.aLastSort=s}function Et(t,e){var n,r=t.aoColumns[e],i=Yt.ext.order[r.sSortDataType];i&&(n=i.call(t.oInstance,t,e,g(t,e)));for(var o,a,s=Yt.ext.type.order[r.sType+"-pre"],l=0,u=t.aoData.length;u>l;l++){o=t.aoData[l];o._aSortData||(o._aSortData=[]);if(!o._aSortData[e]||i){a=i?n[l]:T(t,l,e,"sort");o._aSortData[e]=s?s(a):a}}}function Pt(e){if(e.oFeatures.bStateSave&&!e.bDestroying){var n={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.extend(!0,[],e.aaSorting),search:nt(e.oPreviousSearch),columns:t.map(e.aoColumns,function(t,n){return{visible:t.bVisible,search:nt(e.aoPreSearchCols[n])}})};zt(e,"aoStateSaveParams","stateSaveParams",[e,n]);e.oSavedState=n;e.fnStateSaveCallback.call(e.oInstance,e,n)}}function jt(e,n){var r,i,o=e.aoColumns;if(e.oFeatures.bStateSave){var s=e.fnStateLoadCallback.call(e.oInstance,e);if(s&&s.time){var l=zt(e,"aoStateLoadParams","stateLoadParams",[e,s]);if(-1===t.inArray(!1,l)){var u=e.iStateDuration;if(!(u>0&&s.time<+new Date-1e3*u)&&o.length===s.columns.length){e.oLoadedState=t.extend(!0,{},s);if(s.start!==a){e._iDisplayStart=s.start;e.iInitDisplayStart=s.start}s.length!==a&&(e._iDisplayLength=s.length);if(s.order!==a){e.aaSorting=[];t.each(s.order,function(t,n){e.aaSorting.push(n[0]>=o.length?[0,n[1]]:n)})}s.search!==a&&t.extend(e.oPreviousSearch,rt(s.search));for(r=0,i=s.columns.length;i>r;r++){var c=s.columns[r];c.visible!==a&&(o[r].bVisible=c.visible);c.search!==a&&t.extend(e.aoPreSearchCols[r],rt(c.search))}zt(e,"aoStateLoaded","stateLoaded",[e,s])}}}}}function It(e){var n=Yt.settings,r=t.inArray(e,he(n,"nTable"));return-1!==r?n[r]:null}function Ht(t,e,n,r){n="DataTables warning: "+(null!==t?"table id="+t.sTableId+" - ":"")+n;r&&(n+=". For more information about this error, please see http://datatables.net/tn/"+r);if(e)i.console&&console.log&&console.log(n);else{var o=Yt.ext,a=o.sErrMode||o.errMode;zt(t,null,"error",[t,r,n]);if("alert"==a)alert(n);else{if("throw"==a)throw new Error(n);"function"==typeof a&&a(t,r,n)}}}function Ot(e,n,r,i){if(t.isArray(r))t.each(r,function(r,i){t.isArray(i)?Ot(e,n,i[0],i[1]):Ot(e,n,i)});else{i===a&&(i=r);n[r]!==a&&(e[i]=n[r])}}function Rt(e,n,r){var i;for(var o in n)if(n.hasOwnProperty(o)){i=n[o];if(t.isPlainObject(i)){t.isPlainObject(e[o])||(e[o]={});t.extend(!0,e[o],i)}else e[o]=r&&"data"!==o&&"aaData"!==o&&t.isArray(i)?i.slice():i}return e}function Ft(e,n,r){t(e).bind("click.DT",n,function(t){e.blur();r(t)}).bind("keypress.DT",n,function(t){if(13===t.which){t.preventDefault();r(t)}}).bind("selectstart.DT",function(){return!1})}function Wt(t,e,n,r){n&&t[e].push({fn:n,sName:r})}function zt(e,n,r,i){var o=[];n&&(o=t.map(e[n].slice().reverse(),function(t,n){return t.fn.apply(e.oInstance,i)}));if(null!==r){var a=t.Event(r+".dt");t(e.nTable).trigger(a,i);o.push(a.result)}return o}function qt(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),r=t._iDisplayLength;e>=n&&(e=n-r);e-=e%r;(-1===r||0>e)&&(e=0);t._iDisplayStart=e}function Ut(e,n){var r=e.renderer,i=Yt.ext.renderer[n];return t.isPlainObject(r)&&r[n]?i[r[n]]||i._:"string"==typeof r?i[r]||i._:i._}function Bt(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function Vt(t,e){var n=[],r=Xe.numbers_length,i=Math.floor(r/2);if(r>=e)n=pe(0,e);else if(i>=t){n=pe(0,r-2);n.push("ellipsis");n.push(e-1)}else if(t>=e-1-i){n=pe(e-(r-2),e);n.splice(0,0,"ellipsis");n.splice(0,0,0)}else{n=pe(t-i+2,t+i-1);n.push("ellipsis");n.push(e-1);n.splice(0,0,"ellipsis");n.splice(0,0,0)}n.DT_el="span";return n}function Xt(e){t.each({num:function(t){return Ge(t,e)},"num-fmt":function(t){return Ge(t,e,oe)},"html-num":function(t){return Ge(t,e,ee)},"html-num-fmt":function(t){return Ge(t,e,ee,oe)}},function(t,n){$t.type.order[t+e+"-pre"]=n;t.match(/^html\-/)&&($t.type.search[t+e]=$t.type.search.html)})}function Gt(t){return function(){var e=[It(this[Yt.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return Yt.ext.internal[t].apply(this,e)}}var Yt,$t,Jt,Kt,Zt,Qt={},te=/[\r\n]/g,ee=/<.*?>/g,ne=/^[\w\+\-]/,re=/[\w\+\-]$/,ie=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),oe=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,ae=function(t){return t&&t!==!0&&"-"!==t?!1:!0},se=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},le=function(t,e){Qt[e]||(Qt[e]=new RegExp(tt(e),"g"));return"string"==typeof t&&"."!==e?t.replace(/\./g,"").replace(Qt[e],"."):t},ue=function(t,e,n){var r="string"==typeof t;if(ae(t))return!0;e&&r&&(t=le(t,e));n&&r&&(t=t.replace(oe,""));return!isNaN(parseFloat(t))&&isFinite(t)},ce=function(t){return ae(t)||"string"==typeof t},fe=function(t,e,n){if(ae(t))return!0;var r=ce(t);return r&&ue(me(t),e,n)?!0:null},he=function(t,e,n){var r=[],i=0,o=t.length;if(n!==a)for(;o>i;i++)t[i]&&t[i][e]&&r.push(t[i][e][n]);else for(;o>i;i++)t[i]&&r.push(t[i][e]);return r},de=function(t,e,n,r){var i=[],o=0,s=e.length;if(r!==a)for(;s>o;o++)t[e[o]][n]&&i.push(t[e[o]][n][r]);else for(;s>o;o++)i.push(t[e[o]][n]);return i},pe=function(t,e){var n,r=[];if(e===a){e=0;n=t}else{n=e;e=t}for(var i=e;n>i;i++)r.push(i);return r},ge=function(t){for(var e=[],n=0,r=t.length;r>n;n++)t[n]&&e.push(t[n]);return e},me=function(t){return t.replace(ee,"")},ve=function(t){var e,n,r,i=[],o=t.length,a=0;t:for(n=0;o>n;n++){e=t[n];for(r=0;a>r;r++)if(i[r]===e)continue t;i.push(e);a++}return i},ye=function(t,e,n){t[e]!==a&&(t[n]=t[e])},be=/\[.*?\]$/,we=/\(\)$/,xe=t("<div>")[0],Ce=xe.textContent!==a,Se=/<.*?>/g;Yt=function(e){this.$=function(t,e){return this.api(!0).$(t,e)};this._=function(t,e){return this.api(!0).rows(t,e).data()};this.api=function(t){return new Jt(t?It(this[$t.iApiIndex]):this)};this.fnAddData=function(e,n){var r=this.api(!0),i=t.isArray(e)&&(t.isArray(e[0])||t.isPlainObject(e[0]))?r.rows.add(e):r.row.add(e);(n===a||n)&&r.draw();return i.flatten().toArray()};this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),n=e.settings()[0],r=n.oScroll;t===a||t?e.draw(!1):(""!==r.sX||""!==r.sY)&&mt(n)};this.fnClearTable=function(t){var e=this.api(!0).clear();(t===a||t)&&e.draw()};this.fnClose=function(t){this.api(!0).row(t).child.hide()};this.fnDeleteRow=function(t,e,n){var r=this.api(!0),i=r.rows(t),o=i.settings()[0],s=o.aoData[i[0][0]];i.remove();e&&e.call(this,o,s);(n===a||n)&&r.draw();return s};this.fnDestroy=function(t){this.api(!0).destroy(t)};this.fnDraw=function(t){this.api(!0).draw(t)};this.fnFilter=function(t,e,n,r,i,o){var s=this.api(!0);null===e||e===a?s.search(t,n,r,o):s.column(e).search(t,n,r,o);s.draw()};this.fnGetData=function(t,e){var n=this.api(!0);if(t!==a){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==a||"td"==r||"th"==r?n.cell(t,e).data():n.row(t).data()||null}return n.data().toArray()};this.fnGetNodes=function(t){var e=this.api(!0);return t!==a?e.row(t).node():e.rows().nodes().flatten().toArray()};this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"==n||"TH"==n){var r=e.cell(t).index();return[r.row,r.columnVisible,r.column]}return null};this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()};this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]};this.fnPageChange=function(t,e){var n=this.api(!0).page(t);(e===a||e)&&n.draw(!1)};this.fnSetColumnVis=function(t,e,n){var r=this.api(!0).column(t).visible(e);(n===a||n)&&r.columns.adjust().draw()};this.fnSettings=function(){return It(this[$t.iApiIndex])};this.fnSort=function(t){this.api(!0).order(t).draw()};this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)};this.fnUpdate=function(t,e,n,r,i){var o=this.api(!0);n===a||null===n?o.row(e).data(t):o.cell(e,n).data(t);(i===a||i)&&o.columns.adjust();(r===a||r)&&o.draw();return 0};this.fnVersionCheck=$t.fnVersionCheck;var i=this,o=e===a,c=this.length;o&&(e={});this.oApi=this.internal=$t.internal;for(var d in Yt.ext.internal)d&&(this[d]=Gt(d));this.each(function(){var d,p={},g=c>1?Rt(p,e,!0):e,m=0,v=this.getAttribute("id"),y=!1,C=Yt.defaults,S=t(this);if("table"==this.nodeName.toLowerCase()){s(C);l(C.column);n(C,C,!0);n(C.column,C.column,!0);n(C,t.extend(g,S.data()));var T=Yt.settings;for(m=0,d=T.length;d>m;m++){var k=T[m];if(k.nTable==this||k.nTHead.parentNode==this||k.nTFoot&&k.nTFoot.parentNode==this){var M=g.bRetrieve!==a?g.bRetrieve:C.bRetrieve,_=g.bDestroy!==a?g.bDestroy:C.bDestroy;if(o||M)return k.oInstance;if(_){k.oInstance.fnDestroy();break}Ht(k,0,"Cannot reinitialise DataTable",3);return}if(k.sTableId==this.id){T.splice(m,1);break}}if(null===v||""===v){v="DataTables_Table_"+Yt.ext._unique++;this.id=v}var D=t.extend(!0,{},Yt.models.oSettings,{sDestroyWidth:S[0].style.width,sInstance:v,sTableId:v});D.nTable=this;D.oApi=i.internal;D.oInit=g;T.push(D);D.oInstance=1===i.length?i:S.dataTable();s(g);g.oLanguage&&r(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=t.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Rt(t.extend(!0,{},C),g);Ot(D.oFeatures,g,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]);Ot(D,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);Ot(D.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);Ot(D.oLanguage,g,"fnInfoCallback");Wt(D,"aoDrawCallback",g.fnDrawCallback,"user");Wt(D,"aoServerParams",g.fnServerParams,"user");Wt(D,"aoStateSaveParams",g.fnStateSaveParams,"user");Wt(D,"aoStateLoadParams",g.fnStateLoadParams,"user");Wt(D,"aoStateLoaded",g.fnStateLoaded,"user");Wt(D,"aoRowCallback",g.fnRowCallback,"user");Wt(D,"aoRowCreatedCallback",g.fnCreatedRow,"user");Wt(D,"aoHeaderCallback",g.fnHeaderCallback,"user");Wt(D,"aoFooterCallback",g.fnFooterCallback,"user");Wt(D,"aoInitComplete",g.fnInitComplete,"user");Wt(D,"aoPreDrawCallback",g.fnPreDrawCallback,"user");var L=D.oClasses;if(g.bJQueryUI){t.extend(L,Yt.ext.oJUIClasses,g.oClasses);g.sDom===C.sDom&&"lfrtip"===C.sDom&&(D.sDom='<"H"lfr>t<"F"ip>');D.renderer?t.isPlainObject(D.renderer)&&!D.renderer.header&&(D.renderer.header="jqueryui"):D.renderer="jqueryui"}else t.extend(L,Yt.ext.classes,g.oClasses);S.addClass(L.sTable);(""!==D.oScroll.sX||""!==D.oScroll.sY)&&(D.oScroll.iBarWidth=kt());D.oScroll.sX===!0&&(D.oScroll.sX="100%");if(D.iInitDisplayStart===a){D.iInitDisplayStart=g.iDisplayStart;D._iDisplayStart=g.iDisplayStart}if(null!==g.iDeferLoading){D.bDeferLoading=!0;var A=t.isArray(g.iDeferLoading);D._iRecordsDisplay=A?g.iDeferLoading[0]:g.iDeferLoading;D._iRecordsTotal=A?g.iDeferLoading[1]:g.iDeferLoading}var N=D.oLanguage;t.extend(!0,N,g.oLanguage);if(""!==N.sUrl){t.ajax({dataType:"json",url:N.sUrl,success:function(e){r(e);n(C.oLanguage,e);t.extend(!0,N,e);st(D)},error:function(){st(D)}});y=!0}null===g.asStripeClasses&&(D.asStripeClasses=[L.sStripeOdd,L.sStripeEven]);var E=D.asStripeClasses,j=S.children("tbody").find("tr").eq(0);if(-1!==t.inArray(!0,t.map(E,function(t,e){return j.hasClass(t)}))){t("tbody tr",this).removeClass(E.join(" "));D.asDestroyStripes=E.slice()}var I,H=[],O=this.getElementsByTagName("thead");if(0!==O.length){z(D.aoHeader,O[0]);H=q(D)}if(null===g.aoColumns){I=[];for(m=0,d=H.length;d>m;m++)I.push(null)}else I=g.aoColumns;for(m=0,d=I.length;d>m;m++)f(D,H?H[m]:null);b(D,g.aoColumnDefs,I,function(t,e){h(D,t,e)});if(j.length){var R=function(t,e){return null!==t.getAttribute("data-"+e)?e:null};t.each(P(D,j[0]).cells,function(t,e){var n=D.aoColumns[t];if(n.mData===t){var r=R(e,"sort")||R(e,"order"),i=R(e,"filter")||R(e,"search");if(null!==r||null!==i){n.mData={_:t+".display",sort:null!==r?t+".@data-"+r:a,type:null!==r?t+".@data-"+r:a,filter:null!==i?t+".@data-"+i:a};h(D,t); }}})}var F=D.oFeatures;if(g.bStateSave){F.bStateSave=!0;jt(D,g);Wt(D,"aoDrawCallback",Pt,"state_save")}if(g.aaSorting===a){var W=D.aaSorting;for(m=0,d=W.length;d>m;m++)W[m][1]=D.aoColumns[m].asSorting[0]}Nt(D);F.bSort&&Wt(D,"aoDrawCallback",function(){if(D.bSorted){var e=Mt(D),n={};t.each(e,function(t,e){n[e.src]=e.dir});zt(D,null,"order",[D,e,n]);Dt(D)}});Wt(D,"aoDrawCallback",function(){(D.bSorted||"ssp"===Bt(D)||F.bDeferRender)&&Nt(D)},"sc");u(D);var U=S.children("caption").each(function(){this._captionSide=S.css("caption-side")}),B=S.children("thead");0===B.length&&(B=t("<thead/>").appendTo(this));D.nTHead=B[0];var V=S.children("tbody");0===V.length&&(V=t("<tbody/>").appendTo(this));D.nTBody=V[0];var X=S.children("tfoot");0===X.length&&U.length>0&&(""!==D.oScroll.sX||""!==D.oScroll.sY)&&(X=t("<tfoot/>").appendTo(this));if(0===X.length||0===X.children().length)S.addClass(L.sNoFooter);else if(X.length>0){D.nTFoot=X[0];z(D.aoFooter,D.nTFoot)}if(g.aaData)for(m=0;m<g.aaData.length;m++)w(D,g.aaData[m]);else(D.bDeferLoading||"dom"==Bt(D))&&x(D,t(D.nTBody).children("tr"));D.aiDisplay=D.aiDisplayMaster.slice();D.bInitialised=!0;y===!1&&st(D)}else Ht(null,0,"Non-table node initialisation ("+this.nodeName+")",2)});i=null;return this};var Te=[],ke=Array.prototype,Me=function(e){var n,r,i=Yt.settings,o=t.map(i,function(t,e){return t.nTable});if(!e)return[];if(e.nTable&&e.oApi)return[e];if(e.nodeName&&"table"===e.nodeName.toLowerCase()){n=t.inArray(e,o);return-1!==n?[i[n]]:null}if(e&&"function"==typeof e.settings)return e.settings().toArray();"string"==typeof e?r=t(e):e instanceof t&&(r=e);return r?r.map(function(e){n=t.inArray(this,o);return-1!==n?i[n]:null}).toArray():void 0};Jt=function(e,n){if(!(this instanceof Jt))return new Jt(e,n);var r=[],i=function(t){var e=Me(t);e&&r.push.apply(r,e)};if(t.isArray(e))for(var o=0,a=e.length;a>o;o++)i(e[o]);else i(e);this.context=ve(r);n&&this.push.apply(this,n.toArray?n.toArray():n);this.selector={rows:null,cols:null,opts:null};Jt.extend(this,this,Te)};Yt.Api=Jt;Jt.prototype={any:function(){return 0!==this.flatten().length},concat:ke.concat,context:[],each:function(t){for(var e=0,n=this.length;n>e;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new Jt(e[t],this[t]):null},filter:function(t){var e=[];if(ke.filter)e=ke.filter.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new Jt(this.context,e)},flatten:function(){var t=[];return new Jt(this.context,t.concat.apply(t,this.toArray()))},join:ke.join,indexOf:ke.indexOf||function(t,e){for(var n=e||0,r=this.length;r>n;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,n,r){var i,o,s,l,u,c,f,h,d=[],p=this.context,g=this.selector;if("string"==typeof t){r=n;n=e;e=t;t=!1}for(o=0,s=p.length;s>o;o++){var m=new Jt(p[o]);if("table"===e){i=n.call(m,p[o],o);i!==a&&d.push(i)}else if("columns"===e||"rows"===e){i=n.call(m,p[o],this[o],o);i!==a&&d.push(i)}else if("column"===e||"column-rows"===e||"row"===e||"cell"===e){f=this[o];"column-rows"===e&&(c=Ee(p[o],g.opts));for(l=0,u=f.length;u>l;l++){h=f[l];i="cell"===e?n.call(m,p[o],h.row,h.column,o,l):n.call(m,p[o],h,o,l,c);i!==a&&d.push(i)}}}if(d.length||r){var v=new Jt(p,t?d.concat.apply([],d):d),y=v.selector;y.rows=g.rows;y.cols=g.cols;y.opts=g.opts;return v}return this},lastIndexOf:ke.lastIndexOf||function(t,e){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(ke.map)e=ke.map.call(this,t,this);else for(var n=0,r=this.length;r>n;n++)e.push(t.call(this,this[n],n));return new Jt(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:ke.pop,push:ke.push,reduce:ke.reduce||function(t,e){return c(this,t,e,0,this.length,1)},reduceRight:ke.reduceRight||function(t,e){return c(this,t,e,this.length-1,-1,-1)},reverse:ke.reverse,selector:null,shift:ke.shift,sort:ke.sort,splice:ke.splice,toArray:function(){return ke.slice.call(this)},to$:function(){return t(this)},toJQuery:function(){return t(this)},unique:function(){return new Jt(this.context,ve(this))},unshift:ke.unshift};Jt.extend=function(e,n,r){if(r.length&&n&&(n instanceof Jt||n.__dt_wrapper)){var i,o,a,s=function(t,e,n){return function(){var r=e.apply(t,arguments);Jt.extend(r,r,n.methodExt);return r}};for(i=0,o=r.length;o>i;i++){a=r[i];n[a.name]="function"==typeof a.val?s(e,a.val,a):t.isPlainObject(a.val)?{}:a.val;n[a.name].__dt_wrapper=!0;Jt.extend(e,n[a.name],a.propExt)}}};Jt.register=Kt=function(e,n){if(t.isArray(e))for(var r=0,i=e.length;i>r;r++)Jt.register(e[r],n);else{var o,a,s,l,u=e.split("."),c=Te,f=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n].name===e)return t[n];return null};for(o=0,a=u.length;a>o;o++){l=-1!==u[o].indexOf("()");s=l?u[o].replace("()",""):u[o];var h=f(c,s);if(!h){h={name:s,val:{},methodExt:[],propExt:[]};c.push(h)}o===a-1?h.val=n:c=l?h.methodExt:h.propExt}}};Jt.registerPlural=Zt=function(e,n,r){Jt.register(e,r);Jt.register(n,function(){var e=r.apply(this,arguments);return e===this?this:e instanceof Jt?e.length?t.isArray(e[0])?new Jt(e.context,e[0]):e[0]:a:e})};var _e=function(e,n){if("number"==typeof e)return[n[e]];var r=t.map(n,function(t,e){return t.nTable});return t(r).filter(e).map(function(e){var i=t.inArray(this,r);return n[i]}).toArray()};Kt("tables()",function(t){return t?new Jt(_e(t,this.context)):this});Kt("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new Jt(n[0]):e});Zt("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable},1)});Zt("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody},1)});Zt("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead},1)});Zt("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot},1)});Zt("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper},1)});Kt("draw()",function(t){return this.iterator("table",function(e){F(e,t===!1)})});Kt("page()",function(t){return t===a?this.page.info().page:this.iterator("table",function(e){ht(e,t)})});Kt("page.info()",function(t){if(0===this.context.length)return a;var e=this.context[0],n=e._iDisplayStart,r=e._iDisplayLength,i=e.fnRecordsDisplay(),o=-1===r;return{page:o?0:Math.floor(n/r),pages:o?1:Math.ceil(i/r),start:n,end:e.fnDisplayEnd(),length:r,recordsTotal:e.fnRecordsTotal(),recordsDisplay:i}});Kt("page.len()",function(t){return t===a?0!==this.context.length?this.context[0]._iDisplayLength:a:this.iterator("table",function(e){ut(e,t)})});var De=function(t,e,n){if(n){var r=new Jt(t);r.one("draw",function(){n(r.ajax.json())})}if("ssp"==Bt(t))F(t,e);else{pt(t,!0);U(t,[],function(n){A(t);for(var r=G(t,n),i=0,o=r.length;o>i;i++)w(t,r[i]);F(t,e);pt(t,!1)})}};Kt("ajax.json()",function(){var t=this.context;return t.length>0?t[0].json:void 0});Kt("ajax.params()",function(){var t=this.context;return t.length>0?t[0].oAjaxData:void 0});Kt("ajax.reload()",function(t,e){return this.iterator("table",function(n){De(n,e===!1,t)})});Kt("ajax.url()",function(e){var n=this.context;if(e===a){if(0===n.length)return a;n=n[0];return n.ajax?t.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource}return this.iterator("table",function(n){t.isPlainObject(n.ajax)?n.ajax.url=e:n.ajax=e})});Kt("ajax.url().load()",function(t,e){return this.iterator("table",function(n){De(n,e===!1,t)})});var Le=function(e,n,r,i,o){var s,l,u,c,f,h,d=[],p=typeof n;n&&"string"!==p&&"function"!==p&&n.length!==a||(n=[n]);for(u=0,c=n.length;c>u;u++){l=n[u]&&n[u].split?n[u].split(","):[n[u]];for(f=0,h=l.length;h>f;f++){s=r("string"==typeof l[f]?t.trim(l[f]):l[f]);s&&s.length&&d.push.apply(d,s)}}var g=$t.selector[e];if(g.length)for(u=0,c=g.length;c>u;u++)d=g[u](i,o,d);return d},Ae=function(e){e||(e={});e.filter&&e.search===a&&(e.search=e.filter);return t.extend({search:"none",order:"current",page:"all"},e)},Ne=function(t){for(var e=0,n=t.length;n>e;e++)if(t[e].length>0){t[0]=t[e];t[0].length=1;t.length=1;t.context=[t.context[e]];return t}t.length=0;return t},Ee=function(e,n){var r,i,o,a=[],s=e.aiDisplay,l=e.aiDisplayMaster,u=n.search,c=n.order,f=n.page;if("ssp"==Bt(e))return"removed"===u?[]:pe(0,l.length);if("current"==f)for(r=e._iDisplayStart,i=e.fnDisplayEnd();i>r;r++)a.push(s[r]);else if("current"==c||"applied"==c)a="none"==u?l.slice():"applied"==u?s.slice():t.map(l,function(e,n){return-1===t.inArray(e,s)?e:null});else if("index"==c||"original"==c)for(r=0,i=e.aoData.length;i>r;r++)if("none"==u)a.push(r);else{o=t.inArray(r,s);(-1===o&&"removed"==u||o>=0&&"applied"==u)&&a.push(r)}return a},Pe=function(e,n,r){var i=function(n){var i=se(n);if(null!==i&&!r)return[i];var o=Ee(e,r);if(null!==i&&-1!==t.inArray(i,o))return[i];if(!n)return o;if("function"==typeof n)return t.map(o,function(t){var r=e.aoData[t];return n(t,r._aData,r.nTr)?t:null});var a=ge(de(e.aoData,o,"nTr"));return n.nodeName&&-1!==t.inArray(n,a)?[n._DT_RowIndex]:t(a).filter(n).map(function(){return this._DT_RowIndex}).toArray()};return Le("row",n,i,e,r)};Kt("rows()",function(e,n){if(e===a)e="";else if(t.isPlainObject(e)){n=e;e=""}n=Ae(n);var r=this.iterator("table",function(t){return Pe(t,e,n)},1);r.selector.rows=e;r.selector.opts=n;return r});Kt("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||a},1)});Kt("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return de(t.aoData,e,"_aData")},1)});Zt("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,n){var r=e.aoData[n];return"search"===t?r._aFilterData:r._aSortData},1)});Zt("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,n){E(e,n,t)})});Zt("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e},1)});Zt("rows().remove()","row().remove()",function(){var e=this;return this.iterator("row",function(n,r,i){var o=n.aoData;o.splice(r,1);for(var a=0,s=o.length;s>a;a++)null!==o[a].nTr&&(o[a].nTr._DT_RowIndex=a);t.inArray(r,n.aiDisplay);N(n.aiDisplayMaster,r);N(n.aiDisplay,r);N(e[i],r,!1);qt(n)})});Kt("rows.add()",function(t){var e=this.iterator("table",function(e){var n,r,i,o=[];for(r=0,i=t.length;i>r;r++){n=t[r];o.push(n.nodeName&&"TR"===n.nodeName.toUpperCase()?x(e,n)[0]:w(e,n))}return o},1),n=this.rows(-1);n.pop();n.push.apply(n,e.toArray());return n});Kt("row()",function(t,e){return Ne(this.rows(t,e))});Kt("row().data()",function(t){var e=this.context;if(t===a)return e.length&&this.length?e[0].aoData[this[0]]._aData:a;e[0].aoData[this[0]]._aData=t;E(e[0],this[0],"data");return this});Kt("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null});Kt("row.add()",function(e){e instanceof t&&e.length&&(e=e[0]);var n=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?x(t,e)[0]:w(t,e)});return this.row(n[0])});var je=function(e,n,r,i){var o=[],a=function(n,r){if(t.isArray(n)||n instanceof t)for(var i=0,s=n.length;s>i;i++)a(n[i],r);else if(n.nodeName&&"tr"===n.nodeName.toLowerCase())o.push(n);else{var l=t("<tr><td/></tr>").addClass(r);t("td",l).addClass(r).html(n)[0].colSpan=m(e);o.push(l[0])}};a(r,i);n._details&&n._details.remove();n._details=t(o);n._detailsShow&&n._details.insertAfter(n.nTr)},Ie=function(t,e){var n=t.context;if(n.length){var r=n[0].aoData[e!==a?e:t[0]];if(r._details){r._details.remove();r._detailsShow=a;r._details=a}}},He=function(t,e){var n=t.context;if(n.length&&t.length){var r=n[0].aoData[t[0]];if(r._details){r._detailsShow=e;e?r._details.insertAfter(r.nTr):r._details.detach();Oe(n[0])}}},Oe=function(t){var e=new Jt(t),n=".dt.DT_details",r="draw"+n,i="column-visibility"+n,o="destroy"+n,a=t.aoData;e.off(r+" "+i+" "+o);if(he(a,"_details").length>0){e.on(r,function(n,r){t===r&&e.rows({page:"current"}).eq(0).each(function(t){var e=a[t];e._detailsShow&&e._details.insertAfter(e.nTr)})});e.on(i,function(e,n,r,i){if(t===n)for(var o,s=m(n),l=0,u=a.length;u>l;l++){o=a[l];o._details&&o._details.children("td[colspan]").attr("colspan",s)}});e.on(o,function(n,r){if(t===r)for(var i=0,o=a.length;o>i;i++)a[i]._details&&Ie(e,i)})}},Re="",Fe=Re+"row().child",We=Fe+"()";Kt(We,function(t,e){var n=this.context;if(t===a)return n.length&&this.length?n[0].aoData[this[0]]._details:a;t===!0?this.child.show():t===!1?Ie(this):n.length&&this.length&&je(n[0],n[0].aoData[this[0]],t,e);return this});Kt([Fe+".show()",We+".show()"],function(t){He(this,!0);return this});Kt([Fe+".hide()",We+".hide()"],function(){He(this,!1);return this});Kt([Fe+".remove()",We+".remove()"],function(){Ie(this);return this});Kt(Fe+".isShown()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]]._detailsShow||!1:!1});var ze=/^(.+):(name|visIdx|visible)$/,qe=function(t,e,n,r,i){for(var o=[],a=0,s=i.length;s>a;a++)o.push(T(t,i[a],e));return o},Ue=function(e,n,r){var i=e.aoColumns,o=he(i,"sName"),a=he(i,"nTh"),s=function(n){var s=se(n);if(""===n)return pe(i.length);if(null!==s)return[s>=0?s:i.length+s];if("function"==typeof n){var l=Ee(e,r);return t.map(i,function(t,r){return n(r,qe(e,r,0,0,l),a[r])?r:null})}var u="string"==typeof n?n.match(ze):"";if(!u)return t(a).filter(n).map(function(){return t.inArray(this,a)}).toArray();switch(u[2]){case"visIdx":case"visible":var c=parseInt(u[1],10);if(0>c){var f=t.map(i,function(t,e){return t.bVisible?e:null});return[f[f.length+c]]}return[p(e,c)];case"name":return t.map(o,function(t,e){return t===u[1]?e:null})}};return Le("column",n,s,e,r)},Be=function(e,n,r,i){var o,s,l,u,c=e.aoColumns,f=c[n],h=e.aoData;if(r===a)return f.bVisible;if(f.bVisible!==r){if(r){var p=t.inArray(!0,he(c,"bVisible"),n+1);for(s=0,l=h.length;l>s;s++){u=h[s].nTr;o=h[s].anCells;u&&u.insertBefore(o[n],o[p]||null)}}else t(he(e.aoData,"anCells",n)).detach();f.bVisible=r;O(e,e.aoHeader);O(e,e.aoFooter);if(i===a||i){d(e);(e.oScroll.sX||e.oScroll.sY)&&mt(e)}zt(e,null,"column-visibility",[e,n,r]);Pt(e)}};Kt("columns()",function(e,n){if(e===a)e="";else if(t.isPlainObject(e)){n=e;e=""}n=Ae(n);var r=this.iterator("table",function(t){return Ue(t,e,n)},1);r.selector.cols=e;r.selector.opts=n;return r});Zt("columns().header()","column().header()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh},1)});Zt("columns().footer()","column().footer()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf},1)});Zt("columns().data()","column().data()",function(){return this.iterator("column-rows",qe,1)});Zt("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData},1)});Zt("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,n,r,i,o){return de(e.aoData,o,"search"===t?"_aFilterData":"_aSortData",n)},1)});Zt("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,r,i){return de(t.aoData,i,"anCells",e)},1)});Zt("columns().visible()","column().visible()",function(t,e){return this.iterator("column",function(n,r){if(t===a)return n.aoColumns[r].bVisible;Be(n,r,t,e);return void 0})});Zt("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,n){return"visible"===t?g(e,n):n},1)});Kt("columns.adjust()",function(){return this.iterator("table",function(t){d(t)},1)});Kt("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return p(n,e);if("fromData"===t||"toVisible"===t)return g(n,e)}});Kt("column()",function(t,e){return Ne(this.columns(t,e))});var Ve=function(e,n,r){var i,o,s,l,u,c,f,h=e.aoData,d=Ee(e,r),p=ge(de(h,d,"anCells")),g=t([].concat.apply([],p)),m=e.aoColumns.length,v=function(n){var r="function"==typeof n;if(null===n||n===a||r){o=[];for(s=0,l=d.length;l>s;s++){i=d[s];for(u=0;m>u;u++){c={row:i,column:u};if(r){f=e.aoData[i];n(c,T(e,i,u),f.anCells?f.anCells[u]:null)&&o.push(c)}else o.push(c)}}return o}return t.isPlainObject(n)?[n]:g.filter(n).map(function(e,n){i=n.parentNode._DT_RowIndex;return{row:i,column:t.inArray(n,h[i].anCells)}}).toArray()};return Le("cell",n,v,e,r)};Kt("cells()",function(e,n,r){if(t.isPlainObject(e))if(e.row===a){r=e;e=null}else{r=n;n=null}if(t.isPlainObject(n)){r=n;n=null}if(null===n||n===a)return this.iterator("table",function(t){return Ve(t,e,Ae(r))});var i,o,s,l,u,c=this.columns(n,r),f=this.rows(e,r),h=this.iterator("table",function(t,e){i=[];for(o=0,s=f[e].length;s>o;o++)for(l=0,u=c[e].length;u>l;l++)i.push({row:f[e][o],column:c[e][l]});return i},1);t.extend(h.selector,{cols:n,rows:e,opts:r});return h});Zt("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){var r=t.aoData[e].anCells;return r?r[n]:a},1)});Kt("cells().data()",function(){return this.iterator("cell",function(t,e,n){return T(t,e,n)},1)});Zt("cells().cache()","cell().cache()",function(t){t="search"===t?"_aFilterData":"_aSortData";return this.iterator("cell",function(e,n,r){return e.aoData[n][t][r]},1)});Zt("cells().render()","cell().render()",function(t){return this.iterator("cell",function(e,n,r){return T(e,n,r,t)},1)});Zt("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:g(t,n)}},1)});Zt("cells().invalidate()","cell().invalidate()",function(t){return this.iterator("cell",function(e,n,r){E(e,n,t,r)})});Kt("cell()",function(t,e,n){return Ne(this.cells(t,e,n))});Kt("cell().data()",function(t){var e=this.context,n=this[0];if(t===a)return e.length&&n.length?T(e[0],n[0].row,n[0].column):a;k(e[0],n[0].row,n[0].column,t);E(e[0],n[0].row,"data",n[0].column);return this});Kt("order()",function(e,n){var r=this.context;if(e===a)return 0!==r.length?r[0].aaSorting:a;"number"==typeof e?e=[[e,n]]:t.isArray(e[0])||(e=Array.prototype.slice.call(arguments));return this.iterator("table",function(t){t.aaSorting=e.slice()})});Kt("order.listener()",function(t,e,n){return this.iterator("table",function(r){At(r,t,e,n)})});Kt(["columns().order()","column().order()"],function(e){var n=this;return this.iterator("table",function(r,i){var o=[];t.each(n[i],function(t,n){o.push([n,e])});r.aaSorting=o})});Kt("search()",function(e,n,r,i){var o=this.context;return e===a?0!==o.length?o[0].oPreviousSearch.sSearch:a:this.iterator("table",function(o){o.oFeatures.bFilter&&$(o,t.extend({},o.oPreviousSearch,{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i}),1)})});Zt("columns().search()","column().search()",function(e,n,r,i){return this.iterator("column",function(o,s){var l=o.aoPreSearchCols;if(e===a)return l[s].sSearch;if(o.oFeatures.bFilter){t.extend(l[s],{sSearch:e+"",bRegex:null===n?!1:n,bSmart:null===r?!0:r,bCaseInsensitive:null===i?!0:i});$(o,o.oPreviousSearch,1)}})});Kt("state()",function(){return this.context.length?this.context[0].oSavedState:null});Kt("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})});Kt("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});Kt("state.save()",function(){return this.iterator("table",function(t){Pt(t)})});Yt.versionCheck=Yt.fnVersionCheck=function(t){for(var e,n,r=Yt.version.split("."),i=t.split("."),o=0,a=i.length;a>o;o++){e=parseInt(r[o],10)||0;n=parseInt(i[o],10)||0;if(e!==n)return e>n}return!0};Yt.isDataTable=Yt.fnIsDataTable=function(e){var n=t(e).get(0),r=!1;t.each(Yt.settings,function(e,i){var o=i.nScrollHead?t("table",i.nScrollHead)[0]:null,a=i.nScrollFoot?t("table",i.nScrollFoot)[0]:null;(i.nTable===n||o===n||a===n)&&(r=!0)});return r};Yt.tables=Yt.fnTables=function(e){return t.map(Yt.settings,function(n){return!e||e&&t(n.nTable).is(":visible")?n.nTable:void 0})};Yt.util={throttle:bt,escapeRegex:tt};Yt.camelToHungarian=n;Kt("$()",function(e,n){var r=this.rows(n).nodes(),i=t(r);return t([].concat(i.filter(e).toArray(),i.find(e).toArray()))});t.each(["on","one","off"],function(e,n){Kt(n+"()",function(){var e=Array.prototype.slice.call(arguments);e[0].match(/\.dt\b/)||(e[0]+=".dt");var r=t(this.tables().nodes());r[n].apply(r,e);return this})});Kt("clear()",function(){return this.iterator("table",function(t){A(t)})});Kt("settings()",function(){return new Jt(this.context,this.context)});Kt("init()",function(){var t=this.context;return t.length?t[0].oInit:null});Kt("data()",function(){return this.iterator("table",function(t){return he(t.aoData,"_aData")}).flatten()});Kt("destroy()",function(e){e=e||!1;return this.iterator("table",function(n){var r,o=n.nTableWrapper.parentNode,a=n.oClasses,s=n.nTable,l=n.nTBody,u=n.nTHead,c=n.nTFoot,f=t(s),h=t(l),d=t(n.nTableWrapper),p=t.map(n.aoData,function(t){return t.nTr});n.bDestroying=!0;zt(n,"aoDestroyCallback","destroy",[n]);e||new Jt(n).columns().visible(!0);d.unbind(".DT").find(":not(tbody *)").unbind(".DT");t(i).unbind(".DT-"+n.sInstance);if(s!=u.parentNode){f.children("thead").detach();f.append(u)}if(c&&s!=c.parentNode){f.children("tfoot").detach();f.append(c)}f.detach();d.detach();n.aaSorting=[];n.aaSortingFixed=[];Nt(n);t(p).removeClass(n.asStripeClasses.join(" "));t("th, td",u).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone);if(n.bJUI){t("th span."+a.sSortIcon+", td span."+a.sSortIcon,u).detach();t("th, td",u).each(function(){var e=t("div."+a.sSortJUIWrapper,this);t(this).append(e.contents());e.detach()})}!e&&o&&o.insertBefore(s,n.nTableReinsertBefore);h.children().detach();h.append(p);f.css("width",n.sDestroyWidth).removeClass(a.sTable);r=n.asDestroyStripes.length;r&&h.children().each(function(e){t(this).addClass(n.asDestroyStripes[e%r])});var g=t.inArray(n,Yt.settings);-1!==g&&Yt.settings.splice(g,1)})});t.each(["column","row","cell"],function(t,e){Kt(e+"s().every()",function(t){return this.iterator(e,function(n,r,i){t.call(new Jt(n)[e](r,i))})})});Kt("i18n()",function(e,n,r){var i=this.context[0],o=_(e)(i.oLanguage);o===a&&(o=n);r!==a&&t.isPlainObject(o)&&(o=o[r]!==a?o[r]:o._);return o.replace("%d",r)});Yt.version="1.10.7";Yt.settings=[];Yt.models={};Yt.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};Yt.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null};Yt.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};Yt.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(e){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(n){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:t.extend({},Yt.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};e(Yt.defaults);Yt.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};e(Yt.defaults.column);Yt.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:a,oAjaxData:a,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==Bt(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==Bt(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,r=this.aiDisplay.length,i=this.oFeatures,o=i.bPaginate;return i.bServerSide?o===!1||-1===t?e+r:Math.min(e+t,this._iRecordsDisplay):!o||n>r||-1===t?r:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{}};Yt.ext=$t={buttons:{},classes:{},errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:Yt.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:Yt.version};t.extend($t,{afnFiltering:$t.search,aTypes:$t.type.detect,ofnSearch:$t.type.search,oSort:$t.type.order,afnSortData:$t.order,aoFeatures:$t.feature,oApi:$t.internal,oStdClasses:$t.classes,oPagination:$t.pager});t.extend(Yt.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});(function(){var e="";e="";var n=e+"ui-state-default",r=e+"css_right ui-icon ui-icon-",i=e+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";t.extend(Yt.ext.oJUIClasses,Yt.ext.classes,{sPageButton:"fg-button ui-button "+n,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:n+" sorting_asc",sSortDesc:n+" sorting_desc",sSortable:n+" sorting",sSortableAsc:n+" sorting_asc_disabled",sSortableDesc:n+" sorting_desc_disabled",sSortableNone:n+" sorting_disabled",sSortJUIAsc:r+"triangle-1-n",sSortJUIDesc:r+"triangle-1-s",sSortJUI:r+"carat-2-n-s",sSortJUIAscAllowed:r+"carat-1-n",sSortJUIDescAllowed:r+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+n,sScrollFoot:"dataTables_scrollFoot "+n,sHeaderTH:n,sFooterTH:n,sJUIHeader:i+" ui-corner-tl ui-corner-tr",sJUIFooter:i+" ui-corner-bl ui-corner-br"})})();var Xe=Yt.ext.pager;t.extend(Xe,{simple:function(t,e){return["previous","next"]},full:function(t,e){return["first","previous","next","last"]},simple_numbers:function(t,e){return["previous",Vt(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Vt(t,e),"next","last"]},_numbers:Vt,numbers_length:7});t.extend(!0,Yt.ext.renderer,{pageButton:{_:function(e,n,r,i,a,s){var l,u,c,f=e.oClasses,h=e.oLanguage.oPaginate,d=0,p=function(n,i){var o,c,g,m,v=function(t){ht(e,t.data.action,!0)};for(o=0,c=i.length;c>o;o++){m=i[o];if(t.isArray(m)){var y=t("<"+(m.DT_el||"div")+"/>").appendTo(n);p(y,m)}else{l="";u="";switch(m){case"ellipsis":n.append('<span class="ellipsis">&#x2026;</span>');break;case"first":l=h.sFirst;u=m+(a>0?"":" "+f.sPageButtonDisabled);break;case"previous":l=h.sPrevious;u=m+(a>0?"":" "+f.sPageButtonDisabled);break;case"next":l=h.sNext;u=m+(s-1>a?"":" "+f.sPageButtonDisabled);break;case"last":l=h.sLast;u=m+(s-1>a?"":" "+f.sPageButtonDisabled);break;default:l=m+1;u=a===m?f.sPageButtonActive:""}if(l){g=t("<a>",{"class":f.sPageButton+" "+u,"aria-controls":e.sTableId,"data-dt-idx":d,tabindex:e.iTabIndex,id:0===r&&"string"==typeof m?e.sTableId+"_"+m:null}).html(l).appendTo(n);Ft(g,{action:m},v);d++}}}};try{c=t(o.activeElement).data("dt-idx")}catch(g){}p(t(n).empty(),i);c&&t(n).find("[data-dt-idx="+c+"]").focus()}}});t.extend(Yt.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return ue(t,n)?"num"+n:null},function(t,e){if(!(!t||t instanceof Date||ne.test(t)&&re.test(t)))return null;var n=Date.parse(t);return null!==n&&!isNaN(n)||ae(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return ue(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return fe(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return fe(t,n,!0)?"html-num-fmt"+n:null},function(t,e){return ae(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]);t.extend(Yt.ext.type.search,{html:function(t){return ae(t)?t:"string"==typeof t?t.replace(te," ").replace(ee,""):""},string:function(t){return ae(t)?t:"string"==typeof t?t.replace(te," "):t}});var Ge=function(t,e,n,r){if(0!==t&&(!t||"-"===t))return-(1/0);e&&(t=le(t,e));if(t.replace){n&&(t=t.replace(n,""));r&&(t=t.replace(r,"")); }return 1*t};t.extend($t.type.order,{"date-pre":function(t){return Date.parse(t)||0},"html-pre":function(t){return ae(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return ae(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return e>t?-1:t>e?1:0},"string-desc":function(t,e){return e>t?1:t>e?-1:0}});Xt("");t.extend(!0,Yt.ext.renderer,{header:{_:function(e,n,r,i){t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=r.idx;n.removeClass(r.sSortingClass+" "+i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[l]?i.sSortAsc:"desc"==s[l]?i.sSortDesc:r.sSortingClass)}})},jqueryui:function(e,n,r,i){t("<div/>").addClass(i.sSortJUIWrapper).append(n.contents()).append(t("<span/>").addClass(i.sSortIcon+" "+r.sSortingClassJUI)).appendTo(n);t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=r.idx;n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[l]?i.sSortAsc:"desc"==s[l]?i.sSortDesc:r.sSortingClass);n.find("span."+i.sSortIcon).removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed).addClass("asc"==s[l]?i.sSortJUIAsc:"desc"==s[l]?i.sSortJUIDesc:r.sSortingClassJUI)}})}}});Yt.render={number:function(t,e,n,r){return{display:function(i){if("number"!=typeof i&&"string"!=typeof i)return i;var o=0>i?"-":"";i=Math.abs(parseFloat(i));var a=parseInt(i,10),s=n?e+(i-a).toFixed(n).substring(2):"";return o+(r||"")+a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+s}}}};t.extend(Yt.ext.internal,{_fnExternApiFunc:Gt,_fnBuildAjax:U,_fnAjaxUpdate:B,_fnAjaxParameters:V,_fnAjaxUpdateDraw:X,_fnAjaxDataSrc:G,_fnAddColumn:f,_fnColumnOptions:h,_fnAdjustColumnSizing:d,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:m,_fnGetColumns:v,_fnColumnTypes:y,_fnApplyColumnDefs:b,_fnHungarianMap:e,_fnCamelToHungarian:n,_fnLanguageCompat:r,_fnBrowserDetect:u,_fnAddData:w,_fnAddTr:x,_fnNodeToDataIndex:C,_fnNodeToColumnIndex:S,_fnGetCellData:T,_fnSetCellData:k,_fnSplitObjNotation:M,_fnGetObjectDataFn:_,_fnSetObjectDataFn:D,_fnGetDataMaster:L,_fnClearTable:A,_fnDeleteIndex:N,_fnInvalidate:E,_fnGetRowElements:P,_fnCreateTr:j,_fnBuildHead:H,_fnDrawHead:O,_fnDraw:R,_fnReDraw:F,_fnAddOptionsHtml:W,_fnDetectHeader:z,_fnGetUniqueThs:q,_fnFeatureHtmlFilter:Y,_fnFilterComplete:$,_fnFilterCustom:J,_fnFilterColumn:K,_fnFilter:Z,_fnFilterCreateSearch:Q,_fnEscapeRegex:tt,_fnFilterData:et,_fnFeatureHtmlInfo:it,_fnUpdateInfo:ot,_fnInfoMacros:at,_fnInitialise:st,_fnInitComplete:lt,_fnLengthChange:ut,_fnFeatureHtmlLength:ct,_fnFeatureHtmlPaginate:ft,_fnPageChange:ht,_fnFeatureHtmlProcessing:dt,_fnProcessingDisplay:pt,_fnFeatureHtmlTable:gt,_fnScrollDraw:mt,_fnApplyToChildren:vt,_fnCalculateColumnWidths:yt,_fnThrottle:bt,_fnConvertToWidth:wt,_fnScrollingWidthAdjust:xt,_fnGetWidestNode:Ct,_fnGetMaxLenString:St,_fnStringToCss:Tt,_fnScrollBarWidth:kt,_fnSortFlatten:Mt,_fnSort:_t,_fnSortAria:Dt,_fnSortListener:Lt,_fnSortAttachListener:At,_fnSortingClasses:Nt,_fnSortData:Et,_fnSaveState:Pt,_fnLoadState:jt,_fnSettingsFromNode:It,_fnLog:Ht,_fnMap:Ot,_fnBindAction:Ft,_fnCallbackReg:Wt,_fnCallbackFire:zt,_fnLengthOverflow:qt,_fnRenderer:Ut,_fnDataSource:Bt,_fnRowAttributes:I,_fnCalculateEnd:function(){}});t.fn.dataTable=Yt;t.fn.dataTableSettings=Yt.settings;t.fn.dataTableExt=Yt.ext;t.fn.DataTable=function(e){return t(this).dataTable(e).api()};t.each(Yt,function(e,n){t.fn.DataTable[e]=n});return t.fn.dataTable})})(window,document)},{jquery:19}],15:[function(t,e,n){var r=t("jquery");(function(t,e){function n(e,n){var i,o,a,s=e.nodeName.toLowerCase();if("area"===s){i=e.parentNode;o=i.name;if(!e.href||!o||"map"!==i.nodeName.toLowerCase())return!1;a=t("img[usemap=#"+o+"]")[0];return!!a&&r(a)}return(/input|select|textarea|button|object/.test(s)?!e.disabled:"a"===s?e.href||n:n)&&r(e)}function r(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var i=0,o=/^ui-id-\d+$/;t.ui=t.ui||{};t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});t.fn.extend({focus:function(e){return function(n,r){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus();r&&r.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0);return/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var r,i,o=t(this[0]);o.length&&o[0]!==document;){r=o.css("position");if("absolute"===r||"relative"===r||"fixed"===r){i=parseInt(o.css("zIndex"),10);if(!isNaN(i)&&0!==i)return i}o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}});t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,r){return!!t.data(e,r[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var r=t.attr(e,"tabindex"),i=isNaN(r);return(i||r>=0)&&n(e,!i)}});t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(n,r){function i(e,n,r,i){t.each(o,function(){n-=parseFloat(t.css(e,"padding"+this))||0;r&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0);i&&(n-=parseFloat(t.css(e,"margin"+this))||0)});return n}var o="Width"===r?["Left","Right"]:["Top","Bottom"],a=r.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+r]=function(n){return n===e?s["inner"+r].call(this):this.each(function(){t(this).css(a,i(this,n)+"px")})};t.fn["outer"+r]=function(e,n){return"number"!=typeof e?s["outer"+r].call(this,e):this.each(function(){t(this).css(a,i(this,e,!0,n)+"px")})}});t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData));t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());t.support.selectstart="onselectstart"in document.createElement("div");t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});t.extend(t.ui,{plugin:{add:function(e,n,r){var i,o=t.ui[e].prototype;for(i in r){o.plugins[i]=o.plugins[i]||[];o.plugins[i].push([n,r[i]])}},call:function(t,e,n){var r,i=t.plugins[e];if(i&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;if(e[r]>0)return!0;e[r]=1;i=e[r]>0;e[r]=0;return i}})})(r)},{jquery:19}],16:[function(t,e,n){var r=t("jquery");t("./widget");(function(t,e){var n=!1;t(document).mouseup(function(){n=!1});t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent")){t.removeData(n.target,e.widgetName+".preventClickEvent");n.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseStarted&&this._mouseUp(e);this._mouseDownEvent=e;var r=this,i=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;if(!i||o||!this._mouseCapture(e))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(e)!==!1;if(!this._mouseStarted){e.preventDefault();return!0}}!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(t){return r._mouseMove(t)};this._mouseUpDelegate=function(t){return r._mouseUp(t)};t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);e.preventDefault();n=!0;return!0}},_mouseMove:function(e){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1;this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)}return!this._mouseStarted},_mouseUp:function(e){t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0);this._mouseStop(e)}return!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(r)},{"./widget":18,jquery:19}],17:[function(t,e,n){var r=t("jquery");t("./core");t("./mouse");t("./widget");(function(t,e){function n(t,e,n){return t>e&&e+n>t}function r(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===t.axis||r(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,n){if("disabled"===e){this.options[e]=n;this.widget().toggleClass("ui-sortable-disabled",!!n)}else t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,n){var r=null,i=!1,o=this;if(this.reverting)return!1;if(this.options.disabled||"static"===this.options.type)return!1;this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){r=t(this);return!1}});t.data(e.target,o.widgetName+"-item")===o&&(r=t(e.target));if(!r)return!1;if(this.options.handle&&!n){t(this.options.handle,r).find("*").addBack().each(function(){this===e.target&&(i=!0)});if(!i)return!1}this.currentItem=r;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,n,r){var i,o,a=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!==this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();a.containment&&this._setContainment();if(a.cursor&&"auto"!==a.cursor){o=this.document.find("body");this.storedCursor=o.css("cursor");o.css("cursor",a.cursor);this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)}if(a.opacity){this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity"));this.helper.css("opacity",a.opacity)}if(a.zIndex){this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex"));this.helper.css("zIndex",a.zIndex)}this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());this._trigger("start",e,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));t.ui.ddmanager&&(t.ui.ddmanager.current=this);t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var n,r,i,o,a=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){if(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName){this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-a.scrollSpeed);this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-a.scrollSpeed)}else{e.pageY-t(document).scrollTop()<a.scrollSensitivity?s=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(s=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed));e.pageX-t(document).scrollLeft()<a.scrollSensitivity?s=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(s=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))}s!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)}this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(n=this.items.length-1;n>=0;n--){r=this.items[n];i=r.item[0];o=this._intersectsWithPointer(r);if(o&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==i&&!t.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],i):!0)){this.direction=1===o?"down":"up";if("pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(e,r);this._trigger("change",e,this._uiHash());break}}this._contactContainers(e);t.ui.ddmanager&&t.ui.ddmanager.drag(this,e);this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,n){if(e){t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e);if(this.options.revert){var r=this,i=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));o&&"y"!==o||(a.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){r._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove();t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&r.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))});!r.length&&e.key&&r.push(e.key+"=");return r.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];e=e||{};n.each(function(){r.push(t(e.item||this).attr(e.attribute||"id")||"")});return r},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,o=t.left,a=o+t.width,s=t.top,l=s+t.height,u=this.offset.click.top,c=this.offset.click.left,f="x"===this.options.axis||r+u>s&&l>r+u,h="y"===this.options.axis||e+c>o&&a>e+c,d=f&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?d:o<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&s<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||n(this.positionAbs.top+this.offset.click.top,t.top,t.height),r="y"===this.options.axis||n(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=e&&r,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return i?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var e=n(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=n(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&r||"left"===o&&!r:i&&("down"===i&&e||"up"===i&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function n(){s.push(this)}var r,i,o,a,s=[],l=[],u=this._connectWith();if(u&&e)for(r=u.length-1;r>=0;r--){o=t(u[r]);for(i=o.length-1;i>=0;i--){a=t.data(o[i],this.widgetFullName);a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(r=l.length-1;r>=0;r--)l[r][0].each(n);return t(s)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var n,r,i,o,a,s,l,u,c=this.items,f=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--){i=t(h[n]);for(r=i.length-1;r>=0;r--){o=t.data(i[r],this.widgetFullName);if(o&&o!==this&&!o.options.disabled){f.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]);this.containers.push(o)}}}for(n=f.length-1;n>=0;n--){a=f[n][1];s=f[n][0];for(r=0,u=s.length;u>r;r++){l=t(s[r]);l.data(this.widgetName+"-item",a);c.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,o;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance===this.currentContainer||!this.currentContainer||r.item[0]===this.currentItem[0]){i=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item;if(!e){r.width=i.outerWidth();r.height=i.outerHeight()}o=i.offset();r.left=o.left;r.top=o.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--){o=this.containers[n].element.offset();this.containers[n].containerCache.left=o.left;this.containers[n].containerCache.top=o.top;this.containers[n].containerCache.width=this.containers[n].element.outerWidth();this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(e){e=e||this;var n,r=e.options;if(!r.placeholder||r.placeholder.constructor===String){n=r.placeholder;r.placeholder={element:function(){var r=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+r+">",e.document[0]).addClass(n||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");"tr"===r?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)}):"img"===r&&i.attr("src",e.currentItem.attr("src"));n||i.css("visibility","hidden");return i},update:function(t,i){if(!n||r.forcePlaceholderSize){i.height()||i.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));i.width()||i.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}}e.placeholder=t(r.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);r.placeholder.update(e,e.placeholder)},_contactContainers:function(e){var i,o,a,s,l,u,c,f,h,d,p=null,g=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(p&&t.contains(this.containers[i].element[0],p.element[0]))continue;p=this.containers[i];g=i}else if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",e,this._uiHash(this));this.containers[i].containerCache.over=0}if(p)if(1===this.containers.length){if(!this.containers[g].containerCache.over){this.containers[g]._trigger("over",e,this._uiHash(this));this.containers[g].containerCache.over=1}}else{a=1e4;s=null;d=p.floating||r(this.currentItem);l=d?"left":"top";u=d?"width":"height";c=this.positionAbs[l]+this.offset.click[l];for(o=this.items.length-1;o>=0;o--)if(t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!d||n(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))){f=this.items[o].item.offset()[l];h=!1;if(Math.abs(f-c)>Math.abs(f+this.items[o][u]-c)){h=!0;f+=this.items[o][u]}if(Math.abs(f-c)<a){a=Math.abs(f-c);s=this.items[o];this.direction=h?"up":"down"}}if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;s?this._rearrange(e,s,null,!0):this._rearrange(e,null,this.containers[g].element,!0);this._trigger("change",e,this._uiHash());this.containers[g]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[g];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[g]._trigger("over",e,this._uiHash(this));this.containers[g].containerCache.over=1}},_createHelper:function(e){var n=this.options,r=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;r.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]);r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width());(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height());return r},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" "));t.isArray(e)&&(e={left:+e[0],top:+e[1]||0});"left"in e&&(this.offset.click.left=e.left+this.margins.left);"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left);"top"in e&&(this.offset.click.top=e.top+this.margins.top);"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if("absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()}(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0});return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode);("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);if(!/^(document|window|parent)$/.test(i.containment)){e=t(i.containment)[0];n=t(i.containment).offset();r="hidden"!==t(e).css("overflow");this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,n){n||(n=this.position);var r="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:i.scrollLeft())*r}},_generatePosition:function(e){var n,r,i=this.options,o=e.pageX,a=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(s[0].tagName);"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());if(this.originalPosition){if(this.containment){e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left);e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top);e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left);e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)}if(i.grid){n=this.originalPageY+Math.round((a-this.originalPageY)/i.grid[1])*i.grid[1];a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n;r=this.originalPageX+Math.round((o-this.originalPageX)/i.grid[0])*i.grid[0];o=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r}}return{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:s.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:s.scrollLeft())}},_rearrange:function(t,e,n,r){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling); this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(t,e){function n(t,e,n){return function(r){n._trigger(t,r,e._uiHash(e))}}this.reverting=!1;var r,i=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!e&&i.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||i.push(function(t){this._trigger("update",t,this._uiHash())});if(this!==this.currentContainer&&!e){i.push(function(t){this._trigger("remove",t,this._uiHash())});i.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer));i.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer))}for(r=this.containers.length-1;r>=0;r--){e||i.push(n("deactivate",this,this.containers[r]));if(this.containers[r].containerCache.over){i.push(n("out",this,this.containers[r]));this.containers[r].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",t,this._uiHash());for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!1}e||this._trigger("beforeStop",t,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!==this.currentItem[0]&&this.helper.remove();this.helper=null;if(!e){for(r=0;r<i.length;r++)i[r].call(this,t);this._trigger("stop",t,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})})(r)},{"./core":15,"./mouse":16,"./widget":18,jquery:19}],18:[function(t,e,n){var r=t("jquery");(function(t,e){var n=0,r=Array.prototype.slice,i=t.cleanData;t.cleanData=function(e){for(var n,r=0;null!=(n=e[r]);r++)try{t(n).triggerHandler("remove")}catch(o){}i(e)};t.widget=function(e,n,r){var i,o,a,s,l={},u=e.split(".")[0];e=e.split(".")[1];i=u+"-"+e;if(!r){r=n;n=t.Widget}t.expr[":"][i.toLowerCase()]=function(e){return!!t.data(e,i)};t[u]=t[u]||{};o=t[u][e];a=t[u][e]=function(t,e){if(!this._createWidget)return new a(t,e);arguments.length&&this._createWidget(t,e);return void 0};t.extend(a,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]});s=new n;s.options=t.widget.extend({},s.options);t.each(r,function(e,r){l[e]=t.isFunction(r)?function(){var t=function(){return n.prototype[e].apply(this,arguments)},i=function(t){return n.prototype[e].apply(this,t)};return function(){var e,n=this._super,o=this._superApply;this._super=t;this._superApply=i;e=r.apply(this,arguments);this._super=n;this._superApply=o;return e}}():r});a.prototype=t.widget.extend(s,{widgetEventPrefix:o?s.widgetEventPrefix||e:e},l,{constructor:a,namespace:u,widgetName:e,widgetFullName:i});if(o){t.each(o._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,a,n._proto)});delete o._childConstructors}else n._childConstructors.push(a);t.widget.bridge(e,a)};t.widget.extend=function(n){for(var i,o,a=r.call(arguments,1),s=0,l=a.length;l>s;s++)for(i in a[s]){o=a[s][i];a[s].hasOwnProperty(i)&&o!==e&&(n[i]=t.isPlainObject(o)?t.isPlainObject(n[i])?t.widget.extend({},n[i],o):t.widget.extend({},o):o)}return n};t.widget.bridge=function(n,i){var o=i.prototype.widgetFullName||n;t.fn[n]=function(a){var s="string"==typeof a,l=r.call(arguments,1),u=this;a=!s&&l.length?t.widget.extend.apply(null,[a].concat(l)):a;this.each(s?function(){var r,i=t.data(this,o);if(!i)return t.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+a+"'");if(!t.isFunction(i[a])||"_"===a.charAt(0))return t.error("no such method '"+a+"' for "+n+" widget instance");r=i[a].apply(i,l);if(r!==i&&r!==e){u=r&&r.jquery?u.pushStack(r.get()):r;return!1}}:function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new i(a,this))});return u}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0];this.element=t(r);this.uuid=n++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=t.widget.extend({},this.options,this._getCreateOptions(),e);this.bindings=t();this.hoverable=t();this.focusable=t();if(r!==this){t.data(r,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}});this.document=t(r.style?r.ownerDocument:r.document||r);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)}this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(n,r){var i,o,a,s=n;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof n){s={};i=n.split(".");n=i.shift();if(i.length){o=s[n]=t.widget.extend({},this.options[n]);for(a=0;a<i.length-1;a++){o[i[a]]=o[i[a]]||{};o=o[i[a]]}n=i.pop();if(1===arguments.length)return o[n]===e?null:o[n];o[n]=r}else{if(1===arguments.length)return this.options[n]===e?null:this.options[n];s[n]=r}}this._setOptions(s);return this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){this.options[t]=e;if("disabled"===t){this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,n,r){var i,o=this;if("boolean"!=typeof e){r=n;n=e;e=!1}if(r){n=i=t(n);this.bindings=this.bindings.add(n)}else{r=n;n=this.element;i=this.widget()}t.each(r,function(r,a){function s(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||t.guid++);var l=r.match(/^(\w+)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?i.delegate(c,u,s):n.bind(u,s)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.unbind(e).undelegate(e)},_delay:function(t,e){function n(){return("string"==typeof t?r[t]:t).apply(r,arguments)}var r=this;return setTimeout(n,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,n,r){var i,o,a=this.options[e];r=r||{};n=t.Event(n);n.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();n.target=this.element[0];o=n.originalEvent;if(o)for(i in o)i in n||(n[i]=o[i]);this.element.trigger(n,r);return!(t.isFunction(a)&&a.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,i,o){"string"==typeof i&&(i={effect:i});var a,s=i?i===!0||"number"==typeof i?n:i.effect||n:e;i=i||{};"number"==typeof i&&(i={duration:i});a=!t.isEmptyObject(i);i.complete=o;i.delay&&r.delay(i.delay);a&&t.effects&&t.effects.effect[s]?r[e](i):s!==e&&r[s]?r[s](i.duration,i.easing,o):r.queue(function(n){t(this)[e]();o&&o.call(r[0]);n()})}})})(r)},{jquery:19}],19:[function(e,n,r){(function(t,e){"object"==typeof n&&"object"==typeof n.exports?n.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)})("undefined"!=typeof window?window:this,function(e,n){function r(t){var e="length"in t&&t.length,n=tt.type(t);return"function"===n||tt.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function i(t,e,n){if(tt.isFunction(e))return tt.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return tt.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(lt.test(e))return tt.filter(e,t,n);e=tt.filter(e,t)}return tt.grep(t,function(t){return G.call(e,t)>=0!==n})}function o(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function a(t){var e=gt[t]={};tt.each(t.match(pt)||[],function(t,n){e[n]=!0});return e}function s(){Z.removeEventListener("DOMContentLoaded",s,!1);e.removeEventListener("load",s,!1);tt.ready()}function l(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=tt.expando+l.uid++}function u(t,e,n){var r;if(void 0===n&&1===t.nodeType){r="data-"+e.replace(xt,"-$1").toLowerCase();n=t.getAttribute(r);if("string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:wt.test(n)?tt.parseJSON(n):n}catch(i){}bt.set(t,e,n)}else n=void 0}return n}function c(){return!0}function f(){return!1}function h(){try{return Z.activeElement}catch(t){}}function d(t,e){return tt.nodeName(t,"table")&&tt.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function p(t){t.type=(null!==t.getAttribute("type"))+"/"+t.type;return t}function g(t){var e=Ot.exec(t.type);e?t.type=e[1]:t.removeAttribute("type");return t}function m(t,e){for(var n=0,r=t.length;r>n;n++)yt.set(t[n],"globalEval",!e||yt.get(e[n],"globalEval"))}function v(t,e){var n,r,i,o,a,s,l,u;if(1===e.nodeType){if(yt.hasData(t)){o=yt.access(t);a=yt.set(e,o);u=o.events;if(u){delete a.handle;a.events={};for(i in u)for(n=0,r=u[i].length;r>n;n++)tt.event.add(e,i,u[i][n])}}if(bt.hasData(t)){s=bt.access(t);l=tt.extend({},s);bt.set(e,l)}}}function y(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&tt.nodeName(t,e)?tt.merge([t],n):n}function b(t,e){var n=e.nodeName.toLowerCase();"input"===n&&kt.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function w(t,n){var r,i=tt(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:tt.css(i[0],"display");i.detach();return o}function x(t){var e=Z,n=zt[t];if(!n){n=w(t,e);if("none"===n||!n){Wt=(Wt||tt("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement);e=Wt[0].contentDocument;e.write();e.close();n=w(t,e);Wt.detach()}zt[t]=n}return n}function C(t,e,n){var r,i,o,a,s=t.style;n=n||Bt(t);n&&(a=n.getPropertyValue(e)||n[e]);if(n){""!==a||tt.contains(t.ownerDocument,t)||(a=tt.style(t,e));if(Ut.test(a)&&qt.test(e)){r=s.width;i=s.minWidth;o=s.maxWidth;s.minWidth=s.maxWidth=s.width=a;a=n.width;s.width=r;s.minWidth=i;s.maxWidth=o}}return void 0!==a?a+"":a}function S(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get;return void 0}}}function T(t,e){if(e in t)return e;for(var n=e[0].toUpperCase()+e.slice(1),r=e,i=Jt.length;i--;){e=Jt[i]+n;if(e in t)return e}return r}function k(t,e,n){var r=Xt.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function M(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2){"margin"===n&&(a+=tt.css(t,n+St[o],!0,i));if(r){"content"===n&&(a-=tt.css(t,"padding"+St[o],!0,i));"margin"!==n&&(a-=tt.css(t,"border"+St[o]+"Width",!0,i))}else{a+=tt.css(t,"padding"+St[o],!0,i);"padding"!==n&&(a+=tt.css(t,"border"+St[o]+"Width",!0,i))}}return a}function _(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=Bt(t),a="border-box"===tt.css(t,"boxSizing",!1,o);if(0>=i||null==i){i=C(t,e,o);(0>i||null==i)&&(i=t.style[e]);if(Ut.test(i))return i;r=a&&(K.boxSizingReliable()||i===t.style[e]);i=parseFloat(i)||0}return i+M(t,e,n||(a?"border":"content"),r,o)+"px"}function D(t,e){for(var n,r,i,o=[],a=0,s=t.length;s>a;a++){r=t[a];if(r.style){o[a]=yt.get(r,"olddisplay");n=r.style.display;if(e){o[a]||"none"!==n||(r.style.display="");""===r.style.display&&Tt(r)&&(o[a]=yt.access(r,"olddisplay",x(r.nodeName)))}else{i=Tt(r);"none"===n&&i||yt.set(r,"olddisplay",i?n:tt.css(r,"display"))}}}for(a=0;s>a;a++){r=t[a];r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[a]||"":"none"))}return t}function L(t,e,n,r,i){return new L.prototype.init(t,e,n,r,i)}function A(){setTimeout(function(){Kt=void 0});return Kt=tt.now()}function N(t,e){var n,r=0,i={height:t};e=e?1:0;for(;4>r;r+=2-e){n=St[r];i["margin"+n]=i["padding"+n]=t}e&&(i.opacity=i.width=t);return i}function E(t,e,n){for(var r,i=(re[e]||[]).concat(re["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,e,t))return r}function P(t,e,n){var r,i,o,a,s,l,u,c,f=this,h={},d=t.style,p=t.nodeType&&Tt(t),g=yt.get(t,"fxshow");if(!n.queue){s=tt._queueHooks(t,"fx");if(null==s.unqueued){s.unqueued=0;l=s.empty.fire;s.empty.fire=function(){s.unqueued||l()}}s.unqueued++;f.always(function(){f.always(function(){s.unqueued--;tt.queue(t,"fx").length||s.empty.fire()})})}if(1===t.nodeType&&("height"in e||"width"in e)){n.overflow=[d.overflow,d.overflowX,d.overflowY];u=tt.css(t,"display");c="none"===u?yt.get(t,"olddisplay")||x(t.nodeName):u;"inline"===c&&"none"===tt.css(t,"float")&&(d.display="inline-block")}if(n.overflow){d.overflow="hidden";f.always(function(){d.overflow=n.overflow[0];d.overflowX=n.overflow[1];d.overflowY=n.overflow[2]})}for(r in e){i=e[r];if(Qt.exec(i)){delete e[r];o=o||"toggle"===i;if(i===(p?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;p=!0}h[r]=g&&g[r]||tt.style(t,r)}else u=void 0}if(tt.isEmptyObject(h))"inline"===("none"===u?x(t.nodeName):u)&&(d.display=u);else{g?"hidden"in g&&(p=g.hidden):g=yt.access(t,"fxshow",{});o&&(g.hidden=!p);p?tt(t).show():f.done(function(){tt(t).hide()});f.done(function(){var e;yt.remove(t,"fxshow");for(e in h)tt.style(t,e,h[e])});for(r in h){a=E(p?g[r]:0,r,f);if(!(r in g)){g[r]=a.start;if(p){a.end=a.start;a.start="width"===r||"height"===r?1:0}}}}}function j(t,e){var n,r,i,o,a;for(n in t){r=tt.camelCase(n);i=e[r];o=t[n];if(tt.isArray(o)){i=o[1];o=t[n]=o[0]}if(n!==r){t[r]=o;delete t[n]}a=tt.cssHooks[r];if(a&&"expand"in a){o=a.expand(o);delete t[r];for(n in o)if(!(n in t)){t[n]=o[n];e[n]=i}}else e[r]=i}}function I(t,e,n){var r,i,o=0,a=ne.length,s=tt.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var e=Kt||A(),n=Math.max(0,u.startTime+u.duration-e),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;l>a;a++)u.tweens[a].run(o);s.notifyWith(t,[u,o,n]);if(1>o&&l)return n;s.resolveWith(t,[u]);return!1},u=s.promise({elem:t,props:tt.extend({},e),opts:tt.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Kt||A(),duration:n.duration,tweens:[],createTween:function(e,n){var r=tt.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);u.tweens.push(r);return r},stop:function(e){var n=0,r=e?u.tweens.length:0;if(i)return this;i=!0;for(;r>n;n++)u.tweens[n].run(1);e?s.resolveWith(t,[u,e]):s.rejectWith(t,[u,e]);return this}}),c=u.props;j(c,u.opts.specialEasing);for(;a>o;o++){r=ne[o].call(u,t,c,u.opts);if(r)return r}tt.map(c,E,u);tt.isFunction(u.opts.start)&&u.opts.start.call(t,u);tt.fx.timer(tt.extend(l,{elem:t,anim:u,queue:u.opts.queue}));return u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function H(t){return function(e,n){if("string"!=typeof e){n=e;e="*"}var r,i=0,o=e.toLowerCase().match(pt)||[];if(tt.isFunction(n))for(;r=o[i++];)if("+"===r[0]){r=r.slice(1)||"*";(t[r]=t[r]||[]).unshift(n)}else(t[r]=t[r]||[]).push(n)}}function O(t,e,n,r){function i(s){var l;o[s]=!0;tt.each(t[s]||[],function(t,s){var u=s(e,n,r);if("string"==typeof u&&!a&&!o[u]){e.dataTypes.unshift(u);i(u);return!1}return a?!(l=u):void 0});return l}var o={},a=t===we;return i(e.dataTypes[0])||!o["*"]&&i("*")}function R(t,e){var n,r,i=tt.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);r&&tt.extend(!0,t,r);return t}function F(t,e,n){for(var r,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];){l.shift();void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"))}if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o){o!==l[0]&&l.unshift(o);return n[o]}}function W(t,e,n,r){var i,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];o=c.shift();for(;o;){t.responseFields[o]&&(n[t.responseFields[o]]=e);!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType));l=o;o=c.shift();if(o)if("*"===o)o=l;else if("*"!==l&&l!==o){a=u[l+" "+o]||u["* "+o];if(!a)for(i in u){s=i.split(" ");if(s[1]===o){a=u[l+" "+s[0]]||u["* "+s[0]];if(a){if(a===!0)a=u[i];else if(u[i]!==!0){o=s[0];c.unshift(s[1])}break}}}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+l+" to "+o}}}}return{state:"success",data:e}}function z(t,e,n,r){var i;if(tt.isArray(e))tt.each(e,function(e,i){n||ke.test(t)?r(t,i):z(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==tt.type(e))r(t,e);else for(i in e)z(t+"["+i+"]",e[i],n,r)}function q(t){return tt.isWindow(t)?t:9===t.nodeType&&t.defaultView}var U=[],B=U.slice,V=U.concat,X=U.push,G=U.indexOf,Y={},$=Y.toString,J=Y.hasOwnProperty,K={},Z=e.document,Q="2.1.4",tt=function(t,e){return new tt.fn.init(t,e)},et=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,nt=/^-ms-/,rt=/-([\da-z])/gi,it=function(t,e){return e.toUpperCase()};tt.fn=tt.prototype={jquery:Q,constructor:tt,selector:"",length:0,toArray:function(){return B.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:B.call(this)},pushStack:function(t){var e=tt.merge(this.constructor(),t);e.prevObject=this;e.context=this.context;return e},each:function(t,e){return tt.each(this,t,e)},map:function(t){return this.pushStack(tt.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(B.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:X,sort:U.sort,splice:U.splice};tt.extend=tt.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;if("boolean"==typeof a){u=a;a=arguments[s]||{};s++}"object"==typeof a||tt.isFunction(a)||(a={});if(s===l){a=this;s--}for(;l>s;s++)if(null!=(t=arguments[s]))for(e in t){n=a[e];r=t[e];if(a!==r)if(u&&r&&(tt.isPlainObject(r)||(i=tt.isArray(r)))){if(i){i=!1;o=n&&tt.isArray(n)?n:[]}else o=n&&tt.isPlainObject(n)?n:{};a[e]=tt.extend(u,o,r)}else void 0!==r&&(a[e]=r)}return a};tt.extend({expando:"jQuery"+(Q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===tt.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!tt.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==tt.type(t)||t.nodeType||tt.isWindow(t)?!1:t.constructor&&!J.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?Y[$.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=tt.trim(t);if(t)if(1===t.indexOf("use strict")){e=Z.createElement("script");e.text=t;Z.head.appendChild(e).parentNode.removeChild(e)}else n(t)},camelCase:function(t){return t.replace(nt,"ms-").replace(rt,it)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i,o=0,a=t.length,s=r(t);if(n)if(s)for(;a>o;o++){i=e.apply(t[o],n);if(i===!1)break}else for(o in t){i=e.apply(t[o],n);if(i===!1)break}else if(s)for(;a>o;o++){i=e.call(t[o],o,t[o]);if(i===!1)break}else for(o in t){i=e.call(t[o],o,t[o]);if(i===!1)break}return t},trim:function(t){return null==t?"":(t+"").replace(et,"")},makeArray:function(t,e){var n=e||[];null!=t&&(r(Object(t))?tt.merge(n,"string"==typeof t?[t]:t):X.call(n,t));return n},inArray:function(t,e,n){return null==e?-1:G.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;r++)t[i++]=e[r];t.length=i;return t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,s=!n;a>o;o++){r=!e(t[o],o);r!==s&&i.push(t[o])}return i},map:function(t,e,n){var i,o=0,a=t.length,s=r(t),l=[];if(s)for(;a>o;o++){i=e(t[o],o,n);null!=i&&l.push(i)}else for(o in t){i=e(t[o],o,n);null!=i&&l.push(i)}return V.apply([],l)},guid:1,proxy:function(t,e){var n,r,i;if("string"==typeof e){n=t[e];e=t;t=n}if(!tt.isFunction(t))return void 0;r=B.call(arguments,2);i=function(){return t.apply(e||this,r.concat(B.call(arguments)))};i.guid=t.guid=t.guid||tt.guid++;return i},now:Date.now,support:K});tt.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){Y["[object "+e+"]"]=e.toLowerCase()});var ot=function(t){function e(t,e,n,r){var i,o,a,s,l,u,f,d,p,g;(e?e.ownerDocument||e:W)!==E&&N(e);e=e||E;n=n||[];s=e.nodeType;if("string"!=typeof t||!t||1!==s&&9!==s&&11!==s)return n;if(!r&&j){if(11!==s&&(i=yt.exec(t)))if(a=i[1]){if(9===s){o=e.getElementById(a);if(!o||!o.parentNode)return n;if(o.id===a){n.push(o);return n}}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&R(e,o)&&o.id===a){n.push(o);return n}}else{if(i[2]){Z.apply(n,e.getElementsByTagName(t));return n}if((a=i[3])&&x.getElementsByClassName){Z.apply(n,e.getElementsByClassName(a));return n}}if(x.qsa&&(!I||!I.test(t))){d=f=F;p=e;g=1!==s&&t;if(1===s&&"object"!==e.nodeName.toLowerCase()){u=k(t);(f=e.getAttribute("id"))?d=f.replace(wt,"\\$&"):e.setAttribute("id",d);d="[id='"+d+"'] ";l=u.length;for(;l--;)u[l]=d+h(u[l]);p=bt.test(t)&&c(e.parentNode)||e;g=u.join(",")}if(g)try{Z.apply(n,p.querySelectorAll(g));return n}catch(m){}finally{f||e.removeAttribute("id")}}}return _(t.replace(lt,"$1"),e,n,r)}function n(){function t(n,r){e.push(n+" ")>C.cacheLength&&delete t[e.shift()];return t[n+" "]=r}var e=[];return t}function r(t){t[F]=!0;return t}function i(t){var e=E.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e);e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)C.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||G)-(~t.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function l(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function u(t){return r(function(e){e=+e;return r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function d(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=q++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,a){var s,l,u=[z,o];if(a){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||i){l=e[F]||(e[F]={});if((s=l[r])&&s[0]===z&&s[1]===o)return u[2]=s[2];l[r]=u;if(u[2]=t(e,n,a))return!0}}}function p(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function m(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,u=null!=e;l>s;s++)if((o=t[s])&&(!n||n(o,r,i))){a.push(o);u&&e.push(s)}return a}function v(t,e,n,i,o,a){i&&!i[F]&&(i=v(i));o&&!o[F]&&(o=v(o,a));return r(function(r,a,s,l){var u,c,f,h=[],d=[],p=a.length,v=r||g(e||"*",s.nodeType?[s]:s,[]),y=!t||!r&&e?v:m(v,h,t,s,l),b=n?o||(r?t:p||i)?[]:a:y;n&&n(y,b,s,l);if(i){u=m(b,d);i(u,[],s,l);c=u.length;for(;c--;)(f=u[c])&&(b[d[c]]=!(y[d[c]]=f))}if(r){if(o||t){if(o){u=[];c=b.length;for(;c--;)(f=b[c])&&u.push(y[c]=f);o(null,b=[],u,l)}c=b.length;for(;c--;)(f=b[c])&&(u=o?tt(r,f):h[c])>-1&&(r[u]=!(a[u]=f))}}else{b=m(b===a?b.splice(p,b.length):b);o?o(null,a,b,l):Z.apply(a,b)}})}function y(t){for(var e,n,r,i=t.length,o=C.relative[t[0].type],a=o||C.relative[" "],s=o?1:0,l=d(function(t){return t===e},a,!0),u=d(function(t){return tt(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==D)||((e=n).nodeType?l(t,n,r):u(t,n,r));e=null;return i}];i>s;s++)if(n=C.relative[t[s].type])c=[d(p(c),n)];else{n=C.filter[t[s].type].apply(null,t[s].matches);if(n[F]){r=++s;for(;i>r&&!C.relative[t[r].type];r++);return v(s>1&&p(c),s>1&&h(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(lt,"$1"),n,r>s&&y(t.slice(s,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}c.push(n)}return p(c)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,s,l,u){var c,f,h,d=0,p="0",g=r&&[],v=[],y=D,b=r||o&&C.find.TAG("*",u),w=z+=null==y?1:Math.random()||.1,x=b.length;u&&(D=a!==E&&a);for(;p!==x&&null!=(c=b[p]);p++){if(o&&c){f=0;for(;h=t[f++];)if(h(c,a,s)){l.push(c);break}u&&(z=w)}if(i){(c=!h&&c)&&d--;r&&g.push(c)}}d+=p;if(i&&p!==d){f=0;for(;h=n[f++];)h(g,v,a,s);if(r){if(d>0)for(;p--;)g[p]||v[p]||(v[p]=J.call(l));v=m(v)}Z.apply(l,v);u&&!r&&v.length>0&&d+n.length>1&&e.uniqueSort(l)}if(u){z=w;D=y}return g};return i?r(a):a}var w,x,C,S,T,k,M,_,D,L,A,N,E,P,j,I,H,O,R,F="sizzle"+1*new Date,W=t.document,z=0,q=0,U=n(),B=n(),V=n(),X=function(t,e){t===e&&(A=!0);return 0},G=1<<31,Y={}.hasOwnProperty,$=[],J=$.pop,K=$.push,Z=$.push,Q=$.slice,tt=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="\\["+nt+"*("+rt+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+nt+"*\\]",at=":("+rt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",st=new RegExp(nt+"+","g"),lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ut=new RegExp("^"+nt+"*,"+nt+"*"),ct=new RegExp("^"+nt+"*([>+~]|"+nt+")"+nt+"*"),ft=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),ht=new RegExp(at),dt=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},gt=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,bt=/[+~]/,wt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),Ct=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},St=function(){N()};try{Z.apply($=Q.call(W.childNodes),W.childNodes);$[W.childNodes.length].nodeType}catch(Tt){Z={apply:$.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}x=e.support={};T=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1};N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:W;if(r===E||9!==r.nodeType||!r.documentElement)return E;E=r;P=r.documentElement;n=r.defaultView;n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",St,!1):n.attachEvent&&n.attachEvent("onunload",St));j=!T(r);x.attributes=i(function(t){t.className="i";return!t.getAttribute("className")});x.getElementsByTagName=i(function(t){t.appendChild(r.createComment(""));return!t.getElementsByTagName("*").length});x.getElementsByClassName=vt.test(r.getElementsByClassName);x.getById=i(function(t){P.appendChild(t).id=F;return!r.getElementsByName||!r.getElementsByName(F).length});if(x.getById){C.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&j){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}};C.filter.ID=function(t){var e=t.replace(xt,Ct);return function(t){return t.getAttribute("id")===e}}}else{delete C.find.ID;C.filter.ID=function(t){var e=t.replace(xt,Ct);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}}C.find.TAG=x.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):x.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o};C.find.CLASS=x.getElementsByClassName&&function(t,e){return j?e.getElementsByClassName(t):void 0};H=[];I=[];if(x.qsa=vt.test(r.querySelectorAll)){i(function(t){P.appendChild(t).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\f]' msallowcapture=''><option selected=''></option></select>";t.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+nt+"*(?:''|\"\")");t.querySelectorAll("[selected]").length||I.push("\\["+nt+"*(?:value|"+et+")");t.querySelectorAll("[id~="+F+"-]").length||I.push("~=");t.querySelectorAll(":checked").length||I.push(":checked");t.querySelectorAll("a#"+F+"+*").length||I.push(".#.+[+~]")});i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden");t.appendChild(e).setAttribute("name","D");t.querySelectorAll("[name=d]").length&&I.push("name"+nt+"*[*^$|!~]?=");t.querySelectorAll(":enabled").length||I.push(":enabled",":disabled");t.querySelectorAll("*,:x");I.push(",.*:")})}(x.matchesSelector=vt.test(O=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&i(function(t){x.disconnectedMatch=O.call(t,"div");O.call(t,"[s!='']:x");H.push("!=",at)});I=I.length&&new RegExp(I.join("|"));H=H.length&&new RegExp(H.join("|"));e=vt.test(P.compareDocumentPosition);R=e||vt.test(P.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0; return!1};X=e?function(t,e){if(t===e){A=!0;return 0}var n=!t.compareDocumentPosition-!e.compareDocumentPosition;if(n)return n;n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1;return 1&n||!x.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===W&&R(W,t)?-1:e===r||e.ownerDocument===W&&R(W,e)?1:L?tt(L,t)-tt(L,e):0:4&n?-1:1}:function(t,e){if(t===e){A=!0;return 0}var n,i=0,o=t.parentNode,s=e.parentNode,l=[t],u=[e];if(!o||!s)return t===r?-1:e===r?1:o?-1:s?1:L?tt(L,t)-tt(L,e):0;if(o===s)return a(t,e);n=t;for(;n=n.parentNode;)l.unshift(n);n=e;for(;n=n.parentNode;)u.unshift(n);for(;l[i]===u[i];)i++;return i?a(l[i],u[i]):l[i]===W?-1:u[i]===W?1:0};return r};e.matches=function(t,n){return e(t,null,null,n)};e.matchesSelector=function(t,n){(t.ownerDocument||t)!==E&&N(t);n=n.replace(ft,"='$1']");if(!(!x.matchesSelector||!j||H&&H.test(n)||I&&I.test(n)))try{var r=O.call(t,n);if(r||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,E,null,[t]).length>0};e.contains=function(t,e){(t.ownerDocument||t)!==E&&N(t);return R(t,e)};e.attr=function(t,e){(t.ownerDocument||t)!==E&&N(t);var n=C.attrHandle[e.toLowerCase()],r=n&&Y.call(C.attrHandle,e.toLowerCase())?n(t,e,!j):void 0;return void 0!==r?r:x.attributes||!j?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null};e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)};e.uniqueSort=function(t){var e,n=[],r=0,i=0;A=!x.detectDuplicates;L=!x.sortStable&&t.slice(0);t.sort(X);if(A){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}L=null;return t};S=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=S(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=S(e);return n};C=e.selectors={cacheLength:50,createPseudo:r,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){t[1]=t[1].replace(xt,Ct);t[3]=(t[3]||t[4]||t[5]||"").replace(xt,Ct);"~="===t[2]&&(t[3]=" "+t[3]+" ");return t.slice(0,4)},CHILD:function(t){t[1]=t[1].toLowerCase();if("nth"===t[1].slice(0,3)){t[3]||e.error(t[0]);t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3]));t[5]=+(t[7]+t[8]||"odd"===t[3])}else t[3]&&e.error(t[0]);return t},PSEUDO:function(t){var e,n=!t[6]&&t[2];if(pt.CHILD.test(t[0]))return null;if(t[3])t[2]=t[4]||t[5]||"";else if(n&&ht.test(n)&&(e=k(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)){t[0]=t[0].slice(0,e);t[2]=n.slice(0,e)}return t.slice(0,3)}},filter:{TAG:function(t){var e=t.replace(xt,Ct).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=U[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&U(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);if(null==o)return"!="===n;if(!n)return!0;o+="";return"="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(st," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,h,d,p,g=o!==a?"nextSibling":"previousSibling",m=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s;if(m){if(o){for(;g;){f=e;for(;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}p=[a?m.firstChild:m.lastChild];if(a&&y){c=m[F]||(m[F]={});u=c[t]||[];d=u[0]===z&&u[1];h=u[0]===z&&u[2];f=d&&m.childNodes[d];for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[z,d,h];break}}else if(y&&(u=(e[F]||(e[F]={}))[t])&&u[0]===z)h=u[1];else for(;f=++d&&f&&f[g]||(h=d=0)||p.pop();)if((s?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++h){y&&((f[F]||(f[F]={}))[t]=[z,h]);if(f===e)break}h-=i;return h===r||h%r===0&&h/r>=0}}},PSEUDO:function(t,n){var i,o=C.pseudos[t]||C.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);if(o[F])return o(n);if(o.length>1){i=[t,t,"",n];return C.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;){r=tt(t,i[a]);t[r]=!(e[r]=i[a])}}):function(t){return o(t,0,i)}}return o}},pseudos:{not:r(function(t){var e=[],n=[],i=M(t.replace(lt,"$1"));return i[F]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,r,o){e[0]=t;i(e,null,o,n);e[0]=null;return!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){t=t.replace(xt,Ct);return function(e){return(e.textContent||e.innerText||S(e)).indexOf(t)>-1}}),lang:r(function(t){dt.test(t||"")||e.error("unsupported lang: "+t);t=t.replace(xt,Ct).toLowerCase();return function(e){var n;do if(n=j?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang")){n=n.toLowerCase();return n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===P},focus:function(t){return t===E.activeElement&&(!E.hasFocus||E.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){t.parentNode&&t.parentNode.selectedIndex;return t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!C.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return gt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,n){return[0>n?n+e:n]}),even:u(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:u(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:u(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:u(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}};C.pseudos.nth=C.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);f.prototype=C.filters=C.pseudos;C.setFilters=new f;k=e.tokenize=function(t,n){var r,i,o,a,s,l,u,c=B[t+" "];if(c)return n?0:c.slice(0);s=t;l=[];u=C.preFilter;for(;s;){if(!r||(i=ut.exec(s))){i&&(s=s.slice(i[0].length)||s);l.push(o=[])}r=!1;if(i=ct.exec(s)){r=i.shift();o.push({value:r,type:i[0].replace(lt," ")});s=s.slice(r.length)}for(a in C.filter)if((i=pt[a].exec(s))&&(!u[a]||(i=u[a](i)))){r=i.shift();o.push({value:r,type:a,matches:i});s=s.slice(r.length)}if(!r)break}return n?s.length:s?e.error(t):B(t,l).slice(0)};M=e.compile=function(t,e){var n,r=[],i=[],o=V[t+" "];if(!o){e||(e=k(t));n=e.length;for(;n--;){o=y(e[n]);o[F]?r.push(o):i.push(o)}o=V(t,b(i,r));o.selector=t}return o};_=e.select=function(t,e,n,r){var i,o,a,s,l,u="function"==typeof t&&t,f=!r&&k(t=u.selector||t);n=n||[];if(1===f.length){o=f[0]=f[0].slice(0);if(o.length>2&&"ID"===(a=o[0]).type&&x.getById&&9===e.nodeType&&j&&C.relative[o[1].type]){e=(C.find.ID(a.matches[0].replace(xt,Ct),e)||[])[0];if(!e)return n;u&&(e=e.parentNode);t=t.slice(o.shift().value.length)}i=pt.needsContext.test(t)?0:o.length;for(;i--;){a=o[i];if(C.relative[s=a.type])break;if((l=C.find[s])&&(r=l(a.matches[0].replace(xt,Ct),bt.test(o[0].type)&&c(e.parentNode)||e))){o.splice(i,1);t=r.length&&h(o);if(!t){Z.apply(n,r);return n}break}}}(u||M(t,f))(r,e,!j,n,bt.test(t)&&c(e.parentNode)||e);return n};x.sortStable=F.split("").sort(X).join("")===F;x.detectDuplicates=!!A;N();x.sortDetached=i(function(t){return 1&t.compareDocumentPosition(E.createElement("div"))});i(function(t){t.innerHTML="<a href='#'></a>";return"#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)});x.attributes&&i(function(t){t.innerHTML="<input/>";t.firstChild.setAttribute("value","");return""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue});i(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null});return e}(e);tt.find=ot;tt.expr=ot.selectors;tt.expr[":"]=tt.expr.pseudos;tt.unique=ot.uniqueSort;tt.text=ot.getText;tt.isXMLDoc=ot.isXML;tt.contains=ot.contains;var at=tt.expr.match.needsContext,st=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,lt=/^.[^:#\[\.,]*$/;tt.filter=function(t,e,n){var r=e[0];n&&(t=":not("+t+")");return 1===e.length&&1===r.nodeType?tt.find.matchesSelector(r,t)?[r]:[]:tt.find.matches(t,tt.grep(e,function(t){return 1===t.nodeType}))};tt.fn.extend({find:function(t){var e,n=this.length,r=[],i=this;if("string"!=typeof t)return this.pushStack(tt(t).filter(function(){for(e=0;n>e;e++)if(tt.contains(i[e],this))return!0}));for(e=0;n>e;e++)tt.find(t,i[e],r);r=this.pushStack(n>1?tt.unique(r):r);r.selector=this.selector?this.selector+" "+t:t;return r},filter:function(t){return this.pushStack(i(this,t||[],!1))},not:function(t){return this.pushStack(i(this,t||[],!0))},is:function(t){return!!i(this,"string"==typeof t&&at.test(t)?tt(t):t||[],!1).length}});var ut,ct=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ft=tt.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:ct.exec(t);if(!n||!n[1]&&e)return!e||e.jquery?(e||ut).find(t):this.constructor(e).find(t);if(n[1]){e=e instanceof tt?e[0]:e;tt.merge(this,tt.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:Z,!0));if(st.test(n[1])&&tt.isPlainObject(e))for(n in e)tt.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}r=Z.getElementById(n[2]);if(r&&r.parentNode){this.length=1;this[0]=r}this.context=Z;this.selector=t;return this}if(t.nodeType){this.context=this[0]=t;this.length=1;return this}if(tt.isFunction(t))return"undefined"!=typeof ut.ready?ut.ready(t):t(tt);if(void 0!==t.selector){this.selector=t.selector;this.context=t.context}return tt.makeArray(t,this)};ft.prototype=tt.fn;ut=tt(Z);var ht=/^(?:parents|prev(?:Until|All))/,dt={children:!0,contents:!0,next:!0,prev:!0};tt.extend({dir:function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&tt(t).is(n))break;r.push(t)}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}});tt.fn.extend({has:function(t){var e=tt(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(tt.contains(this,e[t]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],a=at.test(t)||"string"!=typeof t?tt(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&tt.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?tt.unique(o):o)},index:function(t){return t?"string"==typeof t?G.call(tt(t),this[0]):G.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(tt.unique(tt.merge(this.get(),tt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}});tt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return tt.dir(t,"parentNode")},parentsUntil:function(t,e,n){return tt.dir(t,"parentNode",n)},next:function(t){return o(t,"nextSibling")},prev:function(t){return o(t,"previousSibling")},nextAll:function(t){return tt.dir(t,"nextSibling")},prevAll:function(t){return tt.dir(t,"previousSibling")},nextUntil:function(t,e,n){return tt.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return tt.dir(t,"previousSibling",n)},siblings:function(t){return tt.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return tt.sibling(t.firstChild)},contents:function(t){return t.contentDocument||tt.merge([],t.childNodes)}},function(t,e){tt.fn[t]=function(n,r){var i=tt.map(this,e,n);"Until"!==t.slice(-5)&&(r=n);r&&"string"==typeof r&&(i=tt.filter(r,i));if(this.length>1){dt[t]||tt.unique(i);ht.test(t)&&i.reverse()}return this.pushStack(i)}});var pt=/\S+/g,gt={};tt.Callbacks=function(t){t="string"==typeof t?gt[t]||a(t):tt.extend({},t);var e,n,r,i,o,s,l=[],u=!t.once&&[],c=function(a){e=t.memory&&a;n=!0;s=i||0;i=0;o=l.length;r=!0;for(;l&&o>s;s++)if(l[s].apply(a[0],a[1])===!1&&t.stopOnFalse){e=!1;break}r=!1;l&&(u?u.length&&c(u.shift()):e?l=[]:f.disable())},f={add:function(){if(l){var n=l.length;(function a(e){tt.each(e,function(e,n){var r=tt.type(n);"function"===r?t.unique&&f.has(n)||l.push(n):n&&n.length&&"string"!==r&&a(n)})})(arguments);if(r)o=l.length;else if(e){i=n;c(e)}}return this},remove:function(){l&&tt.each(arguments,function(t,e){for(var n;(n=tt.inArray(e,l,n))>-1;){l.splice(n,1);if(r){o>=n&&o--;s>=n&&s--}}});return this},has:function(t){return t?tt.inArray(t,l)>-1:!(!l||!l.length)},empty:function(){l=[];o=0;return this},disable:function(){l=u=e=void 0;return this},disabled:function(){return!l},lock:function(){u=void 0;e||f.disable();return this},locked:function(){return!u},fireWith:function(t,e){if(l&&(!n||u)){e=e||[];e=[t,e.slice?e.slice():e];r?u.push(e):c(e)}return this},fire:function(){f.fireWith(this,arguments);return this},fired:function(){return!!n}};return f};tt.extend({Deferred:function(t){var e=[["resolve","done",tt.Callbacks("once memory"),"resolved"],["reject","fail",tt.Callbacks("once memory"),"rejected"],["notify","progress",tt.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){i.done(arguments).fail(arguments);return this},then:function(){var t=arguments;return tt.Deferred(function(n){tt.each(e,function(e,o){var a=tt.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&tt.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})});t=null}).promise()},promise:function(t){return null!=t?tt.extend(t,r):r}},i={};r.pipe=r.then;tt.each(e,function(t,o){var a=o[2],s=o[3];r[o[1]]=a.add;s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock);i[o[0]]=function(){i[o[0]+"With"](this===i?r:this,arguments);return this};i[o[0]+"With"]=a.fireWith});r.promise(i);t&&t.call(i,i);return i},when:function(t){var e,n,r,i=0,o=B.call(arguments),a=o.length,s=1!==a||t&&tt.isFunction(t.promise)?a:0,l=1===s?t:tt.Deferred(),u=function(t,n,r){return function(i){n[t]=this;r[t]=arguments.length>1?B.call(arguments):i;r===e?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1){e=new Array(a);n=new Array(a);r=new Array(a);for(;a>i;i++)o[i]&&tt.isFunction(o[i].promise)?o[i].promise().done(u(i,r,o)).fail(l.reject).progress(u(i,n,e)):--s}s||l.resolveWith(r,o);return l.promise()}});var mt;tt.fn.ready=function(t){tt.ready.promise().done(t);return this};tt.extend({isReady:!1,readyWait:1,holdReady:function(t){t?tt.readyWait++:tt.ready(!0)},ready:function(t){if(t===!0?!--tt.readyWait:!tt.isReady){tt.isReady=!0;if(!(t!==!0&&--tt.readyWait>0)){mt.resolveWith(Z,[tt]);if(tt.fn.triggerHandler){tt(Z).triggerHandler("ready");tt(Z).off("ready")}}}}});tt.ready.promise=function(t){if(!mt){mt=tt.Deferred();if("complete"===Z.readyState)setTimeout(tt.ready);else{Z.addEventListener("DOMContentLoaded",s,!1);e.addEventListener("load",s,!1)}}return mt.promise(t)};tt.ready.promise();var vt=tt.access=function(t,e,n,r,i,o,a){var s=0,l=t.length,u=null==n;if("object"===tt.type(n)){i=!0;for(s in n)tt.access(t,e,s,n[s],!0,o,a)}else if(void 0!==r){i=!0;tt.isFunction(r)||(a=!0);if(u)if(a){e.call(t,r);e=null}else{u=e;e=function(t,e,n){return u.call(tt(t),n)}}if(e)for(;l>s;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)))}return i?t:u?e.call(t):l?e(t[0],n):o};tt.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};l.uid=1;l.accepts=tt.acceptData;l.prototype={key:function(t){if(!l.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=l.uid++;try{e[this.expando]={value:n};Object.defineProperties(t,e)}catch(r){e[this.expando]=n;tt.extend(t,e)}}this.cache[n]||(this.cache[n]={});return n},set:function(t,e,n){var r,i=this.key(t),o=this.cache[i];if("string"==typeof e)o[e]=n;else if(tt.isEmptyObject(o))tt.extend(this.cache[i],e);else for(r in e)o[r]=e[r];return o},get:function(t,e){var n=this.cache[this.key(t)];return void 0===e?n:n[e]},access:function(t,e,n){var r;if(void 0===e||e&&"string"==typeof e&&void 0===n){r=this.get(t,e);return void 0!==r?r:this.get(t,tt.camelCase(e))}this.set(t,e,n);return void 0!==n?n:e},remove:function(t,e){var n,r,i,o=this.key(t),a=this.cache[o];if(void 0===e)this.cache[o]={};else{if(tt.isArray(e))r=e.concat(e.map(tt.camelCase));else{i=tt.camelCase(e);if(e in a)r=[e,i];else{r=i;r=r in a?[r]:r.match(pt)||[]}}n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(t){return!tt.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var yt=new l,bt=new l,wt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,xt=/([A-Z])/g;tt.extend({hasData:function(t){return bt.hasData(t)||yt.hasData(t)},data:function(t,e,n){return bt.access(t,e,n)},removeData:function(t,e){bt.remove(t,e)},_data:function(t,e,n){return yt.access(t,e,n)},_removeData:function(t,e){yt.remove(t,e)}});tt.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length){i=bt.get(o);if(1===o.nodeType&&!yt.get(o,"hasDataAttrs")){n=a.length;for(;n--;)if(a[n]){r=a[n].name;if(0===r.indexOf("data-")){r=tt.camelCase(r.slice(5));u(o,r,i[r])}}yt.set(o,"hasDataAttrs",!0)}}return i}return"object"==typeof t?this.each(function(){bt.set(this,t)}):vt(this,function(e){var n,r=tt.camelCase(t);if(o&&void 0===e){n=bt.get(o,t);if(void 0!==n)return n;n=bt.get(o,r);if(void 0!==n)return n;n=u(o,r,void 0);if(void 0!==n)return n}else this.each(function(){var n=bt.get(this,r);bt.set(this,r,e);-1!==t.indexOf("-")&&void 0!==n&&bt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){bt.remove(this,t)})}});tt.extend({queue:function(t,e,n){var r;if(t){e=(e||"fx")+"queue";r=yt.get(t,e);n&&(!r||tt.isArray(n)?r=yt.access(t,e,tt.makeArray(n)):r.push(n));return r||[]}},dequeue:function(t,e){e=e||"fx";var n=tt.queue(t,e),r=n.length,i=n.shift(),o=tt._queueHooks(t,e),a=function(){tt.dequeue(t,e)};if("inprogress"===i){i=n.shift();r--}if(i){"fx"===e&&n.unshift("inprogress");delete o.stop;i.call(t,a,o)}!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return yt.get(t,n)||yt.access(t,n,{empty:tt.Callbacks("once memory").add(function(){yt.remove(t,[e+"queue",n])})})}});tt.fn.extend({queue:function(t,e){var n=2;if("string"!=typeof t){e=t;t="fx";n--}return arguments.length<n?tt.queue(this[0],t):void 0===e?this:this.each(function(){var n=tt.queue(this,t,e);tt._queueHooks(this,t);"fx"===t&&"inprogress"!==n[0]&&tt.dequeue(this,t)})},dequeue:function(t){return this.each(function(){tt.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=tt.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};if("string"!=typeof t){e=t;t=void 0}t=t||"fx";for(;a--;){n=yt.get(o[a],t+"queueHooks");if(n&&n.empty){r++;n.empty.add(s)}}s();return i.promise(e)}});var Ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,St=["Top","Right","Bottom","Left"],Tt=function(t,e){t=e||t;return"none"===tt.css(t,"display")||!tt.contains(t.ownerDocument,t)},kt=/^(?:checkbox|radio)$/i;(function(){var t=Z.createDocumentFragment(),e=t.appendChild(Z.createElement("div")),n=Z.createElement("input");n.setAttribute("type","radio");n.setAttribute("checked","checked");n.setAttribute("name","t");e.appendChild(n);K.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked;e.innerHTML="<textarea>x</textarea>";K.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue})();var Mt="undefined";K.focusinBubbles="onfocusin"in e;var _t=/^key/,Dt=/^(?:mouse|pointer|contextmenu)|click/,Lt=/^(?:focusinfocus|focusoutblur)$/,At=/^([^.]*)(?:\.(.+)|)$/;tt.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=yt.get(t);if(m){if(n.handler){o=n;n=o.handler;i=o.selector}n.guid||(n.guid=tt.guid++);(l=m.events)||(l=m.events={});(a=m.handle)||(a=m.handle=function(e){return typeof tt!==Mt&&tt.event.triggered!==e.type?tt.event.dispatch.apply(t,arguments):void 0});e=(e||"").match(pt)||[""];u=e.length;for(;u--;){s=At.exec(e[u])||[];d=g=s[1];p=(s[2]||"").split(".").sort();if(d){f=tt.event.special[d]||{};d=(i?f.delegateType:f.bindType)||d;f=tt.event.special[d]||{};c=tt.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&tt.expr.match.needsContext.test(i),namespace:p.join(".")},o);if(!(h=l[d])){h=l[d]=[];h.delegateCount=0;f.setup&&f.setup.call(t,r,p,a)!==!1||t.addEventListener&&t.addEventListener(d,a,!1)}if(f.add){f.add.call(t,c);c.handler.guid||(c.handler.guid=n.guid)}i?h.splice(h.delegateCount++,0,c):h.push(c);tt.event.global[d]=!0}}}},remove:function(t,e,n,r,i){var o,a,s,l,u,c,f,h,d,p,g,m=yt.hasData(t)&&yt.get(t);if(m&&(l=m.events)){e=(e||"").match(pt)||[""];u=e.length;for(;u--;){s=At.exec(e[u])||[];d=g=s[1];p=(s[2]||"").split(".").sort();if(d){f=tt.event.special[d]||{};d=(r?f.delegateType:f.bindType)||d;h=l[d]||[];s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)");a=o=h.length;for(;o--;){c=h[o];if(!(!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector))){h.splice(o,1);c.selector&&h.delegateCount--;f.remove&&f.remove.call(t,c)}}if(a&&!h.length){f.teardown&&f.teardown.call(t,p,m.handle)!==!1||tt.removeEvent(t,d,m.handle);delete l[d]}}else for(d in l)tt.event.remove(t,d+e[u],n,r,!0)}if(tt.isEmptyObject(l)){delete m.handle;yt.remove(t,"events")}}},trigger:function(t,n,r,i){var o,a,s,l,u,c,f,h=[r||Z],d=J.call(t,"type")?t.type:t,p=J.call(t,"namespace")?t.namespace.split("."):[];a=s=r=r||Z;if(3!==r.nodeType&&8!==r.nodeType&&!Lt.test(d+tt.event.triggered)){if(d.indexOf(".")>=0){p=d.split(".");d=p.shift();p.sort()}u=d.indexOf(":")<0&&"on"+d;t=t[tt.expando]?t:new tt.Event(d,"object"==typeof t&&t);t.isTrigger=i?2:3;t.namespace=p.join(".");t.namespace_re=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;t.result=void 0;t.target||(t.target=r);n=null==n?[t]:tt.makeArray(n,[t]);f=tt.event.special[d]||{};if(i||!f.trigger||f.trigger.apply(r,n)!==!1){if(!i&&!f.noBubble&&!tt.isWindow(r)){l=f.delegateType||d;Lt.test(l+d)||(a=a.parentNode);for(;a;a=a.parentNode){h.push(a);s=a}s===(r.ownerDocument||Z)&&h.push(s.defaultView||s.parentWindow||e)}o=0;for(;(a=h[o++])&&!t.isPropagationStopped();){t.type=o>1?l:f.bindType||d;c=(yt.get(a,"events")||{})[t.type]&&yt.get(a,"handle");c&&c.apply(a,n);c=u&&a[u];if(c&&c.apply&&tt.acceptData(a)){t.result=c.apply(a,n);t.result===!1&&t.preventDefault()}}t.type=d;if(!i&&!t.isDefaultPrevented()&&(!f._default||f._default.apply(h.pop(),n)===!1)&&tt.acceptData(r)&&u&&tt.isFunction(r[d])&&!tt.isWindow(r)){s=r[u];s&&(r[u]=null);tt.event.triggered=d;r[d]();tt.event.triggered=void 0;s&&(r[u]=s)}return t.result}}},dispatch:function(t){t=tt.event.fix(t);var e,n,r,i,o,a=[],s=B.call(arguments),l=(yt.get(this,"events")||{})[t.type]||[],u=tt.event.special[t.type]||{};s[0]=t;t.delegateTarget=this;if(!u.preDispatch||u.preDispatch.call(this,t)!==!1){a=tt.event.handlers.call(this,t,l);e=0;for(;(i=a[e++])&&!t.isPropagationStopped();){t.currentTarget=i.elem;n=0;for(;(o=i.handlers[n++])&&!t.isImmediatePropagationStopped();)if(!t.namespace_re||t.namespace_re.test(o.namespace)){t.handleObj=o;t.data=o.data;r=((tt.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s);if(void 0!==r&&(t.result=r)===!1){t.preventDefault();t.stopPropagation()}}}u.postDispatch&&u.postDispatch.call(this,t);return t.result}},handlers:function(t,e){var n,r,i,o,a=[],s=e.delegateCount,l=t.target;if(s&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==t.type){r=[];for(n=0;s>n;n++){o=e[n];i=o.selector+" ";void 0===r[i]&&(r[i]=o.needsContext?tt(i,this).index(l)>=0:tt.find(i,this,null,[l]).length);r[i]&&r.push(o)}r.length&&a.push({elem:l,handlers:r})}s<e.length&&a.push({elem:this,handlers:e.slice(s)});return a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode);return t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,i,o=e.button;if(null==t.pageX&&null!=e.clientX){n=t.target.ownerDocument||Z;r=n.documentElement;i=n.body;t.pageX=e.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0);t.pageY=e.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)}t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0);return t}},fix:function(t){if(t[tt.expando])return t;var e,n,r,i=t.type,o=t,a=this.fixHooks[i];a||(this.fixHooks[i]=a=Dt.test(i)?this.mouseHooks:_t.test(i)?this.keyHooks:{});r=a.props?this.props.concat(a.props):this.props;t=new tt.Event(o);e=r.length;for(;e--;){n=r[e];t[n]=o[n]}t.target||(t.target=Z);3===t.target.nodeType&&(t.target=t.target.parentNode);return a.filter?a.filter(t,o):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==h()&&this.focus){this.focus();return!1}},delegateType:"focusin"},blur:{trigger:function(){if(this===h()&&this.blur){this.blur();return!1}},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&tt.nodeName(this,"input")){this.click();return!1}},_default:function(t){return tt.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=tt.extend(new tt.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?tt.event.trigger(i,null,e):tt.event.dispatch.call(e,i);i.isDefaultPrevented()&&n.preventDefault()}};tt.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)};tt.Event=function(t,e){if(!(this instanceof tt.Event))return new tt.Event(t,e);if(t&&t.type){this.originalEvent=t;this.type=t.type;this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?c:f}else this.type=t;e&&tt.extend(this,e);this.timeStamp=t&&t.timeStamp||tt.now();this[tt.expando]=!0};tt.Event.prototype={isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=c;t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=c;t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=c;t&&t.stopImmediatePropagation&&t.stopImmediatePropagation();this.stopPropagation()}};tt.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){tt.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;if(!i||i!==r&&!tt.contains(r,i)){t.type=o.origType;n=o.handler.apply(this,arguments);t.type=e}return n}}});K.focusinBubbles||tt.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){tt.event.simulate(e,t.target,tt.event.fix(t),!0)};tt.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=yt.access(r,e);i||r.addEventListener(t,n,!0);yt.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=yt.access(r,e)-1;if(i)yt.access(r,e,i);else{r.removeEventListener(t,n,!0);yt.remove(r,e)}}}});tt.fn.extend({on:function(t,e,n,r,i){var o,a;if("object"==typeof t){if("string"!=typeof e){n=n||e;e=void 0}for(a in t)this.on(a,e,n,t[a],i);return this}if(null==n&&null==r){r=e;n=e=void 0}else if(null==r)if("string"==typeof e){r=n;n=void 0}else{r=n;n=e;e=void 0}if(r===!1)r=f;else if(!r)return this;if(1===i){o=r;r=function(t){tt().off(t);return o.apply(this,arguments)};r.guid=o.guid||(o.guid=tt.guid++)}return this.each(function(){tt.event.add(this,t,r,n,e)})},one:function(t,e,n,r){return this.on(t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj){r=t.handleObj;tt(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler);return this}if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}if(e===!1||"function"==typeof e){n=e;e=void 0}n===!1&&(n=f);return this.each(function(){tt.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){tt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];return n?tt.event.trigger(t,e,n,!0):void 0}});var Nt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Et=/<([\w:]+)/,Pt=/<|&#?\w+;/,jt=/<(?:script|style|link)/i,It=/checked\s*(?:[^=]|=\s*.checked.)/i,Ht=/^$|\/(?:java|ecma)script/i,Ot=/^true\/(.*)/,Rt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ft={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ft.optgroup=Ft.option;Ft.tbody=Ft.tfoot=Ft.colgroup=Ft.caption=Ft.thead;Ft.th=Ft.td;tt.extend({clone:function(t,e,n){var r,i,o,a,s=t.cloneNode(!0),l=tt.contains(t.ownerDocument,t);if(!(K.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||tt.isXMLDoc(t))){a=y(s);o=y(t);for(r=0,i=o.length;i>r;r++)b(o[r],a[r])}if(e)if(n){o=o||y(t);a=a||y(s);for(r=0,i=o.length;i>r;r++)v(o[r],a[r])}else v(t,s);a=y(s,"script");a.length>0&&m(a,!l&&y(t,"script"));return s},buildFragment:function(t,e,n,r){for(var i,o,a,s,l,u,c=e.createDocumentFragment(),f=[],h=0,d=t.length;d>h;h++){i=t[h];if(i||0===i)if("object"===tt.type(i))tt.merge(f,i.nodeType?[i]:i);else if(Pt.test(i)){o=o||c.appendChild(e.createElement("div"));a=(Et.exec(i)||["",""])[1].toLowerCase();s=Ft[a]||Ft._default;o.innerHTML=s[1]+i.replace(Nt,"<$1></$2>")+s[2];u=s[0];for(;u--;)o=o.lastChild;tt.merge(f,o.childNodes);o=c.firstChild;o.textContent=""}else f.push(e.createTextNode(i))}c.textContent="";h=0;for(;i=f[h++];)if(!r||-1===tt.inArray(i,r)){l=tt.contains(i.ownerDocument,i);o=y(c.appendChild(i),"script");l&&m(o);if(n){u=0;for(;i=o[u++];)Ht.test(i.type||"")&&n.push(i)}}return c},cleanData:function(t){for(var e,n,r,i,o=tt.event.special,a=0;void 0!==(n=t[a]);a++){if(tt.acceptData(n)){i=n[yt.expando];if(i&&(e=yt.cache[i])){if(e.events)for(r in e.events)o[r]?tt.event.remove(n,r):tt.removeEvent(n,r,e.handle);yt.cache[i]&&delete yt.cache[i]}}delete bt.cache[n[bt.expando]]}}});tt.fn.extend({text:function(t){return vt(this,function(t){return void 0===t?tt.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=d(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){ var e=d(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?tt.filter(t,this):this,i=0;null!=(n=r[i]);i++){e||1!==n.nodeType||tt.cleanData(y(n));if(n.parentNode){e&&tt.contains(n.ownerDocument,n)&&m(y(n,"script"));n.parentNode.removeChild(n)}}return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)if(1===t.nodeType){tt.cleanData(y(t,!1));t.textContent=""}return this},clone:function(t,e){t=null==t?!1:t;e=null==e?t:e;return this.map(function(){return tt.clone(this,t,e)})},html:function(t){return vt(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!jt.test(t)&&!Ft[(Et.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Nt,"<$1></$2>");try{for(;r>n;n++){e=this[n]||{};if(1===e.nodeType){tt.cleanData(y(e,!1));e.innerHTML=t}}e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];this.domManip(arguments,function(e){t=this.parentNode;tt.cleanData(y(this));t&&t.replaceChild(e,this)});return t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=V.apply([],t);var n,r,i,o,a,s,l=0,u=this.length,c=this,f=u-1,h=t[0],d=tt.isFunction(h);if(d||u>1&&"string"==typeof h&&!K.checkClone&&It.test(h))return this.each(function(n){var r=c.eq(n);d&&(t[0]=h.call(this,n,r.html()));r.domManip(t,e)});if(u){n=tt.buildFragment(t,this[0].ownerDocument,!1,this);r=n.firstChild;1===n.childNodes.length&&(n=r);if(r){i=tt.map(y(n,"script"),p);o=i.length;for(;u>l;l++){a=n;if(l!==f){a=tt.clone(a,!0,!0);o&&tt.merge(i,y(a,"script"))}e.call(this[l],a,l)}if(o){s=i[i.length-1].ownerDocument;tt.map(i,g);for(l=0;o>l;l++){a=i[l];Ht.test(a.type||"")&&!yt.access(a,"globalEval")&&tt.contains(s,a)&&(a.src?tt._evalUrl&&tt._evalUrl(a.src):tt.globalEval(a.textContent.replace(Rt,"")))}}}}return this}});tt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){tt.fn[t]=function(t){for(var n,r=[],i=tt(t),o=i.length-1,a=0;o>=a;a++){n=a===o?this:this.clone(!0);tt(i[a])[e](n);X.apply(r,n.get())}return this.pushStack(r)}});var Wt,zt={},qt=/^margin/,Ut=new RegExp("^("+Ct+")(?!px)[a-z%]+$","i"),Bt=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};(function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";a.innerHTML="";i.appendChild(o);var t=e.getComputedStyle(a,null);n="1%"!==t.top;r="4px"===t.width;i.removeChild(o)}var n,r,i=Z.documentElement,o=Z.createElement("div"),a=Z.createElement("div");if(a.style){a.style.backgroundClip="content-box";a.cloneNode(!0).style.backgroundClip="";K.clearCloneStyle="content-box"===a.style.backgroundClip;o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute";o.appendChild(a);e.getComputedStyle&&tt.extend(K,{pixelPosition:function(){t();return n},boxSizingReliable:function(){null==r&&t();return r},reliableMarginRight:function(){var t,n=a.appendChild(Z.createElement("div"));n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0";n.style.marginRight=n.style.width="0";a.style.width="1px";i.appendChild(o);t=!parseFloat(e.getComputedStyle(n,null).marginRight);i.removeChild(o);a.removeChild(n);return t}})}})();tt.swap=function(t,e,n,r){var i,o,a={};for(o in e){a[o]=t.style[o];t.style[o]=e[o]}i=n.apply(t,r||[]);for(o in e)t.style[o]=a[o];return i};var Vt=/^(none|table(?!-c[ea]).+)/,Xt=new RegExp("^("+Ct+")(.*)$","i"),Gt=new RegExp("^([+-])=("+Ct+")","i"),Yt={position:"absolute",visibility:"hidden",display:"block"},$t={letterSpacing:"0",fontWeight:"400"},Jt=["Webkit","O","Moz","ms"];tt.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=C(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=tt.camelCase(e),l=t.style;e=tt.cssProps[s]||(tt.cssProps[s]=T(l,s));a=tt.cssHooks[e]||tt.cssHooks[s];if(void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:l[e];o=typeof n;if("string"===o&&(i=Gt.exec(n))){n=(i[1]+1)*i[2]+parseFloat(tt.css(t,e));o="number"}if(null!=n&&n===n){"number"!==o||tt.cssNumber[s]||(n+="px");K.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit");a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l[e]=n)}}},css:function(t,e,n,r){var i,o,a,s=tt.camelCase(e);e=tt.cssProps[s]||(tt.cssProps[s]=T(t.style,s));a=tt.cssHooks[e]||tt.cssHooks[s];a&&"get"in a&&(i=a.get(t,!0,n));void 0===i&&(i=C(t,e,r));"normal"===i&&e in $t&&(i=$t[e]);if(""===n||n){o=parseFloat(i);return n===!0||tt.isNumeric(o)?o||0:i}return i}});tt.each(["height","width"],function(t,e){tt.cssHooks[e]={get:function(t,n,r){return n?Vt.test(tt.css(t,"display"))&&0===t.offsetWidth?tt.swap(t,Yt,function(){return _(t,e,r)}):_(t,e,r):void 0},set:function(t,n,r){var i=r&&Bt(t);return k(t,n,r?M(t,e,r,"border-box"===tt.css(t,"boxSizing",!1,i),i):0)}}});tt.cssHooks.marginRight=S(K.reliableMarginRight,function(t,e){return e?tt.swap(t,{display:"inline-block"},C,[t,"marginRight"]):void 0});tt.each({margin:"",padding:"",border:"Width"},function(t,e){tt.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+St[r]+e]=o[r]||o[r-2]||o[0];return i}};qt.test(t)||(tt.cssHooks[t+e].set=k)});tt.fn.extend({css:function(t,e){return vt(this,function(t,e,n){var r,i,o={},a=0;if(tt.isArray(e)){r=Bt(t);i=e.length;for(;i>a;a++)o[e[a]]=tt.css(t,e[a],!1,r);return o}return void 0!==n?tt.style(t,e,n):tt.css(t,e)},t,e,arguments.length>1)},show:function(){return D(this,!0)},hide:function(){return D(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Tt(this)?tt(this).show():tt(this).hide()})}});tt.Tween=L;L.prototype={constructor:L,init:function(t,e,n,r,i,o){this.elem=t;this.prop=n;this.easing=i||"swing";this.options=e;this.start=this.now=this.cur();this.end=r;this.unit=o||(tt.cssNumber[n]?"":"px")},cur:function(){var t=L.propHooks[this.prop];return t&&t.get?t.get(this):L.propHooks._default.get(this)},run:function(t){var e,n=L.propHooks[this.prop];this.pos=e=this.options.duration?tt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t;this.now=(this.end-this.start)*e+this.start;this.options.step&&this.options.step.call(this.elem,this.now,this);n&&n.set?n.set(this):L.propHooks._default.set(this);return this}};L.prototype.init.prototype=L.prototype;L.propHooks={_default:{get:function(t){var e;if(null!=t.elem[t.prop]&&(!t.elem.style||null==t.elem.style[t.prop]))return t.elem[t.prop];e=tt.css(t.elem,t.prop,"");return e&&"auto"!==e?e:0},set:function(t){tt.fx.step[t.prop]?tt.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[tt.cssProps[t.prop]]||tt.cssHooks[t.prop])?tt.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}};L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}};tt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}};tt.fx=L.prototype.init;tt.fx.step={};var Kt,Zt,Qt=/^(?:toggle|show|hide)$/,te=new RegExp("^(?:([+-])=|)("+Ct+")([a-z%]*)$","i"),ee=/queueHooks$/,ne=[P],re={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=te.exec(e),o=i&&i[3]||(tt.cssNumber[t]?"":"px"),a=(tt.cssNumber[t]||"px"!==o&&+r)&&te.exec(tt.css(n.elem,t)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3];i=i||[];a=+r||1;do{s=s||".5";a/=s;tt.style(n.elem,t,a+o)}while(s!==(s=n.cur()/r)&&1!==s&&--l)}if(i){a=n.start=+a||+r||0;n.unit=o;n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]}return n}]};tt.Animation=tt.extend(I,{tweener:function(t,e){if(tt.isFunction(t)){e=t;t=["*"]}else t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++){n=t[r];re[n]=re[n]||[];re[n].unshift(e)}},prefilter:function(t,e){e?ne.unshift(t):ne.push(t)}});tt.speed=function(t,e,n){var r=t&&"object"==typeof t?tt.extend({},t):{complete:n||!n&&e||tt.isFunction(t)&&t,duration:t,easing:n&&e||e&&!tt.isFunction(e)&&e};r.duration=tt.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in tt.fx.speeds?tt.fx.speeds[r.duration]:tt.fx.speeds._default;(null==r.queue||r.queue===!0)&&(r.queue="fx");r.old=r.complete;r.complete=function(){tt.isFunction(r.old)&&r.old.call(this);r.queue&&tt.dequeue(this,r.queue)};return r};tt.fn.extend({fadeTo:function(t,e,n,r){return this.filter(Tt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=tt.isEmptyObject(t),o=tt.speed(e,n,r),a=function(){var e=I(this,tt.extend({},t),o);(i||yt.get(this,"finish"))&&e.stop(!0)};a.finish=a;return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop;e(n)};if("string"!=typeof t){n=e;e=t;t=void 0}e&&t!==!1&&this.queue(t||"fx",[]);return this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=tt.timers,a=yt.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ee.test(i)&&r(a[i]);for(i=o.length;i--;)if(o[i].elem===this&&(null==t||o[i].queue===t)){o[i].anim.stop(n);e=!1;o.splice(i,1)}(e||!n)&&tt.dequeue(this,t)})},finish:function(t){t!==!1&&(t=t||"fx");return this.each(function(){var e,n=yt.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=tt.timers,a=r?r.length:0;n.finish=!0;tt.queue(this,t,[]);i&&i.stop&&i.stop.call(this,!0);for(e=o.length;e--;)if(o[e].elem===this&&o[e].queue===t){o[e].anim.stop(!0);o.splice(e,1)}for(e=0;a>e;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}});tt.each(["toggle","show","hide"],function(t,e){var n=tt.fn[e];tt.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(N(e,!0),t,r,i)}});tt.each({slideDown:N("show"),slideUp:N("hide"),slideToggle:N("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){tt.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}});tt.timers=[];tt.fx.tick=function(){var t,e=0,n=tt.timers;Kt=tt.now();for(;e<n.length;e++){t=n[e];t()||n[e]!==t||n.splice(e--,1)}n.length||tt.fx.stop();Kt=void 0};tt.fx.timer=function(t){tt.timers.push(t);t()?tt.fx.start():tt.timers.pop()};tt.fx.interval=13;tt.fx.start=function(){Zt||(Zt=setInterval(tt.fx.tick,tt.fx.interval))};tt.fx.stop=function(){clearInterval(Zt);Zt=null};tt.fx.speeds={slow:600,fast:200,_default:400};tt.fn.delay=function(t,e){t=tt.fx?tt.fx.speeds[t]||t:t;e=e||"fx";return this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})};(function(){var t=Z.createElement("input"),e=Z.createElement("select"),n=e.appendChild(Z.createElement("option"));t.type="checkbox";K.checkOn=""!==t.value;K.optSelected=n.selected;e.disabled=!0;K.optDisabled=!n.disabled;t=Z.createElement("input");t.value="t";t.type="radio";K.radioValue="t"===t.value})();var ie,oe,ae=tt.expr.attrHandle;tt.fn.extend({attr:function(t,e){return vt(this,tt.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){tt.removeAttr(this,t)})}});tt.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o){if(typeof t.getAttribute===Mt)return tt.prop(t,e,n);if(1!==o||!tt.isXMLDoc(t)){e=e.toLowerCase();r=tt.attrHooks[e]||(tt.expr.match.bool.test(e)?oe:ie)}if(void 0===n){if(r&&"get"in r&&null!==(i=r.get(t,e)))return i;i=tt.find.attr(t,e);return null==i?void 0:i}if(null!==n){if(r&&"set"in r&&void 0!==(i=r.set(t,n,e)))return i;t.setAttribute(e,n+"");return n}tt.removeAttr(t,e)}},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(pt);if(o&&1===t.nodeType)for(;n=o[i++];){r=tt.propFix[n]||n;tt.expr.match.bool.test(n)&&(t[r]=!1);t.removeAttribute(n)}},attrHooks:{type:{set:function(t,e){if(!K.radioValue&&"radio"===e&&tt.nodeName(t,"input")){var n=t.value;t.setAttribute("type",e);n&&(t.value=n);return e}}}}});oe={set:function(t,e,n){e===!1?tt.removeAttr(t,n):t.setAttribute(n,n);return n}};tt.each(tt.expr.match.bool.source.match(/\w+/g),function(t,e){var n=ae[e]||tt.find.attr;ae[e]=function(t,e,r){var i,o;if(!r){o=ae[e];ae[e]=i;i=null!=n(t,e,r)?e.toLowerCase():null;ae[e]=o}return i}});var se=/^(?:input|select|textarea|button)$/i;tt.fn.extend({prop:function(t,e){return vt(this,tt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[tt.propFix[t]||t]})}});tt.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a){o=1!==a||!tt.isXMLDoc(t);if(o){e=tt.propFix[e]||e;i=tt.propHooks[e]}return void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]}},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||se.test(t.nodeName)||t.href?t.tabIndex:-1}}}});K.optSelected||(tt.propHooks.selected={get:function(t){var e=t.parentNode;e&&e.parentNode&&e.parentNode.selectedIndex;return null}});tt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){tt.propFix[this.toLowerCase()]=this});var le=/[\t\r\n\f]/g;tt.fn.extend({addClass:function(t){var e,n,r,i,o,a,s="string"==typeof t&&t,l=0,u=this.length;if(tt.isFunction(t))return this.each(function(e){tt(this).addClass(t.call(this,e,this.className))});if(s){e=(t||"").match(pt)||[];for(;u>l;l++){n=this[l];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(le," "):" ");if(r){o=0;for(;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=tt.trim(r);n.className!==a&&(n.className=a)}}}return this},removeClass:function(t){var e,n,r,i,o,a,s=0===arguments.length||"string"==typeof t&&t,l=0,u=this.length;if(tt.isFunction(t))return this.each(function(e){tt(this).removeClass(t.call(this,e,this.className))});if(s){e=(t||"").match(pt)||[];for(;u>l;l++){n=this[l];r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(le," "):"");if(r){o=0;for(;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=t?tt.trim(r):"";n.className!==a&&(n.className=a)}}}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(tt.isFunction(t)?function(n){tt(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,i=tt(this),o=t.match(pt)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else if(n===Mt||"boolean"===n){this.className&&yt.set(this,"__className__",this.className);this.className=this.className||t===!1?"":yt.get(this,"__className__")||""}})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(le," ").indexOf(e)>=0)return!0;return!1}});var ue=/\r/g;tt.fn.extend({val:function(t){var e,n,r,i=this[0];if(arguments.length){r=tt.isFunction(t);return this.each(function(n){var i;if(1===this.nodeType){i=r?t.call(this,n,tt(this).val()):t;null==i?i="":"number"==typeof i?i+="":tt.isArray(i)&&(i=tt.map(i,function(t){return null==t?"":t+""}));e=tt.valHooks[this.type]||tt.valHooks[this.nodeName.toLowerCase()];e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i)}})}if(i){e=tt.valHooks[i.type]||tt.valHooks[i.nodeName.toLowerCase()];if(e&&"get"in e&&void 0!==(n=e.get(i,"value")))return n;n=i.value;return"string"==typeof n?n.replace(ue,""):null==n?"":n}}});tt.extend({valHooks:{option:{get:function(t){var e=tt.find.attr(t,"value");return null!=e?e:tt.trim(tt.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++){n=r[l];if(!(!n.selected&&l!==i||(K.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&tt.nodeName(n.parentNode,"optgroup"))){e=tt(n).val();if(o)return e;a.push(e)}}return a},set:function(t,e){for(var n,r,i=t.options,o=tt.makeArray(e),a=i.length;a--;){r=i[a];(r.selected=tt.inArray(r.value,o)>=0)&&(n=!0)}n||(t.selectedIndex=-1);return o}}}});tt.each(["radio","checkbox"],function(){tt.valHooks[this]={set:function(t,e){return tt.isArray(e)?t.checked=tt.inArray(tt(t).val(),e)>=0:void 0}};K.checkOn||(tt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});tt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){tt.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});tt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var ce=tt.now(),fe=/\?/;tt.parseJSON=function(t){return JSON.parse(t+"")};tt.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{n=new DOMParser;e=n.parseFromString(t,"text/xml")}catch(r){e=void 0}(!e||e.getElementsByTagName("parsererror").length)&&tt.error("Invalid XML: "+t);return e};var he=/#.*$/,de=/([?&])_=[^&]*/,pe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ge=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,me=/^(?:GET|HEAD)$/,ve=/^\/\//,ye=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,be={},we={},xe="*/".concat("*"),Ce=e.location.href,Se=ye.exec(Ce.toLowerCase())||[];tt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce,type:"GET",isLocal:ge.test(Se[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":xe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":tt.parseJSON,"text xml":tt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?R(R(t,tt.ajaxSettings),e):R(tt.ajaxSettings,t)},ajaxPrefilter:H(be),ajaxTransport:H(we),ajax:function(t,e){function n(t,e,n,a){var l,c,v,y,w,C=e;if(2!==b){b=2;s&&clearTimeout(s);r=void 0;o=a||"";x.readyState=t>0?4:0;l=t>=200&&300>t||304===t;n&&(y=F(f,x,n));y=W(f,y,x,l);if(l){if(f.ifModified){w=x.getResponseHeader("Last-Modified");w&&(tt.lastModified[i]=w);w=x.getResponseHeader("etag");w&&(tt.etag[i]=w)}if(204===t||"HEAD"===f.type)C="nocontent";else if(304===t)C="notmodified";else{C=y.state;c=y.data;v=y.error;l=!v}}else{v=C;if(t||!C){C="error";0>t&&(t=0)}}x.status=t;x.statusText=(e||C)+"";l?p.resolveWith(h,[c,C,x]):p.rejectWith(h,[x,C,v]);x.statusCode(m);m=void 0;u&&d.trigger(l?"ajaxSuccess":"ajaxError",[x,f,l?c:v]);g.fireWith(h,[x,C]);if(u){d.trigger("ajaxComplete",[x,f]);--tt.active||tt.event.trigger("ajaxStop")}}}if("object"==typeof t){e=t;t=void 0}e=e||{};var r,i,o,a,s,l,u,c,f=tt.ajaxSetup({},e),h=f.context||f,d=f.context&&(h.nodeType||h.jquery)?tt(h):tt.event,p=tt.Deferred(),g=tt.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!a){a={};for(;e=pe.exec(o);)a[e[1].toLowerCase()]=e[2]}e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();if(!b){t=y[n]=y[n]||t;v[t]=e}return this},overrideMimeType:function(t){b||(f.mimeType=t);return this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)m[e]=[m[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||w;r&&r.abort(e);n(0,e);return this}};p.promise(x).complete=g.add;x.success=x.done;x.error=x.fail;f.url=((t||f.url||Ce)+"").replace(he,"").replace(ve,Se[1]+"//");f.type=e.method||e.type||f.method||f.type;f.dataTypes=tt.trim(f.dataType||"*").toLowerCase().match(pt)||[""];if(null==f.crossDomain){l=ye.exec(f.url.toLowerCase());f.crossDomain=!(!l||l[1]===Se[1]&&l[2]===Se[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(Se[3]||("http:"===Se[1]?"80":"443")))}f.data&&f.processData&&"string"!=typeof f.data&&(f.data=tt.param(f.data,f.traditional));O(be,f,e,x);if(2===b)return x;u=tt.event&&f.global;u&&0===tt.active++&&tt.event.trigger("ajaxStart");f.type=f.type.toUpperCase();f.hasContent=!me.test(f.type);i=f.url;if(!f.hasContent){if(f.data){i=f.url+=(fe.test(i)?"&":"?")+f.data;delete f.data}f.cache===!1&&(f.url=de.test(i)?i.replace(de,"$1_="+ce++):i+(fe.test(i)?"&":"?")+"_="+ce++)}if(f.ifModified){tt.lastModified[i]&&x.setRequestHeader("If-Modified-Since",tt.lastModified[i]);tt.etag[i]&&x.setRequestHeader("If-None-Match",tt.etag[i])}(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&x.setRequestHeader("Content-Type",f.contentType);x.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+xe+"; q=0.01":""):f.accepts["*"]);for(c in f.headers)x.setRequestHeader(c,f.headers[c]);if(f.beforeSend&&(f.beforeSend.call(h,x,f)===!1||2===b))return x.abort();w="abort";for(c in{success:1,error:1,complete:1})x[c](f[c]);r=O(we,f,e,x);if(r){x.readyState=1;u&&d.trigger("ajaxSend",[x,f]);f.async&&f.timeout>0&&(s=setTimeout(function(){x.abort("timeout")},f.timeout));try{b=1;r.send(v,n)}catch(C){if(!(2>b))throw C;n(-1,C)}}else n(-1,"No Transport");return x},getJSON:function(t,e,n){return tt.get(t,e,n,"json")},getScript:function(t,e){return tt.get(t,void 0,e,"script")}});tt.each(["get","post"],function(t,e){tt[e]=function(t,n,r,i){if(tt.isFunction(n)){i=i||r;r=n;n=void 0}return tt.ajax({url:t,type:e,dataType:i,data:n,success:r})}});tt._evalUrl=function(t){return tt.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})};tt.fn.extend({wrapAll:function(t){var e;if(tt.isFunction(t))return this.each(function(e){tt(this).wrapAll(t.call(this,e))});if(this[0]){e=tt(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]);e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)}return this},wrapInner:function(t){return this.each(tt.isFunction(t)?function(e){tt(this).wrapInner(t.call(this,e))}:function(){var e=tt(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=tt.isFunction(t);return this.each(function(n){tt(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){tt.nodeName(this,"body")||tt(this).replaceWith(this.childNodes)}).end()}});tt.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0};tt.expr.filters.visible=function(t){return!tt.expr.filters.hidden(t)};var Te=/%20/g,ke=/\[\]$/,Me=/\r?\n/g,_e=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;tt.param=function(t,e){var n,r=[],i=function(t,e){e=tt.isFunction(e)?e():null==e?"":e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};void 0===e&&(e=tt.ajaxSettings&&tt.ajaxSettings.traditional);if(tt.isArray(t)||t.jquery&&!tt.isPlainObject(t))tt.each(t,function(){i(this.name,this.value)});else for(n in t)z(n,t[n],e,i);return r.join("&").replace(Te,"+")};tt.fn.extend({serialize:function(){return tt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=tt.prop(this,"elements");return t?tt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!tt(this).is(":disabled")&&De.test(this.nodeName)&&!_e.test(t)&&(this.checked||!kt.test(t))}).map(function(t,e){var n=tt(this).val();return null==n?null:tt.isArray(n)?tt.map(n,function(t){return{name:e.name,value:t.replace(Me,"\r\n")}}):{name:e.name,value:n.replace(Me,"\r\n")}}).get()}});tt.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var Le=0,Ae={},Ne={0:200,1223:204},Ee=tt.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var t in Ae)Ae[t]()});K.cors=!!Ee&&"withCredentials"in Ee;K.ajax=Ee=!!Ee;tt.ajaxTransport(function(t){var e;return K.cors||Ee&&!t.crossDomain?{send:function(n,r){var i,o=t.xhr(),a=++Le;o.open(t.type,t.url,t.async,t.username,t.password);if(t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType);t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);e=function(t){return function(){if(e){delete Ae[a];e=o.onload=o.onerror=null;"abort"===t?o.abort():"error"===t?r(o.status,o.statusText):r(Ne[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders())}}};o.onload=e();o.onerror=e("error");e=Ae[a]=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(s){if(e)throw s}},abort:function(){e&&e()}}:void 0});tt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){tt.globalEval(t);return t}}});tt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1);t.crossDomain&&(t.type="GET")});tt.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(r,i){e=tt("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove();n=null;t&&i("error"===t.type?404:200,t.type)});Z.head.appendChild(e[0])},abort:function(){n&&n()}}}});var Pe=[],je=/(=)\?(?=&|$)|\?\?/;tt.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Pe.pop()||tt.expando+"_"+ce++;this[t]=!0;return t}});tt.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=t.jsonp!==!1&&(je.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&je.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0]){i=t.jsonpCallback=tt.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback;s?t[s]=t[s].replace(je,"$1"+i):t.jsonp!==!1&&(t.url+=(fe.test(t.url)?"&":"?")+t.jsonp+"="+i);t.converters["script json"]=function(){a||tt.error(i+" was not called");return a[0]};t.dataTypes[0]="json";o=e[i];e[i]=function(){a=arguments};r.always(function(){e[i]=o;if(t[i]){t.jsonpCallback=n.jsonpCallback;Pe.push(i)}a&&tt.isFunction(o)&&o(a[0]);a=o=void 0});return"script"}});tt.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;if("boolean"==typeof e){n=e;e=!1}e=e||Z;var r=st.exec(t),i=!n&&[];if(r)return[e.createElement(r[1])];r=tt.buildFragment([t],e,i);i&&i.length&&tt(i).remove();return tt.merge([],r.childNodes)};var Ie=tt.fn.load;tt.fn.load=function(t,e,n){if("string"!=typeof t&&Ie)return Ie.apply(this,arguments);var r,i,o,a=this,s=t.indexOf(" ");if(s>=0){r=tt.trim(t.slice(s));t=t.slice(0,s)}if(tt.isFunction(e)){n=e;e=void 0}else e&&"object"==typeof e&&(i="POST");a.length>0&&tt.ajax({url:t,type:i,dataType:"html",data:e}).done(function(t){o=arguments;a.html(r?tt("<div>").append(tt.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,o||[t.responseText,e,t])});return this};tt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){tt.fn[e]=function(t){return this.on(e,t)}});tt.expr.filters.animated=function(t){return tt.grep(tt.timers,function(e){return t===e.elem}).length};var He=e.document.documentElement;tt.offset={setOffset:function(t,e,n){var r,i,o,a,s,l,u,c=tt.css(t,"position"),f=tt(t),h={};"static"===c&&(t.style.position="relative");s=f.offset();o=tt.css(t,"top");l=tt.css(t,"left");u=("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1;if(u){r=f.position();a=r.top;i=r.left}else{a=parseFloat(o)||0;i=parseFloat(l)||0}tt.isFunction(e)&&(e=e.call(t,n,s));null!=e.top&&(h.top=e.top-s.top+a);null!=e.left&&(h.left=e.left-s.left+i);"using"in e?e.using.call(t,h):f.css(h)}};tt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){tt.offset.setOffset(this,t,e)});var e,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o){e=o.documentElement;if(!tt.contains(e,r))return i;typeof r.getBoundingClientRect!==Mt&&(i=r.getBoundingClientRect());n=q(o);return{top:i.top+n.pageYOffset-e.clientTop,left:i.left+n.pageXOffset-e.clientLeft}}},position:function(){if(this[0]){var t,e,n=this[0],r={top:0,left:0};if("fixed"===tt.css(n,"position"))e=n.getBoundingClientRect();else{t=this.offsetParent();e=this.offset();tt.nodeName(t[0],"html")||(r=t.offset());r.top+=tt.css(t[0],"borderTopWidth",!0);r.left+=tt.css(t[0],"borderLeftWidth",!0)}return{top:e.top-r.top-tt.css(n,"marginTop",!0),left:e.left-r.left-tt.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||He;t&&!tt.nodeName(t,"html")&&"static"===tt.css(t,"position");)t=t.offsetParent;return t||He})}});tt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;tt.fn[t]=function(i){return vt(this,function(t,i,o){var a=q(t);if(void 0===o)return a?a[n]:t[i];a?a.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o;return void 0},t,i,arguments.length,null)}});tt.each(["top","left"],function(t,e){tt.cssHooks[e]=S(K.pixelPosition,function(t,n){if(n){n=C(t,e);return Ut.test(n)?tt(t).position()[e]+"px":n}})});tt.each({Height:"height",Width:"width"},function(t,e){tt.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){tt.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return vt(this,function(e,n,r){var i;if(tt.isWindow(e))return e.document.documentElement["client"+t];if(9===e.nodeType){i=e.documentElement;return Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])}return void 0===r?tt.css(e,n,a):tt.style(e,n,r,a)},e,o?r:void 0,o,null)}})});tt.fn.size=function(){return this.length};tt.fn.andSelf=tt.fn.addBack;"function"==typeof t&&t.amd&&t("jquery",[],function(){return tt});var Oe=e.jQuery,Re=e.$;tt.noConflict=function(t){e.$===tt&&(e.$=Re);t&&e.jQuery===tt&&(e.jQuery=Oe);return tt};typeof n===Mt&&(e.jQuery=e.$=tt);return tt})},{}],20:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){return t.pivotUtilities.d3_renderers={Treemap:function(e,n){var r,i,o,a,s,l,u,c,f,h,d,p,g;o={localeStrings:{},d3:{width:function(){return t(window).width()/1.4},height:function(){return t(window).height()/1.4}}};n=t.extend(o,n);c=t("<div>").css({width:"100%",height:"100%"});h={name:"All",children:[]};r=function(t,e,n){var i,o,a,s,l,u;if(0!==e.length){null==t.children&&(t.children=[]);u=e.shift();l=t.children;for(o=0,a=l.length;a>o;o++){i=l[o];if(i.name===u){r(i,e,n);return}}s={name:u};r(s,e,n);return t.children.push(s)}t.value=n};u=e.getRowKeys();for(s=0,l=u.length;l>s;s++){f=u[s];p=e.getAggregator(f,[]).value();null!=p&&r(h,f,p)}i=d3.scale.category10();g=n.d3.width();a=n.d3.height();d=d3.layout.treemap().size([g,a]).sticky(!0).value(function(t){return t.size});d3.select(c[0]).append("div").style("position","relative").style("width",g+"px").style("height",a+"px").datum(h).selectAll(".node").data(d.padding([15,0,0,0]).value(function(t){return t.value}).nodes).enter().append("div").attr("class","node").style("background",function(t){return null!=t.children?"lightgrey":i(t.name)}).text(function(t){return t.name}).call(function(){this.style("left",function(t){return t.x+"px"}).style("top",function(t){return t.y+"px"}).style("width",function(t){ return Math.max(0,t.dx-1)+"px"}).style("height",function(t){return Math.max(0,t.dy-1)+"px"})});return c}}})}).call(this)},{jquery:19}],21:[function(e,n,r){(function(){var i;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e;e=function(e,n){return function(r,i){var o,a,s,l,u,c,f,h,d,p,g,m,v,y,b,w,x,C,S,T,k,M,_,D,L,A,N,E,P,j,I;h={localeStrings:{vs:"vs",by:"by"},gchart:{}};i=t.extend(!0,h,i);null==(a=i.gchart).width&&(a.width=window.innerWidth/1.4);null==(s=i.gchart).height&&(s.height=window.innerHeight/1.4);D=r.getRowKeys();0===D.length&&D.push([]);u=r.getColKeys();0===u.length&&u.push([]);d=r.aggregatorName;r.valAttrs.length&&(d+="("+r.valAttrs.join(", ")+")");v=function(){var t,e,n;n=[];for(t=0,e=D.length;e>t;t++){g=D[t];n.push(g.join("-"))}return n}();v.unshift("");C=0;if("ScatterChart"===e){c=[];T=r.tree;for(I in T){A=T[I];for(j in A){o=A[j];c.push([parseFloat(j),parseFloat(I),d+": \n"+o.format(o.value())])}}f=new google.visualization.DataTable;f.addColumn("number",r.colAttrs.join("-"));f.addColumn("number",r.rowAttrs.join("-"));f.addColumn({type:"string",role:"tooltip"});f.addRows(c);m=r.colAttrs.join("-");N=r.rowAttrs.join("-");L=""}else{c=[v];for(y=0,w=u.length;w>y;y++){l=u[y];M=[l.join("-")];C+=M[0].length;for(b=0,x=D.length;x>b;b++){_=D[b];o=r.getAggregator(_,l);if(null!=o.value()){E=o.value();M.push(t.isNumeric(E)?1>E?parseFloat(E.toPrecision(3)):parseFloat(E.toFixed(3)):E)}else M.push(null)}c.push(M)}f=google.visualization.arrayToDataTable(c);L=N=d;m=r.colAttrs.join("-");""!==m&&(L+=" "+i.localeStrings.vs+" "+m);p=r.rowAttrs.join("-");""!==p&&(L+=" "+i.localeStrings.by+" "+p)}S={title:L,hAxis:{title:m,slantedText:C>50},vAxis:{title:N},tooltip:{textStyle:{fontName:"Arial",fontSize:12}}};"ColumnChart"===e&&(S.vAxis.minValue=0);if("ScatterChart"===e){S.legend={position:"none"};S.chartArea={width:"80%",height:"80%"}}else 2===c[0].length&&""===c[0][1]&&(S.legend={position:"none"});t.extend(S,i.gchart,n);k=t("<div>").css({width:"100%",height:"100%"});P=new google.visualization.ChartWrapper({dataTable:f,chartType:e,options:S});P.draw(k[0]);k.bind("dblclick",function(){var t;t=new google.visualization.ChartEditor;google.visualization.events.addListener(t,"ok",function(){return t.getChartWrapper().draw(k[0])});return t.openDialog(P)});return k}};return t.pivotUtilities.gchart_renderers={"Line Chart":e("LineChart"),"Bar Chart":e("ColumnChart"),"Stacked Bar Chart":e("ColumnChart",{isStacked:!0}),"Area Chart":e("AreaChart",{isStacked:!0}),"Scatter Chart":e("ScatterChart")}})}).call(this)},{jquery:19}],22:[function(e,n,r){(function(){var i,o=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=[].slice,s=function(t,e){return function(){return t.apply(e,arguments)}},l={}.hasOwnProperty;i=function(i){return"object"==typeof r&&"object"==typeof n?i(e("jquery")):"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)};i(function(t){var e,n,r,i,u,c,f,h,d,p,g,m,v,y,b,w,x,C;n=function(t,e,n){var r,i,o,a;t+="";i=t.split(".");o=i[0];a=i.length>1?n+i[1]:"";r=/(\d+)(\d{3})/;for(;r.test(o);)o=o.replace(r,"$1"+e+"$2");return o+a};g=function(e){var r;r={digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:"",showZero:!1};e=t.extend(r,e);return function(t){var r;if(isNaN(t)||!isFinite(t))return"";if(0===t&&!e.showZero)return"";r=n((e.scaler*t).toFixed(e.digitsAfterDecimal),e.thousandsSep,e.decimalSep);return""+e.prefix+r+e.suffix}};b=g();w=g({digitsAfterDecimal:0});x=g({digitsAfterDecimal:1,scaler:100,suffix:"%"});r={count:function(t){null==t&&(t=w);return function(){return function(e,n,r){return{count:0,push:function(){return this.count++},value:function(){return this.count},format:t}}}},countUnique:function(t){null==t&&(t=w);return function(e){var n;n=e[0];return function(e,r,i){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.length},format:t,numInputs:null!=n?0:1}}}},listUnique:function(t){return function(e){var n;n=e[0];return function(e,r,i){return{uniq:[],push:function(t){var e;return e=t[n],o.call(this.uniq,e)<0?this.uniq.push(t[n]):void 0},value:function(){return this.uniq.join(t)},format:function(t){return t},numInputs:null!=n?0:1}}}},sum:function(t){null==t&&(t=b);return function(e){var n;n=e[0];return function(e,r,i){return{sum:0,push:function(t){return isNaN(parseFloat(t[n]))?void 0:this.sum+=parseFloat(t[n])},value:function(){return this.sum},format:t,numInputs:null!=n?0:1}}}},min:function(t){null==t&&(t=b);return function(e){var n;n=e[0];return function(e,r,i){return{val:null,push:function(t){var e,r;r=parseFloat(t[n]);return isNaN(r)?void 0:this.val=Math.min(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},max:function(t){null==t&&(t=b);return function(e){var n;n=e[0];return function(e,r,i){return{val:null,push:function(t){var e,r;r=parseFloat(t[n]);return isNaN(r)?void 0:this.val=Math.max(r,null!=(e=this.val)?e:r)},value:function(){return this.val},format:t,numInputs:null!=n?0:1}}}},average:function(t){null==t&&(t=b);return function(e){var n;n=e[0];return function(e,r,i){return{sum:0,len:0,push:function(t){if(!isNaN(parseFloat(t[n]))){this.sum+=parseFloat(t[n]);return this.len++}},value:function(){return this.sum/this.len},format:t,numInputs:null!=n?0:1}}}},sumOverSum:function(t){null==t&&(t=b);return function(e){var n,r;r=e[0],n=e[1];return function(e,i,o){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[r]))||(this.sumNum+=parseFloat(t[r]));return isNaN(parseFloat(t[n]))?void 0:this.sumDenom+=parseFloat(t[n])},value:function(){return this.sumNum/this.sumDenom},format:t,numInputs:null!=r&&null!=n?0:2}}}},sumOverSumBound80:function(t,e){null==t&&(t=!0);null==e&&(e=b);return function(n){var r,i;i=n[0],r=n[1];return function(n,o,a){return{sumNum:0,sumDenom:0,push:function(t){isNaN(parseFloat(t[i]))||(this.sumNum+=parseFloat(t[i]));return isNaN(parseFloat(t[r]))?void 0:this.sumDenom+=parseFloat(t[r])},value:function(){var e;e=t?1:-1;return(.821187207574908/this.sumDenom+this.sumNum/this.sumDenom+1.2815515655446004*e*Math.sqrt(.410593603787454/(this.sumDenom*this.sumDenom)+this.sumNum*(1-this.sumNum/this.sumDenom)/(this.sumDenom*this.sumDenom)))/(1+1.642374415149816/this.sumDenom)},format:e,numInputs:null!=i&&null!=r?0:2}}}},fractionOf:function(t,e,n){null==e&&(e="total");null==n&&(n=x);return function(){var r;r=1<=arguments.length?a.call(arguments,0):[];return function(i,o,a){return{selector:{total:[[],[]],row:[o,[]],col:[[],a]}[e],inner:t.apply(null,r)(i,o,a),push:function(t){return this.inner.push(t)},format:n,value:function(){return this.inner.value()/i.getAggregator.apply(i,this.selector).inner.value()},numInputs:t.apply(null,r)().numInputs}}}}};i=function(t){return{Count:t.count(w),"Count Unique Values":t.countUnique(w),"List Unique Values":t.listUnique(", "),Sum:t.sum(b),"Integer Sum":t.sum(w),Average:t.average(b),Minimum:t.min(b),Maximum:t.max(b),"Sum over Sum":t.sumOverSum(b),"80% Upper Bound":t.sumOverSumBound80(!0,b),"80% Lower Bound":t.sumOverSumBound80(!1,b),"Sum as Fraction of Total":t.fractionOf(t.sum(),"total",x),"Sum as Fraction of Rows":t.fractionOf(t.sum(),"row",x),"Sum as Fraction of Columns":t.fractionOf(t.sum(),"col",x),"Count as Fraction of Total":t.fractionOf(t.count(),"total",x),"Count as Fraction of Rows":t.fractionOf(t.count(),"row",x),"Count as Fraction of Columns":t.fractionOf(t.count(),"col",x)}}(r);v={Table:function(t,e){return m(t,e)},"Table Barchart":function(e,n){return t(m(e,n)).barchart()},Heatmap:function(e,n){return t(m(e,n)).heatmap()},"Row Heatmap":function(e,n){return t(m(e,n)).heatmap("rowheatmap")},"Col Heatmap":function(e,n){return t(m(e,n)).heatmap("colheatmap")}};h={en:{aggregators:i,renderers:v,localeStrings:{renderError:"An error occurred rendering the PivotTable results.",computeError:"An error occurred computing the PivotTable results.",uiRenderError:"An error occurred rendering the PivotTable UI.",selectAll:"Select All",selectNone:"Select None",tooMany:"(too many to list)",filterResults:"Filter results",totals:"Totals",vs:"vs",by:"by"}}};d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];C=function(t){return("0"+t).substr(-2,2)};c={bin:function(t,e){return function(n){return n[t]-n[t]%e}},dateFormat:function(t,e,n,r,i){var o;null==n&&(n=!1);null==r&&(r=d);null==i&&(i=u);o=n?"UTC":"";return function(n){var a;a=new Date(Date.parse(n[t]));return isNaN(a)?"":e.replace(/%(.)/g,function(t,e){switch(e){case"y":return a["get"+o+"FullYear"]();case"m":return C(a["get"+o+"Month"]()+1);case"n":return r[a["get"+o+"Month"]()];case"d":return C(a["get"+o+"Date"]());case"w":return i[a["get"+o+"Day"]()];case"x":return a["get"+o+"Day"]();case"H":return C(a["get"+o+"Hours"]());case"M":return C(a["get"+o+"Minutes"]());case"S":return C(a["get"+o+"Seconds"]());default:return"%"+e}})}}};p=function(t){return function(t,e){var n,r,i,o,a,s,l;s=/(\d+)|(\D+)/g;a=/\d/;l=/^0/;if("number"==typeof t||"number"==typeof e)return isNaN(t)?1:isNaN(e)?-1:t-e;n=String(t).toLowerCase();i=String(e).toLowerCase();if(n===i)return 0;if(!a.test(n)||!a.test(i))return n>i?1:-1;n=n.match(s);i=i.match(s);for(;n.length&&i.length;){r=n.shift();o=i.shift();if(r!==o)return a.test(r)&&a.test(o)?r.replace(l,".0")-o.replace(l,".0"):r>o?1:-1}return n.length-i.length}}(this);y=function(t){var e,n,r;n={};for(e in t){r=t[e];n[r]=e}return function(t,e){return null!=n[t]&&null!=n[e]?n[t]-n[e]:null!=n[t]?-1:null!=n[e]?1:p(t,e)}};f=function(e,n){var r;r=e(n);return t.isFunction(r)?r:p};t.pivotUtilities={aggregatorTemplates:r,aggregators:i,renderers:v,derivers:c,locales:h,naturalSort:p,numberFormat:g,sortAs:y};e=function(){function e(t,n){this.getAggregator=s(this.getAggregator,this);this.getRowKeys=s(this.getRowKeys,this);this.getColKeys=s(this.getColKeys,this);this.sortKeys=s(this.sortKeys,this);this.arrSort=s(this.arrSort,this);this.aggregator=n.aggregator;this.aggregatorName=n.aggregatorName;this.colAttrs=n.cols;this.rowAttrs=n.rows;this.valAttrs=n.vals;this.sorters=n.sorters;this.tree={};this.rowKeys=[];this.colKeys=[];this.rowTotals={};this.colTotals={};this.allTotal=this.aggregator(this,[],[]);this.sorted=!1;e.forEachRecord(t,n.derivedAttributes,function(t){return function(e){return n.filter(e)?t.processRecord(e):void 0}}(this))}e.forEachRecord=function(e,n,r){var i,o,a,s,u,c,f,h,d,p,g,m;i=t.isEmptyObject(n)?r:function(t){var e,i,o;for(e in n){o=n[e];t[e]=null!=(i=o(t))?i:t[e]}return r(t)};if(t.isFunction(e))return e(i);if(t.isArray(e)){if(t.isArray(e[0])){p=[];for(a in e)if(l.call(e,a)){o=e[a];if(a>0){h={};d=e[0];for(s in d)if(l.call(d,s)){u=d[s];h[u]=o[s]}p.push(i(h))}}return p}g=[];for(c=0,f=e.length;f>c;c++){h=e[c];g.push(i(h))}return g}if(e instanceof jQuery){m=[];t("thead > tr > th",e).each(function(e){return m.push(t(this).text())});return t("tbody > tr",e).each(function(e){h={};t("td",this).each(function(e){return h[m[e]]=t(this).html()});return i(h)})}throw new Error("unknown input format")};e.convertToArray=function(t){var n;n=[];e.forEachRecord(t,{},function(t){return n.push(t)});return n};e.prototype.arrSort=function(t){var e,n;n=function(){var n,r,i;i=[];for(n=0,r=t.length;r>n;n++){e=t[n];i.push(f(this.sorters,e))}return i}.call(this);return function(t,e){var r,i,o;for(i in n){o=n[i];r=o(t[i],e[i]);if(0!==r)return r}return 0}};e.prototype.sortKeys=function(){if(!this.sorted){this.sorted=!0;this.rowKeys.sort(this.arrSort(this.rowAttrs));return this.colKeys.sort(this.arrSort(this.colAttrs))}};e.prototype.getColKeys=function(){this.sortKeys();return this.colKeys};e.prototype.getRowKeys=function(){this.sortKeys();return this.rowKeys};e.prototype.processRecord=function(t){var e,n,r,i,o,a,s,l,u,c,f,h,d;e=[];h=[];l=this.colAttrs;for(i=0,o=l.length;o>i;i++){d=l[i];e.push(null!=(u=t[d])?u:"null")}c=this.rowAttrs;for(s=0,a=c.length;a>s;s++){d=c[s];h.push(null!=(f=t[d])?f:"null")}r=h.join(String.fromCharCode(0));n=e.join(String.fromCharCode(0));this.allTotal.push(t);if(0!==h.length){if(!this.rowTotals[r]){this.rowKeys.push(h);this.rowTotals[r]=this.aggregator(this,h,[])}this.rowTotals[r].push(t)}if(0!==e.length){if(!this.colTotals[n]){this.colKeys.push(e);this.colTotals[n]=this.aggregator(this,[],e)}this.colTotals[n].push(t)}if(0!==e.length&&0!==h.length){this.tree[r]||(this.tree[r]={});this.tree[r][n]||(this.tree[r][n]=this.aggregator(this,h,e));return this.tree[r][n].push(t)}};e.prototype.getAggregator=function(t,e){var n,r,i;i=t.join(String.fromCharCode(0));r=e.join(String.fromCharCode(0));n=0===t.length&&0===e.length?this.allTotal:0===t.length?this.colTotals[r]:0===e.length?this.rowTotals[i]:this.tree[i][r];return null!=n?n:{value:function(){return null},format:function(){return""}}};return e}();m=function(e,n){var r,i,o,a,s,u,c,f,h,d,p,g,m,v,y,b,w,x,C,S,T;u={localeStrings:{totals:"Totals"}};n=t.extend(u,n);o=e.colAttrs;p=e.rowAttrs;m=e.getRowKeys();s=e.getColKeys();d=document.createElement("table");d.className="pvtTable";v=function(t,e,n){var r,i,o,a,s,l,u,c;if(0!==e){a=!0;for(c=r=0,s=n;s>=0?s>=r:r>=s;c=s>=0?++r:--r)t[e-1][c]!==t[e][c]&&(a=!1);if(a)return-1}i=0;for(;e+i<t.length;){u=!1;for(c=o=0,l=n;l>=0?l>=o:o>=l;c=l>=0?++o:--o)t[e][c]!==t[e+i][c]&&(u=!0);if(u)break;i++}return i};for(f in o)if(l.call(o,f)){i=o[f];x=document.createElement("tr");if(0===parseInt(f)&&0!==p.length){b=document.createElement("th");b.setAttribute("colspan",p.length);b.setAttribute("rowspan",o.length);x.appendChild(b)}b=document.createElement("th");b.className="pvtAxisLabel";b.innerHTML=i;x.appendChild(b);for(c in s)if(l.call(s,c)){a=s[c];T=v(s,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtColLabel";b.innerHTML=a[f];b.setAttribute("colspan",T);parseInt(f)===o.length-1&&0!==p.length&&b.setAttribute("rowspan",2);x.appendChild(b)}}if(0===parseInt(f)){b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("rowspan",o.length+(0===p.length?0:1));x.appendChild(b)}d.appendChild(x)}if(0!==p.length){x=document.createElement("tr");for(c in p)if(l.call(p,c)){h=p[c];b=document.createElement("th");b.className="pvtAxisLabel";b.innerHTML=h;x.appendChild(b)}b=document.createElement("th");if(0===o.length){b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals}x.appendChild(b);d.appendChild(x)}for(c in m)if(l.call(m,c)){g=m[c];x=document.createElement("tr");for(f in g)if(l.call(g,f)){C=g[f];T=v(m,parseInt(c),parseInt(f));if(-1!==T){b=document.createElement("th");b.className="pvtRowLabel";b.innerHTML=C;b.setAttribute("rowspan",T);parseInt(f)===p.length-1&&0!==o.length&&b.setAttribute("colspan",2);x.appendChild(b)}}for(f in s)if(l.call(s,f)){a=s[f];r=e.getAggregator(g,a);S=r.value();y=document.createElement("td");y.className="pvtVal row"+c+" col"+f;y.innerHTML=r.format(S);y.setAttribute("data-value",S);x.appendChild(y)}w=e.getAggregator(g,[]);S=w.value();y=document.createElement("td");y.className="pvtTotal rowTotal";y.innerHTML=w.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","row"+c);x.appendChild(y);d.appendChild(x)}x=document.createElement("tr");b=document.createElement("th");b.className="pvtTotalLabel";b.innerHTML=n.localeStrings.totals;b.setAttribute("colspan",p.length+(0===o.length?0:1));x.appendChild(b);for(f in s)if(l.call(s,f)){a=s[f];w=e.getAggregator([],a);S=w.value();y=document.createElement("td");y.className="pvtTotal colTotal";y.innerHTML=w.format(S);y.setAttribute("data-value",S);y.setAttribute("data-for","col"+f);x.appendChild(y)}w=e.getAggregator([],[]);S=w.value();y=document.createElement("td");y.className="pvtGrandTotal";y.innerHTML=w.format(S);y.setAttribute("data-value",S);x.appendChild(y);d.appendChild(x);d.setAttribute("data-numrows",m.length);d.setAttribute("data-numcols",s.length);return d};t.fn.pivot=function(n,i){var o,a,s,l,u;o={cols:[],rows:[],vals:[],filter:function(){return!0},aggregator:r.count()(),aggregatorName:"Count",sorters:function(){},derivedAttributes:{},renderer:m,rendererOptions:null,localeStrings:h.en.localeStrings};i=t.extend(o,i);l=null;try{s=new e(n,i);try{l=i.renderer(s,i.rendererOptions)}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.renderError)}}catch(c){a=c;"undefined"!=typeof console&&null!==console&&console.error(a.stack);l=t("<span>").html(i.localeStrings.computeError)}u=this[0];for(;u.hasChildNodes();)u.removeChild(u.lastChild);return this.append(l)};t.fn.pivotUI=function(n,r,i,a){var s,u,c,d,g,m,v,y,b,w,x,C,S,T,k,M,_,D,L,A,N,E,P,j,I,H,O,R,F,W,z,q,U,B,V,X,G,Y,$,J;null==i&&(i=!1);null==a&&(a="en");null==h[a]&&(a="en");v={derivedAttributes:{},aggregators:h[a].aggregators,renderers:h[a].renderers,hiddenAttributes:[],menuLimit:200,cols:[],rows:[],vals:[],exclusions:{},inclusions:{},unusedAttrsVertical:85,autoSortUnusedAttrs:!1,rendererOptions:{localeStrings:h[a].localeStrings},onRefresh:null,filter:function(){return!0},sorters:function(){},localeStrings:h[a].localeStrings};b=this.data("pivotUIOptions");N=null==b||i?t.extend(v,r):b;try{n=e.convertToArray(n);B=function(){var t,e;t=n[0];e=[];for(S in t)l.call(t,S)&&e.push(S);return e}();j=N.derivedAttributes;for(g in j)l.call(j,g)&&o.call(B,g)<0&&B.push(g);d={};for(T=0,k=B.length;k>T;T++){J=B[T];d[J]={}}e.forEachRecord(n,N.derivedAttributes,function(t){var e,n,r;n=[];for(S in t)if(l.call(t,S)){r=t[S];if(N.filter(t)){null==r&&(r="null");null==(e=d[S])[r]&&(e[r]=0);n.push(d[S][r]++)}}return n});G=t("<table>",{"class":"pvtUi"}).attr("cellpadding",5);q=t("<td>");z=t("<select>").addClass("pvtRenderer").appendTo(q).bind("change",function(){return F()});I=N.renderers;for(J in I)l.call(I,J)&&t("<option>").val(J).html(J).appendTo(z);m=t("<td>").addClass("pvtAxisContainer pvtUnused");U=function(){var t,e,n;n=[];for(e=0,t=B.length;t>e;e++){g=B[e];o.call(N.hiddenAttributes,g)<0&&n.push(g)}return n}();$=!1;Y="auto"===N.unusedAttrsVertical?120:parseInt(N.unusedAttrsVertical);if(!isNaN(Y)){c=0;for(L=0,M=U.length;M>L;L++){s=U[L];c+=s.length}$=c>Y}m.addClass(N.unusedAttrsVertical===!0||$?"pvtVertList":"pvtHorizList");w=function(e){var n,r,i,a,s,l,u,c,h,p,g,v,y,b,w;u=function(){var t;t=[];for(S in d[e])t.push(S);return t}();l=!1;w=t("<div>").addClass("pvtFilterBox").hide();w.append(t("<h4>").text(e+" ("+u.length+")"));if(u.length>N.menuLimit)w.append(t("<p>").html(N.localeStrings.tooMany));else{r=t("<p>").appendTo(w);r.append(t("<button>",{type:"button"}).html(N.localeStrings.selectAll).bind("click",function(){return w.find("input:visible").prop("checked",!0)}));r.append(t("<button>",{type:"button"}).html(N.localeStrings.selectNone).bind("click",function(){return w.find("input:visible").prop("checked",!1)}));r.append(t("<br>"));r.append(t("<input>",{type:"text",placeholder:N.localeStrings.filterResults,"class":"pvtSearch"}).bind("keyup",function(){var e;e=t(this).val().toLowerCase();return w.find(".pvtCheckContainer p").each(function(){var n;n=t(this).text().toLowerCase().indexOf(e);return-1!==n?t(this).show():t(this).hide()})}));i=t("<div>").addClass("pvtCheckContainer").appendTo(w);p=u.sort(f(N.sorters,e));for(h=0,c=p.length;c>h;h++){S=p[h];b=d[e][S];a=t("<label>");s=!1;N.inclusions[e]?s=o.call(N.inclusions[e],S)<0:N.exclusions[e]&&(s=o.call(N.exclusions[e],S)>=0);l||(l=s);t("<input>").attr("type","checkbox").addClass("pvtFilter").attr("checked",!s).data("filter",[e,S]).appendTo(a);a.append(t("<span>").html(S));a.append(t("<span>").text(" ("+b+")"));i.append(t("<p>").append(a))}}y=function(){var t;t=w.find("[type='checkbox']").length-w.find("[type='checkbox']:checked").length;t>0?n.addClass("pvtFilteredAttribute"):n.removeClass("pvtFilteredAttribute");return u.length>N.menuLimit?w.toggle():w.toggle(0,F)};t("<p>").appendTo(w).append(t("<button>",{type:"button"}).text("OK").bind("click",y));g=function(e){var n,r,i;i=t(e.currentTarget).position(),n=i.left,r=i.top;w.css({left:n+10,top:r+10}).toggle();w.find(".pvtSearch").val("");return w.find(".pvtCheckContainer p").show()};v=t("<span>").addClass("pvtTriangle").html(" &#x25BE;").bind("click",g);n=t("<li>").addClass("axis_"+x).append(t("<span>").addClass("pvtAttr").text(e).data("attrName",e).append(v));l&&n.addClass("pvtFilteredAttribute");m.append(n).append(w);return n.bind("dblclick",g)};for(x in U)if(l.call(U,x)){g=U[x];w(g)}V=t("<tr>").appendTo(G);u=t("<select>").addClass("pvtAggregator").bind("change",function(){return F()});H=N.aggregators;for(J in H)l.call(H,J)&&u.append(t("<option>").val(J).html(J));t("<td>").addClass("pvtVals").appendTo(V).append(u).append(t("<br>"));t("<td>").addClass("pvtAxisContainer pvtHorizList pvtCols").appendTo(V);X=t("<tr>").appendTo(G);X.append(t("<td>").addClass("pvtAxisContainer pvtRows").attr("valign","top"));E=t("<td>").attr("valign","top").addClass("pvtRendererArea").appendTo(X);if(N.unusedAttrsVertical===!0||$){G.find("tr:nth-child(1)").prepend(q);G.find("tr:nth-child(2)").prepend(m)}else G.prepend(t("<tr>").append(q).append(m));this.html(G);O=N.cols;for(A=0,_=O.length;_>A;A++){J=O[A];this.find(".pvtCols").append(this.find(".axis_"+t.inArray(J,U)))}R=N.rows;for(P=0,D=R.length;D>P;P++){J=R[P];this.find(".pvtRows").append(this.find(".axis_"+t.inArray(J,U)))}null!=N.aggregatorName&&this.find(".pvtAggregator").val(N.aggregatorName);null!=N.rendererName&&this.find(".pvtRenderer").val(N.rendererName);C=!0;W=function(e){return function(){var r,i,a,s,l,c,f,h,d,g,m,v,y,b,w;v={derivedAttributes:N.derivedAttributes,localeStrings:N.localeStrings,rendererOptions:N.rendererOptions,sorters:N.sorters,cols:[],rows:[]};c=null!=(d=N.aggregators[u.val()]([])().numInputs)?d:0;w=[];e.find(".pvtRows li span.pvtAttr").each(function(){return v.rows.push(t(this).data("attrName"))});e.find(".pvtCols li span.pvtAttr").each(function(){return v.cols.push(t(this).data("attrName"))});e.find(".pvtVals select.pvtAttrDropdown").each(function(){if(0===c)return t(this).remove();c--;return""!==t(this).val()?w.push(t(this).val()):void 0});if(0!==c){h=e.find(".pvtVals");for(J=m=0,g=c;g>=0?g>m:m>g;J=g>=0?++m:--m){l=t("<select>").addClass("pvtAttrDropdown").append(t("<option>")).bind("change",function(){return F()});for(y=0,s=U.length;s>y;y++){r=U[y];l.append(t("<option>").val(r).text(r))}h.append(l)}}if(C){w=N.vals;x=0;e.find(".pvtVals select.pvtAttrDropdown").each(function(){t(this).val(w[x]);return x++});C=!1}v.aggregatorName=u.val();v.vals=w;v.aggregator=N.aggregators[u.val()](w);v.renderer=N.renderers[z.val()];i={};e.find("input.pvtFilter").not(":checked").each(function(){var e;e=t(this).data("filter");return null!=i[e[0]]?i[e[0]].push(e[1]):i[e[0]]=[e[1]]});a={};e.find("input.pvtFilter:checked").each(function(){var e;e=t(this).data("filter");return null!=i[e[0]]?null!=a[e[0]]?a[e[0]].push(e[1]):a[e[0]]=[e[1]]:void 0});v.filter=function(t){var e,n;if(!N.filter(t))return!1;for(S in i){e=i[S];if(n=""+t[S],o.call(e,n)>=0)return!1}return!0};E.pivot(n,v);f=t.extend(N,{cols:v.cols,rows:v.rows,vals:w,exclusions:i,inclusions:a,inclusionsInfo:a,aggregatorName:u.val(),rendererName:z.val()});e.data("pivotUIOptions",f);if(N.autoSortUnusedAttrs){b=e.find("td.pvtUnused.pvtAxisContainer");t(b).children("li").sort(function(e,n){return p(t(e).text(),t(n).text())}).appendTo(b)}E.css("opacity",1);return null!=N.onRefresh?N.onRefresh(f):void 0}}(this);F=function(t){return function(){E.css("opacity",.5);return setTimeout(W,10)}}(this);F();this.find(".pvtAxisContainer").sortable({update:function(t,e){return null==e.sender?F():void 0},connectWith:this.find(".pvtAxisContainer"),items:"li",placeholder:"pvtPlaceholder"})}catch(K){y=K;"undefined"!=typeof console&&null!==console&&console.error(y.stack);this.html(N.localeStrings.uiRenderError)}return this};t.fn.heatmap=function(e){var n,r,i,o,a,s,l,u,c,f;null==e&&(e="heatmap");u=this.data("numrows");l=this.data("numcols");n=function(t,e,n){var r;r=function(){switch(t){case"red":return function(t){return"ff"+t+t};case"green":return function(t){return t+"ff"+t};case"blue":return function(t){return""+t+t+"ff"}}}();return function(t){var i,o;o=255-Math.round(255*(t-e)/(n-e));i=o.toString(16).split(".")[0];1===i.length&&(i=0+i);return r(i)}};r=function(e){return function(r,i){var o,a,s;a=function(n){return e.find(r).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?n(e,t(this)):void 0})};s=[];a(function(t){return s.push(t)});o=n(i,Math.min.apply(Math,s),Math.max.apply(Math,s));return a(function(t,e){return e.css("background-color","#"+o(t))})}}(this);switch(e){case"heatmap":r(".pvtVal","red");break;case"rowheatmap":for(i=a=0,c=u;c>=0?c>a:a>c;i=c>=0?++a:--a)r(".pvtVal.row"+i,"red");break;case"colheatmap":for(o=s=0,f=l;f>=0?f>s:s>f;o=f>=0?++s:--s)r(".pvtVal.col"+o,"red")}r(".pvtTotal.rowTotal","red");r(".pvtTotal.colTotal","red");return this};return t.fn.barchart=function(){var e,n,r,i,o,a;o=this.data("numrows");i=this.data("numcols");e=function(e){return function(n){var r,i,o,a;r=function(r){return e.find(n).each(function(){var e;e=t(this).data("value");return null!=e&&isFinite(e)?r(e,t(this)):void 0})};a=[];r(function(t){return a.push(t)});i=Math.max.apply(Math,a);o=function(t){return 100*t/(1.4*i)};return r(function(e,n){var r,i;r=n.text();i=t("<div>").css({position:"relative",height:"55px"});i.append(t("<div>").css({position:"absolute",bottom:0,left:0,right:0,height:o(e)+"%","background-color":"gray"}));i.append(t("<div>").text(r).css({position:"relative","padding-left":"5px","padding-right":"5px"}));return n.css({padding:0,"padding-top":"5px","text-align":"center"}).html(i)})}}(this);for(n=r=0,a=o;a>=0?a>r:r>a;n=a>=0?++r:--r)e(".pvtVal.row"+n);e(".pvtTotal.colTotal");return this}})}).call(this)},{jquery:19}],23:[function(e,n,r){(function(e){function r(){try{return l in e&&e[l]}catch(t){return!1}}function i(t){return t.replace(/^d/,"___$&").replace(p,"___")}var o,a={},s=e.document,l="localStorage",u="script";a.disabled=!1;a.version="1.3.17";a.set=function(t,e){};a.get=function(t,e){};a.has=function(t){return void 0!==a.get(t)};a.remove=function(t){};a.clear=function(){};a.transact=function(t,e,n){if(null==n){n=e;e=null}null==e&&(e={});var r=a.get(t,e);n(r);a.set(t,r)};a.getAll=function(){};a.forEach=function(){};a.serialize=function(t){return JSON.stringify(t)};a.deserialize=function(t){if("string"!=typeof t)return void 0;try{return JSON.parse(t)}catch(e){return t||void 0}};if(r()){o=e[l];a.set=function(t,e){if(void 0===e)return a.remove(t);o.setItem(t,a.serialize(e));return e};a.get=function(t,e){var n=a.deserialize(o.getItem(t));return void 0===n?e:n};a.remove=function(t){o.removeItem(t)};a.clear=function(){o.clear()};a.getAll=function(){var t={};a.forEach(function(e,n){t[e]=n});return t};a.forEach=function(t){for(var e=0;e<o.length;e++){var n=o.key(e);t(n,a.get(n))}}}else if(s.documentElement.addBehavior){var c,f;try{f=new ActiveXObject("htmlfile");f.open();f.write("<"+u+">document.w=window</"+u+'><iframe src="/favicon.ico"></iframe>');f.close();c=f.w.frames[0].document;o=c.createElement("div")}catch(h){o=s.createElement("div");c=s.body}var d=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);e.unshift(o);c.appendChild(o);o.addBehavior("#default#userData");o.load(l);var n=t.apply(a,e);c.removeChild(o);return n}},p=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=d(function(t,e,n){e=i(e);if(void 0===n)return a.remove(e);t.setAttribute(e,a.serialize(n));t.save(l);return n});a.get=d(function(t,e,n){e=i(e);var r=a.deserialize(t.getAttribute(e));return void 0===r?n:r});a.remove=d(function(t,e){e=i(e);t.removeAttribute(e);t.save(l)});a.clear=d(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(l);for(var n,r=0;n=e[r];r++)t.removeAttribute(n.name);t.save(l)});a.getAll=function(t){var e={};a.forEach(function(t,n){e[t]=n});return e};a.forEach=d(function(t,e){for(var n,r=t.XMLDocument.documentElement.attributes,i=0;n=r[i];++i)e(n.name,a.deserialize(t.getAttribute(n.name)))})}try{var g="__storejs__";a.set(g,g);a.get(g)!=g&&(a.disabled=!0);a.remove(g)}catch(h){a.disabled=!0}a.enabled=!a.disabled;"undefined"!=typeof n&&n.exports&&this.module!==n?n.exports=a:"function"==typeof t&&t.amd?t(a):e.store=a})(Function("return this")())},{}],24:[function(t,e,n){e.exports={name:"yasgui-utils",version:"1.6.0",description:"Utils for YASGUI libs",main:"src/main.js",repository:{type:"git",url:"git://github.com/YASGUI/Utils.git"},licenses:[{type:"MIT",url:"http://yasgui.github.io/license.txt"}],author:{name:"Laurens Rietveld"},maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",url:"http://laurensrietveld.nl"}],bugs:{url:"https://github.com/YASGUI/Utils/issues"},homepage:"https://github.com/YASGUI/Utils",dependencies:{store:"^1.3.14"},readme:"A simple utils repo for the YASGUI tools\n",readmeFilename:"README.md",_id:"yasgui-utils@1.6.0",_from:"yasgui-utils@>=1.4.1 <2.0.0"}},{}],25:[function(t,e,n){window.console=window.console||{log:function(){}};e.exports={storage:t("./storage.js"),svg:t("./svg.js"),version:{"yasgui-utils":t("../package.json").version},nestedExists:function(t){for(var e=Array.prototype.slice.call(arguments,1),n=0;n<e.length;n++){if(!t||!t.hasOwnProperty(e[n]))return!1;t=t[e[n]]}return!0}}},{"../package.json":24,"./storage.js":26,"./svg.js":27}],26:[function(t,e,n){var r=t("store"),i={day:function(){return 864e5},month:function(){30*i.day()},year:function(){12*i.month()}},o=e.exports={set:function(t,e,n){if(r.enabled&&t&&void 0!==e){"string"==typeof n&&(n=i[n]());e.documentElement&&(e=(new XMLSerializer).serializeToString(e.documentElement));r.set(t,{val:e,exp:n,time:(new Date).getTime()})}},remove:function(t){r.enabled&&t&&r.remove(t)},removeAll:function(t){if(r.enabled&&"function"==typeof t)for(var e in r.getAll())t(e,o.get(e))&&o.remove(e)},get:function(t){if(!r.enabled)return null;if(t){var e=r.get(t);return e?e.exp&&(new Date).getTime()-e.time>e.exp?null:e.val:null}return null}}},{store:23}],27:[function(t,e,n){e.exports={draw:function(t,n){if(t){var r=e.exports.getElement(n);r&&(t.append?t.append(r):t.appendChild(r))}},getElement:function(t){if(t&&0==t.indexOf("<svg")){var e=new DOMParser,n=e.parseFromString(t,"text/xml"),r=n.documentElement,i=document.createElement("div");i.className="svgImg";i.appendChild(r);return i}return!1}}},{}],28:[function(t,e,n){e.exports={name:"yasgui-yasr",description:"Yet Another SPARQL Resultset GUI",version:"2.6.5",main:"src/main.js",license:"MIT",author:"Laurens Rietveld",homepage:"http://yasr.yasgui.org",devDependencies:{"bootstrap-sass":"^3.3.1",browserify:"^6.1.0","browserify-shim":"^3.8.1","browserify-transform-tools":"^1.2.1",exorcist:"^0.1.6",gulp:"~3.6.0","gulp-autoprefixer":"^3.0.2","gulp-bump":"^0.1.11","gulp-concat":"^2.4.1","gulp-connect":"^2.0.5","gulp-cssimport":"^1.3.1","gulp-embedlr":"^0.5.2","gulp-filter":"^1.0.2","gulp-git":"^0.5.2","gulp-html-replace":"^1.4.1","gulp-jsvalidate":"^0.2.0","gulp-livereload":"^1.3.1","gulp-minify-css":"0.3.11","gulp-notify":"^2.0.1","gulp-rename":"^1.2.0","gulp-sass":"^2.0.4","gulp-sourcemaps":"^1.2.8","gulp-streamify":"0.0.5","gulp-tag-version":"^1.1.0","gulp-uglify":"^1.0.1","node-sass":"^3.4.0","require-dir":"^0.1.0","run-sequence":"^1.0.1","vinyl-buffer":"^1.0.0","vinyl-source-stream":"~0.1.1","vinyl-transform":"0.0.1",watchify:"^0.6.4"},bugs:"https://github.com/YASGUI/YASR/issues/",keywords:["JavaScript","SPARQL","Editor","Semantic Web","Linked Data"],maintainers:[{name:"Laurens Rietveld",email:"laurens.rietveld@gmail.com",web:"http://laurensrietveld.nl"}],repository:{type:"git",url:"https://github.com/YASGUI/YASR.git"},dependencies:{jquery:">=1.11.3",datatables:"^1.10.7",codemirror:"^4.7.0","yasgui-utils":"^1.4.1",pivottable:"^1.2.2","jquery-ui":"^1.10.5",d3:"^3.4.13"},"browserify-shim":{google:"global:google"},browserify:{transform:["browserify-shim"]},optionalShim:{codemirror:{require:"codemirror",global:"CodeMirror"},jquery:{require:"jquery", global:"jQuery"},"../../lib/codemirror":{require:"codemirror",global:"CodeMirror"},datatables:{require:"datatables",global:"jQuery"},d3:{require:"d3",global:"d3"},"jquery-ui/sortable":{require:"jquery-ui/sortable",global:"jQuery"},pivottable:{require:"pivottable",global:"jQuery"}}}},{}],29:[function(t,e,n){"use strict";e.exports=function(t){var e='"',n=",",r="\n",i=t.head.vars,o=t.results.bindings,a=function(){for(var t=0;t<i.length;t++)u(i[t]);f+=r},s=function(){for(var t=0;t<o.length;t++){l(o[t]);f+=r}},l=function(t){for(var e=0;e<i.length;e++){var n=i[e];u(t.hasOwnProperty(n)?t[n].value:"")}},u=function(t){t.replace(e,e+e);c(t)&&(t=e+t+e);f+=" "+t+" "+n},c=function(t){var r=!1;t.match("[\\w|"+n+"|"+e+"]")&&(r=!0);return r},f="";a();s();return f}},{}],30:[function(t,e,n){"use strict";var r=t("jquery"),i=e.exports=function(e){var n=r("<div class='booleanResult'></div>"),i=function(){n.empty().appendTo(e.resultsContainer);var i=e.results.getBoolean(),o=null,a=null;if(i===!0){o="check";a="True"}else if(i===!1){o="cross";a="False"}else{n.width("140");a="Could not find boolean value in response"}o&&t("yasgui-utils").svg.draw(n,t("./imgs.js")[o]);r("<span></span>").text(a).appendTo(n)},o=function(){return e.results.getBoolean&&(e.results.getBoolean()===!0||0==e.results.getBoolean())};return{name:null,draw:i,hideFromSelection:!0,getPriority:10,canHandleResults:o}};i.version={"YASR-boolean":t("../package.json").version,jquery:r.fn.jquery}},{"../package.json":28,"./imgs.js":36,jquery:19,"yasgui-utils":25}],31:[function(t,e,n){"use strict";var r=t("jquery");e.exports={output:"table",useGoogleCharts:!0,outputPlugins:["table","error","boolean","rawResponse","pivot","gchart"],drawOutputSelector:!0,drawDownloadIcon:!0,getUsedPrefixes:null,persistency:{prefix:function(t){return"yasr_"+r(t.container).closest("[id]").attr("id")+"_"},outputSelector:function(t){return"selector"},results:{id:function(t){return"results_"+r(t.container).closest("[id]").attr("id")},key:"results",maxSize:1e5}}}},{jquery:19}],32:[function(t,e,n){"use strict";var r=t("jquery"),i=e.exports=function(t){var e=r("<div class='errorResult'></div>"),n=r.extend(!0,{},i.defaults),o=function(){var t=null;if(n.tryQueryLink){var e=n.tryQueryLink();t=r("<button>",{"class":"yasr_btn yasr_tryQuery"}).text("Try query in new browser window").click(function(){window.open(e,"_blank");r(this).blur()})}return t},a=function(){var i=t.results.getException();e.empty().appendTo(t.resultsContainer);var a=r("<div>",{"class":"errorHeader"}).appendTo(e);if(0!==i.status){var s="Error";i.statusText&&i.statusText.length<100&&(s=i.statusText);s+=" (#"+i.status+")";a.append(r("<span>",{"class":"exception"}).text(s)).append(o());var l=null;i.responseText?l=i.responseText:"string"==typeof i&&(l=i);l&&e.append(r("<pre>").text(l))}else{a.append(o());e.append(r("<div>",{"class":"corsMessage"}).append(n.corsMessage))}},s=function(t){return t.results.getException()||!1};return{name:null,draw:a,getPriority:20,hideFromSelection:!0,canHandleResults:s}};i.defaults={corsMessage:"Unable to get response from endpoint",tryQueryLink:null}},{jquery:19}],33:[function(t,e,n){e.exports={GoogleTypeException:function(t,e){this.foundTypes=t;this.varName=e;this.toString=function(){var t="Conflicting data types found for variable "+this.varName+'. Assuming all values of this variable are "string".';t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t};this.toHtml=function(){var t="Conflicting data types found for variable <i>"+this.varName+'</i>. Assuming all values of this variable are "string".';t+=" As a result, several Google Charts will not render values of this particular variable.";t+=" To avoid this issue, cast the values in your SPARQL query to the intended xsd datatype";return t}}}},{}],34:[function(t,e,n){(function(n){var r=t("events").EventEmitter,i=(t("jquery"),!1),o=!1,a=function(){r.call(this);var t=this;this.init=function(){if(o||("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)||i)("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)?t.emit("initDone"):o&&t.emit("initError");else{i=!0;s("//google.com/jsapi",function(){i=!1;t.emit("initDone")});var e=100,r=6e3,a=+new Date,l=function(){if(!("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null))if(+new Date-a>r){o=!0;i=!1;t.emit("initError")}else setTimeout(l,e)};l()}};this.googleLoad=function(){var e=function(){("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).load("visualization","1",{packages:["corechart","charteditor"],callback:function(){t.emit("done")}})};if(i){t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}else if("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)e();else if(o)t.emit("error","Could not load google loader");else{t.once("initDone",e);t.once("initError",function(){t.emit("error","Could not load google loader")})}}},s=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.readyState?n.onreadystatechange=function(){if("loaded"==n.readyState||"complete"==n.readyState){n.onreadystatechange=null;e()}}:n.onload=function(){e()};n.src=t;document.body.appendChild(n)};a.prototype=new r;e.exports=new a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{events:4,jquery:19}],35:[function(t,e,n){(function(n){"use strict";var r=t("jquery"),i=t("./utils.js"),o=(t("yasgui-utils"),e.exports=function(e){var a=r.extend(!0,{},o.defaults),s=e.container.closest("[id]").attr("id"),l=null,u=null,c=function(t){var r="undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null;u=new r.visualization.ChartEditor;r.visualization.events.addListener(u,"ok",function(){var t;l=u.getChartWrapper();t=l.getDataTable();l.setDataTable(null);a.chartConfig=JSON.parse(l.toJSON());a.chartConfig.containerId&&delete a.chartConfig.containerId;e.store();l.setDataTable(t);l.setOption("width",a.width);l.setOption("height",a.height);l.draw();e.updateHeader()});t&&t()};return{name:"Google Chart",hideFromSelection:!1,priority:7,options:a,getPersistentSettings:function(){return{chartConfig:a.chartConfig,motionChartState:a.motionChartState}},setPersistentSettings:function(t){t.chartConfig&&(a.chartConfig=t.chartConfig);t.motionChartState&&(a.motionChartState=t.motionChartState)},canHandleResults:function(t){var e,n;return null!=(e=t.results)&&(n=e.getVariables())&&n.length>0},getDownloadInfo:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:r("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var n=e.resultsContainer.find(".google-visualization-table-table");return n.length>0?{getContent:function(){return n.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},getEmbedHtml:function(){if(!e.results)return null;var t=e.resultsContainer.find("svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var n=t[0].outerHTML;n||(n=r("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+n+"\n</div>"},draw:function(){var o=function(){e.resultsContainer.empty();var n=s+"_gchartWrapper";e.resultsContainer.append(r("<button>",{"class":"openGchartBtn yasr_btn"}).text("Chart Config").click(function(){u.openDialog(l)})).append(r("<div>",{id:n,"class":"gchartWrapper"}));var o=new google.visualization.DataTable,c=e.results.getAsJson();c.head.vars.forEach(function(n){var r="string";try{r=i.getGoogleTypeForBindings(c.results.bindings,n)}catch(a){if(!(a instanceof t("./exceptions.js").GoogleTypeException))throw a;e.warn(a.toHtml())}o.addColumn(r,n)});var f=null;e.options.getUsedPrefixes&&(f="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);c.results.bindings.forEach(function(t){var e=[];c.head.vars.forEach(function(n,r){e.push(i.castGoogleType(t[n],f,o.getColumnType(r)))});o.addRow(e)});if(a.chartConfig&&a.chartConfig.chartType){a.chartConfig.containerId=n;l=new google.visualization.ChartWrapper(a.chartConfig);if("MotionChart"===l.getChartType()&&a.motionChartState){l.setOption("state",a.motionChartState);google.visualization.events.addListener(l,"ready",function(){var t;t=l.getChart();google.visualization.events.addListener(t,"statechange",function(){a.motionChartState=t.getState();e.store()})})}l.setDataTable(o)}else l=new google.visualization.ChartWrapper({chartType:"Table",dataTable:o,containerId:n});l.setOption("width",a.width);l.setOption("height",a.height);l.draw();google.visualization.events.addListener(l,"ready",e.updateHeader)};("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null)&&("undefined"!=typeof window?window.google:"undefined"!=typeof n?n.google:null).visualization&&u?o():t("./gChartLoader.js").on("done",function(){c();o()}).on("error",function(){}).googleLoad()}}});o.defaults={height:"100%",width:"100%",persistencyId:"gchart",chartConfig:null,motionChartState:null}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./exceptions.js":33,"./gChartLoader.js":34,"./utils.js":49,jquery:19,"yasgui-utils":25}],36:[function(t,e,n){"use strict";e.exports={cross:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><g> <path d="M83.288,88.13c-2.114,2.112-5.575,2.112-7.689,0L53.659,66.188c-2.114-2.112-5.573-2.112-7.687,0L24.251,87.907 c-2.113,2.114-5.571,2.114-7.686,0l-4.693-4.691c-2.114-2.114-2.114-5.573,0-7.688l21.719-21.721c2.113-2.114,2.113-5.573,0-7.686 L11.872,24.4c-2.114-2.113-2.114-5.571,0-7.686l4.842-4.842c2.113-2.114,5.571-2.114,7.686,0L46.12,33.591 c2.114,2.114,5.572,2.114,7.688,0l21.721-21.719c2.114-2.114,5.573-2.114,7.687,0l4.695,4.695c2.111,2.113,2.111,5.571-0.003,7.686 L66.188,45.973c-2.112,2.114-2.112,5.573,0,7.686L88.13,75.602c2.112,2.111,2.112,5.572,0,7.687L83.288,88.13z"/></g></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><path fill="#000000" d="M14.301,49.982l22.606,17.047L84.361,4.903c2.614-3.733,7.76-4.64,11.493-2.026l0.627,0.462 c3.732,2.614,4.64,7.758,2.025,11.492l-51.783,79.77c-1.955,2.791-3.896,3.762-7.301,3.988c-3.405,0.225-5.464-1.039-7.508-3.084 L2.447,61.814c-3.263-3.262-3.263-8.553,0-11.814l0.041-0.019C5.75,46.718,11.039,46.718,14.301,49.982z"/></svg>',unsorted:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path7-9" d="m 8.8748339,52.571766 16.9382111,-0.222584 4.050851,-0.06665 15.719154,-0.222166 0.27778,-0.04246 0.43276,0.0017 0.41632,-0.06121 0.37532,-0.0611 0.47132,-0.119342 0.27767,-0.08206 0.55244,-0.198047 0.19707,-0.08043 0.61095,-0.259721 0.0988,-0.05825 0.019,-0.01914 0.59303,-0.356548 0.11787,-0.0788 0.49125,-0.337892 0.17994,-0.139779 0.37317,-0.336871 0.21862,-0.219786 0.31311,-0.31479 0.21993,-0.259387 c 0.92402,-1.126057 1.55249,-2.512251 1.78961,-4.016904 l 0.0573,-0.25754 0.0195,-0.374113 0.0179,-0.454719 0.0175,-0.05874 -0.0169,-0.258049 -0.0225,-0.493503 -0.0398,-0.355569 -0.0619,-0.414201 -0.098,-0.414812 -0.083,-0.353334 L 53.23955,41.1484 53.14185,40.850967 52.93977,40.377742 52.84157,40.161628 34.38021,4.2507375 C 33.211567,1.9401875 31.035446,0.48226552 28.639484,0.11316952 l -0.01843,-0.01834 -0.671963,-0.07882 -0.236871,0.0042 L 27.335984,-4.7826577e-7 27.220736,0.00379952 l -0.398804,0.0025 -0.313848,0.04043 -0.594474,0.07724 -0.09611,0.02147 C 23.424549,0.60716252 21.216017,2.1142355 20.013025,4.4296865 L 0.93967491,40.894479 c -2.08310801,3.997178 -0.588125,8.835482 3.35080799,10.819749 1.165535,0.613495 2.43199,0.88731 3.675026,0.864202 l 0.49845,-0.02325 0.410875,0.01658 z M 9.1502369,43.934401 9.0136999,43.910011 27.164145,9.2564625 44.70942,43.42818 l -14.765289,0.214677 -4.031106,0.0468 -16.7627881,0.244744 z" /></svg>',sortDesc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,-0.70898699,-0.70898699,0.70522156,97.988199,55.081205)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,0.12823506 0.09753,0.02006 c 2.39093,0.458209 4.599455,1.96811104 5.80244,4.28639004 L 52.785897,40.894525 c 2.088044,4.002139 0.590949,8.836902 -3.348692,10.821875 -1.329078,0.688721 -2.766603,0.943695 -4.133174,0.841768 l -0.454018,0.02 L 27.910392,52.354171 23.855313,52.281851 8.14393,52.061827 7.862608,52.021477 7.429856,52.021738 7.014241,51.959818 6.638216,51.900838 6.164776,51.779369 5.889216,51.699439 5.338907,51.500691 5.139719,51.419551 4.545064,51.145023 4.430618,51.105123 4.410168,51.084563 3.817138,50.730843 3.693615,50.647783 3.207314,50.310611 3.028071,50.174369 2.652795,49.833957 2.433471,49.613462 2.140099,49.318523 1.901127,49.041407 C 0.97781,47.916059 0.347935,46.528448 0.11153,45.021676 L 0.05352,44.766255 0.05172,44.371683 0.01894,43.936017 0,43.877277 0.01836,43.62206 0.03666,43.122889 0.0765,42.765905 0.13912,42.352413 0.23568,41.940425 0.32288,41.588517 0.481021,41.151945 0.579391,40.853806 0.77369,40.381268 0.876097,40.162336 19.338869,4.2542801 c 1.172169,-2.308419 3.34759,-3.76846504 5.740829,-4.17716604 l 0.01975,0.01985 0.69605,-0.09573 0.218437,0.0225 0.490791,-0.02132 0.39809,0.0046 0.315972,0.03973 0.594462,0.08149 z" /></svg>',sortAsc:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 54.552711 113.78478" enable-background="new 0 0 100 100" xml:space="preserve"><g id="g5" transform="matrix(-0.70522156,0.70898699,-0.70898699,-0.70522156,97.988199,58.704807)"><path style="fill:#000000" inkscape:connector-curvature="0" id="path7" d="M 57.911,66.915 45.808,55.063 42.904,52.238 31.661,41.25 31.435,41.083 31.131,40.775 30.794,40.523 30.486,40.3 30.069,40.05 29.815,39.911 29.285,39.659 29.089,39.576 28.474,39.326 28.363,39.297 H 28.336 L 27.665,39.128 27.526,39.1 26.94,38.99 26.714,38.961 26.212,38.934 h -0.31 -0.444 l -0.339,0.027 c -1.45,0.139 -2.876,0.671 -4.11,1.564 l -0.223,0.141 -0.279,0.25 -0.335,0.308 -0.054,0.029 -0.171,0.194 -0.334,0.364 -0.224,0.279 -0.25,0.336 -0.225,0.362 -0.192,0.308 -0.197,0.421 -0.142,0.279 -0.193,0.477 -0.084,0.222 -12.441,38.414 c -0.814,2.458 -0.313,5.029 1.115,6.988 v 0.026 l 0.418,0.532 0.17,0.165 0.251,0.281 0.084,0.079 0.283,0.281 0.25,0.194 0.474,0.367 0.083,0.053 c 2.015,1.371 4.641,1.874 7.131,1.094 L 55.228,80.776 c 4.303,-1.342 6.679,-5.814 5.308,-10.006 -0.387,-1.259 -1.086,-2.35 -1.979,-3.215 l -0.368,-0.337 -0.278,-0.303 z m -6.318,5.896 0.079,0.114 -37.369,11.57 11.854,-36.538 10.565,10.317 2.876,2.825 11.995,11.712 z" /></g><path style="fill:#000000" inkscape:connector-curvature="0" id="path9" d="m 27.813273,113.65778 0.09753,-0.0201 c 2.39093,-0.45821 4.599455,-1.96811 5.80244,-4.28639 L 52.785897,72.891487 c 2.088044,-4.002139 0.590949,-8.836902 -3.348692,-10.821875 -1.329078,-0.688721 -2.766603,-0.943695 -4.133174,-0.841768 l -0.454018,-0.02 -16.939621,0.223997 -4.055079,0.07232 -15.711383,0.220024 -0.281322,0.04035 -0.432752,-2.61e-4 -0.415615,0.06192 -0.376025,0.05898 -0.47344,0.121469 -0.27556,0.07993 -0.550309,0.198748 -0.199188,0.08114 -0.594655,0.274528 -0.114446,0.0399 -0.02045,0.02056 -0.59303,0.35372 -0.123523,0.08306 -0.486301,0.337172 -0.179243,0.136242 -0.375276,0.340412 -0.219324,0.220495 -0.293372,0.294939 -0.238972,0.277116 C 0.97781,65.869953 0.347935,67.257564 0.11153,68.764336 L 0.05352,69.019757 0.05172,69.414329 0.01894,69.849995 0,69.908735 l 0.01836,0.255217 0.0183,0.499171 0.03984,0.356984 0.06262,0.413492 0.09656,0.411988 0.0872,0.351908 0.158141,0.436572 0.09837,0.298139 0.194299,0.472538 0.102407,0.218932 18.462772,35.908054 c 1.172169,2.30842 3.34759,3.76847 5.740829,4.17717 l 0.01975,-0.0199 0.69605,0.0957 0.218437,-0.0225 0.490791,0.0213 0.39809,-0.005 0.315972,-0.0397 0.594462,-0.0815 z" /></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="tiny" x="0px" y="0px" width="100%" height="100%" viewBox="0 0 100 100" xml:space="preserve"><g id="Captions"></g><g id="Your_Icon"> <path fill-rule="evenodd" fill="#000000" d="M88,84v-2c0-2.961-0.859-4-4-4H16c-2.961,0-4,0.98-4,4v2c0,3.102,1.039,4,4,4h68 C87.02,88,88,87.039,88,84z M58,12H42c-5,0-6,0.941-6,6v22H16l34,34l34-34H64V18C64,12.941,62.939,12,58,12z"/></g></svg>',move:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" id="Layer_1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_11656_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="753" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="287" inkscape:window-y="249" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><polygon points="33,83 50,100 67,83 54,83 54,17 67,17 50,0 33,17 46,17 46,83 " transform="translate(-7.962963,-10)" /><polygon points="83,67 100,50 83,33 83,46 17,46 17,33 0,50 17,67 17,54 83,54 " transform="translate(-7.962963,-10)" /></svg>',fullscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" /><path d="m -7.962963,-10 v 38.889 l 16.667,-16.667 16.667,16.667 5.555,-5.555 -16.667,-16.667 16.667,-16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 92.037037,-10 v 38.889 l -16.667,-16.667 -16.666,16.667 -5.556,-5.555 16.666,-16.667 -16.666,-16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M -7.962963,90 V 51.111 l 16.667,16.666 16.667,-16.666 5.555,5.556 -16.667,16.666 16.667,16.667 h -38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="M 92.037037,90 V 51.111 l -16.667,16.666 -16.666,-16.666 -5.556,5.556 16.666,16.666 -16.666,16.667 h 38.889 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>',smallscreen:'<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" width="100%" height="100%" viewBox="5 -10 74.074074 100" enable-background="new 0 0 100 100" xml:space="preserve" inkscape:version="0.48.4 r9939" sodipodi:docname="noun_2186_cc.svg"><metadata ><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs /><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1855" inkscape:window-height="1056" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" inkscape:zoom="2.36" inkscape:cx="44.101509" inkscape:cy="31.481481" inkscape:window-x="65" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="Layer_1" /><path d="m 30.926037,28.889 0,-38.889 -16.667,16.667 -16.667,-16.667 -5.555,5.555 16.667,16.667 -16.667,16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,28.889 0,-38.889 16.667,16.667 16.666,-16.667 5.556,5.555 -16.666,16.667 16.666,16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 30.926037,51.111 0,38.889 -16.667,-16.666 -16.667,16.666 -5.555,-5.556 16.667,-16.666 -16.667,-16.667 38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /><path d="m 53.148037,51.111 0,38.889 16.667,-16.666 16.666,16.666 5.556,-5.556 -16.666,-16.666 16.666,-16.667 -38.889,0 z" inkscape:connector-curvature="0" style="fill:#010101" /></svg>'}},{}],37:[function(t,e,n){t("./tableToCsv.js")},{"./tableToCsv.js":38}],38:[function(t,e,n){"use strict";var r=t("jquery");r.fn.tableToCsv=function(t){var e="";t=r.extend({quote:'"',delimiter:",",lineBreak:"\n"},t);var n=function(e){var n=!1;e.match("[\\w|"+t.delimiter+"|"+t.quote+"]")&&(n=!0);return n},i=function(r){r.replace(t.quote,t.quote+t.quote);n(r)&&(r=t.quote+r+t.quote);e+=" "+r+" "+t.delimiter},o=function(n){n.forEach(function(t){i(t)});e+=t.lineBreak},a=r(this),s={},l=0;a.find("tr:first *").each(function(){r(this).attr("colspan")?l+=+r(this).attr("colspan"):l++});a.find("tr").each(function(t,e){for(var n=r(e),i=[],a=0,u=0;l>u;)if(s[u]){i.push(s[u].text);s[u].rowSpan--;s[u].rowSpan||(s[u]=null);u++}else{var c=n.find(":nth-child("+(a+1)+")");if(!c)break;for(var f=c.attr("colspan")||1,h=c.attr("rowspan")||1,d=0;f>d;d++){i.push(c.text());h>1&&(s[u]={rowSpan:h-1,text:c.text()});u++}a++}o(i)});return e}},{jquery:19}],39:[function(t,e,n){"use strict";var r=t("jquery"),i=t("events").EventEmitter,o=t("yasgui-utils");console=console||{log:function(){}};t("./jquery/extendJquery.js");var a=function(n,a,s){i.call(this);var l=this;l.options=r.extend(!0,{},e.exports.defaults,a);a&&a.outputPlugins&&(l.options.outputPlugins=a.outputPlugins);l.container=r("<div class='yasr'></div>").appendTo(n);l.header=r("<div class='yasr_header'></div>").appendTo(l.container);l.resultsContainer=r("<div class='yasr_results'></div>").appendTo(l.container);l.storage=o.storage;var u=null;l.getPersistencyId=function(t){null===u&&(u=l.options.persistency&&l.options.persistency.prefix?"string"==typeof l.options.persistency.prefix?l.options.persistency.prefix:l.options.persistency.prefix(l):!1);return u&&null!=t?u+("string"==typeof t?t:t(l)):null};l.options.useGoogleCharts&&t("./gChartLoader.js").once("initError",function(){l.options.useGoogleCharts=!1}).init();l.plugins={};for(var c in e.exports.plugins)(l.options.useGoogleCharts||"gchart"!=c)&&(l.plugins[c]=new e.exports.plugins[c](l));l.updateHeader=function(){var t=l.header.find(".yasr_downloadIcon").removeAttr("title"),e=l.header.find(".yasr_embedBtn"),n=l.plugins[l.options.output];if(n){var r=n.getDownloadInfo?n.getDownloadInfo():null;if(r){r.buttonTitle&&t.attr("title",r.buttonTitle);t.prop("disabled",!1);t.find("path").each(function(){this.style.fill="black"})}else{t.prop("disabled",!0).prop("title","Download not supported for this result representation");t.find("path").each(function(){this.style.fill="gray"})}var i=null;n.getEmbedHtml&&(i=n.getEmbedHtml());i&&i.length>0?e.show():e.hide()}};l.draw=function(t){if(!l.results)return!1;t||(t=l.options.output);var e=null,n=-1,i=[];for(var o in l.plugins)if(l.plugins[o].canHandleResults(l)){var a=l.plugins[o].getPriority;"function"==typeof a&&(a=a(l));if(null!=a&&void 0!=a&&a>n){n=a;e=o}}else i.push(o);f(i);var s=null;t in l.plugins&&l.plugins[t].canHandleResults(l)?s=t:e&&(s=e);if(s){r(l.resultsContainer).empty();l.emit("draw",l,l.plugins[s]);l.plugins[s].draw();l.emit("drawn",l,l.plugins[s]);l.updateHeader();return!0}l.updateHeader();return!1};var f=function(t){l.header.find(".yasr_btnGroup .yasr_btn").removeClass("disabled");t.forEach(function(t){l.header.find(".yasr_btnGroup .select_"+t).addClass("disabled")})};l.somethingDrawn=function(){return!l.resultsContainer.is(":empty")};l.setResponse=function(e,n,r){try{l.results=t("./parsers/wrapper.js")(e,n,r)}catch(i){l.results={getException:function(){return i}}}l.draw();var a=l.getPersistencyId(l.options.persistency.results.key);a&&(l.results.getOriginalResponseAsString&&l.results.getOriginalResponseAsString().length<l.options.persistency.results.maxSize?o.storage.set(a,l.results.getAsStoreObject(),"month"):o.storage.remove(a))};var h=null,d=null,p=null;l.warn=function(t){if(!h){h=r("<div>",{"class":"toggableWarning"}).prependTo(l.container).hide();d=r("<span>",{"class":"toggleWarning"}).html("&times;").click(function(){h.hide(400)}).appendTo(h);p=r("<span>",{"class":"toggableMsg"}).appendTo(h)}p.empty();t instanceof r?p.append(t):p.html(t);h.show(400)};var g=null,m=function(){if(null===g){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;g=t&&Blob}return g},v=null,y=function(e){var n=function(){var t=r('<div class="yasr_btnGroup"></div>');r.each(e.options.outputPlugins,function(n,i){var o=e.plugins[i];if(o&&!o.hideFromSelection){var a=o.name||i,s=r("<button class='yasr_btn'></button>").text(a).addClass("select_"+i).click(function(){t.find("button.selected").removeClass("selected");r(this).addClass("selected");e.options.output=i;e.store();h&&h.hide(400);e.draw()}).appendTo(t);e.options.output==i&&s.addClass("selected")}});t.children().length>1&&e.header.append(t)},i=function(){var n=function(t,e){var n=null,r=window.URL||window.webkitURL||window.mozURL||window.msURL;if(r&&Blob){var i=new Blob([t],{type:e});n=r.createObjectURL(i)}return n},i=r("<button class='yasr_btn yasr_downloadIcon btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").download)).click(function(){var i=e.plugins[e.options.output];if(i&&i.getDownloadInfo){var o=i.getDownloadInfo(),a=n(o.getContent(),o.contentType?o.contentType:"text/plain"),s=r("<a></a>",{href:a,download:o.filename});t("./utils.js").fireClick(s)}});e.header.append(i)},o=function(){ var n=r("<button class='yasr_btn btn_fullscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").fullscreen)).click(function(){e.container.addClass("yasr_fullscreen")});e.header.append(n)},a=function(){var n=r("<button class='yasr_btn btn_smallscreen btn_icon'></button>").append(t("yasgui-utils").svg.getElement(t("./imgs.js").smallscreen)).click(function(){e.container.removeClass("yasr_fullscreen")});e.header.append(n)},s=function(){v=r("<button>",{"class":"yasr_btn yasr_embedBtn",title:"Get HTML snippet to embed results on a web page"}).text("</>").click(function(t){var n=e.plugins[e.options.output];if(n&&n.getEmbedHtml){var i=n.getEmbedHtml();t.stopPropagation();var o=r("<div class='yasr_embedPopup'></div>").appendTo(e.header);r("html").click(function(){o&&o.remove()});o.click(function(t){t.stopPropagation()});var a=r("<textarea>").val(i);a.focus(function(){var t=r(this);t.select();t.mouseup(function(){t.unbind("mouseup");return!1})});o.empty().append(a);var s=v.position(),l=s.top+v.outerHeight()+"px",u=Math.max(s.left+v.outerWidth()-o.outerWidth(),0)+"px";o.css("top",l).css("left",u)}});e.header.append(v)};o();a();e.options.drawOutputSelector&&n();e.options.drawDownloadIcon&&m()&&i();s()},b=null;l.store=function(){b||(b=l.getPersistencyId("main"));b&&o.storage.set(b,l.getPersistentSettings())};l.load=function(){b||(b=l.getPersistencyId("main"));l.setPersistentSettings(o.storage.get(b))};l.setPersistentSettings=function(t){if(t){t.output&&(l.options.output=t.output);for(var e in t.plugins)l.plugins[e]&&l.plugins[e].setPersistentSettings&&l.plugins[e].setPersistentSettings(t.plugins[e])}};l.getPersistentSettings=function(){var t={output:l.options.output,plugins:{}};for(var e in l.plugins)l.plugins[e].getPersistentSettings&&(t.plugins[e]=l.plugins[e].getPersistentSettings());return t};l.load();y(l);if(!s&&l.options.persistency&&l.options.persistency.results){var w,x=l.getPersistencyId(l.options.persistency.results.key);x&&(w=o.storage.get(x));if(!w&&l.options.persistency.results.id){var C="string"==typeof l.options.persistency.results.id?l.options.persistency.results.id:l.options.persistency.results.id(l);if(C){w=o.storage.get(C);w&&o.storage.remove(C)}}w&&(r.isArray(w)?l.setResponse.apply(this,w):l.setResponse(w))}s&&l.setResponse(s);l.updateHeader();return l};a.prototype=new i;e.exports=function(t,e,n){return new a(t,e,n)};e.exports.plugins={};e.exports.registerOutput=function(t,n){e.exports.plugins[t]=n};e.exports.defaults=t("./defaults.js");e.exports.version={YASR:t("../package.json").version,jquery:r.fn.jquery,"yasgui-utils":t("yasgui-utils").version};e.exports.$=r;try{e.exports.registerOutput("boolean",t("./boolean.js"))}catch(s){}try{e.exports.registerOutput("rawResponse",t("./rawResponse.js"))}catch(s){}try{e.exports.registerOutput("table",t("./table.js"))}catch(s){}try{e.exports.registerOutput("error",t("./error.js"))}catch(s){}try{e.exports.registerOutput("pivot",t("./pivot.js"))}catch(s){}try{e.exports.registerOutput("gchart",t("./gchart.js"))}catch(s){}},{"../package.json":28,"./boolean.js":30,"./defaults.js":31,"./error.js":32,"./gChartLoader.js":34,"./gchart.js":35,"./imgs.js":36,"./jquery/extendJquery.js":37,"./parsers/wrapper.js":44,"./pivot.js":46,"./rawResponse.js":47,"./table.js":48,"./utils.js":49,events:4,jquery:19,"yasgui-utils":25}],40:[function(t,e,n){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e,",")}},{"./dlv.js":41,jquery:19}],41:[function(t,e,n){"use strict";var r=t("jquery");t("../../lib/jquery.csv-0.71.js");e.exports=function(t,e){var n={},i=r.csv.toArrays(t,{separator:e}),o=function(t){return 0==t.indexOf("http")?"uri":null},a=function(){if(2==i.length&&1==i[0].length&&1==i[1].length&&"boolean"==i[0][0]&&("1"==i[1][0]||"0"==i[1][0])){n["boolean"]="1"==i[1][0]?!0:!1;return!0}return!1},s=function(){if(i.length>0&&i[0].length>0){n.head={vars:i[0]};return!0}return!1},l=function(){if(i.length>1){n.results={bindings:[]};for(var t=1;t<i.length;t++){for(var e={},r=0;r<i[t].length;r++){var a=n.head.vars[r];if(a){var s=i[t][r],l=o(s);e[a]={value:s};l&&(e[a].type=l)}}n.results.bindings.push(e)}n.head={vars:i[0]};return!0}return!1},u=a();if(!u){var c=s();c&&l()}return n}},{"../../lib/jquery.csv-0.71.js":3,jquery:19}],42:[function(t,e,n){"use strict";t("jquery"),e.exports=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return!1}return"object"==typeof t&&t.constructor==={}.constructor?t:!1}},{jquery:19}],43:[function(t,e,n){"use strict";t("jquery"),e.exports=function(e){return t("./dlv.js")(e," ")}},{"./dlv.js":41,jquery:19}],44:[function(t,e,n){"use strict";t("jquery"),e.exports=function(e,n,r){var i={xml:t("./xml.js"),json:t("./json.js"),tsv:t("./tsv.js"),csv:t("./csv.js")},o=null,a=null,s=null,l=null,u=null,c=function(){if("object"==typeof e){if(e.exception)u=e.exception;else if(void 0!=e.status&&(e.status>=300||0===e.status)){u={status:e.status};"string"==typeof r&&(u.errorString=r);e.responseText&&(u.responseText=e.responseText);e.statusText&&(u.statusText=e.statusText)}if(e.contentType)o=e.contentType.toLowerCase();else if(e.getResponseHeader&&e.getResponseHeader("content-type")){var t=e.getResponseHeader("content-type").trim().toLowerCase();t.length>0&&(o=t)}e.response?a=e.response:n||r||(a=e)}u||a||(a=e.responseText?e.responseText:e)},f=function(){if(s)return s;if(s===!1||u)return!1;var t=function(){if(o)if(o.indexOf("json")>-1){try{s=i.json(a)}catch(t){u=t}l="json"}else if(o.indexOf("xml")>-1){try{s=i.xml(a)}catch(t){u=t}l="xml"}else if(o.indexOf("csv")>-1){try{s=i.csv(a)}catch(t){u=t}l="csv"}else if(o.indexOf("tab-separated")>-1){try{s=i.tsv(a)}catch(t){u=t}l="tsv"}},e=function(){s=i.json(a);if(s)l="json";else try{s=i.xml(a);s&&(l="xml")}catch(t){}};t();s||e();s||(s=!1);return s},h=function(){var t=f();return t&&"head"in t?t.head.vars:null},d=function(){var t=f();return t&&"results"in t?t.results.bindings:null},p=function(){var t=f();return t&&"boolean"in t?t["boolean"]:null},g=function(){return a},m=function(){var t="";"string"==typeof a?t=a:"json"==l?t=JSON.stringify(a,void 0,2):"xml"==l&&(t=(new XMLSerializer).serializeToString(a));return t},v=function(){return u},y=function(){null==l&&f();return l},b=function(){var t={};if(e.status){t.status=e.status;t.responseText=e.responseText;t.statusText=e.statusText;t.contentType=o}else t=e;var i=n,a=void 0;"string"==typeof r&&(a=r);return[t,i,a]};c();s=f();return{getAsStoreObject:b,getAsJson:f,getOriginalResponse:g,getOriginalResponseAsString:m,getOriginalContentType:function(){return o},getVariables:h,getBindings:d,getBoolean:p,getType:y,getException:v}}},{"./csv.js":40,"./json.js":42,"./tsv.js":43,"./xml.js":45,jquery:19}],45:[function(t,e,n){"use strict";{var r=t("jquery");e.exports=function(t){var e=function(t){a.head={};for(var e=0;e<t.childNodes.length;e++){var n=t.childNodes[e];if("variable"==n.nodeName){a.head.vars||(a.head.vars=[]);var r=n.getAttribute("name");r&&a.head.vars.push(r)}}},n=function(t){a.results={};a.results.bindings=[];for(var e=0;e<t.childNodes.length;e++){for(var n=t.childNodes[e],r=null,i=0;i<n.childNodes.length;i++){var o=n.childNodes[i];if("binding"==o.nodeName){var s=o.getAttribute("name");if(s){r=r||{};r[s]={};for(var l=0;l<o.childNodes.length;l++){var u=o.childNodes[l],c=u.nodeName;if("#text"!=c){r[s].type=c;r[s].value=u.innerHTML;var f=u.getAttribute("datatype");f&&(r[s].datatype=f)}}}}}r&&a.results.bindings.push(r)}},i=function(t){a["boolean"]="true"==t.innerHTML?!0:!1},o=null;"string"==typeof t?o=r.parseXML(t):r.isXMLDoc(t)&&(o=t);var t=null;if(!(o.childNodes.length>0))return null;t=o.childNodes[0];for(var a={},s=0;s<t.childNodes.length;s++){var l=t.childNodes[s];"head"==l.nodeName&&e(l);"results"==l.nodeName&&n(l);"boolean"==l.nodeName&&i(l)}return a}}},{jquery:19}],46:[function(t,e,n){"use strict";var r=t("jquery"),i=t("./utils.js"),o=t("yasgui-utils"),a=t("./imgs.js");t("jquery-ui/sortable");t("pivottable");if(!r.fn.pivotUI)throw new Error("Pivot lib not loaded");var s=e.exports=function(e){var n=r.extend(!0,{},s.defaults);if(n.useD3Chart){try{var l=t("d3");l&&t("../node_modules/pivottable/dist/d3_renderers.js")}catch(u){}r.pivotUtilities.d3_renderers&&r.extend(!0,r.pivotUtilities.renderers,r.pivotUtilities.d3_renderers)}var c,f=null,h=function(){var t=e.results.getVariables();if(!n.mergeLabelsWithUris)return t;var r=[];f="string"==typeof n.mergeLabelsWithUris?n.mergeLabelsWithUris:"Label";t.forEach(function(e){-1!==e.indexOf(f,e.length-f.length)&&t.indexOf(e.substring(0,e.length-f.length))>=0||r.push(e)});return r},d=function(t){var n=h(),r=null;e.options.getUsedPrefixes&&(r="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);e.results.getBindings().forEach(function(e){var o={};n.forEach(function(t){if(t in e){var n=e[t].value;f&&e[t+f]?n=e[t+f].value:"uri"==e[t].type&&(n=i.uriToPrefixed(r,n));o[t]=n}else o[t]=null});t(o)})},p=function(t){if(t){if(e.results){var n=e.results.getVariables(),i=!0;t.cols.forEach(function(t){n.indexOf(t)<0&&(i=!1)});i&&pivotOptionse.rows.forEach(function(t){n.indexOf(t)<0&&(i=!1)});if(!i){t.cols=[];t.rows=[]}r.pivotUtilities.renderers[settings.rendererName]||delete t.rendererName}}else t={};return t},g=function(){var i=function(){var t=function(t){n.pivotTable.cols=t.cols;n.pivotTable.rows=t.rows;n.pivotTable.rendererName=t.rendererName;n.pivotTable.aggregatorName=t.aggregatorName;n.pivotTable.vals=t.vals;e.store();t.rendererName.toLowerCase().indexOf(" chart")>=0?i.show():i.hide();e.updateHeader()},i=r("<button>",{"class":"openPivotGchart yasr_btn"}).text("Chart Config").click(function(){c.find('div[dir="ltr"]').dblclick()}).appendTo(e.resultsContainer);c=r("<div>",{"class":"pivotTable"}).appendTo(r(e.resultsContainer));n.pivotTable.onRefresh=function(){var e=n.pivotTable.onRefresh;return function(n){t(n);e&&e(n)}}();window.pivot=c.pivotUI(d,n.pivotTable);var s=r(o.svg.getElement(a.move));c.find(".pvtTriangle").replaceWith(s);r(".pvtCols").prepend(r("<div>",{"class":"containerHeader"}).text("Columns"));r(".pvtRows").prepend(r("<div>",{"class":"containerHeader"}).text("Rows"));r(".pvtUnused").prepend(r("<div>",{"class":"containerHeader"}).text("Available Variables"));r(".pvtVals").prepend(r("<div>",{"class":"containerHeader"}).text("Cells"));setTimeout(e.updateHeader,400)};e.options.useGoogleCharts&&n.useGoogleCharts&&!r.pivotUtilities.gchart_renderers?t("./gChartLoader.js").on("done",function(){try{t("../node_modules/pivottable/dist/gchart_renderers.js");r.extend(!0,r.pivotUtilities.renderers,r.pivotUtilities.gchart_renderers)}catch(e){n.useGoogleCharts=!1}i()}).on("error",function(){console.log("could not load gchart");n.useGoogleCharts=!1;i()}).googleLoad():i()},m=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0},v=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg");if(t.length>0)return{getContent:function(){return t[0].outerHTML?t[0].outerHTML:r("<div>").append(t.clone()).html()},filename:"queryResults.svg",contentType:"image/svg+xml",buttonTitle:"Download SVG Image"};var n=e.resultsContainer.find(".pvtRendererArea table");return n.length>0?{getContent:function(){return n.tableToCsv()},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:void 0},y=function(){if(!e.results)return null;var t=e.resultsContainer.find(".pvtRendererArea svg").clone().removeAttr("height").removeAttr("width").css("height","").css("width","");if(0==t.length)return null;var n=t[0].outerHTML;n||(n=r("<div>").append(t.clone()).html());return'<div style="width: 800px; height: 600px;">\n'+n+"\n</div>"};return{getPersistentSettings:function(){return{pivotTable:n.pivotTable}},setPersistentSettings:function(t){t.pivotTable&&(n.pivotTable=p(t.pivotTable))},getDownloadInfo:v,getEmbedHtml:y,options:n,draw:g,name:"Pivot Table",canHandleResults:m,getPriority:4}};s.defaults={mergeLabelsWithUris:!1,useGoogleCharts:!0,useD3Chart:!0,persistencyId:"pivot",pivotTable:{}};s.version={"YASR-rawResponse":t("../package.json").version,jquery:r.fn.jquery}},{"../node_modules/pivottable/dist/d3_renderers.js":20,"../node_modules/pivottable/dist/gchart_renderers.js":21,"../package.json":28,"./gChartLoader.js":34,"./imgs.js":36,"./utils.js":49,d3:13,jquery:19,"jquery-ui/sortable":17,pivottable:22,"yasgui-utils":25}],47:[function(t,e,n){"use strict";var r=t("jquery"),i=t("codemirror");t("codemirror/addon/fold/foldcode.js");t("codemirror/addon/fold/foldgutter.js");t("codemirror/addon/fold/xml-fold.js");t("codemirror/addon/fold/brace-fold.js");t("codemirror/addon/edit/matchbrackets.js");t("codemirror/mode/xml/xml.js");t("codemirror/mode/javascript/javascript.js");var o=e.exports=function(t){var e=r.extend(!0,{},o.defaults),n=null,a=function(){var r=e.CodeMirror;r.value=t.results.getOriginalResponseAsString();var o=t.results.getType();if(o){"json"==o&&(o={name:"javascript",json:!0});r.mode=o}n=i(t.resultsContainer.get()[0],r);n.on("fold",function(){n.refresh()});n.on("unfold",function(){n.refresh()})},s=function(){if(!t.results)return!1;if(!t.results.getOriginalResponseAsString)return!1;var e=t.results.getOriginalResponseAsString();return e&&0!=e.length||!t.results.getException()?!0:!1},l=function(){if(!t.results)return null;var e=t.results.getOriginalContentType(),n=t.results.getType();return{getContent:function(){return t.results.getOriginalResponse()},filename:"queryResults"+(n?"."+n:""),contentType:e?e:"text/plain",buttonTitle:"Download raw response"}};return{draw:a,name:"Raw Response",canHandleResults:s,getPriority:2,getDownloadInfo:l}};o.defaults={CodeMirror:{readOnly:!0,lineNumbers:!0,lineWrapping:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]}};o.version={"YASR-rawResponse":t("../package.json").version,jquery:r.fn.jquery,CodeMirror:i.version}},{"../package.json":28,codemirror:10,"codemirror/addon/edit/matchbrackets.js":5,"codemirror/addon/fold/brace-fold.js":6,"codemirror/addon/fold/foldcode.js":7,"codemirror/addon/fold/foldgutter.js":8,"codemirror/addon/fold/xml-fold.js":9,"codemirror/mode/javascript/javascript.js":11,"codemirror/mode/xml/xml.js":12,jquery:19}],48:[function(t,e,n){"use strict";var r=t("jquery"),i=t("yasgui-utils"),o=t("./utils.js"),a=t("./imgs.js");t("datatables");t("../lib/colResizable-1.4.js");var s=e.exports=function(e){var n=null,o={name:"Table",getPriority:10},l=o.options=r.extend(!0,{},s.defaults),u=l.persistency?e.getPersistencyId(l.persistency.tableLength):null,f=function(){var t=[],n=e.results.getBindings(),r=e.results.getVariables(),i=null;e.options.getUsedPrefixes&&(i="function"==typeof e.options.getUsedPrefixes?e.options.getUsedPrefixes(e):e.options.getUsedPrefixes);for(var a=0;a<n.length;a++){var s=[];s.push("");for(var u=n[a],c=0;c<r.length;c++){var f=r[c];s.push(f in u?l.getCellContent?l.getCellContent(e,o,u,f,{rowId:a,colId:c,usedPrefixes:i}):"":"")}t.push(s)}return t},h=(e.getPersistencyId("eventId")||"yasr_"+r(e.container).closest("[id]").attr("id"),function(){n.on("order.dt",function(){d()});u&&n.on("length.dt",function(t,e,n){i.storage.set(u,n,"month")});r.extend(!0,l.callbacks,l.handlers);n.delegate("td","click",function(t){if(l.callbacks&&l.callbacks.onCellClick){var e=l.callbacks.onCellClick(this,t);if(e===!1)return!1}}).delegate("td","mouseenter",function(t){l.callbacks&&l.callbacks.onCellMouseEnter&&l.callbacks.onCellMouseEnter(this,t);var e=r(this);l.fetchTitlesFromPreflabel&&void 0===e.attr("title")&&0==e.text().trim().indexOf("http")&&c(e)}).delegate("td","mouseleave",function(t){l.callbacks&&l.callbacks.onCellMouseLeave&&l.callbacks.onCellMouseLeave(this,t)})});o.draw=function(){n=r('<table cellpadding="0" cellspacing="0" border="0" class="resultsTable"></table>');r(e.resultsContainer).html(n);var t=l.datatable;t.data=f();t.columns=l.getColumns(e,o);var a=i.storage.get(u);a&&(t.pageLength=a);n.DataTable(r.extend(!0,{},t));d();h();n.colResizable()};var d=function(){var t={sorting:"unsorted",sorting_asc:"sortAsc",sorting_desc:"sortDesc"};n.find(".sortIcons").remove();for(var e in t){var o=r("<div class='sortIcons'></div>");i.svg.draw(o,a[t[e]]);n.find("th."+e).append(o)}};o.canHandleResults=function(){return e.results&&e.results.getVariables&&e.results.getVariables()&&e.results.getVariables().length>0};o.getDownloadInfo=function(){return e.results?{getContent:function(){return t("./bindingsToCsv.js")(e.results.getAsJson())},filename:"queryResults.csv",contentType:"text/csv",buttonTitle:"Download as CSV"}:null};return o},l=function(t,e,n){var r=o.escapeHtmlEntities(n.value);if(n["xml:lang"])r='"'+r+'"<sup>@'+n["xml:lang"]+"</sup>";else if(n.datatype){var i="http://www.w3.org/2001/XMLSchema#",a=n.datatype;a=0===a.indexOf(i)?"xsd:"+a.substring(i.length):"&lt;"+a+"&gt;";r='"'+r+'"<sup>^^'+a+"</sup>"}return r},u=function(t,e,n,r,i){var o=n[r],a=null;if("uri"==o.type){var s=null,u=o.value,c=u;if(i.usedPrefixes)for(var f in i.usedPrefixes)if(0==c.indexOf(i.usedPrefixes[f])){c=f+":"+u.substring(i.usedPrefixes[f].length);break}if(e.options.mergeLabelsWithUris){var h="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";if(n[r+h]){c=l(t,e,n[r+h]);s=u}}a="<a "+(s?"title='"+u+"' ":"")+"class='uri' target='_blank' href='"+u+"'>"+c+"</a>"}else a="<span class='nonUri'>"+l(t,e,o)+"</span>";return"<div>"+a+"</div>"},c=function(t){var e=function(){t.attr("title","")};r.get("http://preflabel.org/api/v1/label/"+encodeURIComponent(t.text())+"?silent=true").success(function(n){"object"==typeof n&&n.label?t.attr("title",n.label):"string"==typeof n&&n.length>0?t.attr("title",n):e()}).fail(e)};s.defaults={getCellContent:u,persistency:{tableLength:"tableLength"},getColumns:function(t,e){var n=function(n){if(!e.options.mergeLabelsWithUris)return!0;var r="string"==typeof e.options.mergeLabelsWithUris?e.options.mergeLabelsWithUris:"Label";return-1!==n.indexOf(r,n.length-r.length)&&t.results.getVariables().indexOf(n.substring(0,n.length-r.length))>=0?!1:!0},r=[];r.push({title:""});t.results.getVariables().forEach(function(t){r.push({title:"<span>"+t+"</span>",visible:n(t)})});return r},fetchTitlesFromPreflabel:!0,mergeLabelsWithUris:!1,callbacks:{onCellMouseEnter:null,onCellMouseLeave:null,onCellClick:null},datatable:{autoWidth:!1,dom:'<"dtTopHeader"ilf>rtip',order:[],pageLength:50,lengthMenu:[[10,50,100,1e3,-1],[10,50,100,1e3,"All"]],lengthChange:!0,pagingType:"full_numbers",drawCallback:function(t){for(var e=0;e<t.aiDisplay.length;e++)r("td:eq(0)",t.aoData[t.aiDisplay[e]].nTr).html(e+1);var n=!1;r(t.nTableWrapper).find(".paginate_button").each(function(){-1==r(this).attr("class").indexOf("current")&&-1==r(this).attr("class").indexOf("disabled")&&(n=!0)});n?r(t.nTableWrapper).find(".dataTables_paginate").show():r(t.nTableWrapper).find(".dataTables_paginate").hide()},columnDefs:[{width:"32px",orderable:!1,targets:0}]}};s.version={"YASR-table":t("../package.json").version,jquery:r.fn.jquery,"jquery-datatables":r.fn.DataTable.version}},{"../lib/colResizable-1.4.js":2,"../package.json":28,"./bindingsToCsv.js":29,"./imgs.js":36,"./utils.js":49,datatables:14,jquery:19,"yasgui-utils":25}],49:[function(t,e,n){"use strict";var r=t("jquery"),i=t("./exceptions.js").GoogleTypeException;e.exports={escapeHtmlEntities:function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},uriToPrefixed:function(t,e){if(t)for(var n in t)if(0==e.indexOf(t[n])){e=n+":"+e.substring(t[n].length);break}return e},getGoogleTypeForBinding:function(t){if(null==t)return null;if(null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return"string";switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#double":case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return"number";case"http://www.w3.org/2001/XMLSchema#date":return"date";case"http://www.w3.org/2001/XMLSchema#dateTime":return"datetime";case"http://www.w3.org/2001/XMLSchema#time":return"timeofday";default:return"string"}},getGoogleTypeForBindings:function(t,n){var r={},o=0;t.forEach(function(t){var i=e.exports.getGoogleTypeForBinding(t[n]);if(null!=i){if(!(i in r)){r[i]=0;o++}r[i]++}});if(0==o)return"string";if(1!=o)throw new i(r,n);for(var a in r)return a},castGoogleType:function(t,n,r){if(null==t)return null;if("string"==r||null==t.type||"typed-literal"!==t.type&&"literal"!==t.type)return(t.type="uri")?e.exports.uriToPrefixed(n,t.value):t.value;switch(t.datatype){case"http://www.w3.org/2001/XMLSchema#float":case"http://www.w3.org/2001/XMLSchema#decimal":case"http://www.w3.org/2001/XMLSchema#int":case"http://www.w3.org/2001/XMLSchema#integer":case"http://www.w3.org/2001/XMLSchema#long":case"http://www.w3.org/2001/XMLSchema#gYearMonth":case"http://www.w3.org/2001/XMLSchema#gYear":case"http://www.w3.org/2001/XMLSchema#gMonthDay":case"http://www.w3.org/2001/XMLSchema#gDay":case"http://www.w3.org/2001/XMLSchema#gMonth":return Number(t.value);case"http://www.w3.org/2001/XMLSchema#double":return Number(parseFloat(t.value));case"http://www.w3.org/2001/XMLSchema#date":var i=o(t.value);if(i)return i;case"http://www.w3.org/2001/XMLSchema#dateTime":case"http://www.w3.org/2001/XMLSchema#time":return new Date(t.value);default:return t.value}},fireClick:function(t){t&&t.each(function(t,e){var n=r(e);if(document.dispatchEvent){var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,1,1,1,1,1,!1,!1,!1,!1,0,n[0]);n[0].dispatchEvent(i)}else document.fireEvent&&n[0].click()})}};var o=function(t){var e=new Date(t.replace(/(\d)([\+-]\d{2}:\d{2})/,"$1Z$2"));return isNaN(e)?null:e}},{"./exceptions.js":33,jquery:19}]},{},[1])(1)}); //# sourceMappingURL=yasr.bundled.min.js.map
menuka94/cdnjs
ajax/libs/yasr/2.6.5/yasr.bundled.min.js
JavaScript
mit
630,517
/* style picker api */ /* how to use: * Markup (good to style one input different than other): <!-- simply use a placeholder as class on your input elment --> <input type="date" class="show-week" /> CSS: //replace the placeholder with .input-picker or (.input-date-picker) .input-picker .ws-week { display: table-cell; } SASS: //use the placeholder(s) and go crazy .input-picker { @extend %show-week; //@extend show-selectnav; } * */ /* btn api */ .hide-spinbtns + .input-buttons > .step-controls, .hide-spinbtns .input-buttons > .step-controls { display: none; } .hide-spinbtns::-webkit-inner-spin-button, .hide-spinbtns ::-webkit-inner-spin-button { display: none; } .hide-dropdownbtn + .input-buttons > .ws-popover-opener, .hide-dropdownbtn .input-buttons > .ws-popover-opener { display: none; } .hide-inputbtns + .input-buttons, .hide-inputbtns .input-buttons { display: none; } .hide-inputbtns::-webkit-inner-spin-button, .hide-inputbtns ::-webkit-inner-spin-button { display: none; } .a11yhide-inputbtns + .input-buttons, .a11yhide-inputbtns .input-buttons { width: 0; margin: 0; overflow: visible; } .a11yhide-inputbtns + .input-buttons > .step-controls, .a11yhide-inputbtns .input-buttons > .step-controls { display: none; } .a11yhide-inputbtns + .input-buttons > .ws-popover-opener, .a11yhide-inputbtns .input-buttons > .ws-popover-opener { height: 0; width: 0; overflow: hidden; } .a11yhide-inputbtns + .input-buttons > .ws-popover-opener:focus, .a11yhide-inputbtns + .input-buttons > .ws-popover-opener:active, .a11yhide-inputbtns .input-buttons > .ws-popover-opener:focus, .a11yhide-inputbtns .input-buttons > .ws-popover-opener:active { height: 19px; width: 19px; } .inputbtns-outside + span.input-buttons, .inputbtns-outside span.input.input-buttons { margin-left: 2px; } .inputbtns-outside + span.input-buttons.ws-is-rtl, .inputbtns-outside span.input.input-buttons.ws-is-rtl { margin-left: 0; margin-right: 2px; } .show-ticklabels .ws-range-ticks[data-label]:after { display: inline-block; } .show-tickvalues .ws-range-ticks:before { display: inline-block; } .hide-ticks .ws-range-ticks { display: none; } .show-valuetooltip span.ws-range-thumb > span, .show-valuetooltip span.ws-range-thumb > span > span:after { display: inline-block; } .show-valuetooltip span.ws-range-thumb > span > span:after { content: attr(data-value) !important; visibility: visible !important; } .ws-active.show-activevaluetooltip span.ws-range-thumb > span, .ws-active.show-activevaluetooltip span.ws-range-thumb > span > span:after, .show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb > span, .show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb > span > span:after { display: inline-block; } .ws-active.show-activevaluetooltip span.ws-range-thumb > span > span:after, .show-activevaluetooltip .ws-range.ws-active span.ws-range-thumb > span > span:after { content: attr(data-value) !important; visibility: visible !important; } .show-labeltooltip span.ws-range-thumb > span, .show-labeltooltip span.ws-range-thumb > span > span:before { display: inline-block; } .show-labeltooltip span.ws-range-thumb > span > span:before { content: attr(data-valuetext) !important; visibility: visible !important; } .ws-active.show-activelabeltooltip span.ws-range-thumb > span, .ws-active.show-activelabeltooltip span.ws-range-thumb > span > span:before, .show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb > span, .show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb > span > span:before { display: inline-block; } .ws-active.show-activelabeltooltip span.ws-range-thumb > span > span:before, .show-activelabeltooltip .ws-range.ws-active span.ws-range-thumb > span > span:before { content: attr(data-valuetext) !important; visibility: visible !important; } @font-face { font-family: 'widget'; src: url("widget.eot"); } @font-face { font-family: 'widget'; src: url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAbMAAoAAAAABoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAA08AAANPG9W6FE9TLzIAAAREAAAAYAAAAGAIIwcpY21hcAAABKQAAABUAAAAVPCu8JlnYXNwAAAE+AAAAAgAAAAIAAAAEGhlYWQAAAUAAAAANgAAADYABTw7aGhlYQAABTgAAAAkAAAAJAO9AedobXR4AAAFXAAAABgAAAAYBNwAAG1heHAAAAV0AAAABgAAAAYABlAAbmFtZQAABXwAAAEwAAABMOvWjh9wb3N0AAAGrAAAACAAAAAgAAMAAAEABAQAAQEBB3dpZGdldAABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLZviU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAADRhIABwEBBw0PERQZHndpZGdldHdpZGdldHUwdTF1MjB1RjAxN3VGMDczAAACAYkABAAGAgABAAQABwAKAA0BAQK4/JQO/JQO/JQO+5QO95T31hWL+xQFi4mKiImKiomJioiLCC+LBYmLiYyJjYmMio6LjQiLngWLjYyNjY2NjY2MjYsIy4uL7wWLjoyNjY2NjY2LjosInYsFjouNi4yJjYmMiYuICPcLJxWLp4SlfaN9o3idc5l0mXGSbotvi3GEc310fXh5fXN9c4Rxi2+Lb5JxmXOZc554on0Io32lhKeLqIulkqKZo5menpmjmaOSpYunCMuLFYtjgWZ3anhpcHBqeGl3ZoFji2SLZpVpn2qecKZ3rXisgbCLs4uzla+erZ+spqasnwitnrCVsouzi7CBrXisd6ZwnmqfaZVni2MIDmewixXdi4vdOYuLOQXvixXni4vdL4uLOQUn8BXdi4vmOYuLMAXvixXni4vmL4uLMAUn9wEV3YuL3jmLizgF92b7ZhXmi4vdMIuLOQX7AvdmFeeLi94vi4s4Bfdw+2YV3YuL3TmLizkF+wLwFeaLi+Ywi4swBSb3ihWL3gWLjYqNio2JjYmMiIsIeYsFiIuJiomJiomKiYuJCIs4BYuJjImMiY2JjYqOiwidiwWOi42MjY2MjYyNi40I92f7ihXdi4vmOYuLMAX7AvcBFeaLi94wi4s4BfcCixXdi4veOYuLOAWU9x0Vi94Fi42KjYmNiY2JjImLCHiLBYmLiYqJiYmJiomLiQiLOAWLiYyJjYmNiY2KjYsInosFjYuNjI2NjY2MjYuNCPcBnhWL/AIFi4GIg4SDg4SDh4GLCPwmiwWBi4KPhJKEk4eTi5UIi/gCBYuVj5OSkpKTlI6Viwivi4unBYuXkJaUlJSUlY+YiwidiwWYi5WHlIKUgpCAi38Ii2/3AouLpwWLl4+WlJSUlJaPl4sInosFl4uWh5SClIKPgIt/CItvsIsFlYuTiJODkoSOg4uBCA74lBT4lBWLDAoAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8HMB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAABACDwF/Bz//3//wAAAAAAIPAX8HP//f//AAH/4w/tD5IAAwABAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAAG0trL5fDzz1AAsCAAAAAADPhX3EAAAAAM+FfcQAAP/bAdsB2wAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAB2wABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAACAAAAAdwAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoAKABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoAKABaAHcAaQBkAGcAZQB0AFYAZQByAHMAaQBvAG4AIAAxAC4AMAB3AGkAZABnAGUAdHdpZGdldAB3AGkAZABnAGUAdABSAGUAZwB1AGwAYQByAHcAaQBkAGcAZQB0AEcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format("woff"), url("widget.ttf") format("truetype"); font-weight: normal; font-style: normal; } .ws-popover-opener > span, .time-input-buttons .ws-popover-opener > span { font-family: 'widget'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; zoom: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .ws-popover-opener > span:before { content: "\f073"; } .time-input-buttons .ws-popover-opener > span:before { content: "\f017"; } .ws-range, .ws-range-rail, .ws-range span > span, .input-buttons, .step-controls, .ws-popover-opener, .step-control { margin: 0; padding: 0; border: none; width: auto; background: transparent none; } /* spinner control for time, number (usable for date, datetime-local) */ .has-input-buttons, html > body input.ws-inputreplace.has-input-buttons, span.has-input-buttons { display: inline-block; vertical-align: middle; } .ws-inputreplace[readonly][aria-readonly="false"] { cursor: pointer; } .ws-inputreplace[readonly][aria-readonly="false"][disabled] { cursor: default; cursor: not-allowed; } .input-buttons, .step-controls, .ws-popover-opener { zoom: 1; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: -18.5px; } .step-controls, .ws-popover-opener { position: relative; float: left; margin: 0; height: 19px; width: 15px; } .ws-is-rtl .step-controls, .ws-is-rtl .ws-popover-opener { float: right; } .ws-popover-opener { position: relative; zoom: 1; overflow: visible; margin: 0 0 0 2px; width: 19px; cursor: pointer; background: #ccc; font-size: 13px; text-align: center; outline-offset: -2px; } .ws-popover-opener:focus, .ws-popover-opener:active { outline: 1px dotted #666; } .ws-popover-opener:hover { outline: none; } .ws-is-rtl .ws-popover-opener { margin: 0 2px 0 0; } .ws-popover-opener > span, .ws-popover-opener .ws-color-indicator { display: block; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; } .ws-popover-opener .ws-color-indicator:before { content: ""; } .color-input-buttons .ws-popover-opener .ws-color-indicator { background: url(color-picker.png) no-repeat 0 0; } .color-input-buttons .ws-popover-opener .ws-color-indicator:before { content: ""; } .ws-popover-opener .ws-color-indicator.ws-color-indicator-bg { background: url(../jpicker/images/preview-opacity.png) no-repeat 0; } .ws-popover-opener .ws-color-indicator.ws-color-indicator { background: none; } .ws-popover-opener .ws-color-indicator.ws-color-indicator:before { content: ""; } .time-input-buttons .ws-popover-opener > span { margin: -7.5px 0 0 -7.5px; } input[type="color"] { width: 7.5em; } .input-buttons { text-align: left; } .input-buttons.color-input-buttons { margin-left: 2px; } .input-buttons.ws-disabled { opacity: 0.95; } .input-buttons.ws-disabled .ws-popover-opener, .input-buttons.ws-disabled .step-control, .input-buttons.ws-readonly .ws-popover-opener, .input-buttons.ws-readonly .step-control { cursor: default; } .input-button-size-1.month-input-buttons, .input-button-size-1.date-input-buttons, .input-button-size-1.datetime-local-input-buttons { margin-left: -24px; } .input-button-size-1.month-input-buttons.ws-is-rtl, .input-button-size-1.date-input-buttons.ws-is-rtl, .input-button-size-1.datetime-local-input-buttons.ws-is-rtl { margin-left: 0; margin-right: -24px; } .input-button-size-2 { margin-left: -39px; } .input-button-size-2.ws-is-rtl { margin-left: 0; margin-right: -39px; } .input-button-size-2 .step-controls { visibility: hidden; opacity: 0; } :focus + .input-button-size-2 .step-controls, :hover + .input-button-size-2 .step-controls, :active + .input-button-size-2 .step-controls, .input-button-size-2:hover .step-controls { opacity: 1; visibility: visible; } .step-controls { transition: all 300ms; } span.step-control { position: absolute; left: 0; display: inline-block; overflow: hidden; margin: 0 !important; padding: 0 !important; width: 15px; height: 9px; cursor: pointer; font-size: 0; line-height: 0; text-align: center; transition: border-color 300ms, background-color 300ms; } span.step-control.step-down { bottom: 0; } span.step-control:before { position: absolute; top: 50%; left: 50%; content: ""; display: inline-block; width: 0px; height: 0px; border-style: solid; margin: -2px 0 0 -4px; transition: border-color 300ms, background-color 300ms; } span.step-control.step-up:before { border-width: 0 4px 4px; border-color: transparent transparent #999 transparent; } span.step-control.step-up:hover:before { border-color: transparent transparent #666 transparent; } span.step-control.step-up.mousepress-ui:before { border-color: transparent transparent #000 transparent; } .ws-disabled span.step-control.step-up:before { border-color: transparent transparent #aaa transparent; } span.step-control.step-down:before { border-width: 4px 4px 0; border-color: #999 transparent transparent transparent; } span.step-control.step-down:hover:before { border-color: #666 transparent transparent transparent; } span.step-control.step-down.mousepress-ui:before { border-color: #000 transparent transparent transparent; } .ws-disabled span.step-control.step-down:before { border-color: #aaa transparent transparent transparent; } /* helper classes to hide show/hide specific btn features features */ .ws-input { letter-spacing: -0.31em; word-spacing: -0.43em; } .ws-input > select, .ws-input > input, .ws-input > .ws-input-seperator { text-align: center; letter-spacing: normal; word-spacing: normal; } .ws-input option { text-align: left; } .ws-input .ws-input-seperator { vertical-align: middle; width: 2%; overflow: hidden; } .ws-input + .input-buttons { margin-left: 2px; } .ws-input input, .ws-input .ws-input-seperator { -moz-box-sizing: border-box; box-sizing: border-box; text-align: center; display: inline-block; } span.ws-input { display: inline-block; } .ws-date .mm, .ws-date .dd { width: 23.5%; min-width: 10%; } .ws-date .yy { width: 48%; min-width: 20%; } .ws-date.ws-month-select .dd { width: 22%; min-width: 10%; } .ws-date.ws-month-select .mm { width: 38%; min-width: 17%; } .ws-date.ws-month-select .yy { width: 36%; min-width: 16%; } .ws-month .mm, .ws-month .yy { width: 47.9%; min-width: 20%; } /* range */ .ws-range { position: relative; display: inline-block; vertical-align: middle; margin: 0.57692em 0; zoom: 1; border: none; height: 0.61538em; width: 155px; background: #ddd; cursor: pointer; font-size: 13px; outline: none; transition: background-color 400ms, border-color 400ms; background-color: #ddd; letter-spacing: normal; word-spacing: normal; } [list] + .ws-range { margin: 0.19231em 0 0.96154em; } .ws-range .ws-range-thumb { top: 0; position: absolute; display: block; z-index: 4; margin: -0.38462em 0 0 -1.15385em; height: 1.38462em; width: 2.30769em; background: #ccc; border: 0.07692em solid #aaaaaa; cursor: pointer; transition: background-color 400ms, border-color 400ms; } .ws-range .ws-range-thumb > span { position: absolute; margin: 0 0 3px -90px; padding: 0; border: 0; left: 50%; bottom: 1.46154em; visibility: hidden; width: 180px; text-align: center; background: none; } .ws-range .ws-range-thumb > span > span { visibility: visible; } .ws-range .ws-range-thumb > span > span:after, .ws-range .ws-range-thumb > span > span:before { content: ""; padding: 0.07692em 0.26923em; text-align: center; background: #fff; border: 0.07692em solid #cccccc; visibility: visible; } .ws-range.ws-focus .ws-range-thumb { background: #eee; border-color: #999; } .ws-range.ws-active .ws-range-thumb { background: #efefef; border-color: #666; } .ws-range[aria-disabled="true"], .ws-range[aria-readonly="true"] { cursor: default; opacity: 0.95; } .ws-range[aria-disabled="true"] .ws-range-thumb, .ws-range[aria-readonly="true"] .ws-range-thumb { cursor: default; } .ws-range[aria-disabled="true"] .ws-range-thumb { background: #ddd; border-color: #ddd; } .ws-range .ws-range-rail { position: absolute; display: block; top: 0; left: 0; right: 0; bottom: 0; margin: 0; zoom: 1; } .ws-range .ws-range-progress { position: absolute !important; display: block; margin: 0; padding: 0; top: 0; height: 100%; left: 0; z-index: 1; overflow: hidden; background: #09c; box-sizing: content-box; } .ws-range .ws-range-ticks { position: absolute; bottom: -0.76923em; left: 0; height: 0.61538em; width: 0.07692em; margin: 0 0 0 -0.07692em; background: #ccc; transition: background-color 400ms, color 400ms; } .ws-range .ws-range-ticks.ws-selected-option { background: #09c; color: #09c; } .ws-range.ws-is-rtl .ws-range-progress { left: auto; right: 0; } .ws-range.ws-is-rtl .ws-range-ticks { left: auto; right: 0; } .ws-range.vertical-range { width: 0.61538em; margin: 0 10px 0 5px; } .ws-range.vertical-range .ws-range-ticks { bottom: auto; left: auto; margin: -0.05769em 0 0 0; right: -0.57692em; height: 0.11538em; width: 0.52308em; } .ws-range.vertical-range .ws-range-progress { top: auto; bottom: 1px; left: 0; width: 100%; height: 0; } .ws-range-ticks[data-label]:after, .ws-range-ticks:before { display: none; content: attr(data-label); font-size: 0.76923em; min-width: 2em; text-align: center; margin: 0.69231em 0 0 -0.95em; } .ws-is-rtl .ws-range-ticks[data-label]:after, .ws-is-rtl .ws-range-ticks:before { margin: 0.69231em -0.95em 0 0; } .vertical-range .ws-range-ticks[data-label]:after, .vertical-range .ws-range-ticks:before { margin: 0 0 0 5px; position: relative; top: -0.7em; left: 0.53846em; min-width: 0; } .ws-range-ticks:before { content: attr(data-value); } .ws-range-thumb > span, .ws-range-thumb > span > span:after, .ws-range-thumb > span > span:before { display: none; } /* helper classes to hide show/hide specific range features features */ .ws-inline-picker, div.ws-inline-picker, .ws-popinline, div.ws-popinline { position: relative; max-width: 100%; z-index: 99; }
menuka94/cdnjs
ajax/libs/webshim/1.14.4-RC1/dev/shims/styles/forms-ext.css
CSS
mit
16,773
webshims.register("form-validation",function(a,b,c,d,e,f){"use strict";var g="webkitURL"in c,h=g&&Modernizr.formvalidation&&!b.bugs.bustedValidity,i=h&&parseFloat((navigator.userAgent.match(/Safari\/([\d\.]+)/)||["","999999"])[1],10),j=f.iVal;j.fieldWrapper||(j.fieldWrapper=":not(span), :not(label), :not(em), :not(strong), :not(p)");var k=j.errorClass||(j.errorClass="user-error"),l=j.successClass||"user-success",m=j.errorWrapperClass||(j.errorWrapperClass="ws-invalid"),n=j.successWrapperClass||(j.successWrapperClass="ws-success"),o=j.errorBoxClass||(j.errorBoxClass="ws-errorbox"),p=j.errorMessageClass||(j.errorMessageClass="ws-errormessage"),q={checkbox:1,radio:1},r=b.loader,s=r.addModule,t=a([]),u=function(){return!a.prop(this,"form")},v=function(b){b=a(b);var c,e,f=t;return"radio"==b[0].type&&(e=b.prop("form"),c=b[0].name,f=c?e?a(e).jProp(c):a(d.getElementsByName(c)).filter(u):b,f=f.filter('[type="radio"]')),f},w=function(b,c){var d;return a.each(b,function(b,e){return e?(d=b+a.prop(c,"validationMessage"),!1):void 0}),d},x=function(a){var b;try{b=d.activeElement.name===a}catch(c){}return b},y={radio:1,checkbox:1,"select-one":1,"select-multiple":1,file:1,date:1,month:1,week:1,text:1},z={time:1,date:1,month:1,datetime:1,week:1,"datetime-local":1},A=function(c){if(j.sel){var d,e,f,g;if(c.target&&(d=a(c.target).getNativeElement()[0],f=a(d).getShadowElement(),"submit"!=d.type&&a.prop(d,"willValidate")&&("change"!=c.type||!(g=f.prop("type"))||y[g]))){e=a.data(d,"webshimsswitchvalidityclass");var m=function(){if(g||(g=f.prop("type")),!(h&&("change"==c.type||537.36>i)&&z[g]&&a(c.target).is(":focus")||"focusout"==c.type&&"radio"==d.type&&x(d.name))){if(b.refreshCustomValidityRules&&"async"==b.refreshCustomValidityRules(d))return a(d).one("refreshvalidityui",A),void 0;var e,j,m,n,o,p=a.prop(d,"validity");p.valid?f.hasClass(l)||(e=l,j=k,n="changedvaliditystate",m="changedvalid",q[d.type]&&d.checked&&v(d).not(d).removeClass(j).addClass(e).removeAttr("aria-invalid"),f.removeAttr("aria-invalid"),a.removeData(d,"webshimsinvalidcause")):(o=w(p,d),a.data(d,"webshimsinvalidcause")!=o&&(a.data(d,"webshimsinvalidcause",o),n="changedvaliditystate"),f.hasClass(k)||(e=k,j=l,q[d.type]&&!d.checked&&v(d).not(d).removeClass(j).addClass(e).attr("aria-invalid","true"),f.attr("aria-invalid","true"),m="changedinvalid")),e&&(f.addClass(e).removeClass(j),setTimeout(function(){a(d).trigger(m)},0)),n&&setTimeout(function(){a(d).trigger(n)},0),a.removeData(d,"webshimsswitchvalidityclass")}};f.triggerHandler("wsallowinstantvalidation",[c])!==!1&&(e&&clearTimeout(e),"refreshvalidityui"==c.type?m():a.data(d,"webshimsswitchvalidityclass",setTimeout(m,9)))}}};a(d.body||"html").on(f.validityUIEvents||"focusout change refreshvalidityui invalid",A).on("reset resetvalui",function(b){var c=a(b.target);c.is("form, fieldset")&&(c=c.jProp("elements")),c.filter(".user-error, .user-success").removeAttr("aria-invalid").removeClass("user-error").removeClass("user-success").getNativeElement().each(function(){a.removeData(this,"webshimsinvalidcause")}).trigger("resetvalidityui")});var B=function(){b.scrollRoot=g||"BackCompat"==d.compatMode?a(d.body):a(d.documentElement)},C=Modernizr.boxSizing||Modernizr["display-table"]||a.support.getSetAttribute||a.support.boxSizing?"minWidth":"width",D="transitionDelay"in d.documentElement.style,E={display:"inline-block",left:0,top:0,marginTop:0,marginLeft:0,marginRight:0,marginBottom:0};B(),b.ready("DOM",B),b.getRelOffset=function(b,c,d){var e,f;return b=a(b),a.swap(a(b)[0],E,function(){a.position&&d&&a.position.getScrollInfo?(d.of||(d.of=c),d.using=function(a,c){b.attr({"data-horizontal":c.horizontal,"data-vertical":c.vertical}),e=a},b.attr({"data-horizontal":"","data-vertical":"","data-my":d.my||"center","data-at":d.at||"center"}),b.position(d)):(e=a(c).offset(),f=b.offset(),e.top-=f.top,e.left-=f.left,e.top+=c.outerHeight())}),e},a.extend(b.wsPopover,{isInElement:function(b,c){a.isArray(b)||(b=[b]);var d,e,f,g=!1;for(d=0,e=b.length;e>d;d++)if(f=b[d],f&&f.jquery&&(f=f[0]),f&&(f==c||a.contains(f,c))){g=!0;break}return g},show:function(b){if(!this.isVisible){var e=a.Event("wspopoverbeforeshow");if(this.element.trigger(e),!e.isDefaultPrevented()){this.isVisible=!0,b=a(b||this.options.prepareFor).getNativeElement();var f=this,g=a(b).getShadowElement(),h=function(a){clearTimeout(f.timers.repos),f.timers.repos=setTimeout(function(){f.position(g)},a&&"pospopover"==a.type?4:200)};this.clear(),this.element.removeClass("ws-po-visible").css("display","none"),this.prepareFor(b,g),this.position(g),f.timers.show=setTimeout(function(){f.element.css("display",""),f.timers.show=setTimeout(function(){f.element.addClass("ws-po-visible").trigger("wspopovershow")},14)},4),a(d.body||d).on("focusin"+this.eventns+" mousedown"+this.eventns,function(a){!f.options.hideOnBlur||f.stopBlur||f.isInElement([f.lastElement[0],b[0],f.element[0]],a.target)||f.hide()}),this.element.off("pospopover").on("pospopover",h),a(c).on("resize"+this.eventns+" pospopover"+this.eventns,h)}}},_getAutoAppendElement:function(){var b=/^(?:span|i|label|b|p|tr|thead|tbody|table|strong|em|ul|ol|dl|html)$/i;return function(c){for(var e,f=c[0],g=d.body;(f=f[e?"offsetParent":"parentNode"])&&1==f.nodeType&&f!=g;)e||b.test(f.nodeName)||(e=f),e&&"hidden"==a.css(f,"overflow")&&"static"!=a.css(f,"position")&&(e=!1);return a(e||g)}}(),prepareFor:function(b,c){var d,e,f=this,g={},h=a.extend(!0,{},this.options,b.jProp("form").data("wspopover")||{},b.data("wspopover"));this.lastOpts=h,this.lastElement=a(b).getShadowFocusElement(),this.prepared&&this.options.prepareFor||(e="element"==h.appendTo?b.parent():"auto"==h.appendTo?this._getAutoAppendElement(b):a(h.appendTo),this.prepared&&e[0]==this.element[0].parentNode||this.element.appendTo(e)),this.element.attr({"data-class":b.prop("className"),"data-id":b.prop("id")}),g[C]=h.constrainWidth?c.outerWidth():"",this.element.css(g),h.hideOnBlur&&(d=function(a){f.stopBlur?a.stopImmediatePropagation():f.hide()},f.timers.bindBlur=setTimeout(function(){f.lastElement.off(f.eventns).on("focusout"+f.eventns+" blur"+f.eventns,d),f.lastElement.getNativeElement().off(f.eventns)},10)),this.prepared=!0},clear:function(){a(c).off(this.eventns),a(d).off(this.eventns),a(d.body).off(this.eventns),this.element.off("transitionend"+this.eventns),this.stopBlur=!1,this.lastOpts=!1,a.each(this.timers,function(a,b){clearTimeout(b)})},hide:function(){var b=a.Event("wspopoverbeforehide");if(this.element.trigger(b),!b.isDefaultPrevented()&&this.isVisible){this.isVisible=!1;var d=this,e=function(b){b&&"transitionend"==b.type&&(b=b.originalEvent)&&b.target==d.element[0]&&"hidden"==d.element.css("visibility")||(d.element.off("transitionend"+d.eventns).css("display","none").attr({"data-id":"","data-class":"",hidden:"hidden"}),clearTimeout(d.timers.forcehide),a(c).off("resize"+d.eventns))};this.clear(),this.element.removeClass("ws-po-visible").trigger("wspopoverhide"),a(c).on("resize"+this.eventns,e),D&&this.element.off("transitionend"+this.eventns).on("transitionend"+this.eventns,e),d.timers.forcehide=setTimeout(e,D?600:40)}},position:function(a){var c=b.getRelOffset(this.element.removeAttr("hidden"),a,(this.lastOpts||this.options).position);this.element.css(c)}}),b.validityAlert=function(){f.messagePopover.position=a.extend({},{at:"left bottom",my:"left top",collision:"none"},f.messagePopover.position||{});var c=b.objectCreate(b.wsPopover,{},f.messagePopover),d=c.hide.bind(c);return c.element.addClass("validity-alert").attr({role:"alert"}),a.extend(c,{hideDelay:5e3,showFor:function(b,c,e,f){b=a(b).getNativeElement(),this.clear(),this.hide(),f||(this.getMessage(b,c),this.show(b),this.hideDelay&&(this.timers.delayedHide=setTimeout(d,this.hideDelay))),e||this.setFocus(b)},setFocus:function(d){var e=a(d).getShadowFocusElement(),g=b.scrollRoot.scrollTop()+(f.viewportOffset||0),h=e.offset().top-(f.scrollOffset||30),i=function(){try{e[0].focus()}catch(a){}c.element.triggerHandler("pospopover")};g>h?b.scrollRoot.animate({scrollTop:h-5-(f.viewportOffset||0)},{queue:!1,duration:Math.max(Math.min(600,1.5*(g-h)),80),complete:i}):i()},getMessage:function(a,b){b||(b=a.getErrorMessage()),b?c.contentElement.text(b):this.hide()}}),c}();var F={slide:{show:"slideDown",hide:"slideUp"},fade:{show:"fadeIn",hide:"fadeOut"},no:{show:"show",hide:"hide"}};j.fx&&F[j.fx]||(j.fx="slide"),a.fn[F[j.fx].show]||(j.fx="no");var G=0;if(b.errorbox={create:function(b,c){c||(c=this.getFieldWrapper(b));var d=a("div."+o,c);return d.length||(d=a('<div class="'+o+'" hidden="hidden" style="display: none;">'),c.append(d)),d.prop("id")||(G++,d.prop("id","errorbox-"+G)),c.data("errorbox",d),d},getFieldWrapper:function(c){var d;return d="function"==typeof j.fieldWrapper?j.fieldWrapper.apply(this,arguments):a(c).parent().closest(j.fieldWrapper),d.length||b.error("could not find fieldwrapper: "+j.fieldWrapper),d},_createContentMessage:function(){var c={},d=function(a){return"-"+a.toLowerCase()},e=function(b){var d=a(b).data("errortype");return d||a.each(c,function(c,e){return a(b).is(e)?(d=c,!1):void 0}),d||"defaultMessage"};return a.each(["customError","badInput","typeMismatch","rangeUnderflow","rangeOverflow","stepMismatch","tooLong","tooShort","patternMismatch","valueMissing"],function(a,b){var e=b.replace(/[A-Z]/,d);c[b]="."+e+", ."+b+", ."+b.toLowerCase()+', [data-errortype="'+b+'"]'}),function(c,d){var f=!1,g=a(c).data("errormessage")||{};"string"==typeof g&&(g={defaultMessage:g}),a(d).children().each(function(){var b=e(this);g[b]||(f=!0,g[b]=a(this).html())}),f&&a(c).data("errormessage",g),b.getOptions&&b.getOptions(c,"errormessage")}}(),initIvalContentMessage:function(b){a(b).jProp("form").is(j.sel)&&this.get(b)},get:function(b,c){c||(c=this.getFieldWrapper(b));var d=c.data("errorbox");return d?"string"==typeof d&&(d=a("#"+d),c.data("errorbox",d),this._createContentMessage(b,d)):(d=this.create(b,c),this._createContentMessage(b,d)),d},addSuccess:function(b,c){var d=a.prop(b,"type"),e=function(){var e=q[d]?a.prop(b,"checked"):a(b).val();c[e?"addClass":"removeClass"](n)},f=y[d]?"change":"blur";a(b).off(".recheckvalid").on(f+".recheckinvalid",e),e()},hideError:function(b,c){var d,e=this.getFieldWrapper(b),f=this.get(b,e);return f&&f.jquery&&(a(b).filter("input").off(".recheckinvalid"),!c&&(d=a("input:invalid, select:invalid, textarea:invalid",e)[0])?a(d).trigger("refreshvalidityui"):(e.removeClass(m),f.message="",f[F[j.fx].hide](function(){this.id==b.getAttribute("aria-describedby")&&b.removeAttribute("aria-describedby"),a(this).attr({hidden:"hidden"})}))),c||d||this.addSuccess(b,e),e},recheckInvalidInput:function(b){if(j.recheckDelay&&j.recheckDelay>90){var c,d=function(){A({type:"input",target:b})};a(b).filter('input:not([type="checkbox"]):not([type="radio"])').off(".recheckinvalid").on("input.recheckinvalid",function(){clearTimeout(c),c=setTimeout(d,j.recheckDelay)}).on("focusout.recheckinvalid",function(){clearTimeout(c)})}},showError:function(b){var c=this.getFieldWrapper(b),d=this.get(b,c),e=a(b).getErrorMessage();return d.message!=e&&(d.stop&&d.stop(!0,!0),d.html('<p class="'+p+'">'+e+"</p>"),d.message=e,c.addClass(m).removeClass(n),this.recheckInvalidInput(b),(d.is("[hidden]")||"none"==d.css("display"))&&(b.getAttribute("aria-describedby")||b.setAttribute("aria-describedby",d.prop("id")),d.css({display:"none"}).removeAttr("hidden")[F[j.fx].show]())),c.removeClass(n),a(b).off(".recheckvalid"),c},reset:function(a){this.hideError(a,!0).removeClass(n)},toggle:function(b){a(b).is(":invalid")?this.showError(b):this.hideError(b)}},a(d.body).on({changedvaliditystate:function(c){if(j.sel){var d=a(c.target).jProp("form");d.is(j.sel)&&b.errorbox.toggle(c.target)}},resetvalidityui:function(c){if(j.sel){var d=a(c.target).jProp("form");d.is(j.sel)&&b.errorbox.reset(c.target)}},firstinvalid:function(c){if(j.sel&&j.handleBubble){var d=a(c.target).jProp("form");d.is(j.sel)&&(c.preventDefault(),"none"!=j.handleBubble&&b.validityAlert.showFor(c.target,!1,!1,"hide"==j.handleBubble))}},submit:function(b){return j.sel&&j.submitCheck&&a(b.target).is(j.sel)&&a.prop(b.target,"noValidate")&&!a(b.target).checkValidity()?(b.stopImmediatePropagation(),!1):void 0}}),b.modules["form-core"].getGroupElements=v,/[\s\:\>\~\+]/.test(j.sel||"")&&b.error("please use a simple selector for iVal.sel: for example .validate"),f.replaceValidationUI&&a(d).on("firstinvalid",function(a){a.isDefaultPrevented()||(a.preventDefault(),setTimeout(function(){b.validityAlert.showFor(a.target)},4))}),function(){var b,c,e=[];a(d).on("invalid",function(d){if(!d.wrongWebkitInvalid){var f=a(d.target);b||(b=a.Event("firstinvalid"),f.trigger(b)),b&&b.isDefaultPrevented()&&d.preventDefault(),e.push(d.target),d.extraData="fix",clearTimeout(c),c=setTimeout(function(){var c={type:"lastinvalid",cancelable:!1,invalidlist:a(e)};b=!1,e=[],a(d.target).trigger(c,[c])},9),f=null}})}(),!a.event.special.change&&!a.event.special.input&&Modernizr.inputtypes&&f.fixRangeChange){var H={trigger:function(){H.blockElement&&(H.blockElement=!1,setTimeout(function(){H.requestedChange&&H.value!=H.requestedChange.value&&a(H.requestedChange).trigger("change"),H.value=!1},9))},lastValue:!1,updateInputValue:function(a){H.lastValue=a.target.value},triggerInput:function(b){H.lastValue!==!1&&H.lastValue!=b.target.value&&a(b.target).trigger("input")},inputTeardown:function(b){a(b.target).off("input",H.updateInputValue).off("blur",H.inputTeardown),H.lastValue=!1},inputSetup:function(b){"range"==b.target.type&&(H.inputTeardown(b),H.lastValue=b.target.value,a(b.target).on("input",H.updateInputValue).on("blur",H.inputTeardown))}};a.each([{name:"key",evt:"keyup"},{name:"mouse",evt:"mouseup"},{name:"touch",evt:"touchend"}],function(b,c){var e=(c.name+"Setup",c.name+"Commit");H[c.name+"Block"]=function(b){H.blockElement||"range"!=b.target.type||(H.blockElement=b.target,H.value=b.target.value,a(H.blockElement).off("blur",H.trigger).on("blur",H.trigger),a(d.body).off(c.evt,H[e]).on(c.evt,H[e]))},H[e]=function(){a(d.body).off(c.evt,H[e]),H.trigger()}}),a(d.body||"html").on({mousedown:H.mouseBlock,"keydown kepress":function(a){a.keyCode<45&&a.keyCode>30&&H.keyBlock(a)},touchstart:H.touchBlock,focusin:H.inputSetup}),a.extend(!0,a.event.special,{change:{handle:function(a){return a.isTrigger||H.blockElement!=a.target?(H.requestedChange==a.target&&(H.requestedChange=!1),a.handleObj.handler.apply(this,arguments),void 0):(H.requestedChange=a.target,H.triggerInput(a),!1)}},input:{handle:function(){var b,c,d=function(){c&&a(c).off("change",d),b=!1,c=!1},e=function(e){d(e),c=e.target,b=e.target.value,a(e.target).on("change",d)};return function(a){var d;if(!a.isTrigger&&"range"==a.target.type)if(c!=a.target)e(a);else if(c==a.target){if(b==(d=a.target.value))return!1;b=a.target.value}a.handleObj.handler.apply(this,arguments)}}()}})}b.cfg.debug!==!1&&a(function(){a("form.ws-instantvalidation").length&&b.error(".ws-instantvalidation was renamed to .ws-validate")}),s("form-combat",{d:["dom-support"],test:!(a.mobile&&(a.mobile.selectmenu||a.mobile.checkboxradio)||a.fn.select2||a.fn.chosen||a.fn.selectpicker||a.fn.selectBoxIt)}),s("position",{src:"plugins/jquery.ui.position.js",test:!(!a.position||!a.position.getScrollInfo)}),r.loadList(["form-combat","position"])});
dannyxx001/cdnjs
ajax/libs/webshim/1.12.0/minified/shims/form-validation.js
JavaScript
mit
15,238
webshims.register("mediaelement-jaris",function(a,b,c,d,e,f){"use strict";var g=b.mediaelement,h=c.swfmini,i=b.support,j=i.mediaelement,k=h.hasFlashPlayerVersion("11.3"),l=0,m="ActiveXObject"in c&&j,n={paused:!0,ended:!1,currentSrc:"",duration:c.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,seeking:!1,error:null,buffered:{start:function(a){return a?void b.error("buffered index size error"):0},end:function(a){return a?void b.error("buffered index size error"):0},length:0}},o=Object.keys(n),p={currentTime:0,volume:1,muted:!1},q=(Object.keys(p),a.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_usermedia:null,_bufferedEnd:0,_bufferedStart:0,currentTime:0,lastCalledTime:-500,_ppFlag:e,_calledMeta:!1,lastDuration:0,_timeDif:.3},n,p)),r=function(a){try{a.nodeName}catch(c){return null}var d=b.data(a,"mediaelement");return d&&"third"==d.isActive?d:null},s=function(b,c){c=a.Event(c),c.preventDefault(),a.event.trigger(c,e,b)},t=f.playerPath||b.cfg.basePath+"swf/"+(f.playerName||"JarisFLVPlayer.swf");b.extendUNDEFProp(f.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent",allowNetworking:"all"}),b.extendUNDEFProp(f.vars,{controltype:"1",jsapi:"1"}),b.extendUNDEFProp(f.attrs,{bgcolor:"#000000"}),f.playerPath=t;var u=function(a,b){3>a&&clearTimeout(b._canplaythroughTimer),a>=3&&b.readyState<3&&(b.readyState=a,s(b._elem,"canplay"),b.paused||s(b._elem,"playing"),clearTimeout(b._canplaythroughTimer),b._canplaythroughTimer=setTimeout(function(){u(4,b)},4e3)),a>=4&&b.readyState<4&&(b.readyState=a,s(b._elem,"canplaythrough")),b.readyState=a},v=function(b){b.seeking&&Math.abs(b.currentTime-b._lastSeektime)<2&&(b.seeking=!1,a(b._elem).triggerHandler("seeked"))};g.jarisEvent=g.jarisEvent||{};var w,x={onPlayPause:function(a,b,c){var d,e,f=b.paused||b.ended;if(null==c)try{d=b.api.api_get("isPlaying")}catch(g){}else d=c;(d==f||null==d)&&(b.paused=!d,e=b.paused?"pause":"play",b._ppFlag=!0,s(b._elem,e)),b.paused&&d!=f&&null!=d||b.readyState<3&&u(3,b),b.paused||s(b._elem,"playing")},onSeek:function(b,c){c._lastSeektime=b.seekTime,c.seeking=!0,a(c._elem).triggerHandler("seeking"),clearTimeout(c._seekedTimer),c._seekedTimer=setTimeout(function(){v(c),c.seeking=!1},300)},onConnectionFailed:function(a,b){g.setError(b._elem,"flash connection error")},onNotBuffering:function(a,b){u(3,b)},onDataInitialized:function(a,b){var c,d=b.duration;b.duration=a.duration,d==b.duration||isNaN(b.duration)||b._calledMeta&&(c=Math.abs(b.lastDuration-b.duration))<2||(b.videoHeight=a.height,b.videoWidth=a.width,b.networkState||(b.networkState=2),b.readyState<1&&u(1,b),clearTimeout(b._durationChangeTimer),b._calledMeta&&b.duration?b._durationChangeTimer=setTimeout(function(){b.lastDuration=b.duration,s(b._elem,"durationchange")},c>50?0:c>9?9:99):(b.lastDuration=b.duration,b.duration&&s(b._elem,"durationchange"),b._calledMeta||s(b._elem,"loadedmetadata"),b._timeDif=b.duration>1&&b.duration<140?.2:b.duration<600?.25:.3),b._calledMeta=!0)},onBuffering:function(a,b){b.ended&&(b.ended=!1),u(1,b),s(b._elem,"waiting")},onTimeUpdate:function(b,c){var d=c.currentTime-c.lastCalledTime;c.ended&&(c.ended=!1),c.readyState<3&&(u(3,c),s(c._elem,"playing")),c.seeking&&v(c),(d>c._timeDif||-.3>d)&&(c.lastCalledTime=c.currentTime,a.event.trigger("timeupdate",e,c._elem,!0))},onProgress:function(b,c){if(c.ended&&(c.ended=!1),c.duration&&!isNaN(c.duration)){var d=b.loaded/b.total;d>.02&&.2>d?u(3,c):d>.2&&(d>.95&&(d=1,c.networkState=1),u(4,c)),c._bufferedEnd&&c._bufferedEnd>d&&(c._bufferedStart=c.currentTime||0),c._bufferedEnd=d,c.buffered.length=1,a.event.trigger("progress",e,c._elem,!0)}},onPlaybackFinished:function(a,b){b.readyState<4&&u(4,b),b.ended=!0,s(b._elem,"ended")},onVolumeChange:function(a,b){(b.volume!=a.volume||b.muted!=a.mute)&&(b.volume=a.volume,b.muted=a.mute,s(b._elem,"volumechange"))},ready:function(){var c=function(a){var b=!0;try{a.api.api_get("volume")}catch(c){b=!1}return b};return function(d,e){var f=0,g=function(){return f>9?void(e.tryedReframeing=0):(f++,e.tryedReframeing++,void(c(e)?(e.wasSwfReady=!0,e.tryedReframeing=0,z(e),y(e)):e.tryedReframeing<6?e.tryedReframeing<3?(e.reframeTimer=setTimeout(g,9),e.shadowElem.css({overflow:"visible"}),setTimeout(function(){e.shadowElem.css({overflow:"hidden"})},1)):(e.shadowElem.css({overflow:"hidden"}),a(e._elem).mediaLoad()):(clearTimeout(e.reframeTimer),b.error("reframing error"))))};e&&e.api&&(e.tryedReframeing||(e.tryedReframeing=0),clearTimeout(w),clearTimeout(e.reframeTimer),e.shadowElem.removeClass("flashblocker-assumed"),f?e.reframeTimer=setTimeout(g,9):g())}}()};x.onMute=x.onVolumeChange,g.onEvent=x;var y=function(a){var c,d=a.actionQueue.length,e=0;if(d&&"third"==a.isActive)for(;a.actionQueue.length&&d>e;){e++,c=a.actionQueue.shift();try{a.api[c.fn].apply(a.api,c.args)}catch(f){b.warn(f)}}a.actionQueue.length&&(a.actionQueue=[])},z=function(b){b&&((b._ppFlag===e&&a.prop(b._elem,"autoplay")||!b.paused)&&setTimeout(function(){if("third"==b.isActive&&(b._ppFlag===e||!b.paused))try{a(b._elem).play(),b._ppFlag=!0}catch(c){}},1),b.muted&&a.prop(b._elem,"muted",!0),1!=b.volume&&a.prop(b._elem,"volume",b.volume))},A=a.noop;if(j){var B={play:1,playing:1},C=["play","pause","playing","loadstart","canplay","progress","waiting","ended","loadedmetadata","durationchange","emptied"],D=C.map(function(a){return a+".webshimspolyfill"}).join(" "),E=function(c){var d=b.data(c.target,"mediaelement");if(d){var e=c.originalEvent&&c.originalEvent.type===c.type;e==("third"==d.activating)&&(c.stopImmediatePropagation(),B[c.type]&&(d.isActive!=d.activating?a(c.target).pause():e&&(a.prop(c.target,"pause")._supvalue||a.noop).apply(c.target)))}};A=function(c){a(c).off(D).on(D,E),C.forEach(function(a){b.moveToFirstEvent(c,a)})},A(d)}g.setActive=function(c,d,e){if(e||(e=b.data(c,"mediaelement")),e&&e.isActive!=d){"html5"!=d&&"third"!=d&&b.warn("wrong type for mediaelement activating: "+d);var f=b.data(c,"shadowData");e.activating=d,a(c).pause(),e.isActive=d,"third"==d?(f.shadowElement=f.shadowFocusElement=e.shadowElem[0],a(c).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):(a(c).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),f.shadowElement=f.shadowFocusElement=!1),a(c).trigger("mediaelementapichange")}};var F=function(){var a=["_calledMeta","lastDuration","_bufferedEnd","lastCalledTime","_usermedia","_bufferedStart","_ppFlag","currentSrc","currentTime","duration","ended","networkState","paused","seeking","videoHeight","videoWidth"],b=a.length;return function(c){if(c){clearTimeout(c._seekedTimer);var d=b,e=c.networkState;for(u(0,c),clearTimeout(c._durationChangeTimer);--d>-1;)delete c[a[d]];c.actionQueue=[],c.buffered.length=0,e&&s(c._elem,"emptied")}}}(),G=function(){var e={},f=function(b){var c,f,g;return e[b.currentSrc]?c=e[b.currentSrc]:b.videoHeight&&b.videoWidth?(e[b.currentSrc]={width:b.videoWidth,height:b.videoHeight},c=e[b.currentSrc]):(f=a.attr(b._elem,"poster"))&&(c=e[f],c||(g=d.createElement("img"),g.onload=function(){e[f]={width:this.width,height:this.height},e[f].height&&e[f].width?H(b,a.prop(b._elem,"controls")):delete e[f],g.onload=null},g.src=f,g.complete&&g.onload&&g.onload())),c||{width:300,height:"video"==b._elemNodeName?150:50}},g=function(a,b){return a.style[b]||a.currentStyle&&a.currentStyle[b]||c.getComputedStyle&&(c.getComputedStyle(a,null)||{})[b]||""},h=["minWidth","maxWidth","minHeight","maxHeight"],i=function(a,b){var c,d,e=!1;for(c=0;4>c;c++)d=g(a,h[c]),parseFloat(d,10)&&(e=!0,b[h[c]]=d);return e},j=function(c){var d,e,h=c._elem,j={width:"auto"==g(h,"width"),height:"auto"==g(h,"height")},k={width:!j.width&&a(h).width(),height:!j.height&&a(h).height()};return(j.width||j.height)&&(d=f(c),e=d.width/d.height,j.width&&j.height?(k.width=d.width,k.height=d.height):j.width?k.width=k.height*e:j.height&&(k.height=k.width/e),i(h,k)&&(c.shadowElem.css(k),j.width&&(k.width=c.shadowElem.height()*e),j.height&&(k.height=(j.width?k.width:c.shadowElem.width())/e),j.width&&j.height&&(c.shadowElem.css(k),k.height=c.shadowElem.width()/e,k.width=k.height*e,c.shadowElem.css(k),k.width=c.shadowElem.height()*e,k.height=k.width/e),b.support.mediaelement||(k.width=c.shadowElem.width(),k.height=c.shadowElem.height()))),k};return j}(),H=function(b,c){var d,e=b.shadowElem;a(b._elem)[c?"addClass":"removeClass"]("webshims-controls"),("third"==b.isActive||"third"==b.activating)&&("audio"!=b._elemNodeName||c?(b._elem.style.display="",d=G(b),b._elem.style.display="none",e.css(d)):e.css({width:0,height:0}))},I=function(){var b={"":1,auto:1};return function(c){var d=a.attr(c,"preload");return null==d||"none"==d||a.prop(c,"autoplay")?!1:(d=a.prop(c,"preload"),!!(b[d]||"metadata"==d&&a(c).is(".preload-in-doubt, video:not([poster])")))}}(),J={A:/&amp;/g,a:/&/g,e:/\=/g,q:/\?/g},K=function(a){return a.replace?a.replace(J.A,"%26").replace(J.a,"%26").replace(J.e,"%3D").replace(J.q,"%3F"):a};if("matchMedia"in c){var L=!1;try{L=c.matchMedia("only all").matches}catch(M){}L&&(g.sortMedia=function(a,b){try{a=!a.media||matchMedia(a.media).matches,b=!b.media||matchMedia(b.media).matches}catch(c){return 0}return a==b?0:a?-1:1})}g.resetSwfProps=F,g.createSWF=function(c,e,f){if(!k)return void setTimeout(function(){a(c).mediaLoad()},1);var h={};1>l?l=1:l++,f||(f=b.data(c,"mediaelement")),((h.height=a.attr(c,"height")||"")||(h.width=a.attr(c,"width")||""))&&(a(c).css(h),b.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull."));var i,m=e.streamrequest,n="jarisplayer/stream"==e.type,o=a.prop(c,"controls"),p="jarisplayer-"+b.getID(c),r=c.nodeName.toLowerCase(),t=function(){"third"==f.isActive&&H(f,a.prop(c,"controls"))};return n&&!m?void webshim.usermedia.attach(c,e,f):(f&&f.swfCreated?(g.setActive(c,"third",f),f.currentSrc="",f.shadowElem.html('<div id="'+p+'">'),f.api=!1,f.actionQueue=[],i=f.shadowElem,F(f),f.currentSrc=e.srcProp):(a(d.getElementById("wrapper-"+p)).remove(),i=a('<div class="polyfill-'+r+" polyfill-mediaelement "+b.shadowClass+'" id="wrapper-'+p+'"><div id="'+p+'"></div>').css({position:"relative",overflow:"hidden"}),f=b.data(c,"mediaelement",b.objectCreate(q,{actionQueue:{value:[]},shadowElem:{value:i},_elemNodeName:{value:r},_elem:{value:c},currentSrc:{value:m?"":e.srcProp},swfCreated:{value:!0},id:{value:p.replace(/-/g,"")},buffered:{value:{start:function(a){return a>=f.buffered.length?void b.error("buffered index size error"):0},end:function(a){return a>=f.buffered.length?void b.error("buffered index size error"):(f.duration-f._bufferedStart)*f._bufferedEnd+f._bufferedStart},length:0}}})),i.insertBefore(c),j&&a.extend(f,{volume:a.prop(c,"volume"),muted:a.prop(c,"muted"),paused:a.prop(c,"paused")}),b.addShadowDom(c,i),b.data(c,"mediaelement")||b.data(c,"mediaelement",f),A(c),g.setActive(c,"third",f),H(f,o),a(c).on({"updatemediaelementdimensions loadedmetadata emptied":t,remove:function(a){!a.originalEvent&&g.jarisEvent[f.id]&&g.jarisEvent[f.id].elem==c&&(delete g.jarisEvent[f.id],clearTimeout(w),clearTimeout(f.flashBlock))}}).onWSOff("updateshadowdom",t)),g.jarisEvent[f.id]&&g.jarisEvent[f.id].elem!=c?void b.error("something went wrong"):(g.jarisEvent[f.id]||(g.jarisEvent[f.id]=function(a){if("ready"==a.type){var b=function(){f.api&&(f.paused||f.api.api_play(),I(c)&&f.api.api_preload(),x.ready(a,f))};f.api?b():setTimeout(b,9)}else f.currentTime=a.position,f.api&&(!f._calledMeta&&isNaN(a.duration)&&f.duration!=a.duration&&isNaN(f.duration)&&x.onDataInitialized(a,f),f._ppFlag||"onPlayPause"==a.type||x.onPlayPause(a,f),x[a.type]&&x[a.type](a,f)),f.duration=a.duration},g.jarisEvent[f.id].elem=c),N(c,e,f,p,o,r),void(m||s(f._elem,"loadstart"))))};var N=function(c,d,e,g,i,j){var k,l,m,n,o="audio/rtmp"==d.type||"video/rtmp"==d.type,p="jarisplayer/stream"==d.type;k=a.extend({},f.vars,{poster:K(a.attr(c,"poster")&&a.prop(c,"poster")||""),source:K(d.streamId||d.srcProp),server:K(d.server||"")}),l=a(c).data("vars")||{},a.extend(k,{id:g,evtId:e.id,controls:""+(!p&&i),autostart:"false",nodename:j},l),o?k.streamtype="rtmp":p?k.streamtype="usermedia":"audio/mpeg"==d.type||"audio/mp3"==d.type?(k.type="audio",k.streamtype="file"):"video/youtube"==d.type&&(k.streamtype="youtube"),n=a.extend({},f.attrs,{name:g,id:g},a(c).data("attrs")),m=a.extend({},f.params,a(c).data("params")),f.changeSWF(k,c,d,e,"embed"),clearTimeout(e.flashBlock),h.embedSWF(t,g,"100%","100%","11.3",!1,k,m,n,function(f){if(f.success){var g=function(){(!f.ref.parentNode&&box[0].parentNode||"none"==f.ref.style.display)&&(box.addClass("flashblocker-assumed"),a(c).trigger("flashblocker"),b.warn("flashblocker assumed")),a(f.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})};e.api=f.ref,i||a(f.ref).attr("tabindex","-1").css("outline","none"),e.flashBlock=setTimeout(g,99),w||(clearTimeout(w),w=setTimeout(function(){g();var c=a(f.ref);c[0].offsetWidth>1&&c[0].offsetHeight>1&&0===location.protocol.indexOf("file:")?b.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(c[0].offsetWidth<2||c[0].offsetHeight<2)&&b.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"),c=null},8e3)),p&&webshim.usermedia.request(c,d,e)}})},O=function(a,b,c,d){return d=d||r(a),d?(d.api&&d.api[b]?d.api[b].apply(d.api,c||[]):(d.actionQueue.push({fn:b,args:c}),d.actionQueue.length>10&&setTimeout(function(){d.actionQueue.length>5&&d.actionQueue.shift()},99)),d):!1};g.queueSwfMethod=O,["audio","video"].forEach(function(c){var d,e={},f=function(a){("audio"!=c||"videoHeight"!=a&&"videoWidth"!=a)&&(e[a]={get:function(){var b=r(this);return b?b[a]:j&&d[a].prop._supget?d[a].prop._supget.apply(this):q[a]},writeable:!1})},g=function(a,b){f(a),delete e[a].writeable,e[a].set=b};g("seeking"),g("volume",function(a){var c=r(this);if(c)a*=1,isNaN(a)||((0>a||a>1)&&b.error("volume greater or less than allowed "+a/100),O(this,"api_volume",[a],c),c.volume!=a&&(c.volume=a,s(c._elem,"volumechange")),c=null);else if(d.volume.prop._supset)return d.volume.prop._supset.apply(this,arguments)}),g("muted",function(a){var b=r(this);if(b)a=!!a,O(this,"api_muted",[a],b),b.muted!=a&&(b.muted=a,s(b._elem,"volumechange")),b=null;else if(d.muted.prop._supset)return d.muted.prop._supset.apply(this,arguments)}),g("currentTime",function(a){var b=r(this);if(b)a*=1,isNaN(a)||O(this,"api_seek",[a],b);else if(d.currentTime.prop._supset)return d.currentTime.prop._supset.apply(this,arguments)}),["play","pause"].forEach(function(a){e[a]={value:function(){var b=r(this);if(b)b.stopPlayPause&&clearTimeout(b.stopPlayPause),O(this,"play"==a?"api_play":"api_pause",[],b),b._ppFlag=!0,b.paused!=("play"!=a)&&(b.paused="play"!=a,s(b._elem,a));else if(d[a].prop._supvalue)return d[a].prop._supvalue.apply(this,arguments)}}}),o.forEach(f),b.onNodeNamesPropertyModify(c,"controls",function(b,d){var e=r(this);a(this)[d?"addClass":"removeClass"]("webshims-controls"),e&&("audio"==c&&H(e,d),O(this,"api_controls",[d],e))}),b.onNodeNamesPropertyModify(c,"preload",function(){var c,d,e;I(this)&&(c=r(this),c?O(this,"api_preload",[],c):!m||!this.paused||this.error||a.data(this,"mediaerror")||this.readyState||this.networkState||this.autoplay||!a(this).is(":not(.nonnative-api-active)")||(e=this,d=b.data(e,"mediaelementBase")||b.data(e,"mediaelementBase",{}),clearTimeout(d.loadTimer),d.loadTimer=setTimeout(function(){a(e).mediaLoad()},9)))}),d=b.defineNodeNameProperties(c,e,"prop"),i.mediaDefaultMuted||b.defineNodeNameProperties(c,{defaultMuted:{get:function(){return null!=a.attr(this,"muted")},set:function(b){b?a.attr(this,"muted",""):a(this).removeAttr("muted")}}},"prop")});var P=function(){if(!c.CanvasRenderingContext2D)return!1;var a=CanvasRenderingContext2D.prototype.drawImage,e=Array.prototype.slice,g={video:1,VIDEO:1},h={};return a||webshim.error("canvas.drawImage feature is needed. In IE8 flashvanvas pro can be used"),CanvasRenderingContext2D.prototype.drawImage=function(c){var i,j,k,l,m,n=this;if(g[c.nodeName]&&(i=b.data(c,"mediaelement"))&&"third"==i.isActive&&i.api.api_image){try{l=i.api.api_image()}catch(o){b.error(o)}return h[i.currentSrc]||(h[i.currentSrc]=!0,null==l&&b.error("video has to be same origin or a crossdomain.xml has to be provided. Video has to be visible for flash API")),k=e.call(arguments,1),f.canvasSync&&i.canvasImg&&(k.unshift(i.canvasImg),a.apply(n,k),k=e.call(arguments,1),m=!0),j=d.createElement("img"),j.onload=function(){k.unshift(this),j.onload=null,f.canvasSync&&(i.canvasImg=j,m&&f.noDoubbleDraw)||a.apply(n,k)},j.src="data:image/jpeg;base64,"+l,void(j.complete&&j.onload&&j.onload())}return a.apply(this,arguments)},!0};if(P()||b.ready("canvas",P),k&&a.cleanData){var Q=a.cleanData,R=d.createElement("object"),S={SetVariable:1,GetVariable:1,SetReturnValue:1,GetReturnValue:1},T={object:1,OBJECT:1};a.cleanData=function(a){var b,c,d,e=Q.apply(this,arguments);if(a&&(c=a.length)&&l)for(b=0;c>b;b++)if(T[a[b].nodeName]&&"api_destroy"in a[b]){l--;try{if(a[b].api_destroy(),4==a[b].readyState)for(d in a[b])S[d]||R[d]||"function"!=typeof a[b][d]||(a[b][d]=null)}catch(f){console.log(f)}}return e}}if(j?"media"in d.createElement("source")||b.reflectProperties("source",["media"]):(["poster","src"].forEach(function(a){b.defineNodeNamesProperty("src"==a?["audio","video","source"]:["video"],a,{reflect:!0,propType:"src"})}),b.defineNodeNamesProperty(["audio","video"],"preload",{reflect:!0,propType:"enumarated",defaultValue:"",limitedTo:["","auto","metadata","none"]}),b.reflectProperties("source",["type","media"]),["autoplay","controls"].forEach(function(a){b.defineNodeNamesBooleanProperty(["audio","video"],a)}),b.defineNodeNamesProperties(["audio","video"],{HAVE_CURRENT_DATA:{value:2},HAVE_ENOUGH_DATA:{value:4},HAVE_FUTURE_DATA:{value:3},HAVE_METADATA:{value:1},HAVE_NOTHING:{value:0},NETWORK_EMPTY:{value:0},NETWORK_IDLE:{value:1},NETWORK_LOADING:{value:2},NETWORK_NO_SOURCE:{value:3}},"prop"),k&&b.ready("WINDOWLOAD",function(){setTimeout(function(){l||(d.createElement("img").src=t)},9)})),j&&k&&!f.preferFlash){var U={3:1,4:1},V=function(c){var e,g,h;(a(c.target).is("audio, video")||(h=c.target.parentNode)&&a("source",h).last()[0]==c.target)&&(e=a(c.target).closest("audio, video"))&&!e.hasClass("nonnative-api-active")&&(g=e.prop("error"),setTimeout(function(){e.hasClass("nonnative-api-active")||(g&&U[g.code]&&(f.preferFlash=!0,d.removeEventListener("error",V,!0),a("audio, video").each(function(){b.mediaelement.selectSource(this)}),b.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+c.target.currentSrc+" Mediaerror: "+e.prop("error")+" error.code: "+g.code)),b.warn("There was a mediaelement error. Run the following line in your console to get more info: webshim.mediaelement.loadDebugger();"))}))};d.addEventListener("error",V,!0),setTimeout(function(){a("audio, video").each(function(){var b=a.prop(this,"error");b&&U[b]&&V({target:this})})})}});
KyleMit/cdnjs
ajax/libs/webshim/1.15.1-RC1/minified/shims/mediaelement-jaris.js
JavaScript
mit
19,071
//this might was already extended by ES5 shim feature (function($){ "use strict"; var webshims = window.webshims; if(webshims.defineProperties){return;} var defineProperty = 'defineProperty'; var has = Object.prototype.hasOwnProperty; var descProps = ['configurable', 'enumerable', 'writable']; var extendUndefined = function(prop){ for(var i = 0; i < 3; i++){ if(prop[descProps[i]] === undefined && (descProps[i] !== 'writable' || prop.value !== undefined)){ prop[descProps[i]] = true; } } }; var extendProps = function(props){ if(props){ for(var i in props){ if(has.call(props, i)){ extendUndefined(props[i]); } } } }; if(Object.create){ webshims.objectCreate = function(proto, props, opts){ extendProps(props); var o = Object.create(proto, props); if(opts){ o.options = $.extend(true, {}, o.options || {}, opts); opts = o.options; } if(o._create && $.isFunction(o._create)){ o._create(opts); } return o; }; } if(Object[defineProperty]){ webshims[defineProperty] = function(obj, prop, desc){ extendUndefined(desc); return Object[defineProperty](obj, prop, desc); }; } if(Object.defineProperties){ webshims.defineProperties = function(obj, props){ extendProps(props); return Object.defineProperties(obj, props); }; } webshims.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; webshims.getPrototypeOf = Object.getPrototypeOf; })(window.webshims.$); //DOM-Extension helper webshims.register('dom-extend', function($, webshims, window, document, undefined){ "use strict"; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute; var has = Object.prototype.hasOwnProperty; webshims.assumeARIA = true; if($('<input type="email" />').attr('type') == 'text' || $('<form />').attr('novalidate') === "" || ('required' in $('<input />')[0].attributes)){ webshims.error("IE browser modes are busted in IE10+. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools"); } if('debug' in webshims){ webshims.error('Use webshims.setOptions("debug", true||false||"noCombo"); to debug flag'); } if (!webshims.cfg.no$Switch) { var switch$ = function(){ if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) { webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly. Or set webshims.cfg.no$Switch to 'true'."); if (window.$) { window.$ = webshims.$; } window.jQuery = webshims.$; } }; switch$(); setTimeout(switch$, 90); webshims.ready('DOM', switch$); $(switch$); webshims.ready('WINDOWLOAD', switch$); } //shortcus var listReg = /\s*,\s*/; //proxying attribute var olds = {}; var havePolyfill = {}; var hasPolyfillMethod = {}; var extendedProps = {}; var extendQ = {}; var modifyProps = {}; var oldVal = $.fn.val; var singleVal = function(elem, name, val, pass, _argless){ return (_argless) ? oldVal.call($(elem)) : oldVal.call($(elem), val); }; //jquery mobile and jquery ui if(!$.widget){ (function(){ var _cleanData = $.cleanData; $.cleanData = function( elems ) { if(!$.widget){ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { try { $( elem ).triggerHandler( "remove" ); // http://bugs.jquery.com/ticket/8235 } catch( e ) {} } } _cleanData( elems ); }; })(); } $.fn.val = function(val){ var elem = this[0]; if(arguments.length && val == null){ val = ''; } if(!arguments.length){ if(!elem || elem.nodeType !== 1){return oldVal.call(this);} return $.prop(elem, 'value', val, 'val', true); } if($.isArray(val)){ return oldVal.apply(this, arguments); } var isFunction = $.isFunction(val); return this.each(function(i){ elem = this; if(elem.nodeType === 1){ if(isFunction){ var genVal = val.call( elem, i, $.prop(elem, 'value', undefined, 'val', true)); if(genVal == null){ genVal = ''; } $.prop(elem, 'value', genVal, 'val') ; } else { $.prop(elem, 'value', val, 'val'); } } }); }; $.fn.onTrigger = function(evt, fn){ return this.on(evt, fn).each(fn); }; $.fn.onWSOff = function(evt, fn, trigger, evtDel){ if(!evtDel){ evtDel = document; } $(evtDel)[trigger ? 'onTrigger' : 'on'](evt, fn); this.on('remove', function(e){ if(!e.originalEvent){ $(evtDel).off(evt, fn); } }); return this; }; var idCount = 0; var dataID = '_webshims'+ (Math.round(Math.random() * 1000)); var elementData = function(elem, key, val){ elem = elem.jquery ? elem[0] : elem; if(!elem){return val || {};} var data = $.data(elem, dataID); if(val !== undefined){ if(!data){ data = $.data(elem, dataID, {}); } if(key){ data[key] = val; } } return key ? data && data[key] : data; }; [{name: 'getNativeElement', prop: 'nativeElement'}, {name: 'getShadowElement', prop: 'shadowElement'}, {name: 'getShadowFocusElement', prop: 'shadowFocusElement'}].forEach(function(data){ $.fn[data.name] = function(){ var elems = []; this.each(function(){ var shadowData = elementData(this, 'shadowData'); var elem = shadowData && shadowData[data.prop] || this; if($.inArray(elem, elems) == -1){ elems.push(elem); } }); return this.pushStack(elems); }; }); function clone(elem, dataAndEvents, uniqueIds){ var cloned = $.clone( elem, dataAndEvents, false ); $(cloned.querySelectorAll('.'+webshims.shadowClass)).detach(); if(uniqueIds){ idCount++; $(cloned.querySelectorAll('[id]')).prop('id', function(i, id){ return id +idCount; }); } else { $(cloned.querySelectorAll('audio[id^="ID-"], video[id^="ID-"], label[id^="ID-"]')).removeAttr('id'); } return cloned; } $.fn.clonePolyfill = function(dataAndEvents, uniqueIds){ dataAndEvents = dataAndEvents || false; return this .map(function() { var cloned = clone( this, dataAndEvents, uniqueIds ); setTimeout(function(){ if($.contains(document.body, cloned)){ $(cloned).updatePolyfill(); } }); return cloned; }) ; }; //add support for $('video').trigger('play') in case extendNative is set to false if(!webshims.cfg.extendNative && !webshims.cfg.noTriggerOverride){ (function(oldTrigger){ $.event.trigger = function(event, data, elem, onlyHandlers){ if(!hasPolyfillMethod[event] || onlyHandlers || !elem || elem.nodeType !== 1){ return oldTrigger.apply(this, arguments); } var ret, isOrig, origName; var origFn = elem[event]; var polyfilledFn = $.prop(elem, event); var changeFn = polyfilledFn && origFn != polyfilledFn; if(changeFn){ origName = '__ws'+event; isOrig = (event in elem) && has.call(elem, event); elem[event] = polyfilledFn; elem[origName] = origFn; } ret = oldTrigger.apply(this, arguments); if (changeFn) { if(isOrig){ elem[event] = origFn; } else { delete elem[event]; } delete elem[origName]; } return ret; }; })($.event.trigger); } ['removeAttr', 'prop', 'attr'].forEach(function(type){ olds[type] = $[type]; $[type] = function(elem, name, value, pass, _argless){ var isVal = (pass == 'val'); var oldMethod = !isVal ? olds[type] : singleVal; if( !elem || !havePolyfill[name] || elem.nodeType !== 1 || (!isVal && pass && type == 'attr' && $.attrFn[name]) ){ return oldMethod(elem, name, value, pass, _argless); } var nodeName = (elem.nodeName || '').toLowerCase(); var desc = extendedProps[nodeName]; var curType = (type == 'attr' && (value === false || value === null)) ? 'removeAttr' : type; var propMethod; var oldValMethod; var ret; if(!desc){ desc = extendedProps['*']; } if(desc){ desc = desc[name]; } if(desc){ propMethod = desc[curType]; } if(propMethod){ if(name == 'value'){ oldValMethod = propMethod.isVal; propMethod.isVal = isVal; } if(curType === 'removeAttr'){ return propMethod.value.call(elem); } else if(value === undefined){ return (propMethod.get) ? propMethod.get.call(elem) : propMethod.value ; } else if(propMethod.set) { if(type == 'attr' && value === true){ value = name; } ret = propMethod.set.call(elem, value); } if(name == 'value'){ propMethod.isVal = oldValMethod; } } else { ret = oldMethod(elem, name, value, pass, _argless); } if((value !== undefined || curType === 'removeAttr') && modifyProps[nodeName] && modifyProps[nodeName][name]){ var boolValue; if(curType == 'removeAttr'){ boolValue = false; } else if(curType == 'prop'){ boolValue = !!(value); } else { boolValue = true; } modifyProps[nodeName][name].forEach(function(fn){ if(!fn.only || (fn.only = 'prop' && type == 'prop') || (fn.only == 'attr' && type != 'prop')){ fn.call(elem, value, boolValue, (isVal) ? 'val' : curType, type); } }); } return ret; }; extendQ[type] = function(nodeName, prop, desc){ if(!extendedProps[nodeName]){ extendedProps[nodeName] = {}; } if(!extendedProps[nodeName][prop]){ extendedProps[nodeName][prop] = {}; } var oldDesc = extendedProps[nodeName][prop][type]; var getSup = function(propType, descriptor, oDesc){ var origProp; if(descriptor && descriptor[propType]){ return descriptor[propType]; } if(oDesc && oDesc[propType]){ return oDesc[propType]; } if(type == 'prop' && prop == 'value'){ return function(value){ var elem = this; return (desc.isVal) ? singleVal(elem, prop, value, false, (arguments.length === 0)) : olds[type](elem, prop, value) ; }; } if(type == 'prop' && propType == 'value' && desc.value.apply){ origProp = '__ws'+prop; hasPolyfillMethod[prop] = true; return function(value){ var sup = this[origProp] || olds[type](this, prop); if(sup && sup.apply){ sup = sup.apply(this, arguments); } return sup; }; } return function(value){ return olds[type](this, prop, value); }; }; extendedProps[nodeName][prop][type] = desc; if(desc.value === undefined){ if(!desc.set){ desc.set = desc.writeable ? getSup('set', desc, oldDesc) : (webshims.cfg.useStrict && prop == 'prop') ? function(){throw(prop +' is readonly on '+ nodeName);} : function(){webshims.info(prop +' is readonly on '+ nodeName);} ; } if(!desc.get){ desc.get = getSup('get', desc, oldDesc); } } ['value', 'get', 'set'].forEach(function(descProp){ if(desc[descProp]){ desc['_sup'+descProp] = getSup(descProp, oldDesc); } }); }; }); var extendNativeValue = (function(){ var UNKNOWN = webshims.getPrototypeOf(document.createElement('foobar')); //see also: https://github.com/lojjic/PIE/issues/40 | https://prototype.lighthouseapp.com/projects/8886/tickets/1107-ie8-fatal-crash-when-prototypejs-is-loaded-with-rounded-cornershtc var isExtendNativeSave = webshims.support.advancedObjectProperties && webshims.support.objectAccessor; return function(nodeName, prop, desc){ var elem , elemProto; if( isExtendNativeSave && (elem = document.createElement(nodeName)) && (elemProto = webshims.getPrototypeOf(elem)) && UNKNOWN !== elemProto && ( !elem[prop] || !has.call(elem, prop) ) ){ var sup = elem[prop]; desc._supvalue = function(){ if(sup && sup.apply){ return sup.apply(this, arguments); } return sup; }; elemProto[prop] = desc.value; } else { desc._supvalue = function(){ var data = elementData(this, 'propValue'); if(data && data[prop] && data[prop].apply){ return data[prop].apply(this, arguments); } return data && data[prop]; }; initProp.extendValue(nodeName, prop, desc.value); } desc.value._supvalue = desc._supvalue; }; })(); var initProp = (function(){ var initProps = {}; webshims.addReady(function(context, contextElem){ var nodeNameCache = {}; var getElementsByName = function(name){ if(!nodeNameCache[name]){ nodeNameCache[name] = $(context.getElementsByTagName(name)); if(contextElem[0] && $.nodeName(contextElem[0], name)){ nodeNameCache[name] = nodeNameCache[name].add(contextElem); } } }; $.each(initProps, function(name, fns){ getElementsByName(name); if(!fns || !fns.forEach){ webshims.warn('Error: with '+ name +'-property. methods: '+ fns); return; } fns.forEach(function(fn){ nodeNameCache[name].each(fn); }); }); nodeNameCache = null; }); var tempCache; var emptyQ = $([]); var createNodeNameInit = function(nodeName, fn){ if(!initProps[nodeName]){ initProps[nodeName] = [fn]; } else { initProps[nodeName].push(fn); } if($.isDOMReady){ (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); } }; return { createTmpCache: function(nodeName){ if($.isDOMReady){ tempCache = tempCache || $( document.getElementsByTagName(nodeName) ); } return tempCache || emptyQ; }, flushTmpCache: function(){ tempCache = null; }, content: function(nodeName, prop){ createNodeNameInit(nodeName, function(){ var val = $.attr(this, prop); if(val != null){ $.attr(this, prop, val); } }); }, createElement: function(nodeName, fn){ createNodeNameInit(nodeName, fn); }, extendValue: function(nodeName, prop, value){ createNodeNameInit(nodeName, function(){ $(this).each(function(){ var data = elementData(this, 'propValue', {}); data[prop] = this[prop]; this[prop] = value; }); }); } }; })(); var createPropDefault = function(descs, removeType){ if(descs.defaultValue === undefined){ descs.defaultValue = ''; } if(!descs.removeAttr){ descs.removeAttr = { value: function(){ descs[removeType || 'prop'].set.call(this, descs.defaultValue); descs.removeAttr._supvalue.call(this); } }; } if(!descs.attr){ descs.attr = {}; } }; $.extend(webshims, { getID: (function(){ var ID = new Date().getTime(); return function(elem){ elem = $(elem); var id = elem.prop('id'); if(!id){ ID++; id = 'ID-'+ ID; elem.eq(0).prop('id', id); } return id; }; })(), domPrefixes: ["webkit", "moz", "o", "ms", "ws"], prefixed: function (prop, obj){ var i, testProp; var ret = false; if(obj[prop]){ ret = prop; } if(!ret){ prop = prop.charAt(0).toUpperCase() + prop.slice(1); for(i = 0; i < webshims.domPrefixes.length; i++){ testProp = webshims.domPrefixes[i]+prop; if(testProp in obj){ ret = testProp; break; } } } return ret; }, shadowClass: 'wsshadow-'+(Date.now()), implement: function(elem, type){ var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); if(data[type]){ webshims.warn(type +' already implemented for element #'+elem.id); return false; } data[type] = true; return !$(elem).hasClass('ws-nopolyfill'); }, extendUNDEFProp: function(obj, props){ $.each(props, function(name, prop){ if( !(name in obj) ){ obj[name] = prop; } }); }, getOptions: (function(){ var normalName = /\-([a-z])/g; var regs = {}; var nameRegs = {}; var regFn = function(f, upper){ return upper.toLowerCase(); }; var nameFn = function(f, dashed){ return dashed.toUpperCase(); }; return function(elem, name, bases, stringAllowed){ if(nameRegs[name]){ name = nameRegs[name]; } else { nameRegs[name] = name.replace(normalName, nameFn); name = nameRegs[name]; } var data = elementData(elem, 'cfg'+name); var dataName; var cfg = {}; if(data){ return data; } data = $(elem).data(); if(data && typeof data[name] == 'string'){ if(stringAllowed){ return elementData(elem, 'cfg'+name, data[name]); } webshims.error('data-'+ name +' attribute has to be a valid JSON, was: '+ data[name]); } if(!bases){ bases = [true, {}]; } else if(!Array.isArray(bases)){ bases = [true, {}, bases]; } else { bases.unshift(true, {}); } if(data && typeof data[name] == 'object'){ bases.push(data[name]); } if(!regs[name]){ regs[name] = new RegExp('^'+ name +'([A-Z])'); } for(dataName in data){ if(regs[name].test(dataName)){ cfg[dataName.replace(regs[name], regFn)] = data[dataName]; } } bases.push(cfg); return elementData(elem, 'cfg'+name, $.extend.apply($, bases)); }; })(), //http://www.w3.org/TR/html5/common-dom-interfaces.html#reflect createPropDefault: createPropDefault, data: elementData, moveToFirstEvent: function(elem, eventType, bindType){ var events = ($._data(elem, 'events') || {})[eventType]; var fn; if(events && events.length > 1){ fn = events.pop(); if(!bindType){ bindType = 'bind'; } if(bindType == 'bind' && events.delegateCount){ events.splice( events.delegateCount, 0, fn); } else { events.unshift( fn ); } } elem = null; }, addShadowDom: (function(){ var resizeTimer; var lastHeight; var lastWidth; var $window = $(window); var docObserve = { init: false, runs: 0, test: function(){ var height = docObserve.getHeight(); var width = docObserve.getWidth(); if(height != docObserve.height || width != docObserve.width){ docObserve.height = height; docObserve.width = width; docObserve.handler({type: 'docresize'}); docObserve.runs++; if(docObserve.runs < 9){ setTimeout(docObserve.test, 90); } } else { docObserve.runs = 0; } }, handler: (function(){ var trigger = function(){ $(document).triggerHandler('updateshadowdom'); }; return function(e){ clearTimeout(resizeTimer); resizeTimer = setTimeout(function(){ if(e.type == 'resize'){ var width = $window.width(); var height = $window.width(); if(height == lastHeight && width == lastWidth){ return; } lastHeight = height; lastWidth = width; docObserve.height = docObserve.getHeight(); docObserve.width = docObserve.getWidth(); } if(window.requestAnimationFrame){ requestAnimationFrame(trigger); } else { setTimeout(trigger, 0); } }, (e.type == 'resize' && !window.requestAnimationFrame) ? 50 : 9); }; })(), _create: function(){ $.each({ Height: "getHeight", Width: "getWidth" }, function(name, type){ var body = document.body; var doc = document.documentElement; docObserve[type] = function (){ return Math.max( body[ "scroll" + name ], doc[ "scroll" + name ], body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); }; }); }, start: function(){ if(!this.init && document.body){ this.init = true; this._create(); this.height = docObserve.getHeight(); this.width = docObserve.getWidth(); setInterval(this.test, 999); $(this.test); if($.support.boxSizing == null){ $(function(){ if($.support.boxSizing){ docObserve.handler({type: 'boxsizing'}); } }); } webshims.ready('WINDOWLOAD', this.test); $(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel playerdimensionchange', this.handler); $(window).on('resize', this.handler); } } }; webshims.docObserve = function(){ webshims.ready('DOM', function(){ docObserve.start(); }); }; return function(nativeElem, shadowElem, opts){ if(nativeElem && shadowElem){ opts = opts || {}; if(nativeElem.jquery){ nativeElem = nativeElem[0]; } if(shadowElem.jquery){ shadowElem = shadowElem[0]; } var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {}); var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {}); var shadowFocusElementData = {}; if(!opts.shadowFocusElement){ opts.shadowFocusElement = shadowElem; } else if(opts.shadowFocusElement){ if(opts.shadowFocusElement.jquery){ opts.shadowFocusElement = opts.shadowFocusElement[0]; } shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData); } $(nativeElem).on('remove', function(e){ if (!e.originalEvent) { setTimeout(function(){ $(shadowElem).remove(); }, 4); } }); nativeData.hasShadow = shadowElem; shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem; shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = { nativeElement: nativeElem, shadowElement: shadowElem, shadowFocusElement: opts.shadowFocusElement }; if(opts.shadowChilds){ opts.shadowChilds.each(function(){ elementData(this, 'shadowData', shadowData.shadowData); }); } if(opts.data){ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data; } opts = null; } webshims.docObserve(); }; })(), propTypes: { standard: function(descs, name){ createPropDefault(descs); if(descs.prop){return;} descs.prop = { set: function(val){ descs.attr.set.call(this, ''+val); }, get: function(){ return descs.attr.get.call(this) || descs.defaultValue; } }; }, "boolean": function(descs, name){ createPropDefault(descs); if(descs.prop){return;} descs.prop = { set: function(val){ if(val){ descs.attr.set.call(this, ""); } else { descs.removeAttr.value.call(this); } }, get: function(){ return descs.attr.get.call(this) != null; } }; }, "src": (function(){ var anchor = document.createElement('a'); anchor.style.display = "none"; return function(descs, name){ createPropDefault(descs); if(descs.prop){return;} descs.prop = { set: function(val){ descs.attr.set.call(this, val); }, get: function(){ var href = this.getAttribute(name); var ret; if(href == null){return '';} anchor.setAttribute('href', href+'' ); if(!supportHrefNormalized){ try { $(anchor).insertAfter(this); ret = anchor.getAttribute('href', 4); } catch(er){ ret = anchor.getAttribute('href', 4); } $(anchor).detach(); } return ret || anchor.href; } }; }; })(), enumarated: function(descs, name){ createPropDefault(descs); if(descs.prop){return;} descs.prop = { set: function(val){ descs.attr.set.call(this, val); }, get: function(){ var val = (descs.attr.get.call(this) || '').toLowerCase(); if(!val || descs.limitedTo.indexOf(val) == -1){ val = descs.defaultValue; } return val; } }; } // ,unsignedLong: $.noop // ,"doubble": $.noop // ,"long": $.noop // ,tokenlist: $.noop // ,settableTokenlist: $.noop }, reflectProperties: function(nodeNames, props){ if(typeof props == 'string'){ props = props.split(listReg); } props.forEach(function(prop){ webshims.defineNodeNamesProperty(nodeNames, prop, { prop: { set: function(val){ $.attr(this, prop, val); }, get: function(){ return $.attr(this, prop) || ''; } } }); }); }, defineNodeNameProperty: function(nodeName, prop, descs){ havePolyfill[prop] = true; if(descs.reflect){ if(descs.propType && !webshims.propTypes[descs.propType]){ webshims.error('could not finde propType '+ descs.propType); } else { webshims.propTypes[descs.propType || 'standard'](descs, prop); } } ['prop', 'attr', 'removeAttr'].forEach(function(type){ var desc = descs[type]; if(desc){ if(type === 'prop'){ desc = $.extend({writeable: true}, desc); } else { desc = $.extend({}, desc, {writeable: true}); } extendQ[type](nodeName, prop, desc); if(nodeName != '*' && webshims.cfg.extendNative && type == 'prop' && desc.value && $.isFunction(desc.value)){ extendNativeValue(nodeName, prop, desc); } descs[type] = desc; } }); if(descs.initAttr){ initProp.content(nodeName, prop); } return descs; }, defineNodeNameProperties: function(name, descs, propType, _noTmpCache){ var olddesc; for(var prop in descs){ if(!_noTmpCache && descs[prop].initAttr){ initProp.createTmpCache(name); } if(propType){ if(descs[prop][propType]){ //webshims.log('override: '+ name +'['+prop +'] for '+ propType); } else { descs[prop][propType] = {}; ['value', 'set', 'get'].forEach(function(copyProp){ if(copyProp in descs[prop]){ descs[prop][propType][copyProp] = descs[prop][copyProp]; delete descs[prop][copyProp]; } }); } } descs[prop] = webshims.defineNodeNameProperty(name, prop, descs[prop]); } if(!_noTmpCache){ initProp.flushTmpCache(); } return descs; }, createElement: function(nodeName, create, descs){ var ret; if($.isFunction(create)){ create = { after: create }; } initProp.createTmpCache(nodeName); if(create.before){ initProp.createElement(nodeName, create.before); } if(descs){ ret = webshims.defineNodeNameProperties(nodeName, descs, false, true); } if(create.after){ initProp.createElement(nodeName, create.after); } initProp.flushTmpCache(); return ret; }, onNodeNamesPropertyModify: function(nodeNames, props, desc, only){ if(typeof nodeNames == 'string'){ nodeNames = nodeNames.split(listReg); } if($.isFunction(desc)){ desc = {set: desc}; } nodeNames.forEach(function(name){ if(!modifyProps[name]){ modifyProps[name] = {}; } if(typeof props == 'string'){ props = props.split(listReg); } if(desc.initAttr){ initProp.createTmpCache(name); } props.forEach(function(prop){ if(!modifyProps[name][prop]){ modifyProps[name][prop] = []; havePolyfill[prop] = true; } if(desc.set){ if(only){ desc.set.only = only; } modifyProps[name][prop].push(desc.set); } if(desc.initAttr){ initProp.content(name, prop); } }); initProp.flushTmpCache(); }); }, defineNodeNamesBooleanProperty: function(elementNames, prop, descs){ if(!descs){ descs = {}; } if($.isFunction(descs)){ descs.set = descs; } webshims.defineNodeNamesProperty(elementNames, prop, { attr: { set: function(val){ if(descs.useContentAttribute){ webshims.contentAttr(this, prop, val); } else { this.setAttribute(prop, val); } if(descs.set){ descs.set.call(this, true); } }, get: function(){ var ret = (descs.useContentAttribute) ? webshims.contentAttr(this, prop) : this.getAttribute(prop); return (ret == null) ? undefined : prop; } }, removeAttr: { value: function(){ this.removeAttribute(prop); if(descs.set){ descs.set.call(this, false); } } }, reflect: true, propType: 'boolean', initAttr: descs.initAttr || false }); }, contentAttr: function(elem, name, val){ if(!elem.nodeName){return;} var attr; if(val === undefined){ attr = (elem.attributes[name] || {}); val = attr.specified ? attr.value : null; return (val == null) ? undefined : val; } if(typeof val == 'boolean'){ if(!val){ elem.removeAttribute(name); } else { elem.setAttribute(name, name); } } else { elem.setAttribute(name, val); } }, activeLang: (function(){ var curLang = []; var langDatas = []; var loading = {}; var load = function(src, obj, loadingLang){ obj._isLoading = true; if(loading[src]){ loading[src].push(obj); } else { loading[src] = [obj]; webshims.loader.loadScript(src, function(){ if(loadingLang == curLang.join()){ $.each(loading[src], function(i, obj){ select(obj); }); } delete loading[src]; }); } }; var select = function(obj){ var oldLang = obj.__active; var selectLang = function(i, lang){ obj._isLoading = false; if(obj[lang] || obj.availableLangs.indexOf(lang) != -1){ if(obj[lang]){ obj.__active = obj[lang]; obj.__activeName = lang; } else { load(obj.langSrc+lang, obj, curLang.join()); } return false; } }; $.each(curLang, selectLang); if(!obj.__active){ obj.__active = obj['']; obj.__activeName = ''; } if(oldLang != obj.__active){ $(obj).trigger('change'); } }; return function(lang){ var shortLang; if(typeof lang == 'string'){ if(curLang[0] != lang){ curLang = [lang]; shortLang = curLang[0].split('-')[0]; if(shortLang && shortLang != lang){ curLang.push(shortLang); } langDatas.forEach(select); } } else if(typeof lang == 'object'){ if(!lang.__active){ langDatas.push(lang); select(lang); } return lang.__active; } return curLang[0]; }; })() }); $.each({ defineNodeNamesProperty: 'defineNodeNameProperty', defineNodeNamesProperties: 'defineNodeNameProperties', createElements: 'createElement' }, function(name, baseMethod){ webshims[name] = function(names, a, b, c){ if(typeof names == 'string'){ names = names.split(listReg); } var retDesc = {}; names.forEach(function(nodeName){ retDesc[nodeName] = webshims[baseMethod](nodeName, a, b, c); }); return retDesc; }; }); webshims.isReady('webshimLocalization', true); //html5a11y + hidden attribute (function(){ if(('content' in document.createElement('template'))){return;} $(function(){ var main = $('main').attr({role: 'main'}); if(main.length > 1){ webshims.error('only one main element allowed in document'); } else if(main.is('article *, section *')) { webshims.error('main not allowed inside of article/section elements'); } }); if(('hidden' in document.createElement('a'))){ return; } webshims.defineNodeNamesBooleanProperty(['*'], 'hidden'); var elemMappings = { article: "article", aside: "complementary", section: "region", nav: "navigation", address: "contentinfo" }; var addRole = function(elem, role){ var hasRole = elem.getAttribute('role'); if (!hasRole) { elem.setAttribute('role', role); } }; $.webshims.addReady(function(context, contextElem){ $.each(elemMappings, function(name, role){ var elems = $(name, context).add(contextElem.filter(name)); for (var i = 0, len = elems.length; i < len; i++) { addRole(elems[i], role); } }); if (context === document) { var header = document.getElementsByTagName('header')[0]; var footers = document.getElementsByTagName('footer'); var footerLen = footers.length; if (header && !$(header).closest('section, article')[0]) { addRole(header, 'banner'); } if (!footerLen) { return; } var footer = footers[footerLen - 1]; if (!$(footer).closest('section, article')[0]) { addRole(footer, 'contentinfo'); } } }); })(); }); ;webshim.register('filereader', function($, webshim, window, document, undefined, featureOptions){ "use strict"; var mOxie, moxie, hasXDomain; var FormData = $.noop; var sel = 'input[type="file"].ws-filereader'; var loadMoxie = function (){ webshim.loader.loadList(['moxie']); }; var _createFilePicker = function(){ var $input, picker, $parent, onReset; var input = this; if(webshim.implement(input, 'filepicker')){ input = this; $input = $(this); $parent = $input.parent(); onReset = function(){ if(!input.value){ $input.prop('value', ''); } }; $input.attr('tabindex', '-1').on('mousedown.filereaderwaiting click.filereaderwaiting', false); $parent.addClass('ws-loading'); picker = new mOxie.FileInput({ browse_button: this, accept: $.prop(this, 'accept'), multiple: $.prop(this, 'multiple') }); $input.jProp('form').on('reset', function(){ setTimeout(onReset); }); picker.onready = function(){ $input.off('.fileraderwaiting'); $parent.removeClass('ws-waiting'); }; picker.onchange = function(e){ webshim.data(input, 'fileList', e.target.files); $input.trigger('change'); }; picker.onmouseenter = function(){ $input.trigger('mouseover'); $parent.addClass('ws-mouseenter'); }; picker.onmouseleave = function(){ $input.trigger('mouseout'); $parent.removeClass('ws-mouseenter'); }; picker.onmousedown = function(){ $input.trigger('mousedown'); $parent.addClass('ws-active'); }; picker.onmouseup = function(){ $input.trigger('mouseup'); $parent.removeClass('ws-active'); }; webshim.data(input, 'filePicker', picker); webshim.ready('WINDOWLOAD', function(){ var lastWidth; $input.onWSOff('updateshadowdom', function(){ var curWitdth = input.offsetWidth; if(curWitdth && lastWidth != curWitdth){ lastWidth = curWitdth; picker.refresh(); } }); }); webshim.addShadowDom(); picker.init(); if(input.disabled){ picker.disable(true); } } }; var getFileNames = function(file){ return file.name; }; var createFilePicker = function(){ var elem = this; loadMoxie(); $(elem) .on('mousedown.filereaderwaiting click.filereaderwaiting', false) .parent() .addClass('ws-loading') ; webshim.ready('moxie', function(){ createFilePicker.call(elem); }); }; var noxhr = /^(?:script|jsonp)$/i; var notReadyYet = function(){ loadMoxie(); webshim.error('filereader/formdata not ready yet. please wait for moxie to load `webshim.ready("moxie", callbackFn);`` or wait for the first change event on input[type="file"].ws-filereader.') }; var inputValueDesc = webshim.defineNodeNameProperty('input', 'value', { prop: { get: function(){ var fileList = webshim.data(this, 'fileList'); if(fileList && fileList.map){ return fileList.map(getFileNames).join(', '); } return inputValueDesc.prop._supget.call(this); } } } ); var shimMoxiePath = webshim.cfg.basePath+'moxie/'; var crossXMLMessage = 'You nedd a crossdomain.xml to get all "filereader" / "XHR2" / "CORS" features to work. Or host moxie.swf/moxie.xap on your server an configure filereader options: "swfpath"/"xappath"'; var testMoxie = function(options){ return (options.wsType == 'moxie' || (options.data && options.data instanceof mOxie.FormData) || (options.crossDomain && $.support.cors !== false && hasXDomain != 'no' && !noxhr.test(options.dataType || ''))); }; var createMoxieTransport = function (options){ if(testMoxie(options)){ var ajax; webshim.info('moxie transfer used for $.ajax'); if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } return { send: function( headers, completeCallback ) { var proressEvent = function(obj, name){ if(options[name]){ var called = false; ajax.addEventListener('load', function(e){ if(!called){ options[name]({type: 'progress', lengthComputable: true, total: 1, loaded: 1}); } else if(called.lengthComputable && called.total > called.loaded){ options[name]({type: 'progress', lengthComputable: true, total: called.total, loaded: called.total}); } }); obj.addEventListener('progress', function(e){ called = e; options[name](e); }); } }; ajax = new moxie.xhr.XMLHttpRequest(); ajax.open(options.type, options.url, options.async, options.username, options.password); proressEvent(ajax.upload, featureOptions.uploadprogress); proressEvent(ajax.upload, featureOptions.progress); ajax.addEventListener('load', function(e){ var responses = { text: ajax.responseText, xml: ajax.responseXML }; completeCallback(ajax.status, ajax.statusText, responses, ajax.getAllResponseHeaders()); }); if(options.xhrFields && options.xhrFields.withCredentials){ ajax.withCredentials = true; } if(options.timeout){ ajax.timeout = options.timeout; } $.each(headers, function(name, value){ ajax.setRequestHeader(name, value); }); ajax.send(options.data); }, abort: function() { if(ajax){ ajax.abort(); } } }; } }; var transports = { //based on script: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest xdomain: (function(){ var httpRegEx = /^https?:\/\//i; var getOrPostRegEx = /^get|post$/i; var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i'); return function(options, userOptions, jqXHR) { // Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page if (!options.crossDomain || options.username || (options.xhrFields && options.xhrFields.withCredentials) || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url) || (options.data && options.data instanceof mOxie.FormData) || noxhr.test(options.dataType || '')) { return; } var xdr = null; webshim.info('xdomain transport used.'); return { send: function(headers, complete) { var postData = ''; var userType = (userOptions.dataType || '').toLowerCase(); xdr = new XDomainRequest(); if (/^\d+$/.test(userOptions.timeout)) { xdr.timeout = userOptions.timeout; } xdr.ontimeout = function() { complete(500, 'timeout'); }; xdr.onload = function() { var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\r\nContent-Type: ' + xdr.contentType; var status = { code: xdr.status || 200, message: xdr.statusText || 'OK' }; var responses = { text: xdr.responseText, xml: xdr.responseXML }; try { if (userType === 'html' || /text\/html/i.test(xdr.contentType)) { responses.html = xdr.responseText; } else if (userType === 'json' || (userType !== 'text' && /\/json/i.test(xdr.contentType))) { try { responses.json = $.parseJSON(xdr.responseText); } catch(e) { } } else if (userType === 'xml' && !xdr.responseXML) { var doc; try { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = false; doc.loadXML(xdr.responseText); } catch(e) { } responses.xml = doc; } } catch(parseMessage) {} complete(status.code, status.message, responses, allResponseHeaders); }; // set an empty handler for 'onprogress' so requests don't get aborted xdr.onprogress = function(){}; xdr.onerror = function() { complete(500, 'error', { text: xdr.responseText }); }; if (userOptions.data) { postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data); } xdr.open(options.type, options.url); xdr.send(postData); }, abort: function() { if (xdr) { xdr.abort(); } } }; }; })(), moxie: function (options, originalOptions, jqXHR){ if(testMoxie(options)){ loadMoxie(options); var ajax; var tmpTransport = { send: function( headers, completeCallback ) { ajax = true; webshim.ready('moxie', function(){ if(ajax){ ajax = createMoxieTransport(options, originalOptions, jqXHR); tmpTransport.send = ajax.send; tmpTransport.abort = ajax.abort; ajax.send(headers, completeCallback); } }); }, abort: function() { ajax = false; } }; return tmpTransport; } } }; if(!featureOptions.progress){ featureOptions.progress = 'onprogress'; } if(!featureOptions.uploadprogress){ featureOptions.uploadprogress = 'onuploadprogress'; } if(!featureOptions.swfpath){ featureOptions.swfpath = shimMoxiePath+'flash/Moxie.min.swf'; } if(!featureOptions.xappath){ featureOptions.xappath = shimMoxiePath+'silverlight/Moxie.min.xap'; } if($.support.cors !== false || !window.XDomainRequest){ delete transports.xdomain; } $.ajaxTransport("+*", function( options, originalOptions, jqXHR ) { var ajax, type; if(options.wsType || transports[transports]){ ajax = transports[transports](options, originalOptions, jqXHR); } if(!ajax){ for(type in transports){ ajax = transports[type](options, originalOptions, jqXHR); if(ajax){break;} } } return ajax; }); webshim.defineNodeNameProperty('input', 'files', { prop: { writeable: false, get: function(){ if(this.type != 'file'){return null;} if(!$(this).hasClass('ws-filereader')){ webshim.info("please add the 'ws-filereader' class to your input[type='file'] to implement files-property"); } return webshim.data(this, 'fileList') || []; } } } ); webshim.reflectProperties(['input'], ['accept']); if($('<input />').prop('multiple') == null){ webshim.defineNodeNamesBooleanProperty(['input'], ['multiple']); } webshim.onNodeNamesPropertyModify('input', 'disabled', function(value, boolVal, type){ var picker = webshim.data(this, 'filePicker'); if(picker){ picker.disable(boolVal); } }); webshim.onNodeNamesPropertyModify('input', 'value', function(value, boolVal, type){ if(value === '' && this.type == 'file' && $(this).hasClass('ws-filereader')){ webshim.data(this, 'fileList', []); } }); window.FileReader = notReadyYet; window.FormData = notReadyYet; webshim.ready('moxie', function(){ var wsMimes = 'application/xml,xml'; moxie = window.moxie; mOxie = window.mOxie; mOxie.Env.swf_url = featureOptions.swfpath; mOxie.Env.xap_url = featureOptions.xappath; window.FileReader = mOxie.FileReader; window.FormData = function(form){ var appendData, i, len, files, fileI, fileLen, inputName; var moxieData = new mOxie.FormData(); if(form && $.nodeName(form, 'form')){ appendData = $(form).serializeArray(); for(i = 0; i < appendData.length; i++){ if(Array.isArray(appendData[i].value)){ appendData[i].value.forEach(function(val){ moxieData.append(appendData[i].name, val); }); } else { moxieData.append(appendData[i].name, appendData[i].value); } } appendData = form.querySelectorAll('input[type="file"][name]'); for(i = 0, len = appendData.length; i < appendData.length; i++){ inputName = appendData[i].name; if(inputName && !$(appendData[i]).is(':disabled')){ files = $.prop(appendData[i], 'files') || []; if(files.length){ if(files.length > 1 || (moxieData.hasBlob && moxieData.hasBlob())){ webshim.error('FormData shim can only handle one file per ajax. Use multiple ajax request. One per file.'); } for(fileI = 0, fileLen = files.length; fileI < fileLen; fileI++){ moxieData.append(inputName, files[fileI]); } } } } } return moxieData; }; FormData = window.FormData; createFilePicker = _createFilePicker; transports.moxie = createMoxieTransport; featureOptions.mimeTypes = (featureOptions.mimeTypes) ? wsMimes+','+featureOptions.mimeTypes : wsMimes; try { mOxie.Mime.addMimeType(featureOptions.mimeTypes); } catch(e){ webshim.warn('mimetype to moxie error: '+e); } }); webshim.addReady(function(context, contextElem){ $(context.querySelectorAll(sel)).add(contextElem.filter(sel)).each(createFilePicker); }); webshim.ready('WINDOWLOAD', loadMoxie); if(webshim.cfg.debug !== false && featureOptions.swfpath.indexOf((location.protocol+'//'+location.hostname)) && featureOptions.swfpath.indexOf(('https://'+location.hostname))){ webshim.ready('WINDOWLOAD', function(){ var printMessage = function(){ if(hasXDomain == 'no'){ webshim.error(crossXMLMessage); } }; try { hasXDomain = sessionStorage.getItem('wsXdomain.xml'); } catch(e){} printMessage(); if(hasXDomain == null){ $.ajax({ url: 'crossdomain.xml', type: 'HEAD', dataType: 'xml', success: function(){ hasXDomain = 'yes'; }, error: function(){ hasXDomain = 'no'; }, complete: function(){ try { sessionStorage.setItem('wsXdomain.xml', hasXDomain); } catch(e){} printMessage(); } }); } }); } }); ;webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){ "use strict"; var mediaelement = webshims.mediaelement; var swfmini = window.swfmini; var support = webshims.support; var hasNative = support.mediaelement; var hasFlash = swfmini.hasFlashPlayerVersion('11.3'); var loadedSwf = 0; var needsLoadPreload = 'ActiveXObject' in window && hasNative; var getProps = { paused: true, ended: false, currentSrc: '', duration: window.NaN, readyState: 0, networkState: 0, videoHeight: 0, videoWidth: 0, seeking: false, error: null, buffered: { start: function(index){ if(index){ webshims.error('buffered index size error'); return; } return 0; }, end: function(index){ if(index){ webshims.error('buffered index size error'); return; } return 0; }, length: 0 } }; var getPropKeys = Object.keys(getProps); var getSetProps = { currentTime: 0, volume: 1, muted: false }; var getSetPropKeys = Object.keys(getSetProps); var playerStateObj = $.extend({ isActive: 'html5', activating: 'html5', wasSwfReady: false, _bufferedEnd: 0, _bufferedStart: 0, currentTime: 0, lastCalledTime: -500, _ppFlag: undefined, _calledMeta: false, lastDuration: 0, _timeDif: 0.3 }, getProps, getSetProps); var getSwfDataFromElem = function(elem){ try { (elem.nodeName); } catch(er){ return null; } var data = webshims.data(elem, 'mediaelement'); return (data && data.isActive == 'third') ? data : null; }; var trigger = function(elem, evt){ evt = $.Event(evt); evt.preventDefault(); $.event.trigger(evt, undefined, elem); }; var playerSwfPath = options.playerPath || webshims.cfg.basePath + "swf/" + (options.playerName || 'JarisFLVPlayer.swf'); webshims.extendUNDEFProp(options.params, { allowscriptaccess: 'always', allowfullscreen: 'true', wmode: 'transparent', allowNetworking: 'all' }); webshims.extendUNDEFProp(options.vars, { controltype: '1', jsapi: '1' }); webshims.extendUNDEFProp(options.attrs, { bgcolor: '#000000' }); options.playerPath = playerSwfPath; var setReadyState = function(readyState, data){ if(readyState < 3){ clearTimeout(data._canplaythroughTimer); } if(readyState >= 3 && data.readyState < 3){ data.readyState = readyState; trigger(data._elem, 'canplay'); if(!data.paused){ trigger(data._elem, 'playing'); } clearTimeout(data._canplaythroughTimer); data._canplaythroughTimer = setTimeout(function(){ setReadyState(4, data); }, 4000); } if(readyState >= 4 && data.readyState < 4){ data.readyState = readyState; trigger(data._elem, 'canplaythrough'); } data.readyState = readyState; }; var callSeeked = function(data){ if(data.seeking && Math.abs(data.currentTime - data._lastSeektime) < 2){ data.seeking = false; $(data._elem).triggerHandler('seeked'); } }; mediaelement.jarisEvent = {}; var localConnectionTimer; var onEvent = { onPlayPause: function(jaris, data, override){ var playing, type; var idled = data.paused || data.ended; if(override == null){ try { playing = data.api.api_get("isPlaying"); } catch(e){} } else { playing = override; } if(playing == idled || playing == null){ data.paused = !playing; type = data.paused ? 'pause' : 'play'; data._ppFlag = true; trigger(data._elem, type); if(data.readyState < 3){ setReadyState(3, data); } if(!data.paused){ trigger(data._elem, 'playing'); } } }, onSeek: function(jaris, data){ data._lastSeektime = jaris.seekTime; data.seeking = true; $(data._elem).triggerHandler('seeking'); clearTimeout(data._seekedTimer); data._seekedTimer = setTimeout(function(){ callSeeked(data); data.seeking = false; }, 300); }, onConnectionFailed: function(jaris, data){ mediaelement.setError(data._elem, 'flash connection error'); }, onNotBuffering: function(jaris, data){ setReadyState(3, data); }, onDataInitialized: function(jaris, data){ var oldDur = data.duration; var durDelta; data.duration = jaris.duration; if(oldDur == data.duration || isNaN(data.duration)){return;} if(data._calledMeta && ((durDelta = Math.abs(data.lastDuration - data.duration)) < 2)){return;} data.videoHeight = jaris.height; data.videoWidth = jaris.width; if(!data.networkState){ data.networkState = 2; } if(data.readyState < 1){ setReadyState(1, data); } clearTimeout(data._durationChangeTimer); if(data._calledMeta && data.duration){ data._durationChangeTimer = setTimeout(function(){ data.lastDuration = data.duration; trigger(data._elem, 'durationchange'); }, durDelta > 50 ? 0 : durDelta > 9 ? 9 : 99); } else { data.lastDuration = data.duration; if(data.duration){ trigger(data._elem, 'durationchange'); } if(!data._calledMeta){ trigger(data._elem, 'loadedmetadata'); } if(data.duration > 1 && data.duration < 140){ data._timeDif = 0.2; } else if(data.duration < 600) { data._timeDif = 0.25; } else { data._timeDif = 0.30; } } data._calledMeta = true; }, onBuffering: function(jaris, data){ if(data.ended){ data.ended = false; } setReadyState(1, data); trigger(data._elem, 'waiting'); }, onTimeUpdate: function(jaris, data){ var timeDif = data.currentTime - data.lastCalledTime; if(data.ended){ data.ended = false; } if(data.readyState < 3){ setReadyState(3, data); trigger(data._elem, 'playing'); } if(data.seeking){ callSeeked(data); } if(timeDif > data._timeDif || timeDif < -0.3){ data.lastCalledTime = data.currentTime; $.event.trigger('timeupdate', undefined, data._elem, true); } }, onProgress: function(jaris, data){ if(data.ended){ data.ended = false; } if(!data.duration || isNaN(data.duration)){ return; } var percentage = jaris.loaded / jaris.total; if(percentage > 0.02 && percentage < 0.2){ setReadyState(3, data); } else if(percentage > 0.2){ if(percentage > 0.95){ percentage = 1; data.networkState = 1; } setReadyState(4, data); } if(data._bufferedEnd && (data._bufferedEnd > percentage)){ data._bufferedStart = data.currentTime || 0; } data._bufferedEnd = percentage; data.buffered.length = 1; $.event.trigger('progress', undefined, data._elem, true); }, onPlaybackFinished: function(jaris, data){ if(data.readyState < 4){ setReadyState(4, data); } data.ended = true; trigger(data._elem, 'ended'); }, onVolumeChange: function(jaris, data){ if(data.volume != jaris.volume || data.muted != jaris.mute){ data.volume = jaris.volume; data.muted = jaris.mute; trigger(data._elem, 'volumechange'); } }, ready: (function(){ var testAPI = function(data){ var passed = true; try { data.api.api_get('volume'); } catch(er){ passed = false; } return passed; }; return function(jaris, data){ var i = 0; var doneFn = function(){ if(i > 9){ data.tryedReframeing = 0; return; } i++; data.tryedReframeing++; if(testAPI(data)){ data.wasSwfReady = true; data.tryedReframeing = 0; startAutoPlay(data); workActionQueue(data); } else if(data.tryedReframeing < 6) { if(data.tryedReframeing < 3){ data.reframeTimer = setTimeout(doneFn, 9); data.shadowElem.css({overflow: 'visible'}); setTimeout(function(){ data.shadowElem.css({overflow: 'hidden'}); }, 1); } else { data.shadowElem.css({overflow: 'hidden'}); $(data._elem).mediaLoad(); } } else { clearTimeout(data.reframeTimer); webshims.error("reframing error"); } }; if(!data || !data.api){return;} if(!data.tryedReframeing){ data.tryedReframeing = 0; } clearTimeout(localConnectionTimer); clearTimeout(data.reframeTimer); data.shadowElem.removeClass('flashblocker-assumed'); if(!i){ doneFn(); } else { data.reframeTimer = setTimeout(doneFn, 9); } }; })() }; onEvent.onMute = onEvent.onVolumeChange; var workActionQueue = function(data){ var actionLen = data.actionQueue.length; var i = 0; var operation; if(actionLen && data.isActive == 'third'){ while(data.actionQueue.length && actionLen > i){ i++; operation = data.actionQueue.shift(); try{ data.api[operation.fn].apply(data.api, operation.args); } catch(er){ webshims.warn(er); } } } if(data.actionQueue.length){ data.actionQueue = []; } }; var startAutoPlay = function(data){ if(!data){return;} if( (data._ppFlag === undefined && ($.prop(data._elem, 'autoplay')) || !data.paused)){ setTimeout(function(){ if(data.isActive == 'third' && (data._ppFlag === undefined || !data.paused)){ try { $(data._elem).play(); data._ppFlag = true; } catch(er){} } }, 1); } if(data.muted){ $.prop(data._elem, 'muted', true); } if(data.volume != 1){ $.prop(data._elem, 'volume', data.volume); } }; var addMediaToStopEvents = $.noop; if(hasNative){ var stopEvents = { play: 1, playing: 1 }; var hideEvtArray = ['play', 'pause', 'playing', 'loadstart', 'canplay', 'progress', 'waiting', 'ended', 'loadedmetadata', 'durationchange', 'emptied']; var hidevents = hideEvtArray.map(function(evt){ return evt +'.webshimspolyfill'; }).join(' '); var hidePlayerEvents = function(event){ var data = webshims.data(event.target, 'mediaelement'); if(!data){return;} var isNativeHTML5 = ( event.originalEvent && event.originalEvent.type === event.type ); if( isNativeHTML5 == (data.activating == 'third') ){ event.stopImmediatePropagation(); if(stopEvents[event.type]){ if(data.isActive != data.activating){ $(event.target).pause(); } else if(isNativeHTML5){ ($.prop(event.target, 'pause')._supvalue || $.noop).apply(event.target); } } } }; addMediaToStopEvents = function(elem){ $(elem) .off(hidevents) .on(hidevents, hidePlayerEvents) ; hideEvtArray.forEach(function(evt){ webshims.moveToFirstEvent(elem, evt); }); }; addMediaToStopEvents(document); } mediaelement.setActive = function(elem, type, data){ if(!data){ data = webshims.data(elem, 'mediaelement'); } if(!data || data.isActive == type){return;} if(type != 'html5' && type != 'third'){ webshims.warn('wrong type for mediaelement activating: '+ type); } var shadowData = webshims.data(elem, 'shadowData'); data.activating = type; $(elem).pause(); data.isActive = type; if(type == 'third'){ shadowData.shadowElement = shadowData.shadowFocusElement = data.shadowElem[0]; $(elem).addClass('swf-api-active nonnative-api-active').hide().getShadowElement().show(); } else { $(elem).removeClass('swf-api-active nonnative-api-active').show().getShadowElement().hide(); shadowData.shadowElement = shadowData.shadowFocusElement = false; } $(elem).trigger('mediaelementapichange'); }; var resetSwfProps = (function(){ var resetProtoProps = ['_calledMeta', 'lastDuration', '_bufferedEnd', 'lastCalledTime', '_bufferedStart', '_ppFlag', 'currentSrc', 'currentTime', 'duration', 'ended', 'networkState', 'paused', 'seeking', 'videoHeight', 'videoWidth']; var len = resetProtoProps.length; return function(data){ if(!data){return;} clearTimeout(data._seekedTimer); var lenI = len; var networkState = data.networkState; setReadyState(0, data); clearTimeout(data._durationChangeTimer); while(--lenI > -1){ delete data[resetProtoProps[lenI]]; } data.actionQueue = []; data.buffered.length = 0; if(networkState){ trigger(data._elem, 'emptied'); } }; })(); var getComputedDimension = (function(){ var dimCache = {}; var getVideoDims = function(data){ var ret, poster, img; if(dimCache[data.currentSrc]){ ret = dimCache[data.currentSrc]; } else if(data.videoHeight && data.videoWidth){ dimCache[data.currentSrc] = { width: data.videoWidth, height: data.videoHeight }; ret = dimCache[data.currentSrc]; } else if((poster = $.attr(data._elem, 'poster'))){ ret = dimCache[poster]; if(!ret){ img = document.createElement('img'); img.onload = function(){ dimCache[poster] = { width: this.width, height: this.height }; if(dimCache[poster].height && dimCache[poster].width){ setElementDimension(data, $.prop(data._elem, 'controls')); } else { delete dimCache[poster]; } img.onload = null; }; img.src = poster; if(img.complete && img.onload){ img.onload(); } } } return ret || {width: 300, height: data._elemNodeName == 'video' ? 150 : 50}; }; var getCssStyle = function(elem, style){ return elem.style[style] || (elem.currentStyle && elem.currentStyle[style]) || (window.getComputedStyle && (window.getComputedStyle( elem, null ) || {} )[style]) || ''; }; var minMaxProps = ['minWidth', 'maxWidth', 'minHeight', 'maxHeight']; var addMinMax = function(elem, ret){ var i, prop; var hasMinMax = false; for (i = 0; i < 4; i++) { prop = getCssStyle(elem, minMaxProps[i]); if(parseFloat(prop, 10)){ hasMinMax = true; ret[minMaxProps[i]] = prop; } } return hasMinMax; }; var retFn = function(data){ var videoDims, ratio, hasMinMax; var elem = data._elem; var autos = { width: getCssStyle(elem, 'width') == 'auto', height: getCssStyle(elem, 'height') == 'auto' }; var ret = { width: !autos.width && $(elem).width(), height: !autos.height && $(elem).height() }; if(autos.width || autos.height){ videoDims = getVideoDims(data); ratio = videoDims.width / videoDims.height; if(autos.width && autos.height){ ret.width = videoDims.width; ret.height = videoDims.height; } else if(autos.width){ ret.width = ret.height * ratio; } else if(autos.height){ ret.height = ret.width / ratio; } if(addMinMax(elem, ret)){ data.shadowElem.css(ret); if(autos.width){ ret.width = data.shadowElem.height() * ratio; } if(autos.height){ ret.height = ((autos.width) ? ret.width : data.shadowElem.width()) / ratio; } if(autos.width && autos.height){ data.shadowElem.css(ret); ret.height = data.shadowElem.width() / ratio; ret.width = ret.height * ratio; data.shadowElem.css(ret); ret.width = data.shadowElem.height() * ratio; ret.height = ret.width / ratio; } if(!webshims.support.mediaelement){ ret.width = data.shadowElem.width(); ret.height = data.shadowElem.height(); } } } return ret; }; return retFn; })(); var setElementDimension = function(data, hasControls){ var dims; var box = data.shadowElem; $(data._elem)[hasControls ? 'addClass' : 'removeClass']('webshims-controls'); if(data.isActive == 'third' || data.activating == 'third'){ if(data._elemNodeName == 'audio' && !hasControls){ box.css({width: 0, height: 0}); } else { data._elem.style.display = ''; dims = getComputedDimension(data); data._elem.style.display = 'none'; box.css(dims); } } }; var bufferSrc = (function(){ var preloads = { '': 1, 'auto': 1 }; return function(elem){ var preload = $.attr(elem, 'preload'); if(preload == null || preload == 'none' || $.prop(elem, 'autoplay')){ return false; } preload = $.prop(elem, 'preload'); return !!(preloads[preload] || (preload == 'metadata' && $(elem).is('.preload-in-doubt, video:not([poster])'))); }; })(); var regs = { A: /&amp;/g, a: /&/g, e: /\=/g, q: /\?/g }, replaceVar = function(val){ return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val; }; if('matchMedia' in window){ var allowMediaSorting = false; try { allowMediaSorting = window.matchMedia('only all').matches; } catch(er){} if(allowMediaSorting){ mediaelement.sortMedia = function(src1, src2){ try { src1 = !src1.media || matchMedia( src1.media ).matches; src2 = !src2.media || matchMedia( src2.media ).matches; } catch(er){ return 0; } return src1 == src2 ? 0 : src1 ? -1 : 1; }; } } mediaelement.createSWF = function( elem, canPlaySrc, data ){ if(!hasFlash){ setTimeout(function(){ $(elem).mediaLoad(); //<- this should produce a mediaerror }, 1); return; } var attrStyle = {}; if(loadedSwf < 1){ loadedSwf = 1; } else { loadedSwf++; } if(!data){ data = webshims.data(elem, 'mediaelement'); } if((attrStyle.height = $.attr(elem, 'height') || '') || (attrStyle.width = $.attr(elem, 'width') || '')){ $(elem).css(attrStyle); webshims.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull."); } var isRtmp = canPlaySrc.type == 'audio/rtmp' || canPlaySrc.type == 'video/rtmp'; var vars = $.extend({}, options.vars, { poster: replaceVar($.attr(elem, 'poster') && $.prop(elem, 'poster') || ''), source: replaceVar(canPlaySrc.streamId || canPlaySrc.srcProp), server: replaceVar(canPlaySrc.server || '') }); var elemVars = $(elem).data('vars') || {}; var hasControls = $.prop(elem, 'controls'); var elemId = 'jarisplayer-'+ webshims.getID(elem); var params = $.extend( {}, options.params, $(elem).data('params') ); var elemNodeName = elem.nodeName.toLowerCase(); var attrs = $.extend( {}, options.attrs, { name: elemId, id: elemId }, $(elem).data('attrs') ); var setDimension = function(){ if(data.isActive == 'third'){ setElementDimension(data, $.prop(elem, 'controls')); } }; var box; if(data && data.swfCreated){ mediaelement.setActive(elem, 'third', data); data.currentSrc = ''; data.shadowElem.html('<div id="'+ elemId +'">'); data.api = false; data.actionQueue = []; box = data.shadowElem; resetSwfProps(data); data.currentSrc = canPlaySrc.srcProp; } else { $(document.getElementById('wrapper-'+ elemId )).remove(); box = $('<div class="polyfill-'+ (elemNodeName) +' polyfill-mediaelement '+ webshims.shadowClass +'" id="wrapper-'+ elemId +'"><div id="'+ elemId +'"></div>') .css({ position: 'relative', overflow: 'hidden' }) ; data = webshims.data(elem, 'mediaelement', webshims.objectCreate(playerStateObj, { actionQueue: { value: [] }, shadowElem: { value: box }, _elemNodeName: { value: elemNodeName }, _elem: { value: elem }, currentSrc: { value: canPlaySrc.srcProp }, swfCreated: { value: true }, id: { value: elemId.replace(/-/g, '') }, buffered: { value: { start: function(index){ if(index >= data.buffered.length){ webshims.error('buffered index size error'); return; } return 0; }, end: function(index){ if(index >= data.buffered.length){ webshims.error('buffered index size error'); return; } return ( (data.duration - data._bufferedStart) * data._bufferedEnd) + data._bufferedStart; }, length: 0 } } })); box.insertBefore(elem); if(hasNative){ $.extend(data, {volume: $.prop(elem, 'volume'), muted: $.prop(elem, 'muted'), paused: $.prop(elem, 'paused')}); } webshims.addShadowDom(elem, box); if(!webshims.data(elem, 'mediaelement')){ webshims.data(elem, 'mediaelement', data); } addMediaToStopEvents(elem); mediaelement.setActive(elem, 'third', data); setElementDimension(data, hasControls); $(elem) .on({ 'updatemediaelementdimensions loadedmetadata emptied': setDimension, 'remove': function(e){ if(!e.originalEvent && mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem == elem){ delete mediaelement.jarisEvent[data.id]; clearTimeout(localConnectionTimer); clearTimeout(data.flashBlock); } } }) .onWSOff('updateshadowdom', setDimension) ; } if(mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem != elem){ webshims.error('something went wrong'); return; } else if(!mediaelement.jarisEvent[data.id]){ mediaelement.jarisEvent[data.id] = function(jaris){ if(jaris.type == 'ready'){ var onReady = function(){ if(data.api){ if(!data.paused){ data.api.api_play(); } if(bufferSrc(elem)){ data.api.api_preload(); } onEvent.ready(jaris, data); } }; if(data.api){ onReady(); } else { setTimeout(onReady, 9); } } else { data.currentTime = jaris.position; if(data.api){ if(!data._calledMeta && isNaN(jaris.duration) && data.duration != jaris.duration && isNaN(data.duration)){ onEvent.onDataInitialized(jaris, data); } if(!data._ppFlag && jaris.type != 'onPlayPause'){ onEvent.onPlayPause(jaris, data); } if(onEvent[jaris.type]){ onEvent[jaris.type](jaris, data); } } data.duration = jaris.duration; } }; mediaelement.jarisEvent[data.id].elem = elem; } $.extend(vars, { id: elemId, evtId: data.id, controls: ''+hasControls, autostart: 'false', nodename: elemNodeName }, elemVars ); if(isRtmp){ vars.streamtype = 'rtmp'; } else if(canPlaySrc.type == 'audio/mpeg' || canPlaySrc.type == 'audio/mp3'){ vars.type = 'audio'; vars.streamtype = 'file'; } else if(canPlaySrc.type == 'video/youtube'){ vars.streamtype = 'youtube'; } options.changeSWF(vars, elem, canPlaySrc, data, 'embed'); clearTimeout(data.flashBlock); swfmini.embedSWF(playerSwfPath, elemId, "100%", "100%", "9.0.115", false, vars, params, attrs, function(swfData){ if(swfData.success){ var fBlocker = function(){ if((!swfData.ref.parentNode && box[0].parentNode) || swfData.ref.style.display == "none"){ box.addClass('flashblocker-assumed'); $(elem).trigger('flashblocker'); webshims.warn("flashblocker assumed"); } $(swfData.ref).css({'minHeight': '2px', 'minWidth': '2px', display: 'block'}); }; data.api = swfData.ref; if(!hasControls){ $(swfData.ref).attr('tabindex', '-1').css('outline', 'none'); } data.flashBlock = setTimeout(fBlocker, 99); if(!localConnectionTimer){ clearTimeout(localConnectionTimer); localConnectionTimer = setTimeout(function(){ fBlocker(); var flash = $(swfData.ref); if(flash[0].offsetWidth > 1 && flash[0].offsetHeight > 1 && location.protocol.indexOf('file:') === 0){ webshims.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"); } else if(flash[0].offsetWidth < 2 || flash[0].offsetHeight < 2) { webshims.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"); } flash = null; }, 8000); } } }); trigger(data._elem, 'loadstart'); }; var queueSwfMethod = function(elem, fn, args, data){ data = data || getSwfDataFromElem(elem); if(data){ if(data.api && data.api[fn]){ data.api[fn].apply(data.api, args || []); } else { //todo add to queue data.actionQueue.push({fn: fn, args: args}); if(data.actionQueue.length > 10){ setTimeout(function(){ if(data.actionQueue.length > 5){ data.actionQueue.shift(); } }, 99); } } return data; } return false; }; ['audio', 'video'].forEach(function(nodeName){ var descs = {}; var mediaSup; var createGetProp = function(key){ if(nodeName == 'audio' && (key == 'videoHeight' || key == 'videoWidth')){return;} descs[key] = { get: function(){ var data = getSwfDataFromElem(this); if(data){ return data[key]; } else if(hasNative && mediaSup[key].prop._supget) { return mediaSup[key].prop._supget.apply(this); } else { return playerStateObj[key]; } }, writeable: false }; }; var createGetSetProp = function(key, setFn){ createGetProp(key); delete descs[key].writeable; descs[key].set = setFn; }; createGetSetProp('seeking'); createGetSetProp('volume', function(v){ var data = getSwfDataFromElem(this); if(data){ v *= 1; if(!isNaN(v)){ if(v < 0 || v > 1){ webshims.error('volume greater or less than allowed '+ (v / 100)); } queueSwfMethod(this, 'api_volume', [v], data); if(data.volume != v){ data.volume = v; trigger(data._elem, 'volumechange'); } data = null; } } else if(mediaSup.volume.prop._supset) { return mediaSup.volume.prop._supset.apply(this, arguments); } }); createGetSetProp('muted', function(m){ var data = getSwfDataFromElem(this); if(data){ m = !!m; queueSwfMethod(this, 'api_muted', [m], data); if(data.muted != m){ data.muted = m; trigger(data._elem, 'volumechange'); } data = null; } else if(mediaSup.muted.prop._supset) { return mediaSup.muted.prop._supset.apply(this, arguments); } }); createGetSetProp('currentTime', function(t){ var data = getSwfDataFromElem(this); if(data){ t *= 1; if (!isNaN(t)) { queueSwfMethod(this, 'api_seek', [t], data); } } else if(mediaSup.currentTime.prop._supset) { return mediaSup.currentTime.prop._supset.apply(this, arguments); } }); ['play', 'pause'].forEach(function(fn){ descs[fn] = { value: function(){ var data = getSwfDataFromElem(this); if(data){ if(data.stopPlayPause){ clearTimeout(data.stopPlayPause); } queueSwfMethod(this, fn == 'play' ? 'api_play' : 'api_pause', [], data); data._ppFlag = true; if(data.paused != (fn != 'play')){ data.paused = fn != 'play'; trigger(data._elem, fn); } } else if(mediaSup[fn].prop._supvalue) { return mediaSup[fn].prop._supvalue.apply(this, arguments); } } }; }); getPropKeys.forEach(createGetProp); webshims.onNodeNamesPropertyModify(nodeName, 'controls', function(val, boolProp){ var data = getSwfDataFromElem(this); $(this)[boolProp ? 'addClass' : 'removeClass']('webshims-controls'); if(data){ if(nodeName == 'audio'){ setElementDimension(data, boolProp); } queueSwfMethod(this, 'api_controls', [boolProp], data); } }); webshims.onNodeNamesPropertyModify(nodeName, 'preload', function(val){ var data, baseData, elem; if(bufferSrc(this)){ data = getSwfDataFromElem(this); if(data){ queueSwfMethod(this, 'api_preload', [], data); } else if(needsLoadPreload && this.paused && !this.error && !$.data(this, 'mediaerror') && !this.readyState && !this.networkState && !this.autoplay && $(this).is(':not(.nonnative-api-active)')){ elem = this; baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {}); clearTimeout(baseData.loadTimer); baseData.loadTimer = setTimeout(function(){ $(elem).mediaLoad(); }, 9); } } }); mediaSup = webshims.defineNodeNameProperties(nodeName, descs, 'prop'); if(!support.mediaDefaultMuted){ webshims.defineNodeNameProperties(nodeName, { defaultMuted: { get: function(){ return $.attr(this, 'muted') != null; }, set: function(val){ if(val){ $.attr(this, 'muted', ''); } else { $(this).removeAttr('muted'); } } } }, 'prop'); } }); webshims.ready('canvas', function(){ if(!window.CanvasRenderingContext2D){ webshim.error('canvas.drawImage feature is needed. In IE8 flashvanvas pro can be used'); return; } var _drawImage = CanvasRenderingContext2D.prototype.drawImage; var slice = Array.prototype.slice; var isVideo = { video: 1, VIDEO: 1 }; var tested = {}; CanvasRenderingContext2D.prototype.drawImage = function(elem){ var data, img, args, imgData; var context = this; if(isVideo[elem.nodeName] && (data = webshims.data(elem, 'mediaelement')) && data.isActive == 'third' && data.api.api_image){ try { imgData = data.api.api_image(); } catch (er){ webshims.error('video has to be same origin or a crossdomain.xml has to be provided. Video has to be visible for flash API'); } if(!tested[data.currentSrc]){ tested[data.currentSrc] = true; if(imgData == null){ webshims.error('video has to be same origin or a crossdomain.xml has to be provided. Video has to be visible for flash API'); } } args = slice.call(arguments, 1); img = new Image(); //todo find a performant sync way img.onload = function(){ args.unshift(this); _drawImage.apply(context, args); img.onload = null; }; img.src = 'data:image/jpeg;base64,'+imgData; if(img.complete){ img.onload(); } return; } return _drawImage.apply(this, arguments); }; if(!_drawImage){ webshim.error('canvas.drawImage feature is needed. In IE8 flashvanvas pro can be used'); } }); if(hasFlash && $.cleanData){ var oldClean = $.cleanData; var objElem = document.createElement('object'); var noRemove = { SetVariable: 1, GetVariable: 1, SetReturnValue: 1, GetReturnValue: 1 }; var flashNames = { object: 1, OBJECT: 1 }; $.cleanData = function(elems){ var i, len, prop; var ret = oldClean.apply(this, arguments); if(elems && (len = elems.length) && loadedSwf){ for(i = 0; i < len; i++){ if(flashNames[elems[i].nodeName] && 'api_destroy' in elems[i]){ loadedSwf--; try { elems[i].api_destroy(); if(elems[i].readyState == 4){ for (prop in elems[i]) { if (!noRemove[prop] && !objElem[prop] && typeof elems[i][prop] == "function") { elems[i][prop] = null; } } } } catch(er){console.log(er);} } } } return ret; }; } if(!hasNative){ ['poster', 'src'].forEach(function(prop){ webshims.defineNodeNamesProperty(prop == 'src' ? ['audio', 'video', 'source'] : ['video'], prop, { //attr: {}, reflect: true, propType: 'src' }); }); webshims.defineNodeNamesProperty(['audio', 'video'], 'preload', { reflect: true, propType: 'enumarated', defaultValue: '', limitedTo: ['', 'auto', 'metadata', 'none'] }); webshims.reflectProperties('source', ['type', 'media']); ['autoplay', 'controls'].forEach(function(name){ webshims.defineNodeNamesBooleanProperty(['audio', 'video'], name); }); webshims.defineNodeNamesProperties(['audio', 'video'], { HAVE_CURRENT_DATA: { value: 2 }, HAVE_ENOUGH_DATA: { value: 4 }, HAVE_FUTURE_DATA: { value: 3 }, HAVE_METADATA: { value: 1 }, HAVE_NOTHING: { value: 0 }, NETWORK_EMPTY: { value: 0 }, NETWORK_IDLE: { value: 1 }, NETWORK_LOADING: { value: 2 }, NETWORK_NO_SOURCE: { value: 3 } }, 'prop'); if(hasFlash){ webshims.ready('WINDOWLOAD', function(){ setTimeout(function(){ if(!loadedSwf){ document.createElement('img').src = playerSwfPath; } }, 9); }); } } else if(!('media' in document.createElement('source'))){ webshims.reflectProperties('source', ['media']); } if(hasNative && hasFlash && !options.preferFlash){ var switchErrors = { 3: 1, 4: 1 }; var switchOptions = function(e){ var media, error, parent; if( ($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source', parent).last()[0] == e.target)) && (media = $(e.target).closest('audio, video')) && !media.hasClass('nonnative-api-active') ){ error = media.prop('error'); setTimeout(function(){ if(!media.hasClass('nonnative-api-active')){ if(error && switchErrors[error.code]){ options.preferFlash = true; document.removeEventListener('error', switchOptions, true); $('audio, video').each(function(){ webshims.mediaelement.selectSource(this); }); webshims.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+e.target.currentSrc+" Mediaerror: "+ media.prop('error')+ ' error.code: '+ error.code); } webshims.warn('There was a mediaelement error. Run the following line in your console to get more info: webshim.mediaelement.loadDebugger();') } }); } }; document.addEventListener('error', switchOptions, true); setTimeout(function(){ $('audio, video').each(function(){ var error = $.prop(this, 'error'); if(error && switchErrors[error]){ switchOptions({target: this}); } }); }); } });
mscharl/cdnjs
ajax/libs/webshim/1.14.6-RC1/dev/shims/combos/25.js
JavaScript
mit
79,770
/* * # Semantic UI - 1.6.0 * https://github.com/Semantic-Org/Semantic-UI * http://www.semantic-ui.com/ * * Copyright 2014 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ /******************************* Message *******************************/ .ui.message { position: relative; min-height: 1em; margin: 1em 0em; background: #efefef; padding: 1em 1.5em; line-height: 1.3; color: rgba(0, 0, 0, 0.8); -webkit-transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; border-radius: 0.2857rem; box-shadow: 0px 0px 0px 1px rgba(39, 41, 43, 0.15) inset, 0px 0px 0px 0px transparent; } .ui.message:first-child { margin-top: 0em; } .ui.message:last-child { margin-bottom: 0em; } /*-------------- Content ---------------*/ /* Header */ .ui.message .header { display: block; font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-weight: bold; margin: 0em 0em 0.5rem 0em; } /* Default font size */ .ui.message .header:not(.ui) { font-size: 1.1em; } /* Paragraph */ .ui.message p { opacity: 0.85; margin: 0.75em 0em; } .ui.message p:first-child { margin-top: 0em; } .ui.message p:last-child { margin-bottom: 0em; } .ui.message .header + p { margin-top: 0.25em; } /* List */ .ui.message ul.list { opacity: 0.85; list-style-position: inside; margin: 0.5em 0em 0em; padding: 0em; } .ui.message ul.list:first-child { margin-top: 0em; } .ui.message ul.list:last-child { margin-bottom: 0em; } .ui.message ul.list li { position: relative; list-style-type: none; margin: 0em 0em 0.3em 1em; padding: 0em; } .ui.message ul.list li:before { position: absolute; content: '•'; left: -1em; height: 100%; vertical-align: baseline; } .ui.message ul.list li:last-child { margin-bottom: 0em; } /* Icon */ .ui.message > .icon { margin-right: 0.6em; } /* Close Icon */ .ui.message > .close.icon { cursor: pointer; position: absolute; margin: 0em; top: 1.15em; right: 0.5em; opacity: 0.7; -webkit-transition: opacity 0.1s linear ; transition: opacity 0.1s linear ; } .ui.message > .close.icon:hover { opacity: 1; } /* First / Last Element */ .ui.message > :first-child { margin-top: 0em; } .ui.message > :last-child { margin-bottom: 0em; } /******************************* States *******************************/ /*-------------- Visible ---------------*/ .ui.visible.visible.visible.visible.message { display: block; } .ui.icon.visible.visible.visible.visible.message { display: table; } /*-------------- Hidden ---------------*/ .ui.hidden.hidden.hidden.hidden.message { display: none; } /******************************* Variations *******************************/ /*-------------- Compact ---------------*/ .ui.compact.message { display: inline-block; } /*-------------- Attached ---------------*/ .ui.attached.message { margin-bottom: -1px; border-radius: 0.2857rem 0.2857rem 0em 0em; box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.1) inset; margin-left: -1px; margin-right: -1px; } .ui.attached + .ui.attached.message:not(.top):not(.bottom) { margin-top: -1px; border-radius: 0em; } .ui.bottom.attached.message { margin-top: -1px; border-radius: 0em 0em 0.2857rem 0.2857rem; box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.1) inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.bottom.attached.message:not(:last-child) { margin-bottom: 1em; } .ui.attached.icon.message { display: block; width: auto; } /*-------------- Icon ---------------*/ .ui.icon.message { display: table; width: 100%; } .ui.icon.message > .icon:not(.close) { display: table-cell; width: auto; vertical-align: middle; font-size: 3em; opacity: 0.8; } .ui.icon.message > .content { display: table-cell; width: 100%; vertical-align: middle; } .ui.icon.message .icon:not(.close) + .content { padding-left: 1.5rem; } .ui.icon.message .circular.icon { width: 1em; } .ui.icon.message .circular.icon + .content { width: auto; padding-left: 2em; } /*-------------- Floating ---------------*/ .ui.floating.message { box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15), 0px 0px 0px 1px rgba(39, 41, 43, 0.15) inset; } /*-------------- Colors ---------------*/ .ui.black.message { background-color: #1b1c1d; color: #ffffff; } /*-------------- Types ---------------*/ /* Positive */ .ui.positive.message { background-color: #eeffe7; color: #3c763d; } .ui.positive.message, .ui.attached.positive.message { box-shadow: 0px 0px 0px 1px #b7caa7 inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.positive.message .header { color: #356e36; } /* Negative */ .ui.negative.message { background-color: #fff0f0; color: #a94442; } .ui.negative.message, .ui.attached.negative.message { box-shadow: 0px 0px 0px 1px #dbb1b1 inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.negative.message .header { color: #912d2b; } /* Info */ .ui.info.message { background-color: #e9faff; color: #337b92; } .ui.info.message, .ui.attached.info.message { box-shadow: 0px 0px 0px 1px #aad6df inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.info.message .header { color: #297187; } /* Warning */ .ui.warning.message { background-color: #fffbe6; color: #876a38; } .ui.warning.message, .ui.attached.warning.message { box-shadow: 0px 0px 0px 1px #d9caab inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.warning.message .header { color: #825c01; } /* Error */ .ui.error.message { background-color: #fff0f0; color: #a94442; } .ui.error.message, .ui.attached.error.message { box-shadow: 0px 0px 0px 1px #dbb1b1 inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.error.message .header { color: #912d2b; } /* Success */ .ui.success.message { background-color: #eeffe7; color: #3c763d; } .ui.success.message, .ui.attached.success.message { box-shadow: 0px 0px 0px 1px #b7caa7 inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.05); } .ui.success.message .header { color: #356e36; } /* Colors */ .ui.inverted.message, .ui.black.message { background-color: #1b1c1d; color: #ffffff; } .ui.blue.message { background-color: #dff0ff; color: #3b83c0; } .ui.blue.message .header { color: #3576ac; } .ui.green.message { background-color: #ebffed; color: #1ebc30; } .ui.green.message .header { color: #1aa62a; } .ui.orange.message { background-color: #ffedde; color: #e07b53; } .ui.orange.message .header { color: #dc6a3d; } .ui.pink.message { background-color: #ffe3fb; color: #d9499a; } .ui.pink.message .header { color: #d5348e; } .ui.purple.message { background-color: #eae7ff; color: #564f8a; } .ui.purple.message .header { color: #4c467a; } .ui.red.message { background-color: #ffe8e6; color: #d95c5c; } .ui.red.message .header { color: #d44747; } .ui.teal.message { background-color: #e9ffff; color: #10a3a3; } .ui.teal.message .header { color: #0e8c8c; } .ui.yellow.message { background-color: #fff8db; color: #b58105; } .ui.yellow.message .header { color: #9c6f04; } /*-------------- Sizes ---------------*/ .ui.small.message { font-size: 0.92857143em; } .ui.message { font-size: 1em; } .ui.large.message { font-size: 1.14285714em; } .ui.huge.message { font-size: 1.42857143em; } .ui.massive.message { font-size: 1.71428571em; } /******************************* Theme Overrides *******************************/ /******************************* User Variable Overrides *******************************/
matteofigus/cdnjs
ajax/libs/semantic-ui/1.6.0/components/message.css
CSS
mit
7,692
<?php namespace Doctrine\Tests\ORM\Tools\Pagination; use Doctrine\ORM\Query; class LimitSubqueryOutputWalkerTest extends PaginationTestCase { public function testLimitSubquery() { $query = $this->entityManager->createQuery( 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\MyBlogPost p JOIN p.category c JOIN p.author a'); $query->expireQueryCache(true); $limitQuery = clone $query; $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( "SELECT DISTINCT id0 FROM (SELECT m0_.id AS id0, m0_.title AS title1, c1_.id AS id2, a2_.id AS id3, a2_.name AS name4, m0_.author_id AS author_id5, m0_.category_id AS category_id6 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result", $limitQuery->getSql() ); } public function testLimitSubqueryWithSortPg() { $odp = $this->entityManager->getConnection()->getDatabasePlatform(); $this->entityManager->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\PostgreSqlPlatform); $query = $this->entityManager->createQuery( 'SELECT p, c, a FROM Doctrine\Tests\ORM\Tools\Pagination\MyBlogPost p JOIN p.category c JOIN p.author a ORDER BY p.title'); $limitQuery = clone $query; $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( "SELECT DISTINCT id0, title1 FROM (SELECT m0_.id AS id0, m0_.title AS title1, c1_.id AS id2, a2_.id AS id3, a2_.name AS name4, m0_.author_id AS author_id5, m0_.category_id AS category_id6 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id ORDER BY m0_.title ASC) dctrn_result ORDER BY title1 ASC", $limitQuery->getSql() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); } public function testLimitSubqueryPg() { $odp = $this->entityManager->getConnection()->getDatabasePlatform(); $this->entityManager->getConnection()->setDatabasePlatform(new \Doctrine\DBAL\Platforms\PostgreSqlPlatform); $this->testLimitSubquery(); $this->entityManager->getConnection()->setDatabasePlatform($odp); } public function testCountQuery_MixedResultsWithName() { $query = $this->entityManager->createQuery( 'SELECT a, sum(a.name) as foo FROM Doctrine\Tests\ORM\Tools\Pagination\Author a'); $limitQuery = clone $query; $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( "SELECT DISTINCT id0 FROM (SELECT a0_.id AS id0, a0_.name AS name1, sum(a0_.name) AS sclr2 FROM Author a0_) dctrn_result", $limitQuery->getSql() ); } }
ismaek/Gestor-
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php
PHP
mit
3,019
var util = require('util'); var colors = require('./colors'); // wow what a clusterfuck var parseOptions = function(plugin, message, opt) { if (!opt) opt = {}; if (typeof plugin === 'object') { opt = plugin; } else if (message instanceof Error) { opt.message = message; opt.plugin = plugin; } else if (typeof message === 'object') { opt = message; opt.plugin = plugin; } else if (typeof opt === 'object') { opt.plugin = plugin; opt.message = message; } return opt; }; function PluginError(plugin, message, opt) { if (!(this instanceof PluginError)) throw new Error('Call PluginError using new'); Error.call(this); var options = parseOptions(plugin, message, opt); this.plugin = options.plugin; this.showStack = options.showStack; // if message is an Error grab crap off it if (options.message instanceof Error) { this.name = options.message.name; this.message = options.message.message; this.fileName = options.message.fileName; this.lineNumber = options.message.lineNumber; this.stack = options.message.stack; } else { // else check options obj this.name = options.name; this.message = options.message; this.fileName = options.fileName; this.lineNumber = options.lineNumber; this.stack = options.stack; } // defaults if (!this.name) this.name = 'Error'; // TODO: figure out why this explodes mocha if (!this.stack) Error.captureStackTrace(this, arguments.callee || this.constructor); if (!this.plugin) throw new Error('Missing plugin name'); if (!this.message) throw new Error('Missing error message'); } util.inherits(PluginError, Error); PluginError.prototype.toString = function () { var sig = '['+colors.green('gulp')+'] '+this.name+' in plugin \''+colors.cyan(this.plugin)+'\''; var msg = this.showStack ? (this._stack || this.stack) : this.message; return sig+': '+msg; }; module.exports = PluginError;
skyfaerie/hashout
node_modules/gulp-livereload/node_modules/gulp-util/lib/PluginError.js
JavaScript
mit
1,939
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX-Web/Size5/Regular/Main.js * * Copyright (c) 2009-2014 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.STIXMathJax_Size5={directory:"Size5/Regular",family:"STIXMathJax_Size5",testString:"\u00A0\u02C6\u02C7\u02DC\u02F7\u0302\u0303\u0305\u030C\u0330\u0332\u0338\u203E\u20D0\u20D1",32:[0,0,250,0,0],160:[0,0,250,0,0],710:[816,-572,2328,0,2328],711:[816,-572,2328,0,2328],732:[780,-617,2328,0,2328],759:[-117,280,2328,0,2328],770:[816,-572,2328,0,2328],771:[780,-617,2328,0,2328],773:[820,-770,3000,0,3000],780:[816,-572,2328,0,2328],816:[-117,280,2328,0,2328],818:[-127,177,3000,0,3000],824:[960,454,0,-561,-123],8254:[820,-770,3000,0,3000],8400:[749,-584,3000,0,3000],8401:[749,-584,3000,0,3000],8406:[735,-482,3000,0,3000],8407:[735,-482,3000,0,3000],8428:[-123,288,3000,0,3000],8429:[-123,288,3000,0,3000],8430:[-26,279,3000,0,3000],8431:[-26,279,3000,0,3000],9140:[766,-544,3237,90,3147],9141:[139,83,3237,90,3147],9180:[80,189,3237,0,3237],9181:[842,-573,3237,0,3237],9182:[181,90,3238,0,3238],9183:[844,-573,3238,0,3238],9184:[66,212,3164,0,3164],9185:[842,-564,3164,0,3164],57344:[705,300,450,50,400],57345:[705,305,450,50,174],57346:[700,305,450,50,400],57347:[705,300,450,50,400],57348:[705,305,450,276,400],57349:[700,305,450,50,400],57350:[687,318,450,50,415],57351:[687,323,450,50,150],57352:[682,323,450,50,415],57353:[687,318,450,35,400],57354:[687,323,450,300,400],57355:[682,323,450,35,400],57356:[705,300,640,260,600],57357:[705,305,640,260,380],57358:[705,305,640,40,380],57359:[700,305,640,260,600],57360:[705,300,640,40,380],57361:[705,305,640,260,600],57362:[700,305,640,40,380],57363:[820,-770,1000,0,1000],57364:[-127,177,1000,0,1000],57365:[749,-584,870,0,871],57366:[634,-584,480,-10,490],57367:[749,-584,871,0,871],57368:[735,-482,871,0,872],57369:[736,-482,871,0,872],57370:[-127,177,480,-10,490],57371:[-123,288,871,0,871],57372:[-123,288,871,0,871],57373:[-26,279,871,0,872],57374:[-25,279,871,0,872],57375:[386,-120,315,0,315],57376:[405,-101,686,210,476],57377:[486,-20,315,0,315],57378:[1855,0,1184,112,895],57379:[635,0,1184,829,895],57380:[626,0,1184,829,1211],57381:[2140,0,1184,112,895],57382:[2135,0,1184,112,895],57383:[955,-554,1820,-25,1830],57384:[955,-820,633,-1,634],57385:[955,-554,1820,-10,1845],57386:[140,261,1820,-25,1830],57387:[-126,261,633,-1,634],57388:[140,261,1820,-10,1845],57389:[955,-342,1820,-25,1830],57390:[955,-342,1820,-10,1845],57391:[352,261,1820,-25,1830],57392:[352,261,1820,-10,1845],57393:[955,-512,897,-25,908],57394:[1218,-820,1844,-10,1854],57395:[955,-512,897,-11,922],57396:[182,261,897,-25,908],57397:[-126,524,1844,-10,1854],57398:[182,261,897,-11,922],57399:[405,-101,1033,229,805],57400:[405,-101,926,230,696],57401:[541,35,315,0,315],57402:[700,301,600,35,566],57403:[700,301,600,35,566],57404:[1066,79,688,294,574],57405:[610,25,688,294,394],57406:[1086,59,688,115,394]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"STIXMathJax_Size5"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Size5/Regular/Main.js"]);
yinghunglai/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/STIX-Web/Size5/Regular/Main.js
JavaScript
mit
3,669
/* * /MathJax/jax/output/HTML-CSS/fonts/Asana-Math/Monospace/Regular/Main.js * * Copyright (c) 2009-2014 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_Monospace={directory:"Monospace/Regular",family:"AsanaMathJax_Monospace",testString:"\u00A0\uD835\uDE70\uD835\uDE71\uD835\uDE72\uD835\uDE73\uD835\uDE74\uD835\uDE75\uD835\uDE76\uD835\uDE77\uD835\uDE78\uD835\uDE79\uD835\uDE7A\uD835\uDE7B\uD835\uDE7C\uD835\uDE7D",32:[0,0,524,0,0],160:[0,0,524,0,0],120432:[623,0,524,27,497],120433:[611,0,524,23,482],120434:[622,11,524,40,484],120435:[611,0,524,19,485],120436:[611,0,524,26,502],120437:[611,0,524,28,490],120438:[622,11,524,38,496],120439:[611,0,524,22,502],120440:[611,0,524,79,446],120441:[611,11,524,71,478],120442:[611,0,524,26,495],120443:[611,0,524,32,488],120444:[611,0,524,17,507],120445:[611,0,524,28,496],120446:[622,11,524,56,468],120447:[611,0,524,26,480],120448:[622,139,524,56,468],120449:[611,11,524,22,522],120450:[622,11,524,52,472],120451:[611,0,524,26,498],120452:[611,11,524,4,520],120453:[611,8,524,18,506],120454:[611,8,524,11,513],120455:[611,0,524,27,496],120456:[611,0,524,19,505],120457:[611,0,524,48,481],120458:[440,6,524,55,524],120459:[611,6,524,12,488],120460:[440,6,524,73,466],120461:[611,6,524,36,512],120462:[440,6,524,55,464],120463:[617,0,524,42,437],120464:[442,229,524,29,509],120465:[611,0,524,12,512],120466:[612,0,524,78,455],120467:[612,228,524,48,368],120468:[611,0,524,21,508],120469:[611,0,524,58,467],120470:[437,0,524,-4,516],120471:[437,0,524,12,512],120472:[440,6,524,57,467],120473:[437,222,524,12,488],120474:[437,222,524,40,537],120475:[437,0,524,32,487],120476:[440,6,524,72,459],120477:[554,6,524,25,449],120478:[431,6,524,12,512],120479:[431,4,524,24,500],120480:[431,4,524,16,508],120481:[431,0,524,27,496],120482:[431,228,524,26,500],120483:[431,0,524,33,475],120822:[691,12,499,48,451],120823:[691,0,499,100,421],120824:[691,0,499,50,450],120825:[691,12,499,42,457],120826:[692,0,499,28,471],120827:[679,12,499,50,450],120828:[691,12,499,50,449],120829:[697,12,499,42,457],120830:[691,12,499,42,457],120831:[691,12,499,50,449]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"AsanaMathJax_Monospace"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Monospace/Regular/Main.js"]);
kartikrao31/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/Asana-Math/Monospace/Regular/Main.js
JavaScript
mit
2,888
/* * /MathJax/jax/output/HTML-CSS/fonts/Gyre-Termes/Marks/Regular/Main.js * * Copyright (c) 2009-2014 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.GyreTermesMathJax_Marks={directory:"Marks/Regular",family:"GyreTermesMathJax_Marks",testString:"\u00A0\u02DB\u02DD\u0305\u0309\u030F\u0311\u0323\u0326\u032C\u032D\u032E\u032F\u0330\u0331",32:[0,0,250,0,0],160:[0,0,250,0,0],731:[17,245,333,81,261],733:[676,-505,333,37,427],773:[632,-588,0,-416,-83],777:[704,-517,0,-348,-151],783:[711,-540,0,-510,-120],785:[692,-567,0,-425,-75],803:[-89,191,0,-301,-199],806:[-38,281,0,-319,-180],812:[-70,204,0,-421,-79],813:[-80,214,0,-421,-79],814:[-70,195,0,-425,-75],815:[-88,213,0,-425,-75],816:[-88,197,0,-417,-83],817:[-113,167,0,-405,-94],818:[-70,114,0,-416,-83],819:[-70,228,0,-416,-83],831:[746,-588,0,-416,-83],8192:[0,0,500,0,0],8193:[0,0,1000,0,0],8199:[0,0,500,0,0],8200:[0,0,250,0,0],8203:[0,0,0,0,0],8204:[0,0,0,0,0],8205:[0,0,0,0,0],8208:[257,-194,333,39,285],8210:[357,-305,660,80,580],8213:[276,-224,1160,80,1080],8215:[-70,228,493,80,413],8218:[102,141,333,79,218],8222:[102,141,444,45,416],8226:[400,-100,460,80,380],8239:[0,0,200,0,0],8240:[676,13,1000,14,986],8241:[676,13,1320,14,1306],8246:[780,-450,521,60,461],8247:[780,-450,721,60,661],8249:[411,-33,333,57,278],8250:[411,-33,333,45,266],8251:[514,14,564,18,546],8253:[736,8,444,68,414],8274:[662,0,500,28,472],8287:[0,0,222,0,0],8288:[0,0,0,0,0],8289:[702,202,1008,52,956],8290:[0,0,0,0,0],8291:[0,0,0,0,0],8292:[0,0,0,0,0],8400:[710,-600,0,-438,-62],8401:[710,-600,0,-438,-62],8402:[650,150,0,-272,-228],8403:[500,0,0,-276,-224],8404:[768,-599,0,-452,-48],8405:[768,-599,0,-452,-48],8406:[710,-534,0,-443,-57],8408:[400,-100,0,-400,-100],8411:[660,-560,0,-500,0],8412:[660,-560,0,-600,100],8413:[668,168,0,-668,168],8414:[650,150,0,-650,150],8415:[872,372,0,-872,372],8417:[710,-534,0,-479,-21],8420:[735,209,0,-795,295],8421:[650,150,0,-403,-97],8422:[650,150,0,-344,-156],8424:[-70,170,0,-500,0],8425:[726,-548,0,-438,-63],8426:[430,-70,0,-595,95],8427:[650,150,0,-479,-21],8428:[-150,260,0,-438,-62],8429:[-150,260,0,-438,-62],8430:[-84,260,0,-443,-57],8431:[-84,260,0,-443,-57],8432:[747,-509,0,-356,-143],11800:[503,241,444,30,376],12310:[668,168,430,80,350],12311:[668,168,430,80,350]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"GyreTermesMathJax_Marks"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Marks/Regular/Main.js"]);
emmy41124/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/Gyre-Termes/Marks/Regular/Main.js
JavaScript
mit
3,042
/* * /MathJax/jax/output/HTML-CSS/fonts/Neo-Euler/Marks/Regular/Main.js * * Copyright (c) 2009-2014 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.NeoEulerMathJax_Marks={directory:"Marks/Regular",family:"NeoEulerMathJax_Marks",testString:"\u00A0\u0305\u030F\u0311\u0323\u0324\u0325\u032E\u032F\u0330\u0331\u0332\u2036\u2037\u20D6",32:[0,0,333,0,0],160:[0,0,333,0,0],773:[615,-570,0,-445,-53],783:[683,-502,0,-497,-154],785:[671,-513,0,-390,-108],803:[-93,193,0,-225,-125],804:[-93,193,0,-399,-100],805:[-43,243,0,-349,-149],814:[-78,207,0,-388,-83],815:[-78,207,0,-388,-83],816:[-95,196,0,-389,-68],817:[-116,169,0,-405,-93],818:[-120,165,0,-445,-53],8246:[782,-422,433,30,386],8247:[782,-422,626,30,578],8406:[750,-479,287,-131,287],8411:[642,-542,0,-599,-100],8412:[642,-542,0,-799,-100],8413:[716,216,1000,55,944],8417:[750,-479,449,0,449],8430:[50,221,287,-131,287],8431:[50,221,287,0,418]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"NeoEulerMathJax_Marks"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Marks/Regular/Main.js"]);
janpaepke/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/Neo-Euler/Marks/Regular/Main.js
JavaScript
mit
1,678
/* * /MathJax/jax/output/HTML-CSS/fonts/Gyre-Termes/NonUnicode/Regular/Main.js * * Copyright (c) 2009-2014 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.GyreTermesMathJax_NonUnicode={directory:"NonUnicode/Regular",family:"GyreTermesMathJax_NonUnicode",testString:"\u00A0\uE000\uE001\uE002\uE003\uE004\uE005\uE006\uE007\uE008\uE009\uE00A\uE00B\uE00C\uE00D",32:[0,0,250,0,0],160:[0,0,250,0,0],57344:[-38,281,333,97,236],57345:[684,-497,333,68,265],57346:[683,0,791,32,796],57347:[686,14,760,30,730],57348:[662,0,580,40,540],57349:[250,-201,750,0,750],57350:[250,-201,667,0,667],57351:[721,59,1000,25,974],57352:[676,-505,333,-94,296],57353:[-89,191,333,115,217],57354:[-113,167,333,11,322],57355:[67,67,541,40,502],57356:[676,14,1060,40,1020],57357:[371,0,336,-4,286],57358:[480,-36,500,17,483],57359:[824,162,722,34,688],57360:[608,162,500,29,470],57361:[674,0,814,27,787],57362:[674,0,914,38,874],57363:[460,10,508,51,496],57364:[460,10,577,65,555],57365:[851,0,814,27,787],57366:[851,0,914,38,874],57367:[675,10,508,51,496],57368:[675,10,577,65,555],57369:[851,0,814,27,787],57370:[851,0,914,38,874],57371:[669,10,508,51,496],57372:[669,10,577,65,555],57373:[1010,0,814,27,787],57374:[1010,0,914,38,874],57375:[798,10,508,51,496],57376:[798,10,577,65,555],57377:[851,191,814,27,787],57378:[851,191,914,38,874],57379:[669,191,508,51,496],57380:[669,191,577,65,555],57381:[1010,0,814,27,787],57382:[1010,0,914,38,874],57383:[798,10,508,51,496],57384:[798,10,577,65,555],57385:[984,0,814,27,787],57386:[984,0,914,38,874],57387:[772,10,508,51,496],57388:[772,10,577,65,555],57389:[984,0,814,27,787],57390:[984,0,914,38,874],57391:[772,10,508,51,496],57392:[772,10,577,65,555],57393:[847,0,814,27,787],57394:[847,0,914,38,874],57395:[674,10,508,51,496],57396:[674,10,577,65,555],57397:[1006,0,814,27,787],57398:[1006,0,914,38,874],57399:[794,10,508,51,496],57400:[794,10,577,65,555],57401:[847,191,814,27,787],57402:[847,191,914,38,874],57403:[674,191,508,51,496],57404:[674,191,577,65,555],57405:[1006,0,814,27,787],57406:[1006,0,914,38,874],57407:[794,10,508,51,496],57408:[794,10,577,65,555],57409:[1020,0,814,27,787],57410:[1020,0,914,38,874],57411:[808,10,508,51,496],57412:[808,10,577,65,555],57413:[983,0,814,27,787],57414:[983,0,914,38,874],57415:[771,10,508,51,496],57416:[771,10,577,65,555],57417:[675,-504,386,112,359],57418:[675,-504,443,133,404],57419:[832,0,814,27,787],57420:[832,0,914,38,874],57421:[640,10,508,51,496],57422:[640,10,577,65,555],57423:[674,191,814,27,787],57424:[674,191,914,38,874],57425:[460,191,508,51,496],57426:[460,191,577,65,555],57427:[662,0,998,10,959],57428:[662,0,1116,20,1064],57429:[460,10,754,52,705],57430:[460,10,847,66,785],57431:[851,0,814,27,787],57432:[851,0,914,38,874],57433:[675,10,508,51,496],57434:[675,10,577,65,555],57435:[896,0,814,27,787],57436:[896,0,914,38,874],57437:[684,10,508,51,496],57438:[684,10,577,65,555],57439:[809,0,814,27,787],57440:[809,0,914,38,874],57441:[617,10,508,51,496],57442:[617,10,577,65,555],57443:[676,13,876,56,835],57444:[676,13,981,71,928],57445:[674,245,814,27,787],57446:[674,245,914,38,874],57447:[460,245,508,51,496],57448:[460,245,577,65,555],57449:[896,0,814,27,787],57450:[896,0,914,38,874],57451:[690,10,508,51,496],57452:[690,10,577,65,555],57453:[676,14,1033,138,900],57454:[676,14,1154,160,999],57455:[835,0,814,27,787],57456:[835,0,914,38,874],57457:[643,10,508,51,496],57458:[643,10,577,65,555],57459:[662,0,754,29,662],57460:[662,0,847,41,738],57461:[683,10,570,13,525],57462:[683,10,645,24,586],57463:[669,-512,386,39,348],57464:[669,-512,443,51,391],57465:[662,156,240,84,156],57466:[662,156,282,101,181],57467:[676,14,754,41,706],57468:[676,14,847,54,786],57469:[460,10,508,38,463],57470:[460,10,577,50,519],57471:[851,14,754,41,706],57472:[851,14,847,54,786],57473:[675,10,508,38,463],57474:[675,10,577,50,519],57475:[674,-507,386,22,364],57476:[674,-507,443,33,410],57477:[847,14,754,41,706],57478:[847,14,847,54,786],57479:[674,10,508,38,463],57480:[674,10,577,50,519],57481:[676,215,754,41,706],57482:[676,215,847,54,786],57483:[460,215,508,38,463],57484:[460,215,577,50,519],57485:[5,215,386,67,297],57486:[5,215,443,83,336],57487:[579,138,570,68,503],57488:[579,138,645,84,562],57489:[674,-507,386,22,364],57490:[674,-507,443,33,410],57491:[459,11,326,99,221],57492:[459,11,376,118,252],57493:[102,141,295,72,225],57494:[102,141,343,88,256],57495:[662,0,814,28,764],57496:[662,0,914,39,849],57497:[683,10,570,40,550],57498:[683,10,645,53,614],57499:[847,0,814,28,764],57500:[847,0,914,39,849],57501:[683,10,570,40,673],57502:[683,10,645,53,750],57503:[662,0,814,28,764],57504:[662,0,914,39,849],57505:[683,10,570,40,560],57506:[683,10,645,53,625],57507:[640,-541,386,30,358],57508:[640,-541,443,42,402],57509:[727,87,570,58,513],57510:[727,87,645,73,573],57511:[641,-539,386,137,249],57512:[641,-539,443,159,283],57513:[-89,191,386,137,249],57514:[-89,191,443,159,283],57515:[662,0,692,23,667],57516:[662,0,779,35,742],57517:[460,10,508,38,476],57518:[460,10,577,50,533],57519:[851,0,692,23,667],57520:[851,0,779,35,742],57521:[675,10,508,38,476],57522:[675,10,577,50,533],57523:[847,0,692,23,667],57524:[847,0,779,35,742],57525:[674,10,508,38,476],57526:[674,10,577,50,533],57527:[847,0,692,23,667],57528:[847,0,779,35,742],57529:[674,10,508,38,476],57530:[674,10,577,50,533],57531:[1006,0,692,23,667],57532:[1006,0,779,35,742],57533:[794,10,508,38,476],57534:[794,10,577,50,533],57535:[847,191,692,23,667],57536:[847,191,779,35,742],57537:[674,191,508,38,476],57538:[674,191,577,50,533],57539:[1006,0,692,23,667],57540:[1006,0,779,35,742],57541:[794,10,508,38,476],57542:[794,10,577,50,533],57543:[1020,0,692,23,667],57544:[1020,0,779,35,742],57545:[808,10,508,38,476],57546:[808,10,577,50,533],57547:[983,0,692,23,667],57548:[983,0,779,35,742],57549:[771,10,508,38,476],57550:[771,10,577,50,533],57551:[832,0,692,23,667],57552:[832,0,779,35,742],57553:[640,10,508,38,476],57554:[640,10,577,50,533],57555:[833,0,692,23,667],57556:[833,0,779,35,742],57557:[641,10,508,38,476],57558:[641,10,577,50,533],57559:[662,191,692,23,667],57560:[662,191,779,35,742],57561:[460,191,508,38,476],57562:[460,191,577,50,533],57563:[851,0,692,23,667],57564:[851,0,779,35,742],57565:[675,10,508,38,476],57566:[675,10,577,50,533],57567:[896,0,692,23,667],57568:[896,0,779,35,742],57569:[684,10,508,38,476],57570:[684,10,577,50,533],57571:[676,14,570,72,500],57572:[676,14,645,88,558],57573:[809,0,692,23,667],57574:[809,0,779,35,742],57575:[617,10,508,38,476],57576:[617,10,577,50,533],57577:[662,218,814,23,788],57578:[662,218,914,35,875],57579:[460,218,570,28,476],57580:[460,218,645,39,533],57581:[662,245,692,23,667],57582:[662,245,779,35,742],57583:[460,245,508,38,476],57584:[460,245,577,50,533],57585:[662,0,814,28,764],57586:[662,0,914,39,849],57587:[686,10,570,42,528],57588:[686,10,645,55,590],57589:[835,0,692,23,667],57590:[835,0,779,35,742],57591:[643,10,508,38,476],57592:[643,10,577,50,533],57593:[674,15,570,14,557],57594:[674,15,645,25,621],57595:[676,9,386,153,271],57596:[676,9,443,177,307],57597:[459,226,386,116,233],57598:[459,226,443,136,266],57599:[662,0,632,23,611],57600:[662,0,713,35,681],57601:[683,0,386,32,431],57602:[683,0,443,44,483],57603:[683,0,890,45,886],57604:[683,0,997,59,983],57605:[683,0,680,44,725],57606:[683,0,766,58,807],57607:[683,0,930,44,881],57608:[683,0,1041,58,978],57609:[683,0,930,44,881],57610:[683,0,1041,58,978],57611:[683,0,632,44,583],57612:[683,0,713,58,650],57613:[688,14,570,45,492],57614:[688,14,645,59,550],57615:[683,0,632,45,583],57616:[683,0,713,59,650],57617:[676,0,570,23,529],57618:[676,0,645,35,591],57619:[676,14,814,45,790],57620:[676,14,914,59,878],57621:[460,218,570,41,527],57622:[460,218,645,54,589],57623:[851,14,814,45,790],57624:[851,14,914,59,878],57625:[669,218,570,41,527],57626:[669,218,645,54,589],57627:[676,281,814,45,790],57628:[676,281,914,59,878],57629:[733,218,570,41,527],57630:[733,218,645,54,589],57631:[676,14,1186,54,1132],57632:[676,14,1323,68,1254],57633:[683,9,570,23,525],57634:[683,9,645,35,586],57635:[675,-504,386,28,274],57636:[675,-504,443,39,310],57637:[411,-33,570,73,525],57638:[411,-33,645,89,586],57639:[411,-33,570,60,512],57640:[411,-33,645,74,572],57641:[411,-33,386,73,316],57642:[411,-33,443,89,356],57643:[411,-33,386,60,303],57644:[411,-33,443,74,342],57645:[662,0,814,31,782],57646:[662,0,914,43,869],57647:[683,0,570,20,546],57648:[683,0,645,31,609],57649:[684,-497,386,85,302],57650:[684,-497,443,102,341],57651:[676,-505,386,51,480],57652:[676,-505,443,65,537],57653:[257,-194,386,53,324],57654:[257,-194,443,67,365],57655:[662,0,386,30,357],57656:[662,0,443,42,401],57657:[641,0,326,28,288],57658:[641,0,376,39,326],57659:[851,0,386,30,363],57660:[851,0,443,42,408],57661:[675,0,326,28,327],57662:[675,0,376,39,368],57663:[847,0,386,3,384],57664:[847,0,443,13,431],57665:[674,0,326,-10,332],57666:[674,0,376,-2,375],57667:[832,0,386,30,358],57668:[832,0,443,42,402],57669:[640,0,326,-2,326],57670:[640,0,376,7,367],57671:[833,0,386,30,357],57672:[833,0,443,42,401],57673:[662,191,386,30,357],57674:[662,191,443,42,401],57675:[641,191,326,28,288],57676:[641,191,376,39,326],57677:[851,0,386,23,357],57678:[851,0,443,35,401],57679:[675,0,326,-4,288],57680:[675,0,376,4,326],57681:[896,0,386,30,357],57682:[896,0,443,42,401],57683:[684,0,326,28,288],57684:[684,0,376,39,326],57685:[662,14,886,54,832],57686:[662,14,992,68,924],57687:[641,218,609,54,564],57688:[641,218,687,68,630],57689:[809,0,386,22,364],57690:[809,0,443,33,410],57691:[617,0,326,-10,332],57692:[617,0,376,-2,375],57693:[662,245,386,30,357],57694:[662,245,443,42,401],57695:[641,245,326,28,288],57696:[641,245,376,39,326],57697:[835,0,386,11,374],57698:[835,0,443,21,421],57699:[643,0,326,-21,342],57700:[643,0,376,-14,385],57701:[662,14,448,21,417],57702:[662,14,511,32,468],57703:[641,218,326,-67,232],57704:[641,218,376,-65,264],57705:[662,0,814,47,805],57706:[662,0,914,61,895],57707:[683,0,570,18,566],57708:[683,0,645,28,631],57709:[662,281,814,47,805],57710:[662,281,914,61,895],57711:[683,281,570,18,566],57712:[683,281,645,28,631],57713:[662,0,692,23,668],57714:[662,0,779,35,744],57715:[683,0,326,31,293],57716:[683,0,376,43,331],57717:[851,0,692,23,668],57718:[851,0,779,35,744],57719:[872,0,326,31,321],57720:[872,0,376,43,362],57721:[662,0,692,23,668],57722:[662,0,779,35,744],57723:[683,0,326,31,407],57724:[683,0,376,43,457],57725:[662,281,692,23,668],57726:[662,281,779,35,744],57727:[683,281,326,31,293],57728:[683,281,376,43,331],57729:[683,0,386,32,431],57730:[683,0,443,44,483],57731:[662,0,692,23,668],57732:[662,0,779,35,744],57733:[683,0,326,27,300],57734:[683,0,376,38,339],57735:[662,0,998,23,959],57736:[662,0,1116,35,1064],57737:[460,0,876,28,863],57738:[460,0,981,39,958],57739:[617,-563,386,22,364],57740:[617,-563,443,33,410],57741:[450,250,669,98,615],57742:[450,250,754,117,686],57743:[662,11,814,23,788],57744:[662,11,914,35,875],57745:[460,0,570,28,544],57746:[460,0,645,39,607],57747:[851,11,814,23,788],57748:[851,11,914,35,875],57749:[675,0,570,28,544],57750:[675,0,645,39,607],57751:[847,11,814,23,788],57752:[847,11,914,35,875],57753:[674,0,570,28,544],57754:[674,0,645,39,607],57755:[662,281,814,23,788],57756:[662,281,914,35,875],57757:[460,281,570,28,544],57758:[460,281,645,39,607],57759:[676,22,570,43,515],57760:[676,22,645,56,575],57761:[835,11,814,23,788],57762:[835,11,914,35,875],57763:[643,0,570,28,544],57764:[643,0,645,39,607],57765:[662,0,570,16,556],57766:[662,0,645,26,620],57767:[676,14,814,47,767],57768:[676,14,914,61,852],57769:[460,10,570,42,527],57770:[460,10,645,55,589],57771:[851,14,814,47,767],57772:[851,14,914,61,852],57773:[675,10,570,42,527],57774:[675,10,645,55,589],57775:[847,14,814,47,767],57776:[847,14,914,61,852],57777:[674,10,570,42,527],57778:[674,10,645,55,589],57779:[1006,14,814,47,767],57780:[1006,14,914,61,852],57781:[794,10,570,42,527],57782:[794,10,645,55,589],57783:[847,191,814,47,767],57784:[847,191,914,61,852],57785:[674,191,570,42,527],57786:[674,191,645,55,589],57787:[1006,14,814,47,767],57788:[1006,14,914,61,852],57789:[794,10,570,42,527],57790:[794,10,645,55,589],57791:[1020,14,814,47,767],57792:[1020,14,914,61,852],57793:[808,10,570,42,527],57794:[808,10,645,55,589],57795:[983,14,814,47,767],57796:[983,14,914,61,852],57797:[771,10,570,42,527],57798:[771,10,645,55,589],57799:[832,14,814,47,767],57800:[832,14,914,61,852],57801:[640,10,570,42,527],57802:[640,10,645,55,589],57803:[676,191,814,47,767],57804:[676,191,914,61,852],57805:[460,191,570,42,527],57806:[460,191,645,55,589],57807:[668,6,998,43,984],57808:[668,6,1116,56,1091],57809:[460,10,814,43,769],57810:[460,10,914,56,855],57811:[17,245,386,99,297],57812:[17,245,443,118,336],57813:[851,14,814,47,767],57814:[851,14,914,61,852],57815:[675,10,570,42,527],57816:[675,10,645,55,589],57817:[896,14,814,47,767],57818:[896,14,914,61,852],57819:[684,10,570,42,527],57820:[684,10,645,55,589],57821:[771,14,814,47,767],57822:[771,14,914,61,852],57823:[559,10,570,42,530],57824:[559,10,645,55,592],57825:[851,14,814,47,767],57826:[851,14,914,61,852],57827:[675,10,570,42,530],57828:[675,10,645,55,592],57829:[771,191,814,47,767],57830:[771,191,914,61,852],57831:[559,191,570,42,530],57832:[559,191,645,55,592],57833:[851,14,814,47,767],57834:[851,14,914,61,852],57835:[675,10,570,42,530],57836:[675,10,645,55,592],57837:[896,14,814,47,767],57838:[896,14,914,61,852],57839:[684,10,570,42,530],57840:[684,10,645,55,592],57841:[835,14,814,47,767],57842:[835,14,914,61,852],57843:[643,10,570,42,530],57844:[643,10,645,55,592],57845:[851,14,814,47,767],57846:[851,14,914,61,852],57847:[676,10,570,42,572],57848:[676,10,645,55,638],57849:[809,14,814,47,767],57850:[809,14,914,61,852],57851:[617,10,570,42,527],57852:[617,10,645,55,589],57853:[676,0,570,132,443],57854:[676,0,645,154,497],57855:[824,162,814,47,767],57856:[824,162,914,61,852],57857:[608,162,570,42,527],57858:[608,162,645,55,589],57859:[734,80,814,47,767],57860:[734,80,914,61,852],57861:[551,112,570,42,527],57862:[551,112,645,55,589],57863:[835,14,814,47,767],57864:[835,14,914,61,852],57865:[643,10,570,42,527],57866:[643,10,645,55,589],57867:[662,0,632,28,606],57868:[662,0,713,39,676],57869:[460,217,570,16,527],57870:[460,217,645,26,589],57871:[662,154,518,-14,505],57872:[662,154,588,-7,565],57873:[676,13,936,64,871],57874:[676,13,1048,79,967],57875:[100,11,295,87,209],57876:[100,11,343,105,239],57877:[676,13,1472,25,1447],57878:[676,13,1637,37,1600],57879:[676,13,1120,25,1095],57880:[676,13,1250,37,1213],57881:[676,178,814,47,781],57882:[676,178,914,61,868],57883:[461,217,570,36,547],57884:[461,217,645,49,610],57885:[676,8,508,85,465],57886:[676,8,577,102,521],57887:[458,226,508,43,424],57888:[458,226,577,56,475],57889:[676,-431,469,95,374],57890:[676,-431,534,113,421],57891:[102,141,508,60,468],57892:[102,141,577,74,523],57893:[676,-433,508,57,465],57894:[676,-433,577,72,521],57895:[676,-433,508,43,451],57896:[676,-433,577,56,505],57897:[676,-433,386,137,289],57898:[676,-433,443,159,327],57899:[676,-433,386,97,250],57900:[676,-433,443,116,284],57901:[102,141,386,97,250],57902:[102,141,443,116,284],57903:[676,-431,218,63,156],57904:[676,-431,258,78,181],57905:[662,0,754,29,735],57906:[662,0,847,41,817],57907:[460,0,386,16,379],57908:[460,0,443,26,425],57909:[851,0,754,29,735],57910:[851,0,847,41,817],57911:[675,0,386,16,379],57912:[675,0,443,26,425],57913:[847,0,754,29,735],57914:[847,0,847,41,817],57915:[674,0,386,16,379],57916:[674,0,443,26,425],57917:[662,281,754,29,735],57918:[662,281,847,41,817],57919:[460,281,386,16,379],57920:[460,281,443,26,425],57921:[690,-491,386,84,303],57922:[690,-491,443,101,342],57923:[676,14,632,56,550],57924:[676,14,713,71,614],57925:[459,10,448,66,393],57926:[459,10,511,82,441],57927:[851,14,632,56,550],57928:[851,14,713,71,614],57929:[675,10,448,66,393],57930:[675,10,511,82,441],57931:[847,14,632,56,550],57932:[847,14,713,71,614],57933:[674,10,448,47,393],57934:[674,10,511,61,441],57935:[676,225,632,56,550],57936:[676,225,713,71,614],57937:[459,215,448,66,393],57938:[459,215,511,82,441],57939:[676,281,632,56,550],57940:[676,281,713,71,614],57941:[459,281,448,66,393],57942:[459,281,511,82,441],57943:[676,148,570,87,479],57944:[676,148,645,105,535],57945:[459,141,326,98,251],57946:[459,141,376,117,285],57947:[662,8,570,32,504],57948:[662,8,645,44,563],57949:[684,14,570,47,525],57950:[684,14,645,61,586],57951:[676,8,570,23,549],57952:[676,8,645,35,613],57953:[662,0,692,29,662],57954:[662,0,779,41,738],57955:[579,10,326,24,317],57956:[579,10,376,36,358],57957:[847,0,692,29,662],57958:[847,0,779,41,738],57959:[713,10,326,24,354],57960:[713,10,376,36,399],57961:[662,225,692,29,662],57962:[662,225,779,41,738],57963:[579,215,326,24,317],57964:[579,215,376,36,358],57965:[662,281,692,29,662],57966:[662,281,779,41,738],57967:[579,281,326,24,317],57968:[579,281,376,36,358],57969:[662,0,632,28,606],57970:[662,0,713,39,676],57971:[683,217,570,16,527],57972:[683,217,645,26,589],57973:[676,14,570,57,485],57974:[676,14,645,72,543],57975:[643,-537,386,11,374],57976:[643,-537,443,21,421],57977:[67,67,615,54,562],57978:[67,67,695,68,627],57979:[676,0,570,43,533],57980:[676,0,645,56,595],57981:[662,14,814,25,786],57982:[662,14,914,37,873],57983:[450,10,570,20,537],57984:[450,10,645,31,600],57985:[851,14,814,25,786],57986:[851,14,914,37,873],57987:[675,10,570,20,537],57988:[675,10,645,31,600],57989:[847,14,814,25,786],57990:[847,14,914,37,873],57991:[674,10,570,20,537],57992:[674,10,645,31,600],57993:[832,14,814,25,786],57994:[832,14,914,37,873],57995:[640,10,570,20,537],57996:[640,10,645,31,600],57997:[662,191,814,25,786],57998:[662,191,914,37,873],57999:[450,191,570,20,537],58000:[450,191,645,31,600],58001:[851,14,814,25,786],58002:[851,14,914,37,873],58003:[675,10,570,20,537],58004:[675,10,645,31,600],58005:[896,14,814,25,786],58006:[896,14,914,37,873],58007:[684,10,570,20,537],58008:[684,10,645,31,600],58009:[771,14,797,25,787],58010:[771,14,894,37,874],58011:[560,10,584,20,574],58012:[560,10,661,31,641],58013:[851,14,797,25,787],58014:[851,14,894,37,874],58015:[675,10,584,20,574],58016:[675,10,661,31,641],58017:[771,191,797,25,787],58018:[771,191,894,37,874],58019:[560,191,584,20,574],58020:[560,191,661,31,641],58021:[851,14,797,25,787],58022:[851,14,894,37,874],58023:[675,10,584,20,574],58024:[675,10,661,31,641],58025:[896,14,797,25,787],58026:[896,14,894,37,874],58027:[684,10,584,20,574],58028:[684,10,661,31,641],58029:[835,14,797,25,787],58030:[835,14,894,37,874],58031:[643,10,584,20,574],58032:[643,10,661,31,641],58033:[851,14,814,25,786],58034:[851,14,914,37,873],58035:[676,10,570,20,566],58036:[676,10,645,31,631],58037:[809,14,814,25,786],58038:[809,14,914,37,873],58039:[617,10,570,20,537],58040:[617,10,645,31,600],58041:[662,245,814,25,786],58042:[662,245,914,37,873],58043:[450,245,570,20,537],58044:[450,245,645,31,600],58045:[896,14,814,25,786],58046:[896,14,914,37,873],58047:[690,10,570,20,537],58048:[690,10,645,31,600],58049:[835,14,814,25,786],58050:[835,14,914,37,873],58051:[643,10,570,20,537],58052:[643,10,645,31,600],58053:[662,11,814,28,777],58054:[662,11,914,39,863],58055:[450,14,570,31,535],58056:[450,14,645,43,597],58057:[662,11,1058,16,1035],58058:[662,11,1182,26,1148],58059:[450,14,814,33,773],58060:[450,14,914,45,860],58061:[662,0,814,21,784],58062:[662,0,914,32,872],58063:[450,0,570,29,537],58064:[450,0,645,41,600],58065:[662,0,814,34,783],58066:[662,0,914,47,871],58067:[450,218,570,25,533],58068:[450,218,645,37,595],58069:[851,0,814,34,783],58070:[851,0,914,47,871],58071:[675,218,570,25,533],58072:[675,218,645,37,595],58073:[832,0,814,34,783],58074:[832,0,914,47,871],58075:[640,218,570,25,533],58076:[640,218,645,37,595],58077:[662,191,814,34,783],58078:[662,191,914,47,871],58079:[450,218,570,25,533],58080:[450,218,645,37,595],58081:[662,0,570,-48,573],58082:[662,0,645,-44,640],58083:[851,0,814,34,783],58084:[851,0,914,47,871],58085:[675,218,570,25,533],58086:[675,218,645,37,595],58087:[896,0,814,34,783],58088:[896,0,914,47,871],58089:[684,218,570,25,533],58090:[684,218,645,37,595],58091:[835,0,814,34,783],58092:[835,0,914,47,871],58093:[643,218,570,25,533],58094:[643,218,645,37,595],58095:[662,0,692,20,667],58096:[662,0,779,31,742],58097:[450,0,508,40,470],58098:[450,0,577,53,526],58099:[851,0,692,20,667],58100:[851,0,779,31,742],58101:[675,0,508,40,470],58102:[675,0,577,53,526],58103:[847,0,692,20,667],58104:[847,0,779,31,742],58105:[674,0,508,40,470],58106:[674,0,577,53,526],58107:[833,0,692,20,667],58108:[833,0,779,31,742],58109:[641,0,508,40,470],58110:[641,0,577,53,526],58111:[676,14,570,36,534],58112:[676,14,645,49,596],58113:[668,0,692,-46,630],58114:[668,0,779,-42,702],58115:[441,11,570,29,534],58116:[441,11,645,41,596],58117:[653,0,692,1,657],58118:[653,0,779,10,731],58119:[683,11,570,35,530],58120:[683,11,645,48,592],58121:[666,18,754,83,768],58122:[666,18,847,100,854],58123:[441,11,508,43,478],58124:[441,11,577,56,534],58125:[653,0,814,1,780],58126:[653,0,914,10,867],58127:[683,13,570,27,590],58128:[683,13,645,38,658],58129:[653,0,692,9,707],58130:[653,0,779,19,787],58131:[441,11,508,44,463],58132:[441,11,577,58,519],58133:[653,0,692,19,720],58134:[653,0,779,30,800],58135:[678,207,326,-152,476],58136:[678,207,376,-158,533],58137:[666,18,814,67,804],58138:[666,18,914,83,894],58139:[441,206,570,19,526],58140:[441,206,645,30,587],58141:[653,0,814,1,854],58142:[653,0,914,10,948],58143:[683,9,570,31,536],58144:[683,9,645,43,598],58145:[653,0,386,1,432],58146:[653,0,443,10,485],58147:[643,11,326,64,314],58148:[643,11,376,79,354],58149:[653,18,508,3,550],58150:[653,18,577,13,614],58151:[643,207,326,-126,341],58152:[643,207,376,-130,384],58153:[653,0,754,18,804],58154:[653,0,847,28,894],58155:[683,11,508,25,517],58156:[683,11,577,37,578],58157:[653,0,632,1,625],58158:[653,0,713,10,696],58159:[683,11,326,55,317],58160:[683,11,376,70,358],58161:[653,0,936,-10,970],58162:[653,0,1048,-2,1076],58163:[441,9,814,23,784],58164:[441,9,914,35,872],58165:[653,15,754,-12,810],58166:[653,15,847,-4,900],58167:[441,9,570,25,531],58168:[441,9,645,37,594],58169:[666,18,814,76,779],58170:[666,18,914,93,866],58171:[441,11,570,40,525],58172:[441,11,645,53,586],58173:[653,0,692,10,676],58174:[653,0,779,20,752],58175:[441,205,570,-73,526],58176:[441,205,645,-71,587],58177:[666,182,814,75,779],58178:[666,182,914,91,866],58179:[441,205,570,38,541],58180:[441,205,645,50,604],58181:[653,0,692,-4,657],58182:[653,0,779,4,731],58183:[441,0,448,60,463],58184:[441,0,511,74,519],58185:[667,18,570,29,569],58186:[667,18,645,41,635],58187:[442,13,448,28,413],58188:[442,13,511,39,463],58189:[653,0,632,75,706],58190:[653,0,713,91,786],58191:[546,11,326,51,336],58192:[546,11,376,65,378],58193:[653,18,814,122,852],58194:[653,18,914,143,946],58195:[441,11,570,56,533],58196:[441,11,645,71,595],58197:[653,18,692,94,767],58198:[653,18,779,112,852],58199:[441,18,508,33,479],58200:[441,18,577,45,535],58201:[653,18,936,88,1007],58202:[653,18,1048,106,1116],58203:[441,18,754,28,723],58204:[441,18,847,39,804],58205:[653,0,692,-22,731],58206:[653,0,779,-15,813],58207:[441,11,508,-20,502],58208:[441,11,577,-13,561],58209:[653,0,632,96,706],58210:[653,0,713,114,786],58211:[441,206,508,-16,479],58212:[441,206,577,-9,535],58213:[653,0,632,3,677],58214:[653,0,713,13,753],58215:[428,81,448,8,428],58216:[428,81,511,18,480],58217:[461,0,278,16,255],58218:[461,203,333,-57,260],58219:[462,9,278,2,238],58220:[462,207,278,-189,239],58221:[674,0,954,98,856],58222:[674,0,1067,117,950],58223:[668,0,873,98,775],58224:[668,0,978,117,861],58225:[690,0,944,98,846],58226:[690,0,1056,117,940],58227:[683,0,922,98,824],58228:[683,0,1032,117,915],58229:[662,0,830,98,732],58230:[662,0,931,117,814],58231:[653,0,852,98,754],58232:[653,0,955,117,838],58233:[676,0,859,98,761],58234:[676,0,963,117,846],58235:[669,0,909,98,811],58236:[669,0,1018,117,901],58237:[662,0,782,98,684],58238:[662,0,879,117,762],58239:[662,0,975,98,877],58240:[662,0,1090,117,973],58241:[676,0,831,98,733],58242:[676,0,932,117,815],58243:[676,0,1030,98,932],58244:[676,0,1151,117,1034],58245:[662,0,838,98,740],58246:[662,0,940,117,823],58247:[653,0,895,98,797],58248:[653,0,1002,117,885],58249:[676,0,884,98,786],58250:[676,0,990,117,873],58251:[669,0,944,98,846],58252:[669,0,1056,117,940],58253:[662,0,842,98,744],58254:[662,0,944,117,827],58255:[653,0,869,98,771],58256:[653,0,974,117,857],58257:[676,0,863,98,765],58258:[676,0,967,117,850],58259:[669,0,857,98,759],58260:[669,0,961,117,844],58261:[662,0,947,98,849],58262:[662,0,1060,117,943],58263:[653,0,1049,98,951],58264:[653,0,1171,117,1055],58265:[676,0,1008,98,910],58266:[676,0,1127,117,1010],58267:[669,0,1101,98,1003],58268:[669,0,1229,117,1113],58269:[675,14,915,98,817],58270:[675,14,1025,117,908],58271:[666,18,899,98,801],58272:[666,18,1007,117,890],58273:[691,19,975,98,877],58274:[691,19,1090,117,973],58275:[685,18,948,98,850],58276:[685,18,1061,117,944],58277:[662,0,523,98,425],58278:[662,0,593,117,476],58279:[653,0,627,98,529],58280:[653,0,708,117,591],58281:[676,0,581,98,483],58282:[676,0,657,117,540],58283:[669,0,678,98,580],58284:[669,0,764,117,647],58285:[662,0,954,98,856],58286:[662,0,1067,117,950],58287:[653,0,983,98,885],58288:[653,0,1099,117,982],58289:[676,0,1009,98,911],58290:[676,0,1128,117,1011],58291:[669,0,991,98,893],58292:[669,0,1108,117,992],58293:[674,0,954,98,856],58294:[674,0,1067,117,950],58295:[668,0,873,98,775],58296:[668,0,978,117,861],58297:[690,0,944,98,846],58298:[690,0,1056,117,940],58299:[683,0,922,98,824],58300:[683,0,1032,117,915],58301:[662,0,1132,98,1034],58302:[662,0,1263,117,1147],58303:[653,0,1176,98,1078],58304:[653,0,1312,117,1195],58305:[676,0,1194,98,1096],58306:[676,0,1331,117,1214],58307:[669,12,1237,98,1139],58308:[669,12,1378,117,1261],58309:[662,11,959,98,861],58310:[662,11,1073,117,957],58311:[653,15,1018,98,920],58312:[653,15,1137,117,1021],58313:[676,18,950,98,852],58314:[676,18,1062,117,946],58315:[669,15,1049,98,951],58316:[669,15,1171,117,1055],58317:[662,0,819,98,721],58318:[662,0,918,117,802],58319:[653,0,924,98,826],58320:[653,0,1035,117,918],58321:[662,0,824,98,726],58322:[662,0,925,117,808],58323:[662,0,981,98,883],58324:[662,0,1098,117,981],58325:[675,14,915,98,817],58326:[675,14,1025,117,908],58327:[666,18,899,98,801],58328:[666,18,1007,117,890],58329:[691,19,975,98,877],58330:[691,19,1090,117,973],58331:[685,18,926,98,828],58332:[685,18,1037,117,920],58333:[662,0,947,98,849],58334:[662,0,1060,117,943],58335:[653,0,1049,98,951],58336:[653,0,1171,117,1055],58337:[676,0,1008,98,910],58338:[676,0,1127,117,1010],58339:[669,0,1101,98,1003],58340:[669,0,1229,117,1113],58341:[662,0,775,98,677],58342:[662,0,870,117,753],58343:[653,0,862,98,764],58344:[653,0,966,117,849],58345:[676,0,838,98,740],58346:[676,0,940,117,823],58347:[669,0,900,98,802],58348:[669,0,1008,117,891],58349:[662,0,848,98,750],58350:[662,0,951,117,834],58351:[653,0,953,98,855],58352:[653,0,1066,117,949],58353:[662,0,882,98,784],58354:[662,0,989,117,872],58355:[662,0,1020,98,922],58356:[662,0,1140,117,1023],58357:[662,0,830,98,732],58358:[662,0,931,117,814],58359:[653,0,827,98,729],58360:[653,0,928,117,811],58361:[676,0,862,98,764],58362:[676,0,966,117,849],58363:[669,0,856,98,758],58364:[669,0,960,117,843],58365:[662,0,926,98,828],58366:[662,0,1037,117,920],58367:[653,0,898,98,799],58368:[653,0,1006,117,888],58369:[676,0,953,98,855],58370:[676,0,1066,117,949],58371:[676,0,884,98,785],58372:[676,0,991,117,874],58373:[662,0,814,98,716],58374:[662,0,914,117,797],58375:[653,0,799,97,700],58376:[653,0,896,116,779],58377:[676,0,915,98,817],58378:[676,0,1025,117,908],58379:[676,0,885,97,786],58380:[676,0,991,117,874],58381:[662,0,959,98,861],58382:[662,0,1073,117,957],58383:[653,0,948,98,850],58384:[653,0,1061,117,944],58385:[676,0,947,98,849],58386:[676,0,1060,117,943],58387:[669,0,986,98,888],58388:[669,0,1102,117,986],58389:[662,0,899,98,801],58390:[662,0,1007,117,890],58391:[653,0,867,98,769],58392:[653,0,972,117,855],58393:[676,0,988,98,890],58394:[676,0,1105,117,988],58395:[676,0,966,98,868],58396:[676,0,1081,117,964],58397:[676,0,958,98,860],58398:[676,0,1072,117,955],58399:[649,0,960,98,862],58400:[649,0,1074,117,957],58401:[691,0,955,98,857],58402:[691,0,1069,117,952],58403:[691,0,1002,98,903],58404:[691,0,1120,117,1003],58405:[460,17,718,98,619],58406:[460,17,808,117,690],58407:[441,16,730,97,632],58408:[441,16,821,116,704],58409:[473,14,767,98,669],58410:[473,14,862,117,745],58411:[473,14,821,97,723],58412:[473,14,921,116,804],58413:[673,217,639,98,541],58414:[673,217,721,117,604],58415:[645,208,783,98,685],58416:[645,208,880,117,763],58417:[691,217,735,98,637],58418:[691,217,827,117,710],58419:[691,217,890,98,792],58420:[691,217,997,117,880],58421:[461,234,760,98,662],58422:[461,234,854,117,738],58423:[442,224,772,98,674],58424:[442,224,868,117,751],58425:[473,232,812,98,714],58426:[473,232,911,117,794],58427:[473,232,846,98,748],58428:[473,232,949,117,832],58429:[671,16,682,98,584],58430:[671,16,768,117,652],58431:[645,15,713,97,615],58432:[645,15,802,116,686],58433:[691,14,753,98,655],58434:[691,14,846,117,729],58435:[691,14,787,98,688],58436:[691,14,884,116,766],58437:[460,16,613,98,515],58438:[460,16,692,117,575],58439:[441,15,645,98,546],58440:[441,15,727,116,610],58441:[473,14,650,98,552],58442:[473,14,733,117,617],58443:[473,14,707,97,608],58444:[473,14,795,116,678],58445:[460,16,541,98,443],58446:[460,16,614,117,497],58447:[441,15,597,97,499],58448:[441,15,674,116,558],58449:[482,14,594,98,496],58450:[482,14,672,117,555],58451:[482,14,658,97,560],58452:[482,14,742,116,625],58453:[667,210,621,98,523],58454:[667,210,701,117,584],58455:[639,201,670,97,571],58456:[639,201,755,117,637],58457:[667,215,621,98,523],58458:[667,215,701,117,584],58459:[667,215,684,98,585],58460:[667,215,770,116,653],58461:[460,217,679,98,581],58462:[460,217,765,117,648],58463:[441,208,659,98,560],58464:[441,208,743,117,626],58465:[473,218,760,98,662],58466:[473,218,854,117,738],58467:[473,218,737,98,638],58468:[473,218,829,117,711],58469:[673,16,627,97,529],58470:[673,16,708,116,591],58471:[645,15,654,98,556],58472:[645,15,738,116,620],58473:[691,14,724,98,626],58474:[691,14,814,117,698],58475:[691,14,745,97,647],58476:[691,14,838,116,721],58477:[673,16,820,98,722],58478:[673,16,920,117,803],58479:[645,15,786,98,687],58480:[645,15,882,117,765],58481:[693,14,931,98,833],58482:[693,14,1042,117,925],58483:[693,14,898,98,799],58484:[693,14,1005,117,888],58485:[460,17,529,98,431],58486:[460,17,600,117,483],58487:[441,16,448,98,350],58488:[441,16,511,117,394],58489:[473,14,592,98,494],58490:[473,14,669,117,552],58491:[473,14,507,98,409],58492:[473,14,576,117,459],58493:[460,15,780,98,682],58494:[460,15,876,117,759],58495:[441,14,765,98,666],58496:[441,14,859,117,742],58497:[473,14,866,98,768],58498:[473,14,970,117,854],58499:[473,14,842,98,743],58500:[473,14,944,117,826],58501:[460,16,764,98,666],58502:[460,16,858,117,741],58503:[441,15,740,97,641],58504:[441,15,831,117,714],58505:[473,14,734,98,636],58506:[473,14,825,117,708],58507:[473,14,805,97,707],58508:[473,14,904,117,786],58509:[673,18,753,98,655],58510:[673,18,846,117,729],58511:[645,17,759,98,661],58512:[645,17,853,117,736],58513:[691,14,812,98,714],58514:[691,14,911,117,794],58515:[691,14,841,98,743],58516:[691,14,943,117,826],58517:[444,218,702,98,604],58518:[444,218,790,117,673],58519:[426,209,774,98,676],58520:[426,209,869,117,752],58521:[461,218,779,98,681],58522:[461,218,875,117,758],58523:[461,218,853,98,755],58524:[461,218,956,117,839],58525:[460,16,684,98,586],58526:[460,16,771,117,654],58527:[441,15,685,98,586],58528:[441,15,771,117,654],58529:[473,11,752,98,654],58530:[473,11,845,117,728],58531:[473,11,760,98,662],58532:[473,11,854,117,737],58533:[667,210,620,98,522],58534:[667,210,699,117,583],58535:[639,201,674,98,576],58536:[639,201,759,116,642],58537:[667,215,618,98,520],58538:[667,215,698,117,581],58539:[667,215,697,97,598],58540:[667,215,785,116,668],58541:[460,10,680,98,582],58542:[460,10,766,117,649],58543:[441,11,681,98,583],58544:[441,11,767,117,650],58545:[473,14,692,98,594],58546:[473,14,779,117,663],58547:[473,13,689,98,591],58548:[473,13,776,117,659],58549:[471,16,799,98,701],58550:[471,16,897,117,780],58551:[452,15,862,97,764],58552:[452,15,967,116,850],58553:[481,14,807,98,709],58554:[481,14,905,117,788],58555:[481,14,923,97,825],58556:[481,14,1033,116,917],58557:[471,21,1008,98,910],58558:[471,21,1127,117,1010],58559:[452,20,1017,98,919],58560:[452,20,1136,117,1019],58561:[481,14,1071,98,973],58562:[481,14,1196,117,1079],58563:[481,14,1104,98,1006],58564:[481,14,1232,117,1115],58565:[460,218,618,98,520],58566:[460,218,698,117,581],58567:[441,209,739,98,641],58568:[441,209,831,117,714],58569:[473,218,698,98,600],58570:[473,218,785,117,669],58571:[473,218,824,98,725],58572:[473,218,924,117,807],58573:[460,217,627,98,529],58574:[460,217,708,117,591],58575:[441,208,654,97,555],58576:[441,208,737,116,620],58577:[473,217,698,98,600],58578:[473,217,785,117,669],58579:[473,217,760,98,662],58580:[473,217,855,116,738],58581:[471,16,677,98,579],58582:[471,16,762,117,646],58583:[452,15,743,98,645],58584:[452,15,836,116,719],58585:[471,14,761,98,663],58586:[471,14,856,117,739],58587:[471,14,836,98,738],58588:[471,14,938,116,821],58589:[460,210,620,98,522],58590:[460,210,699,117,583],58591:[441,201,660,98,561],58592:[441,201,744,116,626],58593:[473,215,620,98,522],58594:[473,215,699,117,583],58595:[473,215,691,97,593],58596:[473,215,778,116,661],58597:[471,16,711,98,613],58598:[471,16,800,117,683],58599:[452,15,732,98,634],58600:[452,15,823,117,706],58601:[481,16,741,98,643],58602:[481,16,833,117,716],58603:[481,16,796,98,698],58604:[481,16,893,117,776],58605:[460,16,666,98,568],58606:[460,16,750,117,633],58607:[441,15,667,98,569],58608:[441,15,752,117,635],58609:[473,14,724,98,626],58610:[473,14,814,117,698],58611:[473,14,733,98,634],58612:[473,14,824,117,707],58613:[460,218,770,98,672],58614:[460,218,865,117,748],58615:[441,209,766,98,667],58616:[441,209,860,116,743],58617:[476,218,913,98,815],58618:[476,218,1023,117,906],58619:[476,218,905,97,807],58620:[476,218,1014,116,897],58621:[657,217,792,98,694],58622:[657,217,889,117,773],58623:[630,208,788,97,689],58624:[630,208,885,116,767],58625:[677,218,935,98,837],58626:[677,218,1047,117,930],58627:[677,218,925,97,826],58628:[677,218,1035,116,918],58629:[460,236,753,98,655],58630:[460,236,846,117,729],58631:[441,226,907,98,809],58632:[441,226,1015,117,898],58633:[473,232,812,98,714],58634:[473,232,911,117,794],58635:[473,232,985,98,887],58636:[473,232,1101,117,984],58637:[460,218,878,98,780],58638:[460,218,984,117,867],58639:[441,209,865,97,767],58640:[441,209,970,116,853],58641:[473,218,988,98,890],58642:[473,218,1105,117,988],58643:[473,218,981,97,883],58644:[473,218,1097,116,980],58645:[463,16,864,98,766],58646:[463,16,968,117,851],58647:[444,15,859,97,760],58648:[444,15,963,116,846],58649:[475,14,888,98,790],58650:[475,14,995,117,878],58651:[475,14,869,98,771],58652:[475,14,974,117,857],58653:[674,0,856,98,758],58654:[674,0,960,117,843],58655:[668,0,775,98,677],58656:[668,0,870,117,753],58657:[690,0,857,98,759],58658:[690,0,961,117,844],58659:[683,0,829,98,731],58660:[683,0,929,117,813],58661:[673,17,627,98,529],58662:[673,17,708,117,591],58663:[645,16,664,98,566],58664:[645,16,749,116,631],58665:[691,14,698,98,600],58666:[691,14,785,117,669],58667:[691,14,757,97,658],58668:[691,14,851,116,733],58669:[664,10,856,98,758],58670:[664,10,960,117,843],58671:[658,10,775,98,677],58672:[658,10,870,117,753],58673:[680,10,857,98,759],58674:[680,10,961,117,844],58675:[673,10,829,98,731],58676:[673,10,929,117,813],58677:[675,14,915,98,817],58678:[675,14,1025,117,908],58679:[691,19,975,98,877],58680:[691,19,1090,117,973],58681:[666,18,899,98,801],58682:[666,18,1007,117,890],58683:[685,18,948,98,850],58684:[685,18,1061,117,944],58685:[723,19,684,54,630],58686:[723,19,771,68,702],58687:[729,29,594,54,540],58688:[729,29,672,68,603],58689:[740,18,536,54,481],58690:[740,18,607,68,538],58691:[717,16,594,54,540],58692:[717,16,672,68,603],58693:[482,0,214,69,146],58694:[482,201,207,-18,139],58695:[482,0,203,19,198],58696:[482,201,192,-115,188],58697:[497,0,264,67,193],58698:[497,201,257,4,189],58699:[497,0,264,67,299],58700:[497,201,257,-38,295],58701:[494,0,455,79,375],58702:[497,218,493,80,402],58703:[406,14,466,80,386],58704:[410,308,770,80,690],58705:[411,14,501,80,421],58706:[411,291,811,80,731],58707:[445,25,337,80,257],58708:[445,177,319,80,228],58709:[455,23,378,80,298],58710:[455,169,360,80,280],58711:[417,0,600,92,508],58712:[417,186,600,147,458],58713:[650,150,466,80,386],58714:[606,106,659,80,579],58715:[650,150,466,80,386],58716:[604,104,661,80,581],58717:[650,150,466,80,386],58718:[602,102,660,80,580],58719:[650,150,466,80,386],58720:[600,100,659,80,579],58721:[650,150,466,80,386],58722:[597,97,660,80,580],58723:[650,150,466,80,386],58724:[594,94,660,80,580],58725:[638,-149,444,73,371],58726:[638,-149,444,73,371],58727:[638,-149,744,73,671],58728:[638,-149,744,73,671],58729:[638,-149,1044,73,971],58730:[638,-149,1044,73,971],58731:[638,-149,1344,73,1271],58732:[844,344,686,80,606],58733:[844,344,1077,80,997],58734:[844,344,1468,80,1388],58735:[844,344,1859,80,1779],58736:[844,344,734,80,654],58737:[844,344,1125,80,1045],58738:[844,344,1516,80,1436],58739:[844,344,750,80,710],58740:[844,344,750,80,710],58741:[844,344,739,80,699],58742:[844,344,713,80,673],58743:[959,459,708,80,628],58744:[959,459,1116,80,1036],58745:[959,459,1524,80,1444],58746:[959,459,1932,80,1852],58747:[959,459,758,80,678],58748:[959,459,1166,80,1086],58749:[959,459,1574,80,1494],58750:[959,459,774,80,734],58751:[959,459,774,80,734],58752:[959,459,759,80,719],58753:[959,459,736,80,696],58754:[1097,597,730,80,650],58755:[1097,597,1155,80,1075],58756:[1097,597,1580,80,1500],58757:[1097,597,2005,80,1925],58758:[1097,597,782,80,702],58759:[1097,597,1207,80,1127],58760:[1097,597,1632,80,1552],58761:[1097,597,797,80,757],58762:[1097,597,797,80,757],58763:[1097,597,779,80,739],58764:[1097,597,759,80,719],58765:[1462,962,776,80,696],58766:[1462,962,1235,80,1155],58767:[1462,962,1694,80,1614],58768:[1462,962,2153,80,2073],58769:[1462,962,832,80,752],58770:[1462,962,1291,80,1211],58771:[1462,962,1750,80,1670],58772:[1462,962,846,80,806],58773:[1462,962,846,80,806],58774:[1462,962,821,80,781],58775:[1462,962,807,80,767],58776:[1701,1201,800,80,720],58777:[1701,1201,1275,80,1195],58778:[1701,1201,1750,80,1670],58779:[1701,1201,2225,80,2145],58780:[1701,1201,858,80,778],58781:[1701,1201,1333,80,1253],58782:[1701,1201,1808,80,1728],58783:[1701,1201,871,80,831],58784:[1701,1201,871,80,831],58785:[1701,1201,842,80,802],58786:[1701,1201,832,80,792],58787:[1161,0,2225,80,1891],58788:[580,0,2225,334,1891],58789:[1161,0,2225,334,2145]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"GyreTermesMathJax_NonUnicode"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/NonUnicode/Regular/Main.js"]);
enricodeleo/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/Gyre-Termes/NonUnicode/Regular/Main.js
JavaScript
mit
39,372
/* * /MathJax/jax/output/HTML-CSS/fonts/Neo-Euler/Size2/Regular/Main.js * * Copyright (c) 2009-2014 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.NeoEulerMathJax_Size2={directory:"Size2/Regular",family:"NeoEulerMathJax_Size2",testString:"\u00A0\u2016\u2044\u2215\u221A\u2223\u2225\u2227\u2228\u2229\u222A\u228E\u22C0\u22C1\u22C2",32:[0,0,333,0,0],40:[1599,199,596,180,574],41:[1599,199,595,22,415],47:[1599,200,811,53,759],91:[1674,125,472,226,453],92:[1599,200,811,53,759],93:[1674,125,472,18,245],123:[1599,200,667,119,547],124:[1897,208,213,86,126],125:[1599,200,667,119,547],160:[0,0,333,0,0],8214:[1897,208,403,86,316],8260:[1599,200,811,53,759],8725:[1599,200,811,53,759],8730:[1800,1,1000,110,1024],8739:[1897,208,213,86,126],8741:[1297,208,403,86,316],8743:[1128,267,1549,56,1492],8744:[1069,326,1549,56,1492],8745:[1359,-1,1110,56,1053],8746:[1317,41,1110,56,1053],8846:[1317,41,1110,56,1053],8896:[1128,267,1549,56,1492],8897:[1069,326,1549,56,1492],8898:[1359,-1,1110,56,1053],8899:[1317,41,1110,56,1053],8968:[1599,200,527,226,509],8969:[1599,200,527,18,301],8970:[1599,200,527,226,509],8971:[1599,200,527,18,301],9001:[1536,234,629,109,520],9002:[1536,234,693,89,500],9180:[794,-414,1911,56,1855],9181:[144,236,1911,56,1855],9182:[912,-484,1911,56,1855],9183:[70,358,1911,56,1855],10216:[939,237,501,95,392],10217:[939,237,568,79,375]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"NeoEulerMathJax_Size2"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Size2/Regular/Main.js"]);
iamso/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/Neo-Euler/Size2/Regular/Main.js
JavaScript
mit
2,133
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": { "0": "AM", "1": "PM" }, "DAY": { "0": "Linggo", "1": "Lunes", "2": "Martes", "3": "Miyerkules", "4": "Huwebes", "5": "Biyernes", "6": "Sabado" }, "MONTH": { "0": "Enero", "1": "Pebrero", "2": "Marso", "3": "Abril", "4": "Mayo", "5": "Hunyo", "6": "Hulyo", "7": "Agosto", "8": "Setyembre", "9": "Oktubre", "10": "Nobyembre", "11": "Disyembre" }, "SHORTDAY": { "0": "Lin", "1": "Lun", "2": "Mar", "3": "Mye", "4": "Huw", "5": "Bye", "6": "Sab" }, "SHORTMONTH": { "0": "Ene", "1": "Peb", "2": "Mar", "3": "Abr", "4": "May", "5": "Hun", "6": "Hul", "7": "Ago", "8": "Set", "9": "Okt", "10": "Nob", "11": "Dis" }, "fullDate": "EEEE, MMMM dd y", "longDate": "MMMM d, y", "medium": "MMM d, y HH:mm:ss", "mediumDate": "MMM d, y", "mediumTime": "HH:mm:ss", "short": "M/d/yy HH:mm", "shortDate": "M/d/yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20b1", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": { "0": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, "1": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "(\u00a4", "negSuf": ")", "posPre": "\u00a4", "posSuf": "" } } }, "id": "fil-ph", "pluralCat": function (n) { if (n == 0 || n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
liubo404/cdnjs
ajax/libs/angular-i18n/1.0.7/angular-locale_fil-ph.js
JavaScript
mit
2,127
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": { "0": "AM", "1": "PM" }, "DAY": { "0": "Sunday", "1": "Monday", "2": "Tuesday", "3": "Wednesday", "4": "Thursday", "5": "Friday", "6": "Saturday" }, "MONTH": { "0": "January", "1": "February", "2": "March", "3": "April", "4": "May", "5": "June", "6": "July", "7": "August", "8": "September", "9": "October", "10": "November", "11": "December" }, "SHORTDAY": { "0": "Sun", "1": "Mon", "2": "Tue", "3": "Wed", "4": "Thu", "5": "Fri", "6": "Sat" }, "SHORTMONTH": { "0": "Jan", "1": "Feb", "2": "Mar", "3": "Apr", "4": "May", "5": "Jun", "6": "Jul", "7": "Aug", "8": "Sep", "9": "Oct", "10": "Nov", "11": "Dec" }, "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": { "0": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, "1": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "(\u00a4", "negSuf": ")", "posPre": "\u00a4", "posSuf": "" } } }, "id": "en-mh", "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
bevacqua/angular.js
src/ngLocale/angular-locale_en-mh.js
JavaScript
mit
2,115
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": { "0": "a.m.", "1": "p.m." }, "DAY": { "0": "domingo", "1": "lunes", "2": "martes", "3": "mi\u00e9rcoles", "4": "jueves", "5": "viernes", "6": "s\u00e1bado" }, "MONTH": { "0": "enero", "1": "febrero", "2": "marzo", "3": "abril", "4": "mayo", "5": "junio", "6": "julio", "7": "agosto", "8": "septiembre", "9": "octubre", "10": "noviembre", "11": "diciembre" }, "SHORTDAY": { "0": "dom", "1": "lun", "2": "mar", "3": "mi\u00e9", "4": "jue", "5": "vie", "6": "s\u00e1b" }, "SHORTMONTH": { "0": "ene", "1": "feb", "2": "mar", "3": "abr", "4": "may", "5": "jun", "6": "jul", "7": "ago", "8": "sep", "9": "oct", "10": "nov", "11": "dic" }, "fullDate": "EEEE, d 'de' MMMM 'de' y", "longDate": "d 'de' MMMM 'de' y", "medium": "dd/MM/yyyy HH:mm:ss", "mediumDate": "dd/MM/yyyy", "mediumTime": "HH:mm:ss", "short": "dd/MM/yy HH:mm", "shortDate": "dd/MM/yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20ac", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": { "0": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, "1": { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } } }, "id": "es-ve", "pluralCat": function (n) { if (n == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
flosse/cdnjs
ajax/libs/angular-i18n/1.0.7/angular-locale_es-ve.js
JavaScript
mit
2,176
/* * The MIT License * Copyright (c) 2012 Matias Meno <m@tias.me> */ .dropzone, .dropzone * { box-sizing: border-box; } .dropzone { position: relative; } .dropzone .dz-preview { position: relative; display: inline-block; width: 120px; margin: 0.5em; } .dropzone .dz-preview .dz-progress { display: block; height: 15px; border: 1px solid #aaa; } .dropzone .dz-preview .dz-progress .dz-upload { display: block; height: 100%; width: 0; background: green; } .dropzone .dz-preview .dz-error-message { color: red; display: none; } .dropzone .dz-preview.dz-error .dz-error-message, .dropzone .dz-preview.dz-error .dz-error-mark { display: block; } .dropzone .dz-preview.dz-success .dz-success-mark { display: block; } .dropzone .dz-preview .dz-error-mark, .dropzone .dz-preview .dz-success-mark { position: absolute; display: none; left: 30px; top: 30px; width: 54px; height: 58px; left: 50%; margin-left: -27px; }
khasinski/cdnjs
ajax/libs/dropzone/4.0.0/basic.css
CSS
mit
1,082
(function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)})(function(e,t){(t.defineLocale||t.lang).call(t,"pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"dom_2ª_3ª_4ª_5ª_6ª_sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"LT:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),e.fullCalendar.datepickerLang("pt","pt",{closeText:"Fechar",prevText:"Anterior",nextText:"Seguinte",currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekHeader:"Sem",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),e.fullCalendar.lang("pt",{defaultButtonText:{month:"Mês",week:"Semana",day:"Dia",list:"Agenda"},allDayText:"Todo o dia",eventLimitText:"mais"})});
raszi/cdnjs
ajax/libs/fullcalendar/2.2.2/lang/pt.js
JavaScript
mit
1,986
/*! Title parser * This parser will remove "The", "A" and "An" from the beginning of a book * or movie title, so it sorts by the second word or number * Demo: http://jsfiddle.net/Mottie/abkNM/5/ */ /*global jQuery: false */ ;(function($){ "use strict"; // basic list from http://en.wikipedia.org/wiki/Article_%28grammar%29 $.tablesorter.ignoreArticles = { "en" : "the, a, an", "de" : "der, die, das, des, dem, den, ein, eine, einer, eines, einem, einen", "nl" : "de, het, de, een", "es" : "el, la, lo, los, las, un, una, unos, unas", "pt" : "o, a, os, as, um, uma, uns, umas", "fr" : "le, la, l'_, les, un, une, des", "it" : "il, lo, la, l'_, i, gli, le, un', uno, una, un", "hu" : "a, az, egy" }; // To add a custom parser, define: // $.tablesorter.ignoreArticles['xx'] = "A, B, C"; // and then set the language id 'xx' in the headers option // ignoreArticles : 'xx' $.tablesorter.addParser({ id: 'ignoreArticles', is: function() { return false; }, format: function(s, table, cell, cellIndex) { var c = table.config, art, lang; if ( !(c.headers && c.headers[cellIndex] && c.headers[cellIndex].ignoreArticlesRegex) ) { // initialize - save regex in c.headers[cellIndex].ignoreArticles if (!c.headers) { c.headers = {}; } if (!c.headers[cellIndex]) { c.headers[cellIndex] = {}; } lang = $.tablesorter.getData(c.$headers.eq(cellIndex), c.headers[cellIndex], 'ignoreArticles'); art = ($.tablesorter.ignoreArticles[lang] || "the, a, an" ) + ""; c.headers[cellIndex].ignoreArticlesRegex = new RegExp('^(' + $.trim( art.split(/\s*\,\s*/).join('\\s|') + "\\s" ).replace("_\\s","") + ')', 'i'); } return (s || '').replace(c.headers[cellIndex].ignoreArticlesRegex, ''); }, type: 'text' }); })(jQuery);
noraesae/cdnjs
ajax/libs/jquery.tablesorter/2.14.0/js/parsers/parser-ignore-articles.js
JavaScript
mit
1,777
import repeating from "repeating"; import * as t from "../../types"; /** * Prints WithStatement, prints object and body. */ export function WithStatement(node, print) { this.keyword("with"); this.push("("); print.plain(node.object); this.push(")"); print.block(node.body); } /** * Prints IfStatement, prints test, consequent, and alternate. */ export function IfStatement(node, print) { this.keyword("if"); this.push("("); print.plain(node.test); this.push(")"); this.space(); print.indentOnComments(node.consequent); if (node.alternate) { if (this.isLast("}")) this.space(); this.push("else "); print.indentOnComments(node.alternate); } } /** * Prints ForStatement, prints init, test, update, and body. */ export function ForStatement(node, print) { this.keyword("for"); this.push("("); print.plain(node.init); this.push(";"); if (node.test) { this.space(); print.plain(node.test); } this.push(";"); if (node.update) { this.space(); print.plain(node.update); } this.push(")"); print.block(node.body); } /** * Prints WhileStatement, prints test and body. */ export function WhileStatement(node, print) { this.keyword("while"); this.push("("); print.plain(node.test); this.push(")"); print.block(node.body); } /** * Builds ForIn or ForOf statement printers. * Prints left, right, and body. */ var buildForXStatement = function (op) { return function (node, print) { this.keyword("for"); this.push("("); print.plain(node.left); this.push(` ${op} `); print.plain(node.right); this.push(")"); print.block(node.body); }; }; /** * Create ForInStatement and ForOfStatement printers. */ export var ForInStatement = buildForXStatement("in"); export var ForOfStatement = buildForXStatement("of"); /** * Prints DoWhileStatement, prints body and test. */ export function DoWhileStatement(node, print) { this.push("do "); print.plain(node.body); this.space(); this.keyword("while"); this.push("("); print.plain(node.test); this.push(");"); } /** * Builds continue, return, or break statement printers. * Prints label (or key). */ var buildLabelStatement = function (prefix, key = "label") { return function (node, print) { this.push(prefix); var label = node[key]; if (label) { this.push(" "); var terminatorState = this.startTerminatorless(); print.plain(label); this.endTerminatorless(terminatorState); } this.semicolon(); }; }; /** * Create ContinueStatement, ReturnStatement, and BreakStatement printers. */ export var ContinueStatement = buildLabelStatement("continue"); export var ReturnStatement = buildLabelStatement("return", "argument"); export var BreakStatement = buildLabelStatement("break"); export var ThrowStatement = buildLabelStatement("throw", "argument"); /** * Prints LabeledStatement, prints label and body. */ export function LabeledStatement(node, print) { print.plain(node.label); this.push(": "); print.plain(node.body); } /** * Prints TryStatement, prints block, handlers, and finalizer. */ export function TryStatement(node, print) { this.keyword("try"); print.plain(node.block); this.space(); // Esprima bug puts the catch clause in a `handlers` array. // see https://code.google.com/p/esprima/issues/detail?id=433 // We run into this from regenerator generated ast. if (node.handlers) { print.plain(node.handlers[0]); } else { print.plain(node.handler); } if (node.finalizer) { this.space(); this.push("finally "); print.plain(node.finalizer); } } /** * Prints CatchClause, prints param and body. */ export function CatchClause(node, print) { this.keyword("catch"); this.push("("); print.plain(node.param); this.push(") "); print.plain(node.body); } /** * Prints SwitchStatement, prints discriminant and cases. */ export function SwitchStatement(node, print) { this.keyword("switch"); this.push("("); print.plain(node.discriminant); this.push(")"); this.space(); this.push("{"); print.sequence(node.cases, { indent: true, addNewlines(leading, cas) { if (!leading && node.cases[node.cases.length - 1] === cas) return -1; } }); this.push("}"); } /** * Prints SwitchCase, prints test and consequent. */ export function SwitchCase(node, print) { if (node.test) { this.push("case "); print.plain(node.test); this.push(":"); } else { this.push("default:"); } if (node.consequent.length) { this.newline(); print.sequence(node.consequent, { indent: true }); } } /** * Prints DebuggerStatement. */ export function DebuggerStatement() { this.push("debugger;"); } /** * Prints VariableDeclaration, prints declarations, handles kind and format. */ export function VariableDeclaration(node, print, parent) { this.push(node.kind + " "); var hasInits = false; // don't add whitespace to loop heads if (!t.isFor(parent)) { for (var declar of (node.declarations: Array)) { if (declar.init) { // has an init so let's split it up over multiple lines hasInits = true; } } } // // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on // this will format declarations like: // // var foo = "bar", bar = "foo"; // // into // // var foo = "bar", // bar = "foo"; // var sep; if (!this.format.compact && !this.format.concise && hasInits && !this.format.retainLines) { sep = `,\n${repeating(" ", node.kind.length + 1)}`; } // print.list(node.declarations, { separator: sep }); if (t.isFor(parent)) { // don't give semicolons to these nodes since they'll be inserted in the parent generator if (parent.left === node || parent.init === node) return; } this.semicolon(); } /** * Prints VariableDeclarator, handles id, id.typeAnnotation, and init. */ export function VariableDeclarator(node, print) { print.plain(node.id); print.plain(node.id.typeAnnotation); if (node.init) { this.space(); this.push("="); this.space(); print.plain(node.init); } }
hubli/babel
packages/babel/src/generation/generators/statements.js
JavaScript
mit
6,223
webshims.register('form-number-date-api', function($, webshims, window, document, undefined, options){ "use strict"; if(!webshims.addInputType){ webshims.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')"); } if(!webshims.getStep){ webshims.getStep = function(elem, type){ var step = $.attr(elem, 'step'); if(step === 'any'){ return step; } type = type || getType(elem); if(!typeModels[type] || !typeModels[type].step){ return step; } step = typeProtos.number.asNumber(step); return ((!isNaN(step) && step > 0) ? step : typeModels[type].step) * (typeModels[type].stepScaleFactor || 1); }; } if(!webshims.addMinMaxNumberToCache){ webshims.addMinMaxNumberToCache = function(attr, elem, cache){ if (!(attr+'AsNumber' in cache)) { cache[attr+'AsNumber'] = typeModels[cache.type].asNumber(elem.attr(attr)); if(isNaN(cache[attr+'AsNumber']) && (attr+'Default' in typeModels[cache.type])){ cache[attr+'AsNumber'] = typeModels[cache.type][attr+'Default']; } } }; } var nan = parseInt('NaN', 10), doc = document, typeModels = webshims.inputTypes, isNumber = function(string){ return (typeof string == 'number' || (string && string == string * 1)); }, supportsType = function(type){ return ($('<input type="'+type+'" />').prop('type') === type); }, getType = function(elem){ return (elem.getAttribute('type') || '').toLowerCase(); }, isDateTimePart = function(string){ return (string && !(isNaN(string * 1))); }, addMinMaxNumberToCache = webshims.addMinMaxNumberToCache, addleadingZero = function(val, len){ val = ''+val; len = len - val.length; for(var i = 0; i < len; i++){ val = '0'+val; } return val; }, EPS = 1e-7, typeBugs = webshims.bugs.bustedValidity ; webshims.addValidityRule('stepMismatch', function(input, val, cache, validityState){ if(val === ''){return false;} if(!('type' in cache)){ cache.type = getType(input[0]); } if(cache.type == 'week'){return false;} var base, attrVal; var ret = (validityState || {}).stepMismatch || false; if(typeModels[cache.type] && typeModels[cache.type].step){ if( !('step' in cache) ){ cache.step = webshims.getStep(input[0], cache.type); } if(cache.step == 'any'){return false;} if(!('valueAsNumber' in cache)){ cache.valueAsNumber = typeModels[cache.type].asNumber( val ); } if(isNaN(cache.valueAsNumber)){return false;} addMinMaxNumberToCache('min', input, cache); base = cache.minAsNumber; if(isNaN(base) && (attrVal = input.prop('defaultValue'))){ base = typeModels[cache.type].asNumber( attrVal ); } if(isNaN(base)){ base = typeModels[cache.type].stepBase || 0; } ret = Math.abs((cache.valueAsNumber - base) % cache.step); ret = !( ret <= EPS || Math.abs(ret - cache.step) <= EPS ); } return ret; }); [{name: 'rangeOverflow', attr: 'max', factor: 1}, {name: 'rangeUnderflow', attr: 'min', factor: -1}].forEach(function(data, i){ webshims.addValidityRule(data.name, function(input, val, cache, validityState) { var ret = (validityState || {})[data.name] || false; if(val === ''){return ret;} if (!('type' in cache)) { cache.type = getType(input[0]); } if (typeModels[cache.type] && typeModels[cache.type].asNumber) { if(!('valueAsNumber' in cache)){ cache.valueAsNumber = typeModels[cache.type].asNumber( val ); } if(isNaN(cache.valueAsNumber)){ return false; } addMinMaxNumberToCache(data.attr, input, cache); if(isNaN(cache[data.attr+'AsNumber'])){ return ret; } ret = ( cache[data.attr+'AsNumber'] * data.factor < cache.valueAsNumber * data.factor - EPS ); } return ret; }); }); webshims.reflectProperties(['input'], ['max', 'min', 'step']); //IDLs and methods, that aren't part of constrain validation, but strongly tight to it var valueAsNumberDescriptor = webshims.defineNodeNameProperty('input', 'valueAsNumber', { prop: { get: function(){ var elem = this; var type = getType(elem); var ret = (typeModels[type] && typeModels[type].asNumber) ? typeModels[type].asNumber($.prop(elem, 'value')) : (valueAsNumberDescriptor.prop._supget && valueAsNumberDescriptor.prop._supget.apply(elem, arguments)); if(ret == null){ ret = nan; } return ret; }, set: function(val){ var elem = this; var type = getType(elem); if(typeModels[type] && typeModels[type].numberToString){ //is NaN a number? if(isNaN(val)){ $.prop(elem, 'value', ''); return; } var set = typeModels[type].numberToString(val); if(set !== false){ $.prop(elem, 'value', set); } else { webshims.error('INVALID_STATE_ERR: DOM Exception 11'); } } else if(valueAsNumberDescriptor.prop._supset) { valueAsNumberDescriptor.prop._supset.apply(elem, arguments); } } } }); var valueAsDateDescriptor = webshims.defineNodeNameProperty('input', 'valueAsDate', { prop: { get: function(){ var elem = this; var type = getType(elem); return (typeModels[type] && typeModels[type].asDate && !typeModels[type].noAsDate) ? typeModels[type].asDate($.prop(elem, 'value')) : valueAsDateDescriptor.prop._supget && valueAsDateDescriptor.prop._supget.call(elem) || null; }, set: function(value){ var elem = this; var type = getType(elem); if(typeModels[type] && typeModels[type].dateToString && !typeModels[type].noAsDate){ if(value === null){ $.prop(elem, 'value', ''); return ''; } var set = typeModels[type].dateToString(value); if(set !== false){ $.prop(elem, 'value', set); return set; } else { webshims.error('INVALID_STATE_ERR: DOM Exception 11'); } } else { return valueAsDateDescriptor.prop._supset && valueAsDateDescriptor.prop._supset.apply(elem, arguments) || null; } } } }); $.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){ var stepDescriptor = webshims.defineNodeNameProperty('input', name, { prop: { value: function(factor){ var step, val, dateVal, valModStep, alignValue, cache, base, attrVal; var type = getType(this); if(typeModels[type] && typeModels[type].asNumber){ cache = {type: type}; if(!factor){ factor = 1; webshims.warn("you should always use a factor for stepUp/stepDown"); } factor *= stepFactor; val = $.prop(this, 'valueAsNumber'); if(isNaN(val)){ webshims.info("valueAsNumber is NaN can't apply stepUp/stepDown "); throw('invalid state error'); } step = webshims.getStep(this, type); if(step == 'any'){ webshims.info("step is 'any' can't apply stepUp/stepDown"); throw('invalid state error'); } webshims.addMinMaxNumberToCache('min', $(this), cache); webshims.addMinMaxNumberToCache('max', $(this), cache); base = cache.minAsNumber; if(isNaN(base) && (attrVal = $.prop(this, 'defaultValue'))){ base = typeModels[type].asNumber( attrVal ); } if(!base){ base = 0; } step *= factor; val = (val + step).toFixed(5) * 1; valModStep = (val - base) % step; if ( valModStep && (Math.abs(valModStep) > EPS) ) { alignValue = val - valModStep; alignValue += ( valModStep > 0 ) ? step : ( -step ); val = alignValue.toFixed(5) * 1; } if( (!isNaN(cache.maxAsNumber) && val > cache.maxAsNumber) || (!isNaN(cache.minAsNumber) && val < cache.minAsNumber) ){ webshims.info("max/min overflow can't apply stepUp/stepDown"); throw('invalid state error'); } $.prop(this, 'valueAsNumber', val); } else if(stepDescriptor.prop && stepDescriptor.prop._supvalue){ return stepDescriptor.prop._supvalue.apply(this, arguments); } else { webshims.info("no step method for type: "+ type); throw('invalid state error'); } } } }); }); /* * ToDO: WEEK */ // var getWeek = function(date){ // var time; // var checkDate = new Date(date.getTime()); // // checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // // time = checkDate.getTime(); // checkDate.setMonth(0); // checkDate.setDate(1); // return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; // }; // // var setWeek = function(year, week){ // var date = new Date(year, 0, 1); // // week = (week - 1) * 86400000 * 7; // date = new Date(date.getTime() + week); // date.setDate(date.getDate() + 1 - (date.getDay() || 7)); // return date; // }; var typeProtos = { number: { bad: function(val){ return !(isNumber(val)); }, step: 1, //stepBase: 0, 0 = default stepScaleFactor: 1, asNumber: function(str){ return (isNumber(str)) ? str * 1 : nan; }, numberToString: function(num){ return (isNumber(num)) ? num : false; } }, range: { minDefault: 0, maxDefault: 100 }, color: { bad: (function(){ var cReg = /^\u0023[a-f0-9]{6}$/; return function(val){ return (!val || val.length != 7 || !(cReg.test(val))); }; })() }, date: { bad: function(val){ if(!val || !val.split || !(/\d$/.test(val))){return true;} var i; var valA = val.split(/\u002D/); if(valA.length !== 3){return true;} var ret = false; if(valA[0].length < 4 || valA[1].length != 2 || valA[1] > 12 || valA[2].length != 2 || valA[2] > 33){ ret = true; } else { for(i = 0; i < 3; i++){ if(!isDateTimePart(valA[i])){ ret = true; break; } } } return ret || (val !== this.dateToString( this.asDate(val, true) ) ); }, step: 1, //stepBase: 0, 0 = default stepScaleFactor: 86400000, asDate: function(val, _noMismatch){ if(!_noMismatch && this.bad(val)){ return null; } return new Date(this.asNumber(val, true)); }, asNumber: function(str, _noMismatch){ var ret = nan; if(_noMismatch || !this.bad(str)){ str = str.split(/\u002D/); ret = Date.UTC(str[0], str[1] - 1, str[2]); } return ret; }, numberToString: function(num){ return (isNumber(num)) ? this.dateToString(new Date( num * 1)) : false; }, dateToString: function(date){ return (date && date.getFullYear) ? addleadingZero(date.getUTCFullYear(), 4) +'-'+ addleadingZero(date.getUTCMonth()+1, 2) +'-'+ addleadingZero(date.getUTCDate(), 2) : false; } }, /* * ToDO: WEEK */ // week: { // bad: function(val){ // if(!val || !val.split){return true;} // var valA = val.split('-W'); // var ret = true; // if(valA.length == 2 && valA[0].length > 3 && valA.length == 2){ // ret = this.dateToString(setWeek(valA[0], valA[1])) != val; // } // return ret; // }, // step: 1, // stepScaleFactor: 604800000, // stepBase: -259200000, // asDate: function(str, _noMismatch){ // var ret = null; // if(_noMismatch || !this.bad(str)){ // ret = str.split('-W'); // ret = setWeek(ret[0], ret[1]); // } // return ret; // }, // asNumber: function(str, _noMismatch){ // var ret = nan; // var date = this.asDate(str, _noMismatch); // if(date && date.getUTCFullYear){ // ret = date.getTime(); // } // return ret; // }, // dateToString: function(date){ // var week, checkDate; // var ret = false; // if(date && date.getFullYear){ // week = getWeek(date); // if(week == 1){ // checkDate = new Date(date.getTime()); // checkDate.setDate(checkDate.getDate() + 7); // date.setUTCFullYear(checkDate.getUTCFullYear()); // } // ret = addleadingZero(date.getUTCFullYear(), 4) +'-W'+addleadingZero(week, 2); // } // return ret; // }, // numberToString: function(num){ // return (isNumber(num)) ? this.dateToString(new Date( num * 1)) : false; // } // }, time: { bad: function(val, _getParsed){ if(!val || !val.split || !(/\d$/.test(val))){return true;} val = val.split(/\u003A/); if(val.length < 2 || val.length > 3){return true;} var ret = false, sFraction; if(val[2]){ val[2] = val[2].split(/\u002E/); sFraction = parseInt(val[2][1], 10); val[2] = val[2][0]; } $.each(val, function(i, part){ if(!isDateTimePart(part) || part.length !== 2){ ret = true; return false; } }); if(ret){return true;} if(val[0] > 23 || val[0] < 0 || val[1] > 59 || val[1] < 0){ return true; } if(val[2] && (val[2] > 59 || val[2] < 0 )){ return true; } if(sFraction && isNaN(sFraction)){ return true; } if(sFraction){ if(sFraction < 100){ sFraction *= 100; } else if(sFraction < 10){ sFraction *= 10; } } return (_getParsed === true) ? [val, sFraction] : false; }, step: 60, stepBase: 0, stepScaleFactor: 1000, asDate: function(val){ val = new Date(this.asNumber(val)); return (isNaN(val)) ? null : val; }, asNumber: function(val){ var ret = nan; val = this.bad(val, true); if(val !== true){ ret = Date.UTC('1970', 0, 1, val[0][0], val[0][1], val[0][2] || 0); if(val[1]){ ret += val[1]; } } return ret; }, dateToString: function(date){ if(date && date.getUTCHours){ var str = addleadingZero(date.getUTCHours(), 2) +':'+ addleadingZero(date.getUTCMinutes(), 2), tmp = date.getSeconds() ; if(tmp != "0"){ str += ':'+ addleadingZero(tmp, 2); } tmp = date.getUTCMilliseconds(); if(tmp != "0"){ str += '.'+ addleadingZero(tmp, 3); } return str; } else { return false; } } }, month: { bad: function(val){ return typeProtos.date.bad(val+'-01'); }, step: 1, stepScaleFactor: false, //stepBase: 0, 0 = default asDate: function(val){ return new Date(typeProtos.date.asNumber(val+'-01')); }, asNumber: function(val){ //1970-01 var ret = nan; if(val && !this.bad(val)){ val = val.split(/\u002D/); val[0] = (val[0] * 1) - 1970; val[1] = (val[1] * 1) - 1; ret = (val[0] * 12) + val[1]; } return ret; }, numberToString: function(num){ var mod; var ret = false; if(isNumber(num)){ mod = (num % 12); num = ((num - mod) / 12) + 1970; mod += 1; if(mod < 1){ num -= 1; mod += 12; } ret = addleadingZero(num, 4)+'-'+addleadingZero(mod, 2); } return ret; }, dateToString: function(date){ if(date && date.getUTCHours){ var str = typeProtos.date.dateToString(date); return (str.split && (str = str.split(/\u002D/))) ? str[0]+'-'+str[1] : false; } else { return false; } } } ,'datetime-local': { bad: function(val, _getParsed){ if(!val || !val.split || (val+'special').split(/\u0054/).length !== 2){return true;} val = val.split(/\u0054/); return ( typeProtos.date.bad(val[0]) || typeProtos.time.bad(val[1], _getParsed) ); }, noAsDate: true, asDate: function(val){ val = new Date(this.asNumber(val)); return (isNaN(val)) ? null : val; }, asNumber: function(val){ var ret = nan; var time = this.bad(val, true); if(time !== true){ val = val.split(/\u0054/)[0].split(/\u002D/); ret = Date.UTC(val[0], val[1] - 1, val[2], time[0][0], time[0][1], time[0][2] || 0); if(time[1]){ ret += time[1]; } } return ret; }, dateToString: function(date, _getParsed){ return typeProtos.date.dateToString(date) +'T'+ typeProtos.time.dateToString(date, _getParsed); } } }; if(typeBugs || !supportsType('range') || !supportsType('time') || !supportsType('month') || !supportsType('datetime-local')){ typeProtos.range = $.extend({}, typeProtos.number, typeProtos.range); typeProtos.time = $.extend({}, typeProtos.date, typeProtos.time); typeProtos.month = $.extend({}, typeProtos.date, typeProtos.month); typeProtos['datetime-local'] = $.extend({}, typeProtos.date, typeProtos.time, typeProtos['datetime-local']); } // ['number', 'month', 'range', 'date', 'time', 'color', 'datetime-local'].forEach(function(type){ if(typeBugs || !supportsType(type)){ webshims.addInputType(type, typeProtos[type]); } }); if($('<input />').prop('labels') == null){ webshims.defineNodeNamesProperty('button, input, keygen, meter, output, progress, select, textarea', 'labels', { prop: { get: function(){ if(this.type == 'hidden'){return null;} var id = this.id; var labels = $(this) .closest('label') .filter(function(){ var hFor = (this.attributes['for'] || {}); return (!hFor.specified || hFor.value == id); }) ; if(id) { labels = labels.add('label[for="'+ id +'"]'); } return labels.get(); }, writeable: false } }); } });;(function($){ var id = 0; var isNumber = function(string){ return (typeof string == 'number' || (string && string == string * 1)); }; var retDefault = function(val, def){ if(!(typeof val == 'number' || (val && val == val * 1))){ return def; } return val * 1; }; var createOpts = ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex']; var rangeProto = { _create: function(){ var i; this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>'); this.trail = $('.ws-range-track', this.element); this.range = $('.ws-range-progress', this.element); this.thumb = $('.ws-range-thumb', this.trail); this.updateMetrics(); this.orig = this.options.orig; for(i = 0; i < createOpts.length; i++){ this[createOpts[i]](this.options[createOpts[i]]); } this.value = this._value; this.value(this.options.value); this.initDataList(); this.element.data('rangeUi', this); this.addBindings(); this._init = true; }, value: $.noop, _value: function(val, _noNormalize, animate){ var left, posDif; var o = this.options; var oVal = val; var thumbStyle = {}; var rangeStyle = {}; if(!_noNormalize && parseFloat(val, 10) != val){ val = o.min + ((o.max - o.min) / 2); } if(!_noNormalize){ val = this.normalizeVal(val); } left = 100 * ((val - o.min) / (o.max - o.min)); if(this._init && val == o.value && oVal == val){return;} o.value = val; if($.fn.stop){ this.thumb.stop(); this.range.stop(); } rangeStyle[this.dirs.width] = left+'%'; if(this.vertical){ left = Math.abs(left - 100); } thumbStyle[this.dirs.left] = left+'%'; if(!animate || !$.fn.animate){ this.thumb.css(thumbStyle); this.range.css(rangeStyle); } else { if(typeof animate != 'object'){ animate = {}; } else { animate = $.extend({}, animate); } if(!animate.duration){ posDif = Math.abs(left - parseInt(this.thumb[0].style[this.dirs.left] || 50, 10)); animate.duration = Math.max(Math.min(999, posDif * 5), 99); } this.thumb.animate(thumbStyle, animate); this.range.animate(rangeStyle, animate); } if(this.orig && (oVal != val || (!this._init && this.orig.value != val)) ){ this.options._change(val); } this._setValueMarkup(); }, _setValueMarkup: function(){ var o = this.options; var textValue = o.textValue ? o.textValue(this.options.value) : o.options[o.value] || o.value; this.element.attr({ 'aria-valuenow': this.options.value, 'aria-valuetext': textValue }); $('span[data-value]', this.thumb).attr({ 'data-value': this.options.value, 'data-valuetext': textValue }); if(o.selectedOption){ $(o.selectedOption).removeClass('ws-selected-option'); o.selectedOption = null; } if(o.value in o.options){ o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks').addClass('ws-selected-option'); } }, initDataList: function(){ if(this.orig){ var listTimer; var that = this; var updateList = function(){ $(that.orig) .jProp('list') .off('updateDatalist', updateList) .on('updateDatalist', updateList) ; clearTimeout(listTimer); listTimer = setTimeout(function(){ if(that.list){ that.list(); } }, 9); }; $(this.orig).on('listdatalistchange', updateList); this.list(); } }, list: function(opts){ var o = this.options; var min = o.min; var max = o.max; var trail = this.trail; var that = this; this.element.attr({'aria-valuetext': o.options[o.value] || o.value}); $('.ws-range-ticks', trail).remove(); $(this.orig).jProp('list').find('option:not([disabled])').each(function(){ o.options[$.prop(this, 'value')] = $.prop(this, 'label') || ''; }); $.each(o.options, function(val, label){ if(!isNumber(val) || val < min || val > max){return;} var left = 100 * ((val - min) / (max - min)); var attr = 'data-value="'+val+'"'; if(label){ attr += ' data-label="'+label+'"'; if(o.showLabels){ attr += ' title="'+label+'"'; } } if(that.vertical){ left = Math.abs(left - 100); } that.posCenter( $('<span class="ws-range-ticks"'+ attr +' style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail) ); }); if(o.value in o.options){ this._setValueMarkup(); } }, readonly: function(val){ val = !!val; this.options.readonly = val; this.element.attr('aria-readonly', ''+val); if(this._init){ this.updateMetrics(); } }, disabled: function(val){ val = !!val; this.options.disabled = val; if(val){ this.element.attr({tabindex: -1, 'aria-disabled': 'true'}); } else { this.element.attr({tabindex: this.options.tabindex, 'aria-disabled': 'false'}); } if(this._init){ this.updateMetrics(); } }, tabindex: function(val){ this.options.tabindex = val; if(!this.options.disabled){ this.element.attr({tabindex: val}); } }, title: function(val){ this.element.prop('title', val); }, min: function(val){ this.options.min = retDefault(val, 0); this.value(this.options.value, true); }, max: function(val){ this.options.max = retDefault(val, 100); this.value(this.options.value, true); }, step: function(val){ var o = this.options; var step = val == 'any' ? 'any' : retDefault(val, 1); if(o.stepping){ webshims.error('stepping was removed. Use stepfactor instead.'); } if(o.stepfactor && step != 'any'){ step *= o.stepfactor; } o.step = step; this.value(this.options.value); }, normalizeVal: function(val){ var valModStep, alignValue, step; var o = this.options; if(val <= o.min){ val = o.min; } else if(val >= o.max) { val = o.max; } else if(o.step != 'any'){ step = o.step; valModStep = (val - o.min) % step; alignValue = val - valModStep; if ( Math.abs(valModStep) * 2 >= step ) { alignValue += ( valModStep > 0 ) ? step : ( -step ); } val = alignValue.toFixed(5) * 1; } return val; }, doStep: function(factor, animate){ var step = retDefault(this.options.step, 1); if(this.options.step == 'any'){ step = Math.min(step, (this.options.max - this.options.min) / 10); } this.value( this.options.value + (step * factor), false, animate ); }, getStepedValueFromPos: function(pos){ var val, valModStep, alignValue, step; if(pos <= 0){ val = this.options[this.dirs[this.isRtl ? 'max' : 'min']]; } else if(pos > 100) { val = this.options[this.dirs[this.isRtl ? 'min' : 'max']]; } else { if(this.vertical || this.isRtl){ pos = Math.abs(pos - 100); } val = ((this.options.max - this.options.min) * (pos / 100)) + this.options.min; step = this.options.step; if(step != 'any'){ valModStep = (val - this.options.min) % step; alignValue = val - valModStep; if ( Math.abs(valModStep) * 2 >= step ) { alignValue += ( valModStep > 0 ) ? step : ( -step ); } val = ((alignValue).toFixed(5)) * 1; } } return val; }, addRemoveClass: function(cName, add){ var isIn = this.element.prop('className').indexOf(cName) != -1; var action; if(!add && isIn){ action = 'removeClass'; this.element.removeClass(cName); this.updateMetrics(); } else if(add && !isIn){ action = 'addClass'; } if(action){ this.element[action](cName); if(this._init){ this.updateMetrics(); } } }, addBindings: function(){ var leftOffset, widgetUnits, hasFocus, isActive; var that = this; var o = this.options; var eventTimer = (function(){ var events = {}; return { init: function(name, curVal, fn){ if(!events[name]){ events[name] = {fn: fn}; if(that.orig){ $(that.orig).on(name, function(){ events[name].val = $.prop(that.orig, 'value'); }); } } events[name].val = curVal; }, call: function(name, val){ if(events[name].val != val){ clearTimeout(events[name].timer); events[name].val = val; events[name].timer = setTimeout(function(){ events[name].fn(val, that); }, 0); } } }; })(); var normalizeTouch = (function(){ var types = { touchstart: 1, touchend: 1, touchmove: 1 }; var normalize = ['pageX', 'pageY']; return function(e){ if(types[e.type] && e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length){ for(var i = 0; i < normalize.length; i++){ e[normalize[i]] = e.originalEvent.touches[0][normalize[i]]; } } return e; }; })(); var updateValue = function(val, animate){ if(val != o.value){ that.value(val, false, animate); eventTimer.call('input', val); } }; var setValueFromPos = function(e, animate){ if(e.type == 'touchmove'){ e.preventDefault(); normalizeTouch(e); } updateValue(that.getStepedValueFromPos((e[that.dirs.mouse] - leftOffset) * widgetUnits), animate); if(e && e.type == 'mousemove'){ e.preventDefault(); } }; var remove = function(e){ if(e && e.type == 'mouseup'){ eventTimer.call('input', o.value); eventTimer.call('change', o.value); } that.addRemoveClass('ws-active'); $(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove); $(window).off('blur', removeWin); isActive = false; }; var removeWin = function(e){ if(e.target == window){remove();} }; var add = function(e){ var outerWidth; if(isActive || (e.type == 'touchstart' && (!e.originalEvent || !e.originalEvent.touches || e.originalEvent.touches.length != 1))){ return; } e.preventDefault(); $(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove); $(window).off('blur', removeWin); if(!o.readonly && !o.disabled){ normalizeTouch(e); that.element.trigger('focus'); that.addRemoveClass('ws-active', true); leftOffset = that.element.offset(); widgetUnits = that.element[that.dirs.innerWidth](); if(!widgetUnits || !leftOffset){return;} outerWidth = that.thumb[that.dirs.outerWidth](); leftOffset = leftOffset[that.dirs.pos]; widgetUnits = 100 / widgetUnits; if(e.target.className == 'ws-range-ticks'){ updateValue(e.target.getAttribute('data-value'), o.animate); } else { setValueFromPos(e, o.animate); } isActive = true; $(document) .on(e.type == 'touchstart' ? { touchend: remove, touchmove: setValueFromPos } : { mouseup: remove, mousemove: setValueFromPos } ) ; $(window).on('blur', removeWin); e.stopPropagation(); } }; var elementEvts = { 'touchstart mousedown': add, focus: function(e){ if(!o.disabled && !hasFocus){ eventTimer.init('input', o.value); eventTimer.init('change', o.value); that.addRemoveClass('ws-focus', true); that.updateMetrics(); } hasFocus = true; }, blur: function(e){ that.element.removeClass('ws-focus ws-active'); that.updateMetrics(); hasFocus = false; eventTimer.init('input', o.value); eventTimer.call('change', o.value); }, keyup: function(){ that.addRemoveClass('ws-active'); eventTimer.call('input', o.value); eventTimer.call('change', o.value); }, keydown: function(e){ var step = true; var code = e.keyCode; if(!o.readonly && !o.disabled){ if(that.isRtl){ if(code == 39){ code = 37; } else if(code == 37){ code = 39; } } if (code == 39 || code == 38) { that.doStep(1); } else if (code == 37 || code == 40) { that.doStep(-1); } else if (code == 33) { that.doStep(10, o.animate); } else if (code == 34) { that.doStep(-10, o.animate); } else if (code == 36) { that.value(that.options.max, false, o.animate); } else if (code == 35) { that.value(that.options.min, false, o.animate); } else { step = false; } if (step) { that.addRemoveClass('ws-active', true); eventTimer.call('input', o.value); e.preventDefault(); } } } }; eventTimer.init('input', o.value, this.options.input); eventTimer.init('change', o.value, this.options.change); elementEvts[$.fn.mwheelIntent ? 'mwheelIntent' : 'mousewheel'] = function(e, delta){ if(delta && hasFocus && !o.readonly && !o.disabled){ that.doStep(delta); e.preventDefault(); eventTimer.call('input', o.value); } }; this.element.on(elementEvts); this.thumb.on({ mousedown: add }); if(this.orig){ $(this.orig).jProp('form').on('reset', function(){ var val = $.prop(that.orig, 'value'); that.value(val); setTimeout(function(){ var val2 = $.prop(that.orig, 'value'); if(val != val2){ that.value(val2); } }, 4); }); } if (window.webshims) { webshims.ready('WINDOWLOAD', function(){ webshims.ready('dom-support', function(){ if ($.fn.onWSOff) { that.element.onWSOff('updateshadowdom', function(){ that.updateMetrics(); }); } }); if (!$.fn.onWSOff && webshims._polyfill) { webshims._polyfill(['dom-support']); } }); } }, posCenter: function(elem, outerWidth){ var temp; if(this.options.calcCenter && (!this._init || this.element[0].offsetWidth)){ if(!elem){ elem = this.thumb; } if(!outerWidth){ outerWidth = elem[this.dirs.outerWidth](); } outerWidth = outerWidth / -2; elem.css(this.dirs.marginLeft, outerWidth); if(this.options.calcTrail && elem[0] == this.thumb[0]){ temp = this.element[this.dirs.innerHeight](); elem.css(this.dirs.marginTop, (elem[this.dirs.outerHeight]() - temp) / -2); this.range.css(this.dirs.marginTop, (this.range[this.dirs.outerHeight]() - temp) / -2 ); outerWidth *= -1; this.trail .css(this.dirs.left, outerWidth) .css(this.dirs.right, outerWidth) ; } } }, updateMetrics: function(){ var width = this.element.innerWidth(); this.vertical = (width && this.element.innerHeight() - width > 10); this.dirs = this.vertical ? {mouse: 'pageY', pos: 'top', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} : {mouse: 'pageX', pos: 'left', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'} ; if(!this.vertical && this.element.css('direction') == 'rtl'){ this.isRtl = true; this.dirs.left = 'right'; this.dirs.right = 'left'; this.dirs.marginLeft = 'marginRight'; } this.element [this.vertical ? 'addClass' : 'removeClass']('vertical-range') [this.isRtl ? 'addClass' : 'removeClass']('ws-is-rtl') ; this.updateMetrics = this.posCenter; this.posCenter(); } }; var oCreate = function (o) { function F() {} F.prototype = o; return new F(); }; $.fn.rangeUI = function(opts){ opts = $.extend({ readonly: false, disabled: false, tabindex: 0, min: 0, step: 1, max: 100, value: 50, input: $.noop, change: $.noop, _change: $.noop, showLabels: true, options: {}, calcCenter: true, calcTrail: true }, opts); return this.each(function(){ var obj = $.extend(oCreate(rangeProto), {element: $(this)}); obj.options = opts; obj._create.call(obj); }); }; if(window.webshims && webshims.isReady){ webshims.isReady('range-ui', true); } })(window.webshims ? webshims.$ : jQuery); ;webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){ "use strict"; var curCfg; var formcfg = webshims.formcfg; var hasFormValidation = Modernizr.formvalidation && !webshims.bugs.bustedValidity; var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']; var stopPropagation = function(e){ e.stopImmediatePropagation(); }; var getMonthOptions = function(opts){ var selectName = 'monthSelect'+opts.monthNames; if(!curCfg[selectName]){ var labels = curCfg.date[opts.monthNames] || monthDigits; curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){ return '<option value="'+val+'"]>'+labels[i]+'</option>'; }).join(''); } return curCfg[selectName]; }; var daySelect = '<select class="dd"><option value=""></option>'+ (function(){ var i = 1; var opts = []; while(i < 32){ opts.push('<option>'+ ((i < 10) ? '0'+ i : i) +'</option>' ); i++; } return opts.join(''); })() +'</select>'; var createFormat = function(name){ if(!curCfg.patterns[name+'Obj']){ var obj = {}; $.each(curCfg.patterns[name].split(curCfg[name+'Format']), function(i, name){ obj[name] = i; }); curCfg.patterns[name+'Obj'] = obj; } }; var createYearSelect = function(obj, opts){ var options, nowY, max, min; if(opts.yearSelect){ nowY = parseInt(opts.value.split('-')[0], 10); max = opts.max.split('-'); min = opts.min.split('-'); options = webshims.picker.createYearSelect(nowY || parseInt(min[0], 10) || parseInt(max[0], 10) || nowYear, max, min); options.unshift('<option />'); $(obj.elements) .filter('select.yy') .html(options.join('')) .each(function(){ if(!nowY){ $('option[selected]', this).removeAttr('selected'); $(this).val(); } }) ; } }; var splitInputs = { date: { _create: function(opts){ var obj = { splits: [] }; if(opts.yearSelect){ obj.splits.push($('<select class="yy"></select>')[0]); } else { obj.splits.push($('<input type="text" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]); } if(opts.monthSelect){ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]); } else { obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]); } if(opts.daySelect){ obj.splits.push($(daySelect)[0]); } else { obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]); } obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]]; createYearSelect(obj, opts); return obj; }, sort: function(element){ createFormat('d'); var i = 0; var seperators = $('.ws-input-seperator', element).html(curCfg.dFormat); var inputs = $('input, select', element); $.each(curCfg.patterns.dObj, function(name, value){ var input = inputs.filter('.'+ name); if(input[0]){ input.appendTo(element); if(i < seperators.length){ seperators.eq(i).insertAfter(input); } i++; } }); } }, month: { _create: function(opts){ var obj = { splits: [] }; if(opts.yearSelect){ obj.splits.push($('<select class="yy"></select>')[0]); } else { obj.splits.push($('<input type="text" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]); } if(opts.monthSelect){ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]); } else { obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]); if(opts.onlyMonthDigits){ $(obj.splits[1]).attr({inputmode: 'numeric', size: 2, maxlength: 2}); } } obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1]]; createYearSelect(obj, opts); return obj; }, sort: function(element){ var seperator = $('.ws-input-seperator', element).html(curCfg.dFormat); var mm = $('input.mm, select.mm', element); var action; if(curCfg.date.showMonthAfterYear){ mm.appendTo(element); action = 'insertBefore'; } else { mm.prependTo(element); action = 'insertAfter'; } seperator[action](mm); } } }; var nowDate = new Date(new Date().getTime() - (new Date().getTimezoneOffset() * 60 * 1000 )); var nowYear = nowDate.getFullYear(); nowDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), nowDate.getHours()).getTime(); var steps = { number: { step: 1 }, // week: { // step: 1, // start: new Date(nowDate) // }, 'datetime-local': { step: 60, start: new Date(nowDate).getTime() }, time: { step: 60 }, month: { step: 1, start: new Date(nowDate) }, date: { step: 1, start: new Date(nowDate) } }; var labelWidth = (function(){ var getId = function(){ return webshims.getID(this); }; return function(element, labels, noFocus){ $(element).attr({'aria-labelledby': labels.map(getId).get().join(' ')}); if(!noFocus){ labels.on('click', function(e){ element.getShadowFocusElement().focus(); e.preventDefault(); return false; }); } }; })(); var addZero = function(val){ if(!val){return "";} val = val+''; return val.length == 1 ? '0'+val : val; }; var loadPicker = function(type, name){ type = (type == 'color' ? 'color' : 'forms')+'-picker'; if(!loadPicker[name+'Loaded'+type]){ loadPicker[name+'Loaded'+type] = true; webshims.ready(name, function(){ webshims.loader.loadList([type]); }); } return type; }; options.addZero = addZero; webshims.loader.addModule('forms-picker', { noAutoCallback: true, options: options }); webshims.loader.addModule('color-picker', { noAutoCallback: true, css: 'jpicker/jpicker.css', options: options, d: ['forms-picker'] }); options.steps = steps; (function(){ formcfg.de = $.extend(true, { numberFormat: { ",": ".", ".": "," }, timeSigns: ":. ", numberSigns: ',', dateSigns: '.', dFormat: ".", patterns: { d: "dd.mm.yy" }, month: { currentText: 'Aktueller Monat' }, time: { currentText: 'Jetzt' }, date: { close: 'schließen', clear: 'Löschen', prevText: 'Zurück', nextText: 'Vor', currentText: 'Heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], weekHeader: 'KW', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '' } }, formcfg.de || {}); formcfg.en = $.extend(true, { numberFormat: { ".": ".", ",": "," }, numberSigns: '.', dateSigns: '/', timeSigns: ":. ", dFormat: "/", patterns: { d: "mm/dd/yy" }, meridian: ['AM', 'PM'], month: { currentText: 'This month' }, time: { "currentText": "Now" }, date: { "closeText": "Done", clear: 'Clear', "prevText": "Prev", "nextText": "Next", "currentText": "Today", "monthNames": ["January","February","March","April","May","June","July","August","September","October","November","December"], "monthNamesShort": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], "dayNames": ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], "dayNamesShort": ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], "dayNamesMin": ["Su","Mo","Tu","We","Th","Fr","Sa"], "weekHeader": "Wk", "firstDay": 0, "isRTL": false, "showMonthAfterYear": false, "yearSuffix": "" } }, formcfg.en || {}); if(!formcfg['en-US']){ formcfg['en-US'] = $.extend(true, {}, formcfg['en']); } if(!formcfg['en-GB']){ formcfg['en-GB'] = $.extend(true, {}, formcfg.en, { date: {firstDay: 1}, patterns: {d: "dd/mm/yy"} }); } if(!formcfg['en-AU']){ formcfg['en-AU'] = $.extend(true, {}, formcfg['en-GB']); } if(!formcfg['']){ formcfg[''] = formcfg['en-US']; } curCfg = formcfg['']; var processLangCFG = function(langCfg){ if(!langCfg.date.monthkeys){ var create = function(i, name){ var strNum; var num = i + 1; strNum = (num < 10) ? '0'+num : ''+num; langCfg.date.monthkeys[num] = strNum; langCfg.date.monthkeys[name] = strNum; langCfg.date.monthkeys[name.toLowerCase()] = strNum; }; langCfg.date.monthkeys = {}; langCfg.date.monthDigits = monthDigits; langCfg.numberSigns += '-'; if(langCfg.meridian){ langCfg.timeSigns += langCfg.meridian[0] + langCfg.meridian[1] + langCfg.meridian[0].toLowerCase() + langCfg.meridian[1].toLowerCase(); } $.each(langCfg.date.monthNames, create); $.each(langCfg.date.monthNamesShort, create); } if(!langCfg.colorSigns){ langCfg.colorSigns = '#abcdefABCDEF'; } if(!langCfg['datetime-localSigns']){ langCfg['datetime-localSigns'] = langCfg.dateSigns+langCfg.timeSigns; } if(!langCfg['datetime-local']){ langCfg['datetime-local'] = {}; } if(!langCfg.time){ langCfg.time = {}; } if(!langCfg['datetime-local'].currentText && langCfg.time.currentText){ langCfg['datetime-local'].currentText = langCfg.time.currentText; } }; var triggerLocaleChange = function(){ processLangCFG(curCfg); $(document).triggerHandler('wslocalechange'); }; curCfg = webshims.activeLang(formcfg); triggerLocaleChange(); $(formcfg).on('change', function(){ curCfg = formcfg.__active; triggerLocaleChange(); }); })(); (function(){ var retDefault = function(val, def){ if(!(typeof val == 'number' || (val && val == val * 1))){ return def; } return val * 1; }; var formatVal = { number: function(val, o){ return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']); }, time: function(val){ var fVal; if(val && curCfg.meridian){ val = val.split(':'); fVal = (val[0] * 1); if(fVal && fVal >= 12){ val[0] = addZero(fVal - 12+''); fVal = 1; } else { fVal = 0; } if(val[0] === '00'){ val[0] = '12'; } val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal]; } return val; }, 'datetime-local': function(val, o){ var fVal = $.trim(val || '').split('T'); if(fVal.length == 2){ val = this.date(fVal[0], o) +' '+this.time(fVal[1], o); } return val; }, // week: function(val){ // return val; // }, //todo empty val for month/split month: function(val, options){ var names; var p = val.split('-'); if(p[0] && p[1]){ names = curCfg.date[options.monthNames] || curCfg.date.monthNames; p[1] = names[(p[1] * 1) - 1]; if(options && options.splitInput){ val = [p[0] || '', p[1] || '']; } else if(p[1]){ val = curCfg.date.showMonthAfterYear ? p.join(' ') : p[1]+' '+p[0]; } } else if(options && options.splitInput){ val = [p[0] || '', p[1] || '']; } return val; }, date: function(val, opts){ var p = (val+'').split('-'); if(p[2] && p[1] && p[0]){ if(opts && opts.splitInput){ val = p; } else { val = curCfg.patterns.d.replace('yy', p[0] || ''); val = val.replace('mm', p[1] || ''); val = val.replace('dd', p[2] || ''); } } else if(opts && opts.splitInput){ val = [p[0] || '', p[1] || '', p[2] || '']; } return val; }, color: function(val, opts){ var ret = '#000000'; if(val){ val = val.toLowerCase(); if(val.length == 7 && createHelper('color').isValid(val)) { ret = val; } } return ret; } }; var parseVal = { number: function(val){ return (val+'').replace(curCfg.numberFormat[','], '').replace(curCfg.numberFormat['.'], '.'); }, // week: function(val){ // return val; // }, 'datetime-local': function(val, o){ var tmp; var fVal = $.trim(val || '').split(/\s+/); if(fVal.length == 2){ if(fVal[0].indexOf(':') != -1 && fVal[1].indexOf(':') == -1){ tmp = fVal[1]; fVal[1] = fVal[0]; fVal[0] = tmp; } val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o); } else if (fVal.length == 3) { val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o); } return val; }, time: function(val){ var fVal; if(val && curCfg.meridian){ val = val.toUpperCase(); if(val.substr(0,2) === "12"){ val = "00" + val.substr(2); } if(val.indexOf(curCfg.meridian[1]) != -1){ val = val.split(':'); fVal = (val[0] * 1); if(!isNaN(fVal)){ val[0] = fVal + 12; } val = val.join(':'); } val = $.trim(val.replace(curCfg.meridian[0], '').replace(curCfg.meridian[1], '')); } return val; }, month: function(val, opts, noCorrect){ var p = (!opts.splitInput) ? val.trim().split(/[\.\s-\/\\]+/) : val; if(p.length == 2 && p[0] && p[1]){ p[0] = !noCorrect && curCfg.date.monthkeys[p[0]] || p[0]; p[1] = !noCorrect && curCfg.date.monthkeys[p[1]] || p[1]; if(p[1].length == 2 && p[0].length > 3){ val = p[0]+'-'+p[1]; } else if(p[0].length == 2 && p[1].length > 3){ val = p[1]+'-'+p[0]; } else { val = ''; } } else if(opts.splitInput) { val = ''; } return val; }, date: function(val, opts, noCorrect){ createFormat('d'); var tmp, obj; var ret = ''; if(opts.splitInput){ obj = {yy: 0, mm: 1, dd: 2}; } else { obj = curCfg.patterns.dObj; val = val.split(curCfg.dFormat); } if(val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))){ if(val[obj.mm] > 12 && val[obj.dd] < 13){ tmp = val[obj.dd]; val[obj.dd] = val[obj.mm]; val[obj.mm] = tmp; } if(val[obj.yy].length < 4){ tmp = ((new Date()).getFullYear() +'').substr(0, 4 - val[obj.yy].length); if(val[obj.yy] > 50){ tmp--; } val[obj.yy] = tmp + val[obj.yy]; } ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-'); } return ret ; }, color: function(val, opts){ var ret = '#000000'; if(val){ val = val.toLowerCase(); if (val.indexOf('#') !== 0) { val = '#' + val; } if(val.length == 4){ val = '#' + val.charAt(1) + val.charAt(1) + val.charAt(2) + val.charAt(2) + val.charAt(3) + val.charAt(3); } if(val.length == 7 && createHelper('color').isValid(val)) { ret = val; } } return ret; } }; var placeholderFormat = { date: function(val, opts){ var hintValue = (val || '').split('-'); if(hintValue.length == 3){ hintValue = opts.splitInput ? hintValue : curCfg.patterns.d.replace('yy', hintValue[0]).replace('mm', hintValue[1]).replace('dd', hintValue[2]); } else { hintValue = opts.splitInput ? [val, val, val] : val; } return hintValue; }, month: function(val, opts){ var hintValue = (val || '').split('-'); if(hintValue.length == 2){ hintValue = opts.splitInput ? hintValue : curCfg.date.showMonthAfterYear ? hintValue[0] +' '+hintValue[1] : hintValue[1] +' '+ hintValue[0]; } else { hintValue = opts.splitInput ? [val, val] : val; } return hintValue; } }; var createHelper = (function(){ var types = {}; return function(type){ var input; if(!types[type]){ input = $('<input type="'+type+'" step="any" />'); types[type] = { asNumber: function(val){ var type = (typeof val == 'object') ? 'valueAsDate' : 'value'; return input.prop(type, val).prop('valueAsNumber'); }, asValue: function(val){ var type = (typeof val == 'object') ? 'valueAsDate' : 'valueAsNumber'; return input.prop(type, val).prop('value'); }, isValid: function(val, attrs){ if(attrs && (attrs.nodeName || attrs.jquery)){ attrs = { min: $(attrs).prop('min') || '', max: $(attrs).prop('max') || '', step: $(attrs).prop('step') || 'any' }; } attrs = $.extend({step: 'any', min: '', max: ''}, attrs || {}); return input.attr(attrs).prop('value', val).is(':valid') && input.prop('value') == val; } }; } return types[type]; }; })(); steps.range = steps.number; var wsWidgetProto = { _create: function(){ var i, that, timedMirror; var o = this.options; var createOpts = this.createOpts; this.type = o.type; this.orig = o.orig; this.buttonWrapper = $('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element); this.options.containerElements.push(this.buttonWrapper[0]); o.mirrorValidity = o.mirrorValidity && this.orig && hasFormValidation; if(o.splitInput && this._addSplitInputs){ if(o.monthSelect){ this.element.addClass('ws-month-select'); } this._addSplitInputs(); } else { this.inputElements = this.element; } if( steps[this.type] && typeof steps[this.type].start == 'object'){ steps[this.type].start = this.asNumber(steps[this.type].start); } if(!webshims.picker[this.type]){ o.buttonOnly = false; } for(i = 0; i < createOpts.length; i++){ if(o[createOpts[i]] != null){ this[createOpts[i]](o[createOpts[i]], o[createOpts[i]]); } } if(this.type == 'color'){ this.inputElements.prop('maxLength', 7); } this.addBindings(); $(this.element).data('wsWidget'+o.type, this); if(o.buttonOnly){ this.inputElements.prop({readOnly: true}); } this._init = true; if(o.mirrorValidity){ that = this; timedMirror = function(){ clearTimeout(timedMirror._timerDealy); timedMirror._timerDealy = setTimeout(timedMirror._wsexec, 9); }; timedMirror._wsexec = function(){ clearTimeout(timedMirror._timerDealy); that.mirrorValidity(true); }; timedMirror(); $(this.orig).on('change input', function(e){ if(e.type == 'input'){ timedMirror(); } else { timedMirror._wsexec(); } }); } }, mirrorValidity: function(_noTest){ // if(this._init && this.options.mirrorValidity){ if(!_noTest){ $.prop(this.orig, 'validity'); } var message = $(this.orig).getErrorMessage(); if(message !== this.lastErrorMessage){ this.inputElements.prop('setCustomValidity', function(i, val){ if(val._supvalue){ val._supvalue.call(this, message); } }); this.lastErrorMessage = message; } } }, addBindings: function(){ var that = this; var o = this.options; var run = function(){ that._addBindings(); }; if(this._addBindings){ run(); } else { webshims.ready('forms-picker', run); loadPicker(this.type, 'WINDOWLOAD'); } this.inputElements .add(this.buttonWrapper) .add(this.element) .one('mousedown focusin', function(e){ loadPicker(that.type, 'DOM'); }) .on({ 'change input focus focusin blur focusout': function(e){ var oVal, nVal; $(e.target).trigger('ws__'+e.type); if(o.toFixed && o.type == 'number' && e.type == 'change'){ oVal = that.element.prop('value'); nVal = that.toFixed(oVal, true); if(oVal != nVal){ that.element[0].value = nVal; } } } }) ; if(this.type != 'color'){ (function(){ var localeChange, select, selectVal; if(!o.splitInput){ localeChange = function(){ if(o.value){ that.value(o.value, true); } if(placeholderFormat[that.type] && o.placeholder){ that.placeholder(o.placeholder); } }; } else { localeChange = function(){ that.reorderInputs(); if(o.monthSelect){ select = that.inputElements.filter('select.mm'); selectVal = select.prop('value'); select.html(getMonthOptions(o)); select.prop('value', selectVal); } }; that.reorderInputs(); } $(that.orig).onWSOff('wslocalechange', localeChange); })(); } }, required: function(val, boolVal){ this.inputElements.attr({'aria-required': ''+boolVal}); this.mirrorValidity(); }, parseValue: function(noCorrect){ var value = this.inputElements.map(function(){ return $.prop(this, 'value'); }).get(); if(!this.options.splitInput){ value = value[0]; } return parseVal[this.type](value, this.options, noCorrect); }, formatValue: function(val, noSplit){ return formatVal[this.type](val, noSplit === false ? false : this.options); }, createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'], placeholder: function(val){ var options = this.options; options.placeholder = val; var placeholder = val; if(placeholderFormat[this.type]){ placeholder = placeholderFormat[this.type](val, this.options); } if(options.splitInput && typeof placeholder == 'object'){ $.each(this.splits, function(i, elem){ if($.nodeName(elem, 'select')){ $(elem).children('option:first-child').text(placeholder[i]); } else { $.prop(elem, 'placeholder', placeholder[i]); } }); } else { this.element.prop('placeholder', placeholder); } }, list: function(val){ if(this.type == 'number'){ this.element.attr('list', $.attr(this.orig, 'list')); } this.options.list = val; this._propertyChange('list'); }, _propertyChange: $.noop, tabindex: function(val){ this.options.tabindex = val; this.inputElements.prop('tabindex', this.options.tabindex); $('button', this.buttonWrapper).prop('tabindex', this.options.tabindex); }, title: function(val){ if(!val && this.orig && $.attr(this.orig, 'title') == null){ val = null; } this.options.title = val; if(val == null){ this.inputElements.removeAttr('title'); } else { this.inputElements.prop('title', this.options.title); } } }; ['defaultValue', 'value'].forEach(function(name){ wsWidgetProto[name] = function(val, force){ if(!this._init || force || val !== this.options[name]){ this.element.prop(name, this.formatValue(val)); this.options[name] = val; this._propertyChange(name); this.mirrorValidity(); } }; }); ['readonly', 'disabled'].forEach(function(name){ var isDisabled = name == 'disabled'; wsWidgetProto[name] = function(val, boolVal){ var options = this.options; if(options[name] != boolVal || !this._init){ options[name] = !!boolVal; if(!isDisabled && options.buttonOnly){ this.inputElements.attr({'aria-readonly': options[name]}); } else { this.inputElements.prop(name, options[name]); } this.buttonWrapper[options[name] ? 'addClass' : 'removeClass']('ws-'+name); if(isDisabled){ $('button', this.buttonWrapper).prop('disabled', options[name]); } } }; }); var spinBtnProto = $.extend({}, wsWidgetProto, { _create: function(){ var o = this.options; var helper = createHelper(o.type); this.elemHelper = $('<input type="'+ o.type+'" />'); this.asNumber = helper.asNumber; this.asValue = helper.asValue; this.isValid = helper.isValid; wsWidgetProto._create.apply(this, arguments); this._init = false; this.buttonWrapper.html('<span unselectable="on" class="step-controls"><span class="step-up"></span><span class="step-down"></span></span>'); if(this.type == 'number'){ this.inputElements.attr('inputmode', 'numeric'); } if((!o.max && typeof o.relMax == 'number') || (!o.min && typeof o.relMin == 'number')){ webshims.error('relMax/relMin are not supported anymore calculate at set it your own.'); } if(this.options.relDefaultValue){ webshims.warn('relDefaultValue was removed use startValue instead!'); } this._init = true; }, createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'], _addSplitInputs: function(){ if(!this.inputElements){ var create = splitInputs[this.type]._create(this.options); this.splits = create.splits; this.inputElements = $(create.elements).prependTo(this.element).filter('input, select'); } }, addZero: addZero, _setStartInRange: function(){ var start = this.options.startValue && this.asNumber( this.options.startValue ) || steps[this.type].start || 0; if(!isNaN(this.minAsNumber) && start < this.minAsNumber){ start = this.minAsNumber; } else if(!isNaN(this.maxAsNumber) && start > this.maxAsNumber){ start = this.maxAsNumber; } this.elemHelper.prop('valueAsNumber', start); this.options.defValue = this.elemHelper.prop('value'); }, reorderInputs: function(){ if(splitInputs[this.type]){ var element = this.element.attr('dir', curCfg.date.isRTL ? 'rtl' : 'ltr'); splitInputs[this.type].sort(element, this.options); setTimeout(function(){ var data = webshims.data(element); if(data && data.shadowData){ data.shadowData.shadowFocusElement = element.find('input, select')[0] || element[0]; } }, 9); } }, step: function(val){ var defStep = steps[this.type]; this.options.step = val; this.elemHelper.prop('step', retDefault(val, defStep.step)); this.mirrorValidity(); }, _beforeValue: function(val){ this.valueAsNumber = this.asNumber(val); this.options.value = val; if(isNaN(this.valueAsNumber) || (!isNaN(this.minAsNumber) && this.valueAsNumber < this.minAsNumber) || (!isNaN(this.maxAsNumber) && this.valueAsNumber > this.maxAsNumber)){ this._setStartInRange(); } else { this.elemHelper.prop('value', val); this.options.defValue = ""; } }, toFixed: function(val, force){ var o = this.options; if(o.toFixed && o.type == 'number' && val && this.valueAsNumber && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1)) && !$(this.orig).is(':invalid')){ val = formatVal[this.type](this.valueAsNumber.toFixed(o.toFixed), this.options); } return val; } }); ['defaultValue', 'value'].forEach(function(name){ var isValue = name == 'value'; spinBtnProto[name] = function(val, force){ if(!this._init || force || this.options[name] !== val){ if(isValue){ this._beforeValue(val); } else { this.elemHelper.prop(name, val); } val = formatVal[this.type](val, this.options); if(this.options.splitInput){ $.each(this.splits, function(i, elem){ var setOption; if(!(name in elem) && !isValue && $.nodeName(elem, 'select')){ $('option[value="'+ val[i] +'"]', elem).prop('defaultSelected', true); } else { $.prop(elem, name, val[i]); } }); } else { this.element.prop(name, this.toFixed(val)); } this._propertyChange(name); this.mirrorValidity(); } }; }); $.each({min: 1, max: -1}, function(name, factor){ var numName = name +'AsNumber'; spinBtnProto[name] = function(val){ this.elemHelper.prop(name, val); this[numName] = this.asNumber(val); if(this.valueAsNumber != null && (isNaN(this.valueAsNumber) || (!isNaN(this[numName]) && (this.valueAsNumber * factor) < (this[numName] * factor)))){ this._setStartInRange(); } this.options[name] = val; if(this._init){ createYearSelect({elements: this.inputElements}, this.options); } this._propertyChange(name); this.mirrorValidity(); }; }); $.fn.wsBaseWidget = function(opts){ opts = $.extend({}, opts); return this.each(function(){ $.webshims.objectCreate(wsWidgetProto, { element: { value: $(this) } }, opts); }); }; $.fn.wsBaseWidget.wsProto = wsWidgetProto; $.fn.spinbtnUI = function(opts){ opts = $.extend({ monthNames: 'monthNamesShort' }, opts); return this.each(function(){ $.webshims.objectCreate(spinBtnProto, { element: { value: $(this) } }, opts); }); }; $.fn.spinbtnUI.wsProto = spinBtnProto; })(); (function(){ var picker = {}; webshims.inlinePopover = { _create: function(){ this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this); this.contentElement = $('.ws-po-box', this.element); this.element.insertAfter(this.options.prepareFor); }, show: $.noop, hide: $.noop, preventBlur: $.noop, isVisible: true }; picker.isInRange = function(value, max, min){ return !((min[0] && min[0] > value[0]) || (max[0] && max[0] < value[0])); }; picker.createYearSelect = function(value, max, min, valueAdd, stepper){ if(!stepper){ stepper = {start: value, step: 1, label: value}; } var temp; var goUp = true; var goDown = true; var options = ['<option selected="">'+ stepper.label + '</option>']; var i = 0; var createOption = function(value, add){ var value2, label; if(stepper.step > 1){ value2 = value + stepper.step - 1; label = value+' – '+value2; } else { label = value; } if(picker.isInRange([value], max, min) || (value2 && picker.isInRange([value2], max, min))){ options[add]('<option value="'+ (value+valueAdd) +'">'+ label +'</option>'); return true; } }; if(!valueAdd){ valueAdd = ''; } while(i < 18 && (goUp || goDown)){ i++; if(goUp){ temp = stepper.start - (i * stepper.step); goUp = createOption(temp, 'unshift'); } if(goDown){ temp = stepper.start + (i * stepper.step); goDown = createOption(temp, 'push'); } } return options; }; picker._genericSetFocus = function(element, _noFocus){ element = $(element || this.activeButton); if(!this.popover.openedByFocus && !_noFocus){ var that = this; var setFocus = function(noTrigger){ clearTimeout(that.timer); that.timer = setTimeout(function(){ if(element[0]){ element.trigger('focus'); if(noTrigger !== true && !element.is(':focus')){ setFocus(true); } } }, that.popover.isVisible ? 0 : 360); }; this.popover.activateElement(element); setFocus(); } }; picker._actions = { changeInput: function(val, popover, data){ if(!data.options.noChangeDismiss){ picker._actions.cancel(val, popover, data); } data.setChange(val); }, cancel: function(val, popover, data){ if(!data.options.inlinePicker){ popover.stopOpen = true; data.element.getShadowFocusElement().trigger('focus'); setTimeout(function(){ popover.stopOpen = false; }, 9); popover.hide(); } } }; picker.commonInit = function(data, popover){ if(data._commonInit){return;} data._commonInit = true; var tabbable; popover.isDirty = true; popover.element.on('updatepickercontent pickerchange', function(){ tabbable = false; }); if(!data.options.inlinePicker){ popover.contentElement.on({ keydown: function(e){ if(e.keyCode == 9){ if(!tabbable){ tabbable = $('input:not(:disabled), [tabindex="0"]:not(:disabled)', this).filter(':visible'); } var index = tabbable.index(e.target); if(e.shiftKey && index <= 0){ tabbable.last().focus(); return false; } if(!e.shiftKey && index >= tabbable.length - 1){ tabbable.first().focus(); return false; } } else if(e.keyCode == 27){ data.element.getShadowFocusElement().focus(); popover.hide(); return false; } } }); } data._propertyChange = (function(){ var timer; var update = function(){ if(popover.isVisible){ popover.element.triggerHandler('updatepickercontent'); } }; return function(prop){ if(prop == 'value' && !data.options.inlinePicker){return;} popover.isDirty = true; if(popover.isVisible){ clearTimeout(timer); timer = setTimeout(update, 9); } }; })(); popover.activeElement = $([]); popover.activateElement = function(element){ element = $(element); if(element[0] != popover.activeElement[0]){ popover.activeElement.removeClass('ws-focus'); element.addClass('ws-focus'); } popover.activeElement = element; }; popover.element.on({ wspopoverbeforeshow: function(){ data.element.triggerHandler('wsupdatevalue'); popover.element.triggerHandler('updatepickercontent'); } }); $(data.orig).on('remove', function(e){ if(!e.originalEvent){ $(document).off('wslocalechange', data._propertyChange); } }); }; picker._common = function(data){ var options = data.options; var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, $.extend(options.popover || {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element})); var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper); if(options.widgetPosition){ webshims.error('options.widgetPosition was removed use options.popover.position instead'); } if(options.openOnFocus && popover.options && (popover.options.appendTo == 'auto' || popover.options.appendTo == 'element')){ webshims.error('openOnFocus and popover.appendTo "auto/element" can prduce a11y problems try to change appendTo to body or similiar or use openOnMouseFocus instead'); } var showPickerContent = function(){ (picker[data.type].showPickerContent || picker.showPickerContent)(data, popover); }; var show = function(){ var type = loadPicker(data.type, 'DOM'); if(!options.disabled && !options.readonly && (options.inlinePicker || !popover.isVisible)){ webshims.ready(type, showPickerContent); popover.show(data.element); } }; var open = function(){ if((options.inlinePicker || popover.isVisible) && popover.activeElement){ popover.openedByFocus = false; popover.activeElement.focus(); } show(); }; options.containerElements.push(popover.element[0]); popover.element .addClass(data.type+'-popover input-picker') .attr({role: 'application'}) .on({ wspopoverhide: function(){ popover.openedByFocus = false; }, focusin: function(e){ if(popover.activateElement){ popover.openedByFocus = false; popover.activateElement(e.target); } }, focusout: function(){ if(popover.activeElement){ popover.activeElement.removeClass('ws-focus'); } if(options.inlinePicker){ popover.openedByFocus = true; } } }) ; labelWidth(popover.element.children('div.ws-po-outerbox').attr({role: 'group'}), options.labels, true); labelWidth(opener, options.labels, true); if(options.tabindex != null){ opener.attr({tabindex: options.tabindex}); } if(options.disabled){ opener.prop({disabled: true}); } opener.on({click: open}); if(options.inlinePicker){ popover.openedByFocus = true; } else { opener .on({ mousedown: function(){ stopPropagation.apply(this, arguments); popover.preventBlur(); }, focus: function(){ popover.preventBlur(); } }) ; (function(){ var mouseFocus = false; var resetMouseFocus = function(){ mouseFocus = false; }; data.inputElements.on({ keydown: function(e){ if(e.keyCode == 40 && e.altKey && !$.nodeName(e.target, 'select')){ open(); } }, focus: function(e){ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus)) && !$.nodeName(e.target, 'select')){ popover.openedByFocus = options.buttonOnly ? false : !options.noInput; show(); } else { popover.preventBlur(); } }, mousedown: function(e){ mouseFocus = true; setTimeout(resetMouseFocus, 9); if(options.buttonOnly && popover.isVisible && popover.activeElement){ popover.openedByFocus = false; setTimeout(function(){ popover.openedByFocus = false; popover.activeElement.focus(); }, 4); } if(data.element.is(':focus') && !$.nodeName(e.target, 'select')){ popover.openedByFocus = options.buttonOnly ? false : !options.noInput; show(); } popover.preventBlur(); } }); })(); } data.popover = popover; data.opener = opener; $(data.orig).on('remove', function(e){ if(!e.originalEvent){ setTimeout(function(){ opener.remove(); popover.element.remove(); }, 4); } }); if(options.inlinePicker){ show(); } }; picker.month = picker._common; picker.date = picker._common; picker.time = picker._common; picker['datetime-local'] = picker._common; // picker.week = picker._common; picker.color = function(data){ var ret = picker._common.apply(this, arguments); var alpha = $(data.orig).data('alphacontrol'); var colorIndicator = data.opener .prepend('<span class="ws-color-indicator-bg"><span class="ws-color-indicator" /></span>') .find('.ws-color-indicator') ; var showColor = function(){ colorIndicator.css({backgroundColor: $.prop(this, 'value') || '#000000'}); }; var showOpacity = (function(){ var timer; var show = function(){ try { var value = data.alpha.prop('valueAsNumber') / (data.alpha.prop('max') || 1); if(!isNaN(value)){ colorIndicator.css({opacity: value}); } } catch(er){} }; return function(e){ clearTimeout(timer); timer = setTimeout(show, !e || e.type == 'change' ? 4: 40); }; })(); data.alpha = (alpha) ? $('#'+alpha) : $([]); $(data.orig).on('wsupdatevalue change', showColor).each(showColor); data.alpha.on('wsupdatevalue change input', showOpacity).each(showOpacity); return ret; }; webshims.picker = picker; })(); (function(){ var stopCircular, isCheckValidity; var modernizrInputTypes = Modernizr.inputtypes; var inputTypes = { }; var boolAttrs = {disabled: 1, required: 1, readonly: 1}; var copyProps = [ 'disabled', 'readonly', 'value', 'defaultValue', 'min', 'max', 'step', 'title', 'required', 'placeholder' ]; // var copyAttrs = ['data-placeholder', 'tabindex']; $.each(copyProps.concat(copyAttrs), function(i, name){ var fnName = name.replace(/^data\-/, ''); webshims.onNodeNamesPropertyModify('input', name, function(val, boolVal){ if(!stopCircular){ var shadowData = webshims.data(this, 'shadowData'); if(shadowData && shadowData.data && shadowData.nativeElement === this && shadowData.data[fnName]){ if(boolAttrs[fnName]){ shadowData.data[fnName](val, boolVal); } else { shadowData.data[fnName](val); } } } }); }); if(options.replaceUI && 'valueAsNumber' in document.createElement('input')){ var reflectFn = function(){ if(webshims.data(this, 'hasShadow')){ $.prop(this, 'value', $.prop(this, 'value')); } }; webshims.onNodeNamesPropertyModify('input', 'valueAsNumber', reflectFn); webshims.onNodeNamesPropertyModify('input', 'valueAsDate', reflectFn); $.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){ var stepDescriptor = webshims.defineNodeNameProperty('input', name, { prop: { value: function(){ var ret; if(stepDescriptor.prop && stepDescriptor.prop._supvalue){ ret = stepDescriptor.prop._supvalue.apply(this, arguments); reflectFn.apply(this, arguments); } return ret; } } }); }); } var extendType = (function(){ return function(name, data){ inputTypes[name] = data; data.attrs = $.merge([], copyAttrs, data.attrs); data.props = $.merge([], copyProps, data.props); }; })(); var isVisible = function(){ return $.css(this, 'display') != 'none'; }; var sizeInput = function(data){ var init; var updateStyles = function(){ $(data.orig).removeClass('ws-important-hide'); $.style( data.orig, 'display', '' ); var hasButtons, marginR, marginL, left, right, isRtl; var correctWidth = 0.8; if(!init || data.orig.offsetWidth){ hasButtons = data.buttonWrapper && data.buttonWrapper.filter(isVisible).length; isRtl = hasButtons && data.buttonWrapper.css('direction') == 'rtl'; if(isRtl){ left = 'Right'; right = 'Left'; } else { left = 'Left'; right = 'Right'; } marginR = $.css( data.orig, 'margin'+right); data.element .css('margin'+left, $.css( data.orig, 'margin'+left)) .css('margin'+right, hasButtons ? 0 : marginR) ; if(hasButtons){ data.buttonWrapper[isRtl ? 'addClass' : 'removeClass']('ws-is-rtl'); marginL = (parseInt(data.buttonWrapper.css('margin'+left), 10) || 0); data.element.css('padding'+right, ''); if(marginL < 0){ marginR = (parseInt(marginR, 10) || 0) + ((data.buttonWrapper.outerWidth() + marginL) * -1); data.buttonWrapper.css('margin'+right, marginR); data.element .css('padding'+right, '') .css('padding'+right, (parseInt( data.element.css('padding'+right), 10) || 0) + data.buttonWrapper.outerWidth()) ; } else { data.buttonWrapper.css('margin'+right, marginR); correctWidth = data.buttonWrapper.outerWidth(true) + correctWidth; } } data.element.outerWidth( $(data.orig).outerWidth() - correctWidth ); } init = true; $(data.orig).addClass('ws-important-hide'); }; data.element.onWSOff('updateshadowdom', updateStyles, true); }; var implementType = function(){ var type = $.prop(this, 'type'); var i, opts, data, optsName, labels, cNames; if(inputTypes[type] && webshims.implement(this, 'inputwidgets')){ data = {}; optsName = type; labels = $(this).jProp('labels'); opts = $.extend(webshims.getOptions(this, type, [options.widgets, options[type], $($.prop(this, 'form')).data(type)]), { orig: this, type: type, labels: labels, options: {}, input: function(val){ opts._change(val, 'input'); }, change: function(val){ opts._change(val, 'change'); }, _change: function(val, trigger){ stopCircular = true; $.prop(opts.orig, 'value', val); stopCircular = false; if(trigger){ $(opts.orig).trigger(trigger); } }, containerElements: [] }); for(i = 0; i < copyProps.length; i++){ opts[copyProps[i]] = $.prop(this, copyProps[i]); } for(i = 0; i < copyAttrs.length; i++){ optsName = copyAttrs[i].replace(/^data\-/, ''); if(optsName == 'placeholder' || !opts[optsName]){ opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName]; } } if(opts.formatMonthNames){ webshims.error('formatMonthNames was renamded to monthNames'); } if(opts.onlyMonthDigits){ opts.monthNames = 'monthDigits'; } data.shim = inputTypes[type]._create(opts); webshims.addShadowDom(this, data.shim.element, { data: data.shim || {} }); data.shim.options.containerElements.push(data.shim.element[0]); cNames = $.prop(this, 'className'); if(opts.classes){ cNames += ' '+opts.classes; } if(opts.splitInput || type == 'range'){ cNames = cNames.replace('form-control', ''); } data.shim.element.on('change input', stopPropagation).addClass(cNames); if(data.shim.buttonWrapper){ data.shim.buttonWrapper.addClass('input-button-size-'+(data.shim.buttonWrapper.children().filter(isVisible).length)); if(data.shim.buttonWrapper.filter(isVisible).length){ data.shim.element.addClass('has-input-buttons'); } } labelWidth($(this).getShadowFocusElement(), labels); $(this).on('change', function(e){ if(!stopCircular){ data.shim.value($.prop(this, 'value')); } }); (function(){ var has = { focusin: true, focus: true }; var timer; var hasFocusTriggered = false; var hasFocus = false; $(data.shim.options.containerElements) .on({ 'focusin focus focusout blur': function(e){ e.stopImmediatePropagation(); hasFocus = has[e.type]; clearTimeout(timer); timer = setTimeout(function(){ if(hasFocus != hasFocusTriggered){ hasFocusTriggered = hasFocus; $(opts.orig).triggerHandler(hasFocus ? 'focus' : 'blur'); $(opts.orig).trigger(hasFocus ? 'focusin' : 'focusout'); } hasFocusTriggered = hasFocus; }, 9); } }) ; })(); if(hasFormValidation){ $(opts.orig).on('firstinvalid', function(e){ if(!webshims.fromSubmit && isCheckValidity){return;} $(opts.orig).off('invalid.replacedwidgetbubble').on('invalid.replacedwidgetbubble', function(evt){ if(!evt.isDefaultPrevented()){ webshims.validityAlert.showFor( e.target ); e.preventDefault(); evt.preventDefault(); } $(opts.orig).off('invalid.replacedwidgetbubble'); }); }); } if(opts.calculateWidth){ sizeInput(data.shim); } else { $(this).addClass('ws-important-hide'); } } }; if(hasFormValidation){ ['input', 'form'].forEach(function(name){ var desc = webshims.defineNodeNameProperty(name, 'checkValidity', { prop: { value: function(){ isCheckValidity = true; var ret = desc.prop._supvalue.apply(this, arguments); isCheckValidity = false; return ret; } } }); }); } var replace = {}; if(options.replaceUI){ if( $.isPlainObject(options.replaceUI) ){ $.extend(replace, options.replaceUI); } else { $.extend(replace, { 'range': 1, 'number': 1, 'time': 1, 'month': 1, 'date': 1, 'color': 1, 'datetime-local': 1 }); } } if(modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)))){ replace.number = 1; } if(!modernizrInputTypes.range || replace.range){ extendType('range', { _create: function(opts, set){ var data = $('<span />').insertAfter(opts.orig).rangeUI(opts).data('rangeUi'); return data; } }); } ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){ if(!modernizrInputTypes[name] || replace[name]){ extendType(name, { _create: function(opts, set){ if(opts.monthSelect || opts.daySelect || opts.yearSelect){ opts.splitInput = true; } if(opts.splitInput && !splitInputs[name]){ webshims.warn('splitInput not supported for '+ name); opts.splitInput = false; } var markup = opts.splitInput ? '<span class="ws-'+name+' ws-input ws-inputreplace" role="group"></span>' : '<input class="ws-'+name+' ws-inputreplace" type="text" />'; var data = $(markup).insertAfter(opts.orig); if(steps[name]){ data = data.spinbtnUI(opts).data('wsWidget'+name); } else { data = data.wsBaseWidget(opts).data('wsWidget'+name); } if(webshims.picker && webshims.picker[name]){ webshims.picker[name](data); } return data; } }); } }); var init = function(){ webshims.addReady(function(context, contextElem){ $('input', context) .add(contextElem.filter('input')) .each(implementType) ; }); }; if(formcfg._isLoading){ $(formcfg).one('change', init); } else { init(); } })(); });
icco/cdnjs
ajax/libs/webshim/1.12.3/dev/shims/combos/17.js
JavaScript
mit
83,176
var nodemailer = require('../lib/nodemailer'), fs = require("fs"), pathlib = require("path"); // Create an Amazon SES transport object var transport = nodemailer.createTransport("SES", { AWSAccessKeyID: "AWSACCESSKEY", AWSSecretKey: "/AWS/SECRET", ServiceUrl: "https://email.us-east-1.amazonaws.com" // optional }); console.log('SES Configured'); // optional DKIM signing /* transport.useDKIM({ domainName: "do-not-trust.node.ee", // signing domain keySelector: "dkim", // selector name (in this case there's a dkim._domainkey.do-not-trust.node.ee TXT record set up) privateKey: fs.readFileSync(pathlib.join(__dirname,"test_private.pem")) }); */ // Message object var message = { // sender info from: 'Sender Name <sender@example.com>', // Comma separated list of recipients to: '"Receiver Name" <receiver@example.com>', // Subject of the message subject: 'Nodemailer is unicode friendly ✔', // // plaintext body text: 'Hello to myself!', // HTML body html:'<p><b>Hello</b> to myself <img src="cid:note@node"/></p>'+ '<p>Here\'s a nyan cat for you as an embedded attachment:<br/><img src="cid:nyan@node"/></p>', // An array of attachments attachments:[ // String attachment { fileName: 'notes.txt', contents: 'Some notes about this e-mail', contentType: 'text/plain' // optional, would be detected from the filename }, // Binary Buffer attachment { fileName: 'image.png', contents: new Buffer('iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/' + '//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U' + 'g9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC', 'base64'), cid: 'note@node' // should be as unique as possible }, // File Stream attachment { fileName: 'nyancat.gif', filePath: __dirname+"/nyan.gif", cid: 'nyan@node' // should be as unique as possible } ] }; console.log('Sending Mail'); transport.sendMail(message, function(error){ if(error){ console.log('Error occured'); console.log(error.message); return; } console.log('Message sent successfully!'); });
gamanox/itfeedw
node_modules/nodemailer/examples/example_ses.js
JavaScript
mit
2,394
webshims.register("form-shim-extend",function(a,b,c,d,e,f){"use strict";b.inputTypes=b.inputTypes||{};var g=b.cfg.forms,h=b.bugs,i=b.inputTypes,j={radio:1,checkbox:1},k=function(a){return(a.getAttribute("type")||a.type||"").toLowerCase()};!function(){if("querySelector"in d){try{h.findRequired=!a('<form action="#" style="width: 1px; height: 1px; overflow: hidden;"><select name="b" required="" /></form>')[0].querySelector("select:required")}catch(b){h.findRequired=!1}(h.bustedValidity||h.findRequired)&&!function(){var b=a.find,c=a.find.matchesSelector,e=/(\:valid|\:invalid|\:optional|\:required|\:in-range|\:out-of-range)(?=[\s\[\~\.\+\>\:\#*]|$)/gi,f=function(a){return a+"-element"};a.find=function(){var a=Array.prototype.slice,c=function(c){var d=arguments;return d=a.call(d,1,d.length),d.unshift(c.replace(e,f)),b.apply(this,d)};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c}(),(!Modernizr.prefixed||Modernizr.prefixed("matchesSelector",d.documentElement))&&(a.find.matchesSelector=function(a,b){return b=b.replace(e,f),c.call(this,a,b)})}()}}(),b.addInputType=function(a,b){i[a]=b};var l={customError:!1,typeMismatch:!1,badInput:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,patternMismatch:!1,valueMissing:!1,valid:!0},m=function(b){if("select-one"==b.type&&b.size<2){var c=a("> option:first-child",b);return!!c.prop("selected")}return!1},n=a([]),o=function(b){b=a(b);var c,e,f=n;return"radio"==b[0].type&&(e=b.prop("form"),c=b[0].name,f=c?e?a(e[c]):a(d.getElementsByName(c)).filter(function(){return!a.prop(this,"form")}):b,f=f.filter('[type="radio"]')),f},p={url:1,email:1,text:1,search:1,tel:1,password:1},q=a.extend({textarea:1},p),r={valueMissing:function(a,b,c){if(!a.prop("required"))return!1;var d=!1;return"type"in c||(c.type=k(a[0])),d="select"==c.nodeName?!b&&(a[0].selectedIndex<0||m(a[0])):j[c.type]?"checkbox"==c.type?!a.is(":checked"):!o(a).filter(":checked")[0]:!b},patternMismatch:function(a,c,d){if(""===c||"select"==d.nodeName)return!1;if("type"in d||(d.type=k(a[0])),!p[d.type])return!1;var e=a.attr("pattern");if(!e)return!1;try{e=new RegExp("^(?:"+e+")$")}catch(f){b.error('invalid pattern value: "'+e+'" | '+f),e=!1}return e?!e.test(c):!1}};a.each({tooShort:["minLength",-1],tooLong:["maxLength",1]},function(a,b){r[a]=function(a,c,d){if("select"==d.nodeName||a.prop("defaultValue")==c)return!1;if("type"in d||(d.type=k(a[0])),!q[d.type])return!1;var e=a.prop(b[0]);return e>0&&e*b[1]<c.length*b[1]}}),a.each({typeMismatch:"mismatch",badInput:"bad"},function(a,b){r[a]=function(c,d,e){if(""===d||"select"==e.nodeName)return!1;var f=!1;return"type"in e||(e.type=k(c[0])),i[e.type]&&i[e.type][b]?f=i[e.type][b](d,c):"validity"in c[0]&&"name"in c[0].validity&&(f=c[0].validity[a]||!1),f}}),b.addValidityRule=function(a,b){r[a]=b},a.event.special.invalid={add:function(){a.event.special.invalid.setup.call(this.form||this)},setup:function(){var c=this.form||this;return a.data(c,"invalidEventShim")?(c=null,void 0):(a(c).data("invalidEventShim",!0).on("submit",a.event.special.invalid.handler),b.moveToFirstEvent(c,"submit"),b.bugs.bustedValidity&&a.nodeName(c,"form")&&!function(){var a=c.getAttribute("novalidate");c.setAttribute("novalidate","novalidate"),b.data(c,"bustedNoValidate",null==a?null:a)}(),c=null,void 0)},teardown:a.noop,handler:function(b){if("submit"==b.type&&!b.testedValidity&&b.originalEvent&&a.nodeName(b.target,"form")&&!a.prop(b.target,"noValidate")){b.testedValidity=!0;var c=!a(b.target).callProp("reportValidity");return c?(b.stopImmediatePropagation(),f.noFormInvalid||a(b.target).trigger("invalid"),!1):void 0}}},a.event.special.submit=a.event.special.submit||{setup:function(){return!1}};var s=a.event.special.submit.setup;a.extend(a.event.special.submit,{setup:function(){return a.nodeName(this,"form")?a(this).on("invalid",a.noop):a("form",this).on("invalid",a.noop),s.apply(this,arguments)}}),b.ready("form-shim-extend2 WINDOWLOAD",function(){a(c).on("invalid",a.noop)}),b.addInputType("email",{mismatch:function(){var b=g.emailReg||/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,c=/\s*,\s*/g;return function(d,e){var f=!1;d=a(e).prop("multiple")?d.split(c):[d];for(var g=0;g<d.length;g++)if(!b.test(d[g])){f=!0;break}return f}}()}),b.addInputType("url",{mismatch:function(){var a=g.urlReg||/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;return function(b){return!a.test(b)}}()}),b.defineNodeNameProperty("input","type",{prop:{get:function(){var a=this,c=(a.getAttribute("type")||"").toLowerCase();return b.inputTypes[c]?c:a.type}}}),b.defineNodeNamesProperties(["button","fieldset","output"],{checkValidity:{value:function(){return!0}},reportValidity:{value:function(){return!0}},willValidate:{value:!1},setCustomValidity:{value:a.noop},validity:{writeable:!1,get:function(){return a.extend({},l)}}},"prop");var t=function(c,d){var e,f=a.prop(c,"validity");if(!f)return!0;if(a.data(c,"cachedValidity",f),!f.valid){e=a.Event("invalid");var g=a(c).trigger(e);"reportValidity"!=d||t.unhandledInvalids||e.isDefaultPrevented()||(b.validityAlert.showFor(g),t.unhandledInvalids=!0)}return a.removeData(c,"cachedValidity"),f.valid},u=/^(?:select|textarea|input)/i;["checkValidity","reportValidity"].forEach(function(c){b.defineNodeNameProperty("form",c,{prop:{value:function(){var d=!0,e=a(a.prop(this,"elements")).filter(function(){if(!u.test(this.nodeName))return!1;var a=b.data(this,"shadowData");return!a||!a.nativeElement||a.nativeElement===this});t.unhandledInvalids=!1;for(var f=0,g=e.length;g>f;f++)t(e[f],c)||(d=!1);return d}}})}),["input","textarea","select"].forEach(function(c){var d={setCustomValidity:{value:function(c){a.removeData(this,"cachedValidity"),b.data(this,"customvalidationMessage",""+c),h.bustedValidity&&d.setCustomValidity.prop._supvalue&&d.setCustomValidity.prop._supvalue.apply(this,arguments)}},willValidate:{writeable:!1,get:function(){var b={button:1,reset:1,hidden:1,image:1};return function(){var c=a(this).getNativeElement()[0];return!(c.readOnly||b[c.type]||a(c).is(":disabled"))}}()},validity:{writeable:!1,get:function(){var c=a(this).getNativeElement(),d=c[0],e=a.data(d,"cachedValidity");if(e)return e;if(e=a.extend({},l),!a.prop(d,"willValidate")||"submit"==d.type)return e;var f=c.val(),g={nodeName:d.nodeName.toLowerCase()};return e.customError=!!b.data(d,"customvalidationMessage"),e.customError&&(e.valid=!1),a.each(r,function(a,b){b(c,f,g)&&(e[a]=!0,e.valid=!1)}),a(this).getShadowFocusElement().attr("aria-invalid",e.valid?"false":"true"),c=null,d=null,e}}};["checkValidity","reportValidity"].forEach(function(b){d[b]={value:function(){return t.unhandledInvalids=!1,t(a(this).getNativeElement()[0],b)}}}),b.defineNodeNameProperties(c,d,"prop")}),b.defineNodeNamesBooleanProperty(["input","textarea","select"],"required",{set:function(b){a(this).getShadowFocusElement().attr("aria-required",!!b+"")},initAttr:Modernizr.localstorage}),b.defineNodeNamesBooleanProperty(["input"],"multiple"),h.bustedValidity&&(b.defineNodeNameProperty("form","novalidate",{attr:{set:function(a){b.data(this,"bustedNoValidate",""+a)},get:function(){var a=b.data(this,"bustedNoValidate");return null==a?e:a}},removeAttr:{value:function(){b.data(this,"bustedNoValidate",null)}}}),a.each(["rangeUnderflow","rangeOverflow","stepMismatch"],function(a,b){r[b]=function(a){return(a[0].validity||{})[b]||!1}})),b.defineNodeNameProperty("form","noValidate",{prop:{set:function(b){b=!!b,b?a.attr(this,"novalidate","novalidate"):a(this).removeAttr("novalidate")},get:function(){return null!=a.attr(this,"novalidate")}}}),b.defineNodeNamesProperty(["input","textarea"],"minLength",{prop:{set:function(a){if(a*=1,0>a)throw"INDEX_SIZE_ERR";this.setAttribute("minlength",a||0)},get:function(){var a=this.getAttribute("minlength");return null==a?-1:1*a||0}}}),Modernizr.inputtypes.date&&/webkit/i.test(navigator.userAgent)&&!function(){var b={updateInput:1,input:1},c={date:1,time:1,month:1,week:1,"datetime-local":1},e={focusout:1,blur:1},f={updateInput:1,change:1},g=function(a){var c,d,g=!0,h=a.prop("value"),i=h,j=function(c){if(a){var d=a.prop("value");d!==h&&(h=d,c&&b[c.type]||a.trigger("input")),c&&f[c.type]&&(i=d),g||d===i||a.trigger("change")}},k=function(){clearTimeout(d),d=setTimeout(j,9)},l=function(b){clearInterval(c),setTimeout(function(){b&&e[b.type]&&(g=!1),a&&(a.off("focusout blur",l).off("input change updateInput",j),j()),a=null},1)};clearInterval(c),c=setInterval(j,160),k(),a.off({"focusout blur":l,"input change updateInput":j}).on({"focusout blur":l,"input updateInput change":j})};a(d).on("focusin",function(b){b.target&&c[b.target.type]&&!b.target.readOnly&&!b.target.disabled&&g(a(b.target))})}(),b.addReady(function(b,c){var e;a("form",b).add(c.filter("form")).on("invalid",a.noop);try{b!=d||"form"in(d.activeElement||{})||(e=a("input[autofocus], select[autofocus], textarea[autofocus]",b).eq(0).getShadowFocusElement()[0],e&&e.offsetHeight&&e.offsetWidth&&e.focus())}catch(f){}}),Modernizr.input.list||b.defineNodeNameProperty("datalist","options",{prop:{writeable:!1,get:function(){var c,d=this,e=a("select",d);return e[0]?c=a.makeArray(e[0].options||[]):(c=a("option",d).get(),c.length&&b.warn("you should wrap your option-elements for a datalist in a select element to support IE and other old browsers.")),c}}});var v={submit:1,button:1,image:1},w={};[{name:"enctype",limitedTo:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},defaultProp:"application/x-www-form-urlencoded",proptype:"enum"},{name:"method",limitedTo:{get:1,post:1},defaultProp:"get",proptype:"enum"},{name:"action",proptype:"url"},{name:"target"},{name:"novalidate",propName:"noValidate",proptype:"boolean"}].forEach(function(b){var c="form"+(b.propName||b.name).replace(/^[a-z]/,function(a){return a.toUpperCase()}),e="form"+b.name,f=b.name,g="click.webshimssubmittermutate"+f,h=function(){var d=this;if("form"in d&&v[d.type]){var g=a.prop(d,"form");if(g){var h=a.attr(d,e);if(null!=h&&(!b.limitedTo||h.toLowerCase()===a.prop(d,c))){var i=a.attr(g,f);a.attr(g,f,h),setTimeout(function(){if(null!=i)a.attr(g,f,i);else try{a(g).removeAttr(f)}catch(b){g.removeAttribute(f)}},9)}}}};switch(b.proptype){case"url":var i=d.createElement("form");w[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var b=a.attr(this,e);return null==b?"":(i.setAttribute("action",b),i.action)}}};break;case"boolean":w[c]={prop:{set:function(b){b=!!b,b?a.attr(this,"formnovalidate","formnovalidate"):a(this).removeAttr("formnovalidate")},get:function(){return null!=a.attr(this,"formnovalidate")}}};break;case"enum":w[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var c=a.attr(this,e);return!c||(c=c.toLowerCase())&&!b.limitedTo[c]?b.defaultProp:c}}};break;default:w[c]={prop:{set:function(b){a.attr(this,e,b)},get:function(){var b=a.attr(this,e);return null!=b?b:""}}}}w[e]||(w[e]={}),w[e].attr={set:function(b){w[e].attr._supset.call(this,b),a(this).off(g).on(g,h)},get:function(){return w[e].attr._supget.call(this)}},w[e].initAttr=!0,w[e].removeAttr={value:function(){a(this).off(g),w[e].removeAttr._supvalue.call(this)}}}),b.defineNodeNamesProperties(["input","button"],w)}),webshims.register("form-message",function(a,b,c,d,e,f){"use strict";f.lazyCustomMessages&&(f.customMessages=!0);var g=b.validityMessages,h=f.customMessages?["customValidationMessage"]:[];g.en=a.extend(!0,{typeMismatch:{defaultMessage:"Please enter a valid value.",email:"Please enter an email address.",url:"Please enter a URL."},badInput:{defaultMessage:"Please enter a valid value.",number:"Please enter a number.",date:"Please enter a date.",time:"Please enter a time.",range:"Invalid input.",month:"Please enter a valid value.","datetime-local":"Please enter a datetime."},rangeUnderflow:{defaultMessage:"Value must be greater than or equal to {%min}."},rangeOverflow:{defaultMessage:"Value must be less than or equal to {%max}."},stepMismatch:"Invalid input.",tooLong:"Please enter at most {%maxlength} character(s). You entered {%valueLen}.",tooShort:"Please enter at least {%minlength} character(s). You entered {%valueLen}.",patternMismatch:"Invalid input. {%title}",valueMissing:{defaultMessage:"Please fill out this field.",checkbox:"Please check this box if you want to proceed."}},g.en||g["en-US"]||{}),"object"==typeof g.en.valueMissing&&["select","radio"].forEach(function(a){g.en.valueMissing[a]=g.en.valueMissing[a]||"Please select an option."}),"object"==typeof g.en.rangeUnderflow&&["date","time","datetime-local","month"].forEach(function(a){g.en.rangeUnderflow[a]=g.en.rangeUnderflow[a]||"Value must be at or after {%min}."}),"object"==typeof g.en.rangeOverflow&&["date","time","datetime-local","month"].forEach(function(a){g.en.rangeOverflow[a]=g.en.rangeOverflow[a]||"Value must be at or before {%max}."}),g["en-US"]||(g["en-US"]=a.extend(!0,{},g.en)),g["en-GB"]||(g["en-GB"]=a.extend(!0,{},g.en)),g["en-AU"]||(g["en-AU"]=a.extend(!0,{},g.en)),g[""]=g[""]||g["en-US"],g.de=a.extend(!0,{typeMismatch:{defaultMessage:"{%value} ist in diesem Feld nicht zul\xe4ssig.",email:"{%value} ist keine g\xfcltige E-Mail-Adresse.",url:"{%value} ist kein(e) g\xfcltige(r) Webadresse/Pfad."},badInput:{defaultMessage:"Geben Sie einen zul\xe4ssigen Wert ein.",number:"Geben Sie eine Nummer ein.",date:"Geben Sie ein Datum ein.",time:"Geben Sie eine Uhrzeit ein.",month:"Geben Sie einen Monat mit Jahr ein.",range:"Geben Sie eine Nummer.","datetime-local":"Geben Sie ein Datum mit Uhrzeit ein."},rangeUnderflow:{defaultMessage:"{%value} ist zu niedrig. {%min} ist der unterste Wert, den Sie benutzen k\xf6nnen."},rangeOverflow:{defaultMessage:"{%value} ist zu hoch. {%max} ist der oberste Wert, den Sie benutzen k\xf6nnen."},stepMismatch:"Der Wert {%value} ist in diesem Feld nicht zul\xe4ssig. Hier sind nur bestimmte Werte zul\xe4ssig. {%title}",tooLong:"Der eingegebene Text ist zu lang! Sie haben {%valueLen} Zeichen eingegeben, dabei sind {%maxlength} das Maximum.",tooShort:"Der eingegebene Text ist zu kurz! Sie haben {%valueLen} Zeichen eingegeben, dabei sind {%minlength} das Minimum.",patternMismatch:"{%value} hat f\xfcr dieses Eingabefeld ein falsches Format. {%title}",valueMissing:{defaultMessage:"Bitte geben Sie einen Wert ein.",checkbox:"Bitte aktivieren Sie das K\xe4stchen."}},g.de||{}),"object"==typeof g.de.valueMissing&&["select","radio"].forEach(function(a){g.de.valueMissing[a]=g.de.valueMissing[a]||"Bitte w\xe4hlen Sie eine Option aus."}),"object"==typeof g.de.rangeUnderflow&&["date","time","datetime-local","month"].forEach(function(a){g.de.rangeUnderflow[a]=g.de.rangeUnderflow[a]||"{%value} ist zu fr\xfch. {%min} ist die fr\xfcheste Zeit, die Sie benutzen k\xf6nnen."}),"object"==typeof g.de.rangeOverflow&&["date","time","datetime-local","month"].forEach(function(a){g.de.rangeOverflow[a]=g.de.rangeOverflow[a]||"{%value} ist zu sp\xe4t. {%max} ist die sp\xe4teste Zeit, die Sie benutzen k\xf6nnen."});var i=g[""],j=function(b,c){return b&&"string"!=typeof b&&(b=b[a.prop(c,"type")]||b[(c.nodeName||"").toLowerCase()]||b.defaultMessage),b||""},k=/</g,l=/>/g,m={value:1,min:1,max:1};b.replaceValidationplaceholder=function(c,d,e){var f,g;return d&&-1!=d.indexOf("{%")&&["value","min","max","title","maxlength","minlength","label"].forEach(function(h){if(-1!==d.indexOf("{%"+h)){var i=("label"==h?a.trim(a('label[for="'+c.id+'"]',c.form).text()).replace(/\*$|:$/,""):a.prop(c,h))||"";"patternMismatch"!=e||"title"!=h||i||b.error("no title for patternMismatch provided. Always add a title attribute."),m[h]&&(g||(g=a(c).getShadowElement().data("wsWidget"+(f=a.prop(c,"type")))),g&&g.formatValue&&(i=g.formatValue(i,!1))),d=d.replace("{%"+h+"}",i.replace(k,"&lt;").replace(l,"&gt;")),"value"==h&&(d=d.replace("{%valueLen}",i.length))}}),d},b.createValidationMessage=function(c,d){var e=j(i[d],c);return e||"badInput"!=d||(e=j(i.typeMismatch,c)),e||"typeMismatch"!=d||(e=j(i.badInput,c)),e||(e=j(g[""][d],c)||a.prop(c,"validationMessage"),b.info("could not find errormessage for: "+d+" / "+a.prop(c,"type")+". in language: "+b.activeLang())),e=b.replaceValidationplaceholder(c,e,d),e||""},(!Modernizr.formvalidation||b.bugs.bustedValidity)&&h.push("validationMessage"),i=b.activeLang(g),a(g).on("change",function(){i=g.__active}),h.forEach(function(c){b.defineNodeNamesProperty(["fieldset","output","button"],c,{prop:{value:"",writeable:!1}}),["input","select","textarea"].forEach(function(d){var e=b.defineNodeNameProperty(d,c,{prop:{get:function(){var c=this,d="";if(!a.prop(c,"willValidate"))return d;var f=a.prop(c,"validity")||{valid:1};return f.valid?d:(d=b.getContentValidationMessage(c,f))?d:f.customError&&c.nodeName&&(d=Modernizr.formvalidation&&!b.bugs.bustedValidity&&e.prop._supget?e.prop._supget.call(c):b.data(c,"customvalidationMessage"))?d:(a.each(f,function(a,e){return"valid"!=a&&e?(d=b.createValidationMessage(c,a),d?!1:void 0):void 0}),d||"")},writeable:!1}})})})}),webshims.register("form-number-date-api",function(a,b,c,d){"use strict";b.addInputType||b.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')"),b.getStep||(b.getStep=function(b,c){var d=a.attr(b,"step");return"any"===d?d:(c=c||i(b),f[c]&&f[c].step?(d=q.number.asNumber(d),(!isNaN(d)&&d>0?d:f[c].step)*(f[c].stepScaleFactor||1)):d)}),b.addMinMaxNumberToCache||(b.addMinMaxNumberToCache=function(a,b,c){a+"AsNumber"in c||(c[a+"AsNumber"]=f[c.type].asNumber(b.attr(a)),isNaN(c[a+"AsNumber"])&&a+"Default"in f[c.type]&&(c[a+"AsNumber"]=f[c.type][a+"Default"]))});var e=parseInt("NaN",10),f=b.inputTypes,g=function(a){return"number"==typeof a||a&&a==1*a},h=function(b){return a('<input type="'+b+'" />').prop("type")===b},i=function(a){return(a.getAttribute("type")||"").toLowerCase()},j=function(a){return a&&!isNaN(1*a)},k=b.addMinMaxNumberToCache,l=function(a,b){a=""+a,b-=a.length;for(var c=0;b>c;c++)a="0"+a;return a},m=1e-7,n=b.bugs.bustedValidity;b.addValidityRule("stepMismatch",function(a,c,d,e){if(""===c)return!1;if("type"in d||(d.type=i(a[0])),"week"==d.type)return!1;var g,h,j=(e||{}).stepMismatch||!1;if(f[d.type]&&f[d.type].step){if("step"in d||(d.step=b.getStep(a[0],d.type)),"any"==d.step)return!1;if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;k("min",a,d),g=d.minAsNumber,isNaN(g)&&(h=a.prop("defaultValue"))&&(g=f[d.type].asNumber(h)),isNaN(g)&&(g=f[d.type].stepBase||0),j=Math.abs((d.valueAsNumber-g)%d.step),j=!(m>=j||Math.abs(j-d.step)<=m)}return j}),[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(a){b.addValidityRule(a.name,function(b,c,d,e){var g=(e||{})[a.name]||!1;if(""===c)return g;if("type"in d||(d.type=i(b[0])),f[d.type]&&f[d.type].asNumber){if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;if(k(a.attr,b,d),isNaN(d[a.attr+"AsNumber"]))return g;g=d[a.attr+"AsNumber"]*a.factor<d.valueAsNumber*a.factor-m}return g})}),b.reflectProperties(["input"],["max","min","step"]);var o=b.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var b=this,c=i(b),d=f[c]&&f[c].asNumber?f[c].asNumber(a.prop(b,"value")):o.prop._supget&&o.prop._supget.apply(b,arguments);return null==d&&(d=e),d},set:function(c){var d=this,e=i(d);if(f[e]&&f[e].numberToString){if(isNaN(c))return a.prop(d,"value",""),void 0;var g=f[e].numberToString(c);g!==!1?a.prop(d,"value",g):b.error("INVALID_STATE_ERR: DOM Exception 11")}else o.prop._supset&&o.prop._supset.apply(d,arguments)}}}),p=b.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var b=this,c=i(b);return f[c]&&f[c].asDate&&!f[c].noAsDate?f[c].asDate(a.prop(b,"value")):p.prop._supget&&p.prop._supget.call(b)||null},set:function(c){var d=this,e=i(d);if(!f[e]||!f[e].dateToString||f[e].noAsDate)return p.prop._supset&&p.prop._supset.apply(d,arguments)||null;if(null===c)return a.prop(d,"value",""),"";var g=f[e].dateToString(c);return g!==!1?(a.prop(d,"value",g),g):(b.error("INVALID_STATE_ERR: DOM Exception 11"),void 0)}}});a.each({stepUp:1,stepDown:-1},function(c,d){var e=b.defineNodeNameProperty("input",c,{prop:{value:function(c){var g,h,j,k,l,n,o,p=i(this);if(!f[p]||!f[p].asNumber){if(e.prop&&e.prop._supvalue)return e.prop._supvalue.apply(this,arguments);throw b.info("no step method for type: "+p),"invalid state error"}if(l={type:p},c||(c=1,b.warn("you should always use a factor for stepUp/stepDown")),c*=d,h=a.prop(this,"valueAsNumber"),isNaN(h))throw b.info("valueAsNumber is NaN can't apply stepUp/stepDown "),"invalid state error";if(g=b.getStep(this,p),"any"==g)throw b.info("step is 'any' can't apply stepUp/stepDown"),"invalid state error";if(b.addMinMaxNumberToCache("min",a(this),l),b.addMinMaxNumberToCache("max",a(this),l),n=l.minAsNumber,isNaN(n)&&(o=a.prop(this,"defaultValue"))&&(n=f[p].asNumber(o)),n||(n=0),g*=c,h=1*(h+g).toFixed(5),j=(h-n)%g,j&&Math.abs(j)>m&&(k=h-j,k+=j>0?g:-g,h=1*k.toFixed(5)),!isNaN(l.maxAsNumber)&&h>l.maxAsNumber||!isNaN(l.minAsNumber)&&h<l.minAsNumber)throw b.info("max/min overflow can't apply stepUp/stepDown"),"invalid state error";a.prop(this,"valueAsNumber",h)}}})});var q={number:{bad:function(a){return!g(a)},step:1,stepScaleFactor:1,asNumber:function(a){return g(a)?1*a:e},numberToString:function(a){return g(a)?a:!1}},range:{minDefault:0,maxDefault:100},color:{bad:function(){var a=/^\u0023[a-f0-9]{6}$/;return function(b){return!b||7!=b.length||!a.test(b)}}()},date:{bad:function(a){if(!a||!a.split||!/\d$/.test(a))return!0;var b,c=a.split(/\u002D/);if(3!==c.length)return!0;var d=!1;if(c[0].length<4||2!=c[1].length||c[1]>12||2!=c[2].length||c[2]>33)d=!0;else for(b=0;3>b;b++)if(!j(c[b])){d=!0;break}return d||a!==this.dateToString(this.asDate(a,!0))},step:1,stepScaleFactor:864e5,asDate:function(a,b){return!b&&this.bad(a)?null:new Date(this.asNumber(a,!0))},asNumber:function(a,b){var c=e;return(b||!this.bad(a))&&(a=a.split(/\u002D/),c=Date.UTC(a[0],a[1]-1,a[2])),c},numberToString:function(a){return g(a)?this.dateToString(new Date(1*a)):!1},dateToString:function(a){return a&&a.getFullYear?l(a.getUTCFullYear(),4)+"-"+l(a.getUTCMonth()+1,2)+"-"+l(a.getUTCDate(),2):!1}},time:{bad:function(b,c){if(!b||!b.split||!/\d$/.test(b))return!0;if(b=b.split(/\u003A/),b.length<2||b.length>3)return!0;var d,e=!1;return b[2]&&(b[2]=b[2].split(/\u002E/),d=parseInt(b[2][1],10),b[2]=b[2][0]),a.each(b,function(a,b){return j(b)&&2===b.length?void 0:(e=!0,!1)}),e?!0:b[0]>23||b[0]<0||b[1]>59||b[1]<0?!0:b[2]&&(b[2]>59||b[2]<0)?!0:d&&isNaN(d)?!0:(d&&(100>d?d*=100:10>d&&(d*=10)),c===!0?[b,d]:!1)},step:60,stepBase:0,stepScaleFactor:1e3,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e;return a=this.bad(a,!0),a!==!0&&(b=Date.UTC("1970",0,1,a[0][0],a[0][1],a[0][2]||0),a[1]&&(b+=a[1])),b},dateToString:function(a){if(a&&a.getUTCHours){var b=l(a.getUTCHours(),2)+":"+l(a.getUTCMinutes(),2),c=a.getSeconds();return"0"!=c&&(b+=":"+l(c,2)),c=a.getUTCMilliseconds(),"0"!=c&&(b+="."+l(c,3)),b}return!1}},month:{bad:function(a){return q.date.bad(a+"-01")},step:1,stepScaleFactor:!1,asDate:function(a){return new Date(q.date.asNumber(a+"-01"))},asNumber:function(a){var b=e;return a&&!this.bad(a)&&(a=a.split(/\u002D/),a[0]=1*a[0]-1970,a[1]=1*a[1]-1,b=12*a[0]+a[1]),b},numberToString:function(a){var b,c=!1;return g(a)&&(b=a%12,a=(a-b)/12+1970,b+=1,1>b&&(a-=1,b+=12),c=l(a,4)+"-"+l(b,2)),c},dateToString:function(a){if(a&&a.getUTCHours){var b=q.date.dateToString(a);return b.split&&(b=b.split(/\u002D/))?b[0]+"-"+b[1]:!1}return!1}},"datetime-local":{bad:function(a,b){return a&&a.split&&2===(a+"special").split(/\u0054/).length?(a=a.split(/\u0054/),q.date.bad(a[0])||q.time.bad(a[1],b)):!0},noAsDate:!0,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e,c=this.bad(a,!0);return c!==!0&&(a=a.split(/\u0054/)[0].split(/\u002D/),b=Date.UTC(a[0],a[1]-1,a[2],c[0][0],c[0][1],c[0][2]||0),c[1]&&(b+=c[1])),b},dateToString:function(a,b){return q.date.dateToString(a)+"T"+q.time.dateToString(a,b)}}};!n&&h("range")&&h("time")&&h("month")&&h("datetime-local")||(q.range=a.extend({},q.number,q.range),q.time=a.extend({},q.date,q.time),q.month=a.extend({},q.date,q.month),q["datetime-local"]=a.extend({},q.date,q.time,q["datetime-local"])),["number","month","range","date","time","color","datetime-local"].forEach(function(a){(n||!h(a))&&b.addInputType(a,q[a])}),null==a("<input />").prop("labels")&&b.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){if("hidden"==this.type)return null;var b=this.id,c=a(this).closest("label").filter(function(){var a=this.attributes["for"]||{};return!a.specified||a.value==b});return b&&(c=c.add('label[for="'+b+'"]')),c.get()},writeable:!1}})}),webshims.register("form-datalist",function(a,b,c,d,e,f){"use strict";var g=function(a){a&&"string"==typeof a||(a="DOM"),g[a+"Loaded"]||(g[a+"Loaded"]=!0,b.ready(a,function(){b.loader.loadList(["form-datalist-lazy"])}))},h={submit:1,button:1,reset:1,hidden:1,range:1,date:1,month:1};b.modules["form-number-date-ui"].loaded&&a.extend(h,{number:1,time:1}),b.propTypes.element=function(c,e){b.createPropDefault(c,"attr"),c.prop||(c.prop={get:function(){var b=a.attr(this,e);return b&&(b=d.getElementById(b),b&&c.propNodeName&&!a.nodeName(b,c.propNodeName)&&(b=null)),b||null},writeable:!1})},function(){var i=a.webshims.cfg.forms,j=Modernizr.input.list;if(!j||i.customDatalist){var k=function(){var c=function(){var b;!a.data(this,"datalistWidgetData")&&(b=a.prop(this,"id"))?a('input[list="'+b+'"], input[data-wslist="'+b+'"]').eq(0).attr("list",b):a(this).triggerHandler("updateDatalist")},d={autocomplete:{attr:{get:function(){var b=this,c=a.data(b,"datalistWidget");return c?c._autocomplete:"autocomplete"in b?b.autocomplete:b.getAttribute("autocomplete")},set:function(b){var c=this,d=a.data(c,"datalistWidget");d?(d._autocomplete=b,"off"==b&&d.hideList()):"autocomplete"in c?c.autocomplete=b:c.setAttribute("autocomplete",b)}}}};j?((a("<datalist><select><option></option></select></datalist>").prop("options")||[]).length||b.defineNodeNameProperty("datalist","options",{prop:{writeable:!1,get:function(){var b=this.options||[];if(!b.length){var c=this,d=a("select",c);d[0]&&d[0].options&&d[0].options.length&&(b=d[0].options)}return b}}}),d.list={attr:{get:function(){var c=b.contentAttr(this,"list");return null!=c?(a.data(this,"datalistListAttr",c),h[a.prop(this,"type")]||h[a.attr(this,"type")]||this.removeAttribute("list")):c=a.data(this,"datalistListAttr"),null==c?e:c},set:function(c){var d=this;a.data(d,"datalistListAttr",c),h[a.prop(this,"type")]||h[a.attr(this,"type")]?d.setAttribute("list",c):(b.objectCreate(l,e,{input:d,id:c,datalist:a.prop(d,"list")}),d.setAttribute("data-wslist",c)),a(d).triggerHandler("listdatalistchange")}},initAttr:!0,reflect:!0,propType:"element",propNodeName:"datalist"}):b.defineNodeNameProperties("input",{list:{attr:{get:function(){var a=b.contentAttr(this,"list");return null==a?e:a},set:function(c){var d=this;b.contentAttr(d,"list",c),b.objectCreate(f.shadowListProto,e,{input:d,id:c,datalist:a.prop(d,"list")}),a(d).triggerHandler("listdatalistchange")}},initAttr:!0,reflect:!0,propType:"element",propNodeName:"datalist"}}),b.defineNodeNameProperties("input",d),b.addReady(function(a,b){b.filter("datalist > select, datalist, datalist > option, datalist > select > option").closest("datalist").each(c)})},l={_create:function(d){if(!h[a.prop(d.input,"type")]&&!h[a.attr(d.input,"type")]){var e=d.datalist,f=a.data(d.input,"datalistWidget"),i=this;return e&&f&&f.datalist!==e?(f.datalist=e,f.id=d.id,a(f.datalist).off("updateDatalist.datalistWidget").on("updateDatalist.datalistWidget",a.proxy(f,"_resetListCached")),f._resetListCached(),void 0):e?(f&&f.datalist===e||(this.datalist=e,this.id=d.id,this.hasViewableData=!0,this._autocomplete=a.attr(d.input,"autocomplete"),a.data(d.input,"datalistWidget",this),a.data(e,"datalistWidgetData",this),g("WINDOWLOAD"),b.isReady("form-datalist-lazy")?c.QUnit?i._lazyCreate(d):setTimeout(function(){i._lazyCreate(d)},9):(a(d.input).one("focus",g),b.ready("form-datalist-lazy",function(){i._destroyed||i._lazyCreate(d)}))),void 0):(f&&f.destroy(),void 0)}},destroy:function(b){var f,g=a.attr(this.input,"autocomplete");a(this.input).off(".datalistWidget").removeData("datalistWidget"),this.shadowList.remove(),a(d).off(".datalist"+this.id),a(c).off(".datalist"+this.id),this.input.form&&this.input.id&&a(this.input.form).off("submit.datalistWidget"+this.input.id),this.input.removeAttribute("aria-haspopup"),g===e?this.input.removeAttribute("autocomplete"):a(this.input).attr("autocomplete",g),b&&"beforeunload"==b.type&&(f=this.input,setTimeout(function(){a.attr(f,"list",a.attr(f,"list"))},9)),this._destroyed=!0}};b.loader.addModule("form-datalist-lazy",{noAutoCallback:!0,options:a.extend(f,{shadowListProto:l})}),f.list||(f.list={}),k()}}()});
tomsoir/cdnjs
ajax/libs/webshim/1.12.3/minified/shims/combos/28.js
JavaScript
mit
30,280
!function(e){"use strict";function t(){}function n(e,t){if(s)return t.indexOf(e);for(var n=t.length;n--;)if(t[n]===e)return n;return-1}var i=t.prototype,r=[],s=r.indexOf?!0:!1;i.getListeners=function(e){var t=this._events||(this._events={});return t[e]||(t[e]=[])},i.addListener=function(e,t){var i=this.getListeners(e);return-1===n(t,i)&&i.push(t),this},i.removeListener=function(e,t){var i=this.getListeners(e),r=n(t,i);return-1!==r&&(i.splice(r,1),0===i.length&&(this._events[e]=null)),this},i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,u=e?this.removeListeners:this.addListeners;if("object"==typeof t)for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):u.call(this,i,r));else for(i=n.length;i--;)s.call(this,t,n[i]);return this},i.removeEvent=function(e){return e?this._events[e]=null:this._events=null,this},i.emitEvent=function(e,t){for(var n=this.getListeners(e),i=n.length;i--;)n[i].apply(null,t||r)===!0&&this.removeListener(e,n[i]);return this},"function"==typeof define&&define.amd?define(function(){return t}):e.EventEmitter=t}(this);
tjbp/cdnjs
ajax/libs/EventEmitter/4.0.1/EventEmitter.min.js
JavaScript
mit
1,260
/*! UIkit 2.10.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function(addon) { var component; if (jQuery && jQuery.UIkit) { component = addon(jQuery, jQuery.UIkit); } if (typeof define == "function" && define.amd) { define("uikit-cover", ["uikit"], function(){ return component || addon(jQuery, jQuery.UIkit); }); } })(function($, UI){ "use strict"; UI.component('cover', { defaults: { automute : true }, init: function() { this.parent = this.element.parent(); this.dimension = {w: this.element.width(), h: this.element.height()}; this.ratio = this.dimension.w / this.dimension.h; UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){ this.check(); }.bind(this), 100)); this.check(); this.element.data("cover", this); if (this.element.is('iframe') && this.options.automute) { var src = this.element.attr('src'); this.element.attr('src', '').on('load', function(){ this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*'); }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join('')); } }, check: function() { var w = this.parent.width(), h = this.parent.height(), width, height; // if element height < parent height (gap underneath) if ((w / this.ratio) < h) { width = Math.ceil(h * this.ratio); height = h; // element width < parent width (gap to right) } else { width = w; height = Math.ceil(w / this.ratio); } this.element.css({ 'width' : width, 'height' : height }); } }); // auto init UI.ready(function(context) { $("[data-uk-cover]", context).each(function(){ var ele = $(this); if(!ele.data("cover")) { var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover"))); } }); }); });
jonataswalker/jsdelivr
files/uikit/2.10.0/js/addons/cover.js
JavaScript
mit
2,349
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/Main.js * * Copyright (c) 2009-2014 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["STIXNonUnicode-bold-italic"]={directory:"NonUnicode/BoldItalic",family:"STIXNonUnicode",weight:"bold",style:"italic",Ranges:[[32,32,"All"],[160,160,"All"],[57344,63743,"PrivateUse"]]};MathJax.OutputJax["HTML-CSS"].initFont("STIXNonUnicode-bold-italic");MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/NonUnicode/BoldItalic/Main.js");
Flo-Schield-Bobby/cdnjs
ajax/libs/mathjax/2.4.0/jax/output/HTML-CSS/fonts/STIX/NonUnicode/BoldItalic/Main.js
JavaScript
mit
1,101
/* * tablesorter pager plugin * updated 9/8/2011 */ (function($) { $.extend({tablesorterPager: new function() { // hide arrows at extremes var pagerArrows = function(c) { if (c.updateArrows) { c.container.removeClass(c.cssDisabled); $(c.cssFirst + ',' + c.cssPrev + ',' + c.cssNext + ',' + c.cssLast, c.container).removeClass(c.cssDisabled); if (c.page === 0) { $(c.cssFirst + ',' + c.cssPrev, c.container).addClass(c.cssDisabled); } else if (c.page === c.totalPages - 1) { $(c.cssNext + ',' + c.cssLast, c.container).addClass(c.cssDisabled); } // if the total # of pages is less than the selected number of visible rows, then hide the pager if (c.totalRows < c.size) { c.container.addClass(c.cssDisabled); } } }, updatePageDisplay = function(table,c) { c.startRow = c.size * (c.page) + 1; c.endRow = Math.min(c.totalRows, c.size * (c.page+1)); var out = $(c.cssPageDisplay, c.container), // form the output string s = c.output.replace(/\{(page|totalPages|startRow|endRow|totalRows)\}/gi, function(m){ return { '{page}' : c.page + 1, '{totalPages}' : c.totalPages, '{startRow}' : c.startRow, '{endRow}' : c.endRow, '{totalRows}' : c.totalRows }[m]; }); if (out[0].tagName === 'INPUT') { out.val(s); } else { out.html(s); } pagerArrows(c); $(table).trigger('pagerComplete', c); }, fixPosition = function(table) { var c = table.config, o = $(table); if (!c.pagerPositionSet && c.positionFixed) { if (o.offset) { c.container.css({ top: o.offset().top + o.height() + 'px', position: 'absolute' }); } c.pagerPositionSet = true; } }, renderTable = function(table,rows) { var i, j, o, tableBody, c = table.config, l = rows.length, s = (c.page * c.size), e = (s + c.size); $(table).trigger('pagerChange',c); if (e > rows.length ) { e = rows.length; } tableBody = $(table.tBodies[0]); // clear the table body $.tablesorter.clearTableBody(table); for(i = s; i < e; i++) { //tableBody.append(rows[i]); o = rows[i]; l = o.length; for (j = 0; j < l; j++) { tableBody[0].appendChild(o[j]); } } fixPosition(table,tableBody); $(table).trigger("applyWidgets"); if( c.page >= c.totalPages ) { moveToLastPage(table); } updatePageDisplay(table,c); }, moveToPage = function(table) { var c = table.config; if (c.page < 0 || c.page > (c.totalPages-1)) { c.page = 0; } renderTable(table,c.rowsCopy); }, setPageSize = function(table,size) { var c = table.config; c.size = size; c.totalPages = Math.ceil(c.totalRows / c.size); c.pagerPositionSet = false; moveToPage(table); fixPosition(table); }, moveToFirstPage = function(table) { var c = table.config; c.page = 0; moveToPage(table); }, moveToLastPage = function(table) { var c = table.config; c.page = (c.totalPages-1); moveToPage(table); }, moveToNextPage = function(table) { var c = table.config; c.page++; if(c.page >= (c.totalPages-1)) { c.page = (c.totalPages-1); } moveToPage(table); }, moveToPrevPage = function(table) { var c = table.config; c.page--; if(c.page <= 0) { c.page = 0; } moveToPage(table); }, destroyPager = function(table){ var c = table.config; c.size = c.totalRows; c.totalPages = 1; renderTable(table,c.rowsCopy); // hide pager c.container.hide(); c.appender = null; $(table).unbind('destroy.pager'); }; this.appender = function(table,rows) { var c = table.config; c.rowsCopy = rows; c.totalRows = rows.length; c.totalPages = Math.ceil(c.totalRows / c.size); renderTable(table,rows); }; this.defaults = { size: 10, offset: 0, page: 0, totalRows: 0, totalPages: 0, container: null, cssNext: '.next', cssPrev: '.prev', cssFirst: '.first', cssLast: '.last', cssPageDisplay: '.pagedisplay', cssPageSize: '.pagesize', cssDisabled: 'disabled', output: '{page}/{totalPages}', // '{startRow} to {endRow} of {totalRows} rows', updateArrows: false, positionFixed: true, appender: this.appender }; this.construct = function(settings) { return this.each(function() { var config = $.extend(this.config, $.tablesorterPager.defaults, settings), table = this, pager = config.container; $(this).trigger("appendCache"); config.size = parseInt($(".pagesize",pager).val(), 10); pagerArrows(config); $(config.cssFirst,pager).click(function() { moveToFirstPage(table); return false; }); $(config.cssNext,pager).click(function() { moveToNextPage(table); return false; }); $(config.cssPrev,pager).click(function() { moveToPrevPage(table); return false; }); $(config.cssLast,pager).click(function() { moveToLastPage(table); return false; }); $(config.cssPageSize,pager).change(function() { setPageSize(table,parseInt($(this).val(), 10)); return false; }); $(this).bind('destroy.pager', function(){ destroyPager(table); }); }); }; } }); // extend plugin scope $.fn.extend({ tablesorterPager: $.tablesorterPager.construct }); })(jQuery);
contentfree/cdnjs
ajax/libs/jquery.tablesorter/2.0.16/addons/pager/jquery.tablesorter.pager.js
JavaScript
mit
5,353
var grunt = require('grunt'); var path = require('path'); module.exports = helper = {}; // where are fixtures are helper.fixtures = path.join(__dirname, '..', 'fixtures'); // If verbose flag set, display output helper.verboseLog = function() {}; if (grunt.util._.indexOf(process.argv, '-v') !== -1) { helper.verboseLog = function() { console.log.apply(null, arguments); }; } // helper for creating assertTasks for testing tasks in child processes helper.assertTask = function assertTask(task, options) { var spawn = require('child_process').spawn; task = task || 'default'; options = options || {}; // get next/kill process trigger var trigger = options.trigger || '.*(Waiting).*'; delete options.trigger; // CWD to spawn var cwd = options.cwd || process.cwd(); delete options.cwd; // Use grunt this process uses var spawnOptions = [process.argv[1]]; // Turn options into spawn options grunt.util._.each(options, function(val, key) { spawnOptions.push('--' + key); spawnOptions.push(val); }); // Add the tasks to run spawnOptions = spawnOptions.concat(task); // Return an interface for testing this task function returnFunc(runs, done) { // Spawn the node this process uses var spawnGrunt = spawn(process.argv[0], spawnOptions, {cwd:cwd}); var out = ''; if (!grunt.util._.isArray(runs)) { runs = [runs]; } // Append a last function to kill spawnGrunt runs.push(function() { spawnGrunt.kill('SIGINT'); }); // After watch starts waiting, run our commands then exit spawnGrunt.stdout.on('data', function(data) { data = grunt.log.uncolor(String(data)); out += data; // If we should run the next function var shouldRun = true; // If our trigger has been found if (trigger !== false) { shouldRun = (new RegExp(trigger, 'gm')).test(data); } // Run the function if (shouldRun) { setTimeout(function() { var run = runs.shift(); if (typeof run === 'function') { run(); } }, 500); } }); // Throw errors for better testing spawnGrunt.stderr.on('data', function(data) { throw new Error(data); }); // On process exit return what has been outputted spawnGrunt.on('exit', function() { done(out); }); } returnFunc.options = options; return returnFunc; }; // clean up files within fixtures helper.cleanUp = function cleanUp(files) { if (typeof files === 'string') files = [files]; files.forEach(function(filepath) { filepath = path.join(helper.fixtures, filepath); if (grunt.file.exists(filepath)) { grunt.file.delete(filepath); } }); }; // Helper for testing cross platform helper.unixify = function(str) { return str.replace(/\\/g, '/').replace(/\r\n|\n/g, '\n'); };
mundoludic/reflexiones-ludicas
node_modules/grunt-contrib-watch/test/tasks/helper.js
JavaScript
mit
2,843
/* * /MathJax/localization/br/MathML.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.Localization.addTranslation("br","MathML",{version:"2.5.0",isLoaded:true,strings:{BadMglyph:"mglyph fall : %1",BadMglyphFont:"Font fall : %1",UnknownNodeType:"Seurt skoulm dianav : %1",UnexpectedTextNode:"Skoulm testenn dic'hortoz : %1",ErrorParsingMathML:"Fazi o tielfenna\u00F1 MathML",ParsingError:"Fazi o ielfenna\u00F1 MathML : %1",MathMLSingleElement:"MathML a rank beza\u00F1 stummet gant un elfenn hepken",MathMLRootElement:"Gant un elfenn \u003Cmath\u003E e rank beza\u00F1 stummet MathML, ha ket gant %1"}});MathJax.Ajax.loadComplete("[MathJax]/localization/br/MathML.js");
xymostech/cdnjs
ajax/libs/mathjax/2.5.1/localization/br/MathML.js
JavaScript
mit
1,260
/* * /MathJax/localization/pt-br/FontWarnings.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.Localization.addTranslation("pt-br","FontWarnings",{version:"2.5.0",isLoaded:true,strings:{webFont:"O MathJax est\u00E1 utilizando fontes baseadas em web para exibir as f\u00F3rmulas matem\u00E1ticas desta p\u00E1gina. O download delas leva algum tempo, ent\u00E3o a p\u00E1gina seria renderizada mais rapidamente se voc\u00EA instalasse as fontes para matem\u00E1tica diretamente na pasta de fontes do seu sistema.",imageFonts:"O MathJax est\u00E1 utilizando fontes feitas com imagens em vez de fontes locais ou baseadas em web. Isso torna a renderiza\u00E7\u00E3o mais lenta do que o de costume, e as f\u00F3rmulas matem\u00E1ticas poder\u00E3o n\u00E3o ser impressas com a maior resolu\u00E7\u00E3o dispon\u00EDvel em sua impressora.",noFonts:"O MathJax n\u00E3o foi capaz de localizar uma fonte para utilizar ao renderizar as f\u00F3rmulas matem\u00E1ticas, e n\u00E3o est\u00E3o dispon\u00EDveis fontes feitas com imagens, ent\u00E3o ser\u00E3o utilizados caracteres unicode gen\u00E9ricos com a esperan\u00E7a de que o seu navegador seja capaz de exib\u00ED-los. Alguns caracteres podem n\u00E3o aparecer como deveriam, ou simplesmente desaparecer.",webFonts:"A maioria dos navegadores modernos permite que as fontes sejam baixadas a partir da web. Atualizar para uma vers\u00E3o mais recente do seu navegador (ou mudar de navegador) poderia melhorar a qualidade das f\u00F3rmulas matem\u00E1ticas desta p\u00E1gina.",fonts:"O MathJax pode usar tanto [fontes STIX](%1) ou as [fontes MathJax TeX](%2). Baixe e instale uma destas fontes para melhorar sua experi\u00EAncia com o MathJax.",STIXPage:"Esta p\u00E1gina foi projetada para utilizar [fontes STIX](%1). Baixe e instale estas fontes para melhorar sua experi\u00EAncia com o MathJax.",TeXPage:"Esta p\u00E1gina foi projetada para utilizar [fontes MathJax TeX](%1). Baixe e instale estas fontes para melhorar sua experi\u00EAncia com o MathJax."}});MathJax.Ajax.loadComplete("[MathJax]/localization/pt-br/FontWarnings.js");
liubo404/cdnjs
ajax/libs/mathjax/2.5.0/localization/pt-br/FontWarnings.js
JavaScript
mit
2,670
/* * /MathJax/localization/pt-br/FontWarnings.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.Localization.addTranslation("pt-br","FontWarnings",{version:"2.5.0",isLoaded:true,strings:{webFont:"O MathJax est\u00E1 utilizando fontes baseadas em web para exibir as f\u00F3rmulas matem\u00E1ticas desta p\u00E1gina. O download delas leva algum tempo, ent\u00E3o a p\u00E1gina seria renderizada mais rapidamente se voc\u00EA instalasse as fontes para matem\u00E1tica diretamente na pasta de fontes do seu sistema.",imageFonts:"O MathJax est\u00E1 utilizando fontes feitas com imagens em vez de fontes locais ou baseadas em web. Isso torna a renderiza\u00E7\u00E3o mais lenta do que o de costume, e as f\u00F3rmulas matem\u00E1ticas poder\u00E3o n\u00E3o ser impressas com a maior resolu\u00E7\u00E3o dispon\u00EDvel em sua impressora.",noFonts:"O MathJax n\u00E3o foi capaz de localizar uma fonte para utilizar ao renderizar as f\u00F3rmulas matem\u00E1ticas, e n\u00E3o est\u00E3o dispon\u00EDveis fontes feitas com imagens, ent\u00E3o ser\u00E3o utilizados caracteres unicode gen\u00E9ricos com a esperan\u00E7a de que o seu navegador seja capaz de exib\u00ED-los. Alguns caracteres podem n\u00E3o aparecer como deveriam, ou simplesmente desaparecer.",webFonts:"A maioria dos navegadores modernos permite que as fontes sejam baixadas a partir da web. Atualizar para uma vers\u00E3o mais recente do seu navegador (ou mudar de navegador) poderia melhorar a qualidade das f\u00F3rmulas matem\u00E1ticas desta p\u00E1gina.",fonts:"O MathJax pode usar tanto [fontes STIX](%1) ou as [fontes MathJax TeX](%2). Baixe e instale uma destas fontes para melhorar sua experi\u00EAncia com o MathJax.",STIXPage:"Esta p\u00E1gina foi projetada para utilizar [fontes STIX](%1). Baixe e instale estas fontes para melhorar sua experi\u00EAncia com o MathJax.",TeXPage:"Esta p\u00E1gina foi projetada para utilizar [fontes MathJax TeX](%1). Baixe e instale estas fontes para melhorar sua experi\u00EAncia com o MathJax."}});MathJax.Ajax.loadComplete("[MathJax]/localization/pt-br/FontWarnings.js");
hibrahimsafak/cdnjs
ajax/libs/mathjax/2.5.0/localization/pt-br/FontWarnings.js
JavaScript
mit
2,670
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * 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. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * File Uploading Class * * @package CodeIgniter * @subpackage Libraries * @category Uploads * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/libraries/file_uploading.html */ class CI_Upload { /** * Maximum file size * * @var int */ public $max_size = 0; /** * Maximum image width * * @var int */ public $max_width = 0; /** * Maximum image height * * @var int */ public $max_height = 0; /** * Minimum image width * * @var int */ public $min_width = 0; /** * Minimum image height * * @var int */ public $min_height = 0; /** * Maximum filename length * * @var int */ public $max_filename = 0; /** * Maximum duplicate filename increment ID * * @var int */ public $max_filename_increment = 100; /** * Allowed file types * * @var string */ public $allowed_types = ''; /** * Temporary filename * * @var string */ public $file_temp = ''; /** * Filename * * @var string */ public $file_name = ''; /** * Original filename * * @var string */ public $orig_name = ''; /** * File type * * @var string */ public $file_type = ''; /** * File size * * @var int */ public $file_size = NULL; /** * Filename extension * * @var string */ public $file_ext = ''; /** * Force filename extension to lowercase * * @var string */ public $file_ext_tolower = FALSE; /** * Upload path * * @var string */ public $upload_path = ''; /** * Overwrite flag * * @var bool */ public $overwrite = FALSE; /** * Obfuscate filename flag * * @var bool */ public $encrypt_name = FALSE; /** * Is image flag * * @var bool */ public $is_image = FALSE; /** * Image width * * @var int */ public $image_width = NULL; /** * Image height * * @var int */ public $image_height = NULL; /** * Image type * * @var string */ public $image_type = ''; /** * Image size string * * @var string */ public $image_size_str = ''; /** * Error messages list * * @var array */ public $error_msg = array(); /** * Remove spaces flag * * @var bool */ public $remove_spaces = TRUE; /** * MIME detection flag * * @var bool */ public $detect_mime = TRUE; /** * XSS filter flag * * @var bool */ public $xss_clean = FALSE; /** * Apache mod_mime fix flag * * @var bool */ public $mod_mime_fix = TRUE; /** * Temporary filename prefix * * @var string */ public $temp_prefix = 'temp_file_'; /** * Filename sent by the client * * @var bool */ public $client_name = ''; // -------------------------------------------------------------------- /** * Filename override * * @var string */ protected $_file_name_override = ''; /** * MIME types list * * @var array */ protected $_mimes = array(); /** * CI Singleton * * @var object */ protected $_CI; // -------------------------------------------------------------------- /** * Constructor * * @param array $props * @return void */ public function __construct($config = array()) { empty($config) OR $this->initialize($config, FALSE); $this->_mimes =& get_mimes(); $this->_CI =& get_instance(); log_message('info', 'Upload Class Initialized'); } // -------------------------------------------------------------------- /** * Initialize preferences * * @param array $config * @param bool $reset * @return CI_Upload */ public function initialize(array $config = array(), $reset = TRUE) { $reflection = new ReflectionClass($this); if ($reset === TRUE) { $defaults = $reflection->getDefaultProperties(); foreach (array_keys($defaults) as $key) { if ($key[0] === '_') { continue; } if (isset($config[$key])) { if ($reflection->hasMethod('set_'.$key)) { $this->{'set_'.$key}($config[$key]); } else { $this->$key = $config[$key]; } } else { $this->$key = $defaults[$key]; } } } else { foreach ($config as $key => &$value) { if ($key[0] !== '_' && $reflection->hasProperty($key)) { if ($reflection->hasMethod('set_'.$key)) { $this->{'set_'.$key}($value); } else { $this->$key = $value; } } } } // if a file_name was provided in the config, use it instead of the user input // supplied file name for all uploads until initialized again $this->_file_name_override = $this->file_name; return $this; } // -------------------------------------------------------------------- /** * Perform the file upload * * @param string $field * @return bool */ public function do_upload($field = 'userfile') { // Is $_FILES[$field] set? If not, no reason to continue. if (isset($_FILES[$field])) { $_file = $_FILES[$field]; } // Does the field name contain array notation? elseif (($c = preg_match_all('/(?:^[^\[]+)|\[[^]]*\]/', $field, $matches)) > 1) { $_file = $_FILES; for ($i = 0; $i < $c; $i++) { // We can't track numeric iterations, only full field names are accepted if (($field = trim($matches[0][$i], '[]')) === '' OR ! isset($_file[$field])) { $_file = NULL; break; } $_file = $_file[$field]; } } if ( ! isset($_file)) { $this->set_error('upload_no_file_selected', 'debug'); return FALSE; } // Is the upload path valid? if ( ! $this->validate_upload_path()) { // errors will already be set by validate_upload_path() so just return FALSE return FALSE; } // Was the file able to be uploaded? If not, determine the reason why. if ( ! is_uploaded_file($_file['tmp_name'])) { $error = isset($_file['error']) ? $_file['error'] : 4; switch ($error) { case UPLOAD_ERR_INI_SIZE: $this->set_error('upload_file_exceeds_limit', 'info'); break; case UPLOAD_ERR_FORM_SIZE: $this->set_error('upload_file_exceeds_form_limit', 'info'); break; case UPLOAD_ERR_PARTIAL: $this->set_error('upload_file_partial', 'debug'); break; case UPLOAD_ERR_NO_FILE: $this->set_error('upload_no_file_selected', 'debug'); break; case UPLOAD_ERR_NO_TMP_DIR: $this->set_error('upload_no_temp_directory', 'error'); break; case UPLOAD_ERR_CANT_WRITE: $this->set_error('upload_unable_to_write_file', 'error'); break; case UPLOAD_ERR_EXTENSION: $this->set_error('upload_stopped_by_extension', 'debug'); break; default: $this->set_error('upload_no_file_selected', 'debug'); break; } return FALSE; } // Set the uploaded data as class variables $this->file_temp = $_file['tmp_name']; $this->file_size = $_file['size']; // Skip MIME type detection? if ($this->detect_mime !== FALSE) { $this->_file_mime_type($_file); } $this->file_type = preg_replace('/^(.+?);.*$/', '\\1', $this->file_type); $this->file_type = strtolower(trim(stripslashes($this->file_type), '"')); $this->file_name = $this->_prep_filename($_file['name']); $this->file_ext = $this->get_extension($this->file_name); $this->client_name = $this->file_name; // Is the file type allowed to be uploaded? if ( ! $this->is_allowed_filetype()) { $this->set_error('upload_invalid_filetype', 'debug'); return FALSE; } // if we're overriding, let's now make sure the new name and type is allowed if ($this->_file_name_override !== '') { $this->file_name = $this->_prep_filename($this->_file_name_override); // If no extension was provided in the file_name config item, use the uploaded one if (strpos($this->_file_name_override, '.') === FALSE) { $this->file_name .= $this->file_ext; } else { // An extension was provided, let's have it! $this->file_ext = $this->get_extension($this->_file_name_override); } if ( ! $this->is_allowed_filetype(TRUE)) { $this->set_error('upload_invalid_filetype', 'debug'); return FALSE; } } // Convert the file size to kilobytes if ($this->file_size > 0) { $this->file_size = round($this->file_size/1024, 2); } // Is the file size within the allowed maximum? if ( ! $this->is_allowed_filesize()) { $this->set_error('upload_invalid_filesize', 'info'); return FALSE; } // Are the image dimensions within the allowed size? // Note: This can fail if the server has an open_basedir restriction. if ( ! $this->is_allowed_dimensions()) { $this->set_error('upload_invalid_dimensions', 'info'); return FALSE; } // Sanitize the file name for security $this->file_name = $this->_CI->security->sanitize_filename($this->file_name); // Truncate the file name if it's too long if ($this->max_filename > 0) { $this->file_name = $this->limit_filename_length($this->file_name, $this->max_filename); } // Remove white spaces in the name if ($this->remove_spaces === TRUE) { $this->file_name = preg_replace('/\s+/', '_', $this->file_name); } if ($this->file_ext_tolower && ($ext_length = strlen($this->file_ext))) { // file_ext was previously lower-cased by a get_extension() call $this->file_name = substr($this->file_name, 0, -$ext_length).$this->file_ext; } /* * Validate the file name * This function appends an number onto the end of * the file if one with the same name already exists. * If it returns false there was a problem. */ $this->orig_name = $this->file_name; if (FALSE === ($this->file_name = $this->set_filename($this->upload_path, $this->file_name))) { return FALSE; } /* * Run the file through the XSS hacking filter * This helps prevent malicious code from being * embedded within a file. Scripts can easily * be disguised as images or other file types. */ if ($this->xss_clean && $this->do_xss_clean() === FALSE) { $this->set_error('upload_unable_to_write_file', 'error'); return FALSE; } /* * Move the file to the final destination * To deal with different server configurations * we'll attempt to use copy() first. If that fails * we'll use move_uploaded_file(). One of the two should * reliably work in most environments */ if ( ! @copy($this->file_temp, $this->upload_path.$this->file_name)) { if ( ! @move_uploaded_file($this->file_temp, $this->upload_path.$this->file_name)) { $this->set_error('upload_destination_error', 'error'); return FALSE; } } /* * Set the finalized image dimensions * This sets the image width/height (assuming the * file was an image). We use this information * in the "data" function. */ $this->set_image_properties($this->upload_path.$this->file_name); return TRUE; } // -------------------------------------------------------------------- /** * Finalized Data Array * * Returns an associative array containing all of the information * related to the upload, allowing the developer easy access in one array. * * @param string $index * @return mixed */ public function data($index = NULL) { $data = array( 'file_name' => $this->file_name, 'file_type' => $this->file_type, 'file_path' => $this->upload_path, 'full_path' => $this->upload_path.$this->file_name, 'raw_name' => str_replace($this->file_ext, '', $this->file_name), 'orig_name' => $this->orig_name, 'client_name' => $this->client_name, 'file_ext' => $this->file_ext, 'file_size' => $this->file_size, 'is_image' => $this->is_image(), 'image_width' => $this->image_width, 'image_height' => $this->image_height, 'image_type' => $this->image_type, 'image_size_str' => $this->image_size_str, ); if ( ! empty($index)) { return isset($data[$index]) ? $data[$index] : NULL; } return $data; } // -------------------------------------------------------------------- /** * Set Upload Path * * @param string $path * @return CI_Upload */ public function set_upload_path($path) { // Make sure it has a trailing slash $this->upload_path = rtrim($path, '/').'/'; return $this; } // -------------------------------------------------------------------- /** * Set the file name * * This function takes a filename/path as input and looks for the * existence of a file with the same name. If found, it will append a * number to the end of the filename to avoid overwriting a pre-existing file. * * @param string $path * @param string $filename * @return string */ public function set_filename($path, $filename) { if ($this->encrypt_name === TRUE) { $filename = md5(uniqid(mt_rand())).$this->file_ext; } if ($this->overwrite === TRUE OR ! file_exists($path.$filename)) { return $filename; } $filename = str_replace($this->file_ext, '', $filename); $new_filename = ''; for ($i = 1; $i < $this->max_filename_increment; $i++) { if ( ! file_exists($path.$filename.$i.$this->file_ext)) { $new_filename = $filename.$i.$this->file_ext; break; } } if ($new_filename === '') { $this->set_error('upload_bad_filename', 'debug'); return FALSE; } else { return $new_filename; } } // -------------------------------------------------------------------- /** * Set Maximum File Size * * @param int $n * @return CI_Upload */ public function set_max_filesize($n) { $this->max_size = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set Maximum File Size * * An internal alias to set_max_filesize() to help with configuration * as initialize() will look for a set_<property_name>() method ... * * @param int $n * @return CI_Upload */ protected function set_max_size($n) { return $this->set_max_filesize($n); } // -------------------------------------------------------------------- /** * Set Maximum File Name Length * * @param int $n * @return CI_Upload */ public function set_max_filename($n) { $this->max_filename = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set Maximum Image Width * * @param int $n * @return CI_Upload */ public function set_max_width($n) { $this->max_width = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set Maximum Image Height * * @param int $n * @return CI_Upload */ public function set_max_height($n) { $this->max_height = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set minimum image width * * @param int $n * @return CI_Upload */ public function set_min_width($n) { $this->min_width = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set minimum image height * * @param int $n * @return CI_Upload */ public function set_min_height($n) { $this->min_height = ($n < 0) ? 0 : (int) $n; return $this; } // -------------------------------------------------------------------- /** * Set Allowed File Types * * @param mixed $types * @return CI_Upload */ public function set_allowed_types($types) { $this->allowed_types = (is_array($types) OR $types === '*') ? $types : explode('|', $types); return $this; } // -------------------------------------------------------------------- /** * Set Image Properties * * Uses GD to determine the width/height/type of image * * @param string $path * @return CI_Upload */ public function set_image_properties($path = '') { if ($this->is_image() && function_exists('getimagesize')) { if (FALSE !== ($D = @getimagesize($path))) { $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); $this->image_width = $D[0]; $this->image_height = $D[1]; $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown'; $this->image_size_str = $D[3]; // string containing height and width } } return $this; } // -------------------------------------------------------------------- /** * Set XSS Clean * * Enables the XSS flag so that the file that was uploaded * will be run through the XSS filter. * * @param bool $flag * @return CI_Upload */ public function set_xss_clean($flag = FALSE) { $this->xss_clean = ($flag === TRUE); return $this; } // -------------------------------------------------------------------- /** * Validate the image * * @return bool */ public function is_image() { // IE will sometimes return odd mime-types during upload, so here we just standardize all // jpegs or pngs to the same file type. $png_mimes = array('image/x-png'); $jpeg_mimes = array('image/jpg', 'image/jpe', 'image/jpeg', 'image/pjpeg'); if (in_array($this->file_type, $png_mimes)) { $this->file_type = 'image/png'; } elseif (in_array($this->file_type, $jpeg_mimes)) { $this->file_type = 'image/jpeg'; } $img_mimes = array('image/gif', 'image/jpeg', 'image/png'); return in_array($this->file_type, $img_mimes, TRUE); } // -------------------------------------------------------------------- /** * Verify that the filetype is allowed * * @param bool $ignore_mime * @return bool */ public function is_allowed_filetype($ignore_mime = FALSE) { if ($this->allowed_types === '*') { return TRUE; } if (empty($this->allowed_types) OR ! is_array($this->allowed_types)) { $this->set_error('upload_no_file_types', 'debug'); return FALSE; } $ext = strtolower(ltrim($this->file_ext, '.')); if ( ! in_array($ext, $this->allowed_types, TRUE)) { return FALSE; } // Images get some additional checks if (in_array($ext, array('gif', 'jpg', 'jpeg', 'jpe', 'png'), TRUE) && @getimagesize($this->file_temp) === FALSE) { return FALSE; } if ($ignore_mime === TRUE) { return TRUE; } if (isset($this->_mimes[$ext])) { return is_array($this->_mimes[$ext]) ? in_array($this->file_type, $this->_mimes[$ext], TRUE) : ($this->_mimes[$ext] === $this->file_type); } return FALSE; } // -------------------------------------------------------------------- /** * Verify that the file is within the allowed size * * @return bool */ public function is_allowed_filesize() { return ($this->max_size === 0 OR $this->max_size > $this->file_size); } // -------------------------------------------------------------------- /** * Verify that the image is within the allowed width/height * * @return bool */ public function is_allowed_dimensions() { if ( ! $this->is_image()) { return TRUE; } if (function_exists('getimagesize')) { $D = @getimagesize($this->file_temp); if ($this->max_width > 0 && $D[0] > $this->max_width) { return FALSE; } if ($this->max_height > 0 && $D[1] > $this->max_height) { return FALSE; } if ($this->min_width > 0 && $D[0] < $this->min_width) { return FALSE; } if ($this->min_height > 0 && $D[1] < $this->min_height) { return FALSE; } } return TRUE; } // -------------------------------------------------------------------- /** * Validate Upload Path * * Verifies that it is a valid upload path with proper permissions. * * @return bool */ public function validate_upload_path() { if ($this->upload_path === '') { $this->set_error('upload_no_filepath', 'error'); return FALSE; } if (realpath($this->upload_path) !== FALSE) { $this->upload_path = str_replace('\\', '/', realpath($this->upload_path)); } if ( ! is_dir($this->upload_path)) { $this->set_error('upload_no_filepath', 'error'); return FALSE; } if ( ! is_really_writable($this->upload_path)) { $this->set_error('upload_not_writable', 'error'); return FALSE; } $this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path); return TRUE; } // -------------------------------------------------------------------- /** * Extract the file extension * * @param string $filename * @return string */ public function get_extension($filename) { $x = explode('.', $filename); if (count($x) === 1) { return ''; } $ext = ($this->file_ext_tolower) ? strtolower(end($x)) : end($x); return '.'.$ext; } // -------------------------------------------------------------------- /** * Limit the File Name Length * * @param string $filename * @param int $length * @return string */ public function limit_filename_length($filename, $length) { if (strlen($filename) < $length) { return $filename; } $ext = ''; if (strpos($filename, '.') !== FALSE) { $parts = explode('.', $filename); $ext = '.'.array_pop($parts); $filename = implode('.', $parts); } return substr($filename, 0, ($length - strlen($ext))).$ext; } // -------------------------------------------------------------------- /** * Runs the file through the XSS clean function * * This prevents people from embedding malicious code in their files. * I'm not sure that it won't negatively affect certain files in unexpected ways, * but so far I haven't found that it causes trouble. * * @return string */ public function do_xss_clean() { $file = $this->file_temp; if (filesize($file) == 0) { return FALSE; } if (memory_get_usage() && ($memory_limit = ini_get('memory_limit'))) { $memory_limit *= 1024 * 1024; // There was a bug/behavioural change in PHP 5.2, where numbers over one million get output // into scientific notation. number_format() ensures this number is an integer // http://bugs.php.net/bug.php?id=43053 $memory_limit = number_format(ceil(filesize($file) + $memory_limit), 0, '.', ''); ini_set('memory_limit', $memory_limit); // When an integer is used, the value is measured in bytes. - PHP.net } // If the file being uploaded is an image, then we should have no problem with XSS attacks (in theory), but // IE can be fooled into mime-type detecting a malformed image as an html file, thus executing an XSS attack on anyone // using IE who looks at the image. It does this by inspecting the first 255 bytes of an image. To get around this // CI will itself look at the first 255 bytes of an image to determine its relative safety. This can save a lot of // processor power and time if it is actually a clean image, as it will be in nearly all instances _except_ an // attempted XSS attack. if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) { if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary { return FALSE; // Couldn't open the file, return FALSE } $opening_bytes = fread($file, 256); fclose($file); // These are known to throw IE into mime-type detection chaos // <a, <body, <head, <html, <img, <plaintext, <pre, <script, <table, <title // title is basically just in SVG, but we filter it anyhow // if it's an image or no "triggers" detected in the first 256 bytes - we're good return ! preg_match('/<(a|body|head|html|img|plaintext|pre|script|table|title)[\s>]/i', $opening_bytes); } if (($data = @file_get_contents($file)) === FALSE) { return FALSE; } return $this->_CI->security->xss_clean($data, TRUE); } // -------------------------------------------------------------------- /** * Set an error message * * @param string $msg * @return CI_Upload */ public function set_error($msg, $log_level = 'error') { $this->_CI->lang->load('upload'); is_array($msg) OR $msg = array($msg); foreach ($msg as $val) { $msg = ($this->_CI->lang->line($val) === FALSE) ? $val : $this->_CI->lang->line($val); $this->error_msg[] = $msg; log_message($log_level, $msg); } return $this; } // -------------------------------------------------------------------- /** * Display the error message * * @param string $open * @param string $close * @return string */ public function display_errors($open = '<p>', $close = '</p>') { return (count($this->error_msg) > 0) ? $open.implode($close.$open, $this->error_msg).$close : ''; } // -------------------------------------------------------------------- /** * Prep Filename * * Prevents possible script execution from Apache's handling * of files' multiple extensions. * * @link http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext * * @param string $filename * @return string */ protected function _prep_filename($filename) { if ($this->mod_mime_fix === FALSE OR $this->allowed_types === '*' OR ($ext_pos = strrpos($filename, '.')) === FALSE) { return $filename; } $ext = substr($filename, $ext_pos); $filename = substr($filename, 0, $ext_pos); return str_replace('.', '_', $filename).$ext; } // -------------------------------------------------------------------- /** * File MIME type * * Detects the (actual) MIME type of the uploaded file, if possible. * The input array is expected to be $_FILES[$field] * * @param array $file * @return void */ protected function _file_mime_type($file) { // We'll need this to validate the MIME info string (e.g. text/plain; charset=us-ascii) $regexp = '/^([a-z\-]+\/[a-z0-9\-\.\+]+)(;\s.+)?$/'; /* Fileinfo extension - most reliable method * * Unfortunately, prior to PHP 5.3 - it's only available as a PECL extension and the * more convenient FILEINFO_MIME_TYPE flag doesn't exist. */ if (function_exists('finfo_file')) { $finfo = @finfo_open(FILEINFO_MIME); if (is_resource($finfo)) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system { $mime = @finfo_file($finfo, $file['tmp_name']); finfo_close($finfo); /* According to the comments section of the PHP manual page, * it is possible that this function returns an empty string * for some files (e.g. if they don't exist in the magic MIME database) */ if (is_string($mime) && preg_match($regexp, $mime, $matches)) { $this->file_type = $matches[1]; return; } } } /* This is an ugly hack, but UNIX-type systems provide a "native" way to detect the file type, * which is still more secure than depending on the value of $_FILES[$field]['type'], and as it * was reported in issue #750 (https://github.com/EllisLab/CodeIgniter/issues/750) - it's better * than mime_content_type() as well, hence the attempts to try calling the command line with * three different functions. * * Notes: * - the DIRECTORY_SEPARATOR comparison ensures that we're not on a Windows system * - many system admins would disable the exec(), shell_exec(), popen() and similar functions * due to security concerns, hence the function_usable() checks */ if (DIRECTORY_SEPARATOR !== '\\') { $cmd = function_exists('escapeshellarg') ? 'file --brief --mime '.escapeshellarg($file['tmp_name']).' 2>&1' : 'file --brief --mime '.$file['tmp_name'].' 2>&1'; if (function_usable('exec')) { /* This might look confusing, as $mime is being populated with all of the output when set in the second parameter. * However, we only need the last line, which is the actual return value of exec(), and as such - it overwrites * anything that could already be set for $mime previously. This effectively makes the second parameter a dummy * value, which is only put to allow us to get the return status code. */ $mime = @exec($cmd, $mime, $return_status); if ($return_status === 0 && is_string($mime) && preg_match($regexp, $mime, $matches)) { $this->file_type = $matches[1]; return; } } if ( ! ini_get('safe_mode') && function_usable('shell_exec')) { $mime = @shell_exec($cmd); if (strlen($mime) > 0) { $mime = explode("\n", trim($mime)); if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) { $this->file_type = $matches[1]; return; } } } if (function_usable('popen')) { $proc = @popen($cmd, 'r'); if (is_resource($proc)) { $mime = @fread($proc, 512); @pclose($proc); if ($mime !== FALSE) { $mime = explode("\n", trim($mime)); if (preg_match($regexp, $mime[(count($mime) - 1)], $matches)) { $this->file_type = $matches[1]; return; } } } } } // Fall back to the deprecated mime_content_type(), if available (still better than $_FILES[$field]['type']) if (function_exists('mime_content_type')) { $this->file_type = @mime_content_type($file['tmp_name']); if (strlen($this->file_type) > 0) // It's possible that mime_content_type() returns FALSE or an empty string { return; } } $this->file_type = $file['type']; } }
nvizero/deer
system/libraries/Upload.php
PHP
mit
30,820
/* * /MathJax/localization/pt/TeX.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.Localization.addTranslation("pt","TeX",{version:"2.5.0",isLoaded:true,strings:{ExtraOpenMissingClose:"Chaveta de abertura a mais ou chaveta de fecho a menos",ExtraCloseMissingOpen:"Chaveta de fecho a mais ou chaveta de abertura a menos",MissingLeftExtraRight:"Falta um \\left ou h\u00E1 um \\right a mais",MissingScript:"Falta o valor de um sobrescrito ou de um subscrito",ExtraLeftMissingRight:"Falta um \\right ou h\u00E1 um \\left a mais",Misplaced:"%1 fora do lugar",MissingOpenForSub:"Falta a chaveta de abertura para o subscrito",MissingOpenForSup:"Falta a chaveta de abertura para o sobrescrito",AmbiguousUseOf:"Uso amb\u00EDguo de %1",EnvBadEnd:"\\begin{%1} foi terminado com \\end{%2}",EnvMissingEnd:"\\end{%1} em falta",MissingBoxFor:"Falta uma caixa para %1",MissingCloseBrace:"Falta chaveta de fecho",UndefinedControlSequence:"Sequ\u00EAncia de controlo indefinida %1",DoubleExponent:"Expoente duplo: use chavetas para clarificar",DoubleSubscripts:"Subscrito duplo: use chavetas para clarificar",DoubleExponentPrime:"\u00C9 amb\u00EDguo a que diz respeito a plica (\u2032): use chavetas para clarificar",CantUseHash1:"Voc\u00EA n\u00E3o pode usar o caractere # que indica um par\u00E2metro de macro no modo matem\u00E1tico",MisplacedMiddle:"%1 deve estar entre \\left e \\right",MisplacedLimits:"%1 s\u00F3 \u00E9 permitido em operadores",MisplacedMoveRoot:"%1 s\u00F3 pode ser usado dentro de uma raiz",MultipleCommand:"Repeti\u00E7\u00E3o de %1",IntegerArg:"O argumento de %1 deve ser um inteiro",NotMathMLToken:"%1 n\u00E3o \u00E9 um elemento de token v\u00E1lido",InvalidMathMLAttr:"Atributo MathML inv\u00E1lido: %1",UnknownAttrForElement:"%1 n\u00E3o \u00E9 um atributo reconhecido para %2",MaxMacroSub1:"Foi excedido o m\u00E1ximo de substitui\u00E7\u00F5es de macros do MathJax; h\u00E1 alguma chamada a uma macro recursiva?",MaxMacroSub2:"Foi excedido o m\u00E1ximo de substitui\u00E7\u00F5es do MathJax; h\u00E1 algum ambiente LaTeX recursivo?",MissingArgFor:"Falta um argumento para %1",ExtraAlignTab:"H\u00E1 um tab de alinhamento a mais no texto de \\cases",BracketMustBeDimension:"O argumento nos par\u00EAnteses retos de %1 deve ser uma dimens\u00E3o",InvalidEnv:"Nome de ambiente inv\u00E1lido: '%1'",UnknownEnv:"Ambiente desconhecido: '%1'",ExtraCloseLooking:"Encontrada uma chaveta de fecho ao procurar por %1",MissingCloseBracket:"N\u00E3o foi encontrado um ']' de fecho para o argumento de %1",MissingOrUnrecognizedDelim:"O delimitador para %1 est\u00E1 em falta ou n\u00E3o foi reconhecido",MissingDimOrUnits:"Falta a dimens\u00E3o ou a unidade de %1",TokenNotFoundForCommand:"N\u00E3o foi encontrado %1 para %2",MathNotTerminated:"A f\u00F3rmula n\u00E3o foi terminada na caixa de texto",IllegalMacroParam:"Refer\u00EAncia inv\u00E1lida a um par\u00E2metro de macro",MaxBufferSize:"O tamanho do buffer interno do MathJax foi excedido; h\u00E1 alguma chamada a uma macro recursiva?",CommandNotAllowedInEnv:"%1 n\u00E3o \u00E9 permitido no ambiente %2",MultipleLabel:"O r\u00F3tulo '%1' foi definido mais que uma vez",CommandAtTheBeginingOfLine:"%1 deve vir no in\u00EDcio da linha",IllegalAlign:"Foi especificado um alinhamento ilegal em %1",BadMathStyleFor:"Estilo de f\u00F3rmula inv\u00E1lido para %1",PositiveIntegerArg:"O argumento para %1 deve ser um inteiro positivo",ErroneousNestingEq:"Aninhamento incorreto de estruturas de equa\u00E7\u00F5es",MultlineRowsOneCol:"As linhas do ambiente %1 devem ter apenas uma coluna",MultipleBBoxProperty:"%1 foi especificado duas vezes em %2",InvalidBBoxProperty:"'%1' n\u00E3o parece ser uma cor, uma dimens\u00E3o de espa\u00E7amento, nem um estilo",ExtraEndMissingBegin:"H\u00E1 um %1 a mais ou um \\begingroup a menos",GlobalNotFollowedBy:"%1 n\u00E3o foi seguido por um \\let, \\def, ou \\newcommand",UndefinedColorModel:"O modelo de cores '%1' n\u00E3o foi definido",ModelArg1:"O modelo %1 requer 3 n\u00FAmeros para valores de cor",InvalidDecimalNumber:"N\u00FAmero decimal inv\u00E1lido",ModelArg2:"Os valores de cor para o modelo %1 devem estar entre %2 e %3",InvalidNumber:"N\u00FAmero inv\u00E1lido",NewextarrowArg1:"O primeiro argumento de %1 deve ser o nome de uma sequ\u00EAncia de controlo",NewextarrowArg2:"O segundo argumento de %1 deve ser composto por dois inteiros separados por uma v\u00EDrgula",NewextarrowArg3:"O terceiro argumento de %1 deve ser o c\u00F3digo Unicode de um caractere",NoClosingChar:"N\u00E3o foi poss\u00EDvel encontrar um %1 de fecho",IllegalControlSequenceName:"O nome da sequ\u00EAncia de controlo para %1 \u00E9 inv\u00E1lido",IllegalParamNumber:"N\u00FAmero inv\u00E1lido de par\u00E2metros especificado em %1",MissingCS:"%1 deve ser seguido por uma sequ\u00EAncia de controlo",CantUseHash2:"Uso ilegal de # em modelo para %1",SequentialParam:"Os par\u00E2metros para %1 devem ser numerados sequencialmente",MissingReplacementString:"Falta a string de substitui\u00E7\u00E3o para a defini\u00E7\u00E3o de %1",MismatchUseDef:"O uso de %1 n\u00E3o condiz com sua defini\u00E7\u00E3o",RunawayArgument:"Argumento em excesso para %1?",NoClosingDelim:"N\u00E3o foi encontrado um delimitador de fecho para %1"}});MathJax.Ajax.loadComplete("[MathJax]/localization/pt/TeX.js");
ljharb/cdnjs
ajax/libs/mathjax/2.5.1/localization/pt/TeX.js
JavaScript
mit
5,866
/* * /MathJax/localization/pt-br/MathML.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.Localization.addTranslation("pt-br","MathML",{version:"2.5.0",isLoaded:true,strings:{BadMglyph:"Mglyph ruim: %1",BadMglyphFont:"Fonte ruim: %1",MathPlayer:"O MathJax n\u00E3o foi capaz de configurar o MathPlayer.\n\nSe o MathPlayer n\u00E3o estiver instalado, precisar\u00E1 instal\u00E1-lo primeiro.\nCaso contr\u00E1rio, suas configura\u00E7\u00F5es de seguran\u00E7a podem estar prevenindo a execu\u00E7\u00E3o\nde controles ActiveX. Use as Op\u00E7\u00F5es de Internet sob\no menu Ferramentas e selecione a aba de Seguran\u00E7a ent\u00E3o pressione o bot\u00E3o N\u00EDvel Personalizado. Confira se as configura\u00E7\u00F5es para 'Execu\u00E7\u00E3o de Controles ActiveX', e 'Comportamento de scripts e c\u00F3digos bin\u00E1rios'\nest\u00E3o ativadas.\n\nAtualmente voc\u00EA ver\u00E1 mensagens de erro em vez da \ndiagrama\u00E7\u00E3o das f\u00F3rmulas matem\u00E1ticas.",CantCreateXMLParser:"O MathJax n\u00E3o pode criar um interpretador de XML para o MathML. Confira se\na configura\u00E7\u00E3o de seguran\u00E7a 'Controles de Script ActiveX marcados como seguros para scripting'\nest\u00E1 habilitado (use as Op\u00E7\u00F5es de Internet no menu \nFerramentas, e selecione o painel de Seguran\u00E7a, depois pressione o bot\u00E3o N\u00EDvel Personalizado\npara conferir isso).\n\nAs equa\u00E7\u00F5es em MathML n\u00E3o poder\u00E3o ser processadas pelo MathJax.",UnknownNodeType:"Tipo de n\u00F3 desconhecido: %1",UnexpectedTextNode:"N\u00F3 de texto inesperado: %1",ErrorParsingMathML:"Erro ao interpretar MathML",ParsingError:"Erro ao interpretar MathML: %1",MathMLSingleElement:"MathML deve ser formado por um \u00FAnico elemento",MathMLRootElement:"MathML deve ser formado por um elemento \u003Cmath\u003E, n\u00E3o %1"}});MathJax.Ajax.loadComplete("[MathJax]/localization/pt-br/MathML.js");
barkinet/cdnjs
ajax/libs/mathjax/2.5.3/localization/pt-br/MathML.js
JavaScript
mit
2,495
/* * /MathJax/localization/uk/TeX.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.Localization.addTranslation("uk","TeX",{version:"2.5.0",isLoaded:true,strings:{ExtraOpenMissingClose:"\u0417\u0430\u0439\u0432\u0430 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0430 \u0444\u0456\u0433\u0443\u0440\u043D\u0430 \u0434\u0443\u0436\u043A\u0430 \u0430\u0431\u043E \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0437\u0430\u043A\u0440\u0438\u0442\u0430 \u0444\u0456\u0433\u0443\u0440\u043D\u0430 \u0434\u0443\u0436\u043A\u0430",ExtraCloseMissingOpen:"\u0417\u0430\u0439\u0432\u0430 \u0437\u0430\u043A\u0440\u0438\u0442\u0430 \u0444\u0456\u0433\u0443\u0440\u043D\u0430 \u0434\u0443\u0436\u043A\u0430 \u0430\u0431\u043E \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0430 \u0444\u0456\u0433\u0443\u0440\u043D\u0430 \u0434\u0443\u0436\u043A\u0430",MissingLeftExtraRight:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \\left \u0430\u0431\u043E \u0437\u0430\u0439\u0432\u0438\u0439 \\right",MissingScript:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0438 \u0432\u0435\u0440\u0445\u043D\u044C\u043E\u0433\u043E \u0456 \u043D\u0438\u0436\u043D\u044C\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0456\u0432",ExtraLeftMissingRight:"\u0417\u0430\u0439\u0432\u0438\u0439 \\left \u0430\u0431\u043E \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \\right",Misplaced:"\u041D\u0435\u0432\u0456\u0440\u043D\u0438\u0439 %1",MissingOpenForSub:"\u0411\u0440\u0430\u043A\u0443\u0454 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u043E\u0457 \u0434\u0443\u0436\u043A\u0438 \u0434\u043B\u044F \u043D\u0438\u0436\u043D\u044C\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0443",MissingOpenForSup:"\u0411\u0440\u0430\u043A\u0443\u0454 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u043E\u0457 \u0434\u0443\u0436\u043A\u0438 \u0434\u043B\u044F \u0432\u0435\u0440\u0445\u043D\u044C\u043E\u0433\u043E \u0456\u043D\u0434\u0435\u043A\u0441\u0443",AmbiguousUseOf:"\u041D\u0435\u043E\u0434\u043D\u043E\u0437\u043D\u0430\u0447\u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F %1",EnvBadEnd:"\\begin{%1} \u0437\u0430\u043A\u0456\u043D\u0447\u0438\u0432\u0441\u044F \\end{%2}",EnvMissingEnd:"\u0411\u0440\u0430\u043A\u0443\u0454 \\end{%1}",MissingBoxFor:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0454 \u043F\u043E\u043B\u0435 \u0434\u043B\u044F %1",MissingCloseBrace:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u044F \u0437\u0430\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u0430 \u0434\u0443\u0436\u043A\u0430",UndefinedControlSequence:"\u041D\u0435\u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0430 \u043A\u043E\u043C\u0430\u043D\u0434\u0430 %1",DoubleExponent:"\u041F\u043E\u0434\u0432\u0456\u0439\u043D\u0438\u0439 \u0441\u0442\u0435\u043F\u0456\u043D\u044C: \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 \u0434\u0443\u0436\u043A\u0438 \u0434\u043B\u044F \u0443\u0442\u043E\u0447\u043D\u0435\u043D\u043D\u044F",DoubleSubscripts:"\u041F\u043E\u0434\u0432\u0456\u0439\u043D\u0438\u0439 \u043D\u0438\u0436\u043D\u0456\u0439 \u0456\u043D\u0434\u0435\u043A\u0441: \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0439\u0442\u0435 \u0434\u0443\u0436\u043A\u0438 \u0443\u0442\u043E\u0447\u0435\u043D\u043D\u044F",DoubleExponentPrime:"\u0417\u043D\u0430\u043A \u0448\u0442\u0440\u0438\u0445\u0430 \u0441\u043F\u0440\u0438\u0447\u0438\u043D\u0438\u0432 \u043F\u043E\u0434\u0432\u0456\u0439\u043D\u0438\u0439 \u0441\u0442\u0435\u043F\u0456\u043D\u044C: \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0434\u0443\u0436\u043A\u0438 \u0434\u043B\u044F \u0443\u0442\u043E\u0447\u043D\u0435\u043D\u043D\u044F",CantUseHash1:"\u041D\u0435 \u043C\u043E\u0436\u043D\u0430 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0432\u0430\u0442\u0438 \u0441\u0438\u043C\u0432\u043E\u043B \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u043C\u0430\u043A\u0440\u043E\u0441\u0443 # \u0443 \u043C\u0430\u0442\u0435\u043C\u0430\u0442\u0438\u0447\u043D\u043E\u043C\u0443 \u0440\u0435\u0436\u0438\u043C\u0456",MisplacedMiddle:"%1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0432 \u043C\u0435\u0436\u0430\u0445 \\left \u0456 \\right",MisplacedLimits:"%1 \u0434\u043E\u0437\u0432\u043E\u043B\u0435\u043D\u043E \u0442\u0456\u043B\u044C\u043A\u0438 \u043D\u0430 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0430\u0445",MisplacedMoveRoot:"%1 \u043C\u043E\u0436\u0435 \u0437'\u044F\u0432\u0438\u0442\u0438\u0441\u044F \u043B\u0438\u0448\u0435 \u043F\u0456\u0434 \u043A\u043E\u0440\u0435\u043D\u0435\u043C",MultipleCommand:"\u041A\u0456\u043B\u044C\u043A\u0430 %1",IntegerArg:"\u0410\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0446\u0456\u043B\u0438\u043C \u0447\u0438\u0441\u043B\u043E\u043C",NotMathMLToken:"%1 \u043D\u0435 \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u043C \u043C\u0430\u0440\u043A\u0435\u0440\u0430",InvalidMathMLAttr:"\u041D\u0435\u043F\u0440\u0438\u043F\u0443\u0441\u0442\u0438\u043C\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 MathML: %1",UnknownAttrForElement:"%1 \u043D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043B\u044F %2",MaxMacroSub1:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0432\u0438\u043A\u043B\u0438\u043A\u0456\u0432 \u043C\u0430\u043A\u0440\u043E\u0441\u0456\u0432; \u0430\u0431\u043E \u0432\u0456\u0434\u0431\u0443\u0432\u0430\u0454\u0442\u044C\u0441\u044F \u0440\u0435\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u0438\u0439 \u0432\u0438\u043A\u043B\u0438\u043A \u043C\u0430\u043A\u0440\u043E\u0441\u0443?",MaxMacroSub2:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0443 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043F\u0456\u0434\u0441\u0442\u0430\u043D\u043E\u0432\u043E\u043A MathJax; \u041C\u043E\u0436\u043B\u0438\u0432\u043E, \u0440\u0435\u043A\u0443\u0440\u0441\u0456\u044F \u0432 \u0441\u0435\u0440\u0435\u0434\u043E\u0432\u0438\u0449\u0456 LaTeX?",MissingArgFor:"\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u0438\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1",ExtraAlignTab:"\u0417\u0430\u0439\u0432\u0438\u0439 \u0442\u0430\u0431\u0443\u043B\u044F\u0442\u043E\u0440 \u0442\u0435\u043A\u0441\u0442\u0443 \u0443 \\cases",BracketMustBeDimension:"\u0410\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0443 \u0434\u0443\u0436\u043A\u0430\u0445 \u0434\u043B\u044F %1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0440\u043E\u0437\u043C\u0456\u0440\u043E\u043C",InvalidEnv:"\u041D\u0435\u0432\u0456\u0440\u043D\u0435 \u0456\u043C'\u044F \u0441\u0435\u0440\u0435\u0434\u043E\u0432\u0438\u0449\u0430 '%1'",UnknownEnv:"\u041D\u0435\u0432\u0456\u0434\u043E\u043C\u0435 \u0441\u0435\u0440\u0435\u0434\u043E\u0432\u0438\u0449\u0435 '%1'",ExtraCloseLooking:"\u0417\u0430\u0439\u0432\u0430 \u0437\u0430\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u0430 \u0434\u0443\u0436\u043A\u0430 \u0432\u0438\u043D\u0438\u043A\u043B\u0430 \u043F\u0456\u0434 \u0447\u0430\u0441 \u043F\u043E\u0448\u0443\u043A\u0443 %1",MissingCloseBracket:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u0437\u043D\u0430\u0439\u0442\u0438 \u0437\u0430\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u0443 ']' \u0434\u043B\u044F \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0443 \u0434\u043E %1",MissingOrUnrecognizedDelim:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \u0430\u0431\u043E \u043D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A \u0434\u043B\u044F %1",MissingDimOrUnits:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0430\u0431\u043E \u0439\u043E\u0433\u043E \u043E\u0434\u0438\u043D\u0438\u0446\u0456 \u0434\u043B\u044F %1",TokenNotFoundForCommand:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u0437\u043D\u0430\u0439\u0442\u0438 %1 \u0434\u043B\u044F %2",MathNotTerminated:"\u041C\u0430\u0442\u0435\u043C\u0430\u0442\u0438\u043A\u0430 \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0443\u0454\u0442\u044C\u0441\u044F \u0432 \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u043C\u0443 \u043F\u043E\u043B\u0456",IllegalMacroParam:"\u041D\u0435\u0437\u0430\u043A\u043E\u043D\u043D\u0435 \u043F\u043E\u0441\u0438\u043B\u0430\u043D\u043D\u044F \u043D\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043C\u0430\u043A\u0440\u043E\u0441\u0443",MaxBufferSize:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u0440\u043E\u0437\u043C\u0456\u0440 \u0432\u043D\u0443\u0442\u0440\u0456\u0448\u043D\u044C\u043E\u0433\u043E \u0431\u0443\u0444\u0435\u0440\u0430 MathJax; \u0442\u0430\u043C \u0454 \u0440\u0435\u043A\u0443\u0440\u0441\u0438\u0432\u043D\u0438\u0439 \u0432\u0438\u043A\u043B\u0438\u043A \u043C\u0430\u043A\u0440\u043E\u0441\u0443?",CommandNotAllowedInEnv:"%1 \u043D\u0435 \u0434\u043E\u043F\u0443\u0441\u043A\u0430\u0454\u0442\u044C\u0441\u044F \u0432 \u0441\u0435\u0440\u0435\u0434\u043E\u0432\u0438\u0449\u0456 %2",MultipleLabel:"\u041C\u0456\u0442\u043A\u0430 '%1' \u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0430 \u043A\u0456\u043B\u044C\u043A\u0430 \u0440\u0430\u0437\u0456\u0432",CommandAtTheBeginingOfLine:"%1 \u043C\u0430\u0454 \u0437\u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0438\u0441\u044F \u043D\u0430 \u043F\u043E\u0447\u0430\u0442\u043A\u0443 \u0440\u044F\u0434\u043A\u0430",IllegalAlign:"\u041D\u0435\u0437\u0430\u043A\u043E\u043D\u043D\u0435 \u0432\u0438\u0440\u0456\u0432\u043D\u044E\u0432\u0430\u043D\u043D\u044F \u0432\u043A\u0430\u0437\u0430\u043D\u0435 \u0443 %1",BadMathStyleFor:"\u041D\u0435\u0432\u0456\u0440\u043D\u0438\u0439 \u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 \u0434\u043B\u044F %1",PositiveIntegerArg:"\u0410\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1 \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0431\u0443\u0442\u0438 \u0434\u043E\u0434\u0430\u0442\u043D\u0438\u043C \u0446\u0456\u043B\u0438\u043C \u0447\u0438\u0441\u043B\u043E\u043C",ErroneousNestingEq:"\u041F\u043E\u043C\u0438\u043B\u043A\u043E\u0432\u0456 \u0432\u043A\u043B\u0430\u0434\u0435\u043D\u043E\u0441\u0442\u0456 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440 \u0440\u0456\u0432\u043D\u044F\u043D\u043D\u044F",MultlineRowsOneCol:"\u0420\u044F\u0434\u043A\u0438 \u0443 \u0441\u0435\u0440\u0435\u0434\u043E\u0432\u0438\u0449\u0456 %1 \u043C\u0443\u0441\u044F\u0442\u044C \u043C\u0430\u0442\u0438 \u043B\u0438\u0448\u0435 \u043E\u0434\u0438\u043D \u0441\u0442\u043E\u0432\u043F\u0435\u0446\u044C",MultipleBBoxProperty:"%1 \u0432\u043A\u0430\u0437\u0430\u043D\u043E \u0434\u0432\u0456\u0447\u0456 \u0432 %2",InvalidBBoxProperty:"'%1' \u0437\u043E\u0432\u0441\u0456\u043C \u043D\u0435 \u0441\u0445\u043E\u0436\u0438\u0439 \u043D\u0430 \u043A\u043E\u043B\u0456\u0440, \u0434\u043E\u0434\u0430\u0442\u043A\u043E\u0432\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0430\u0431\u043E \u0441\u0442\u0438\u043B\u044C",ExtraEndMissingBegin:"\u0417\u0430\u0439\u0432\u0430 %1 \u0430\u0431\u043E \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u044F \\begingroup",GlobalNotFollowedBy:"%1 \u043D\u0435 \u0441\u043B\u0456\u0434\u0443\u0454 \u043F\u0456\u0441\u043B\u044F \\let, \\def \u0430\u0431\u043E \\newcommand",UndefinedColorModel:"\u041A\u043E\u043B\u0456\u0440\u043D\u0430 \u043C\u043E\u0434\u0435\u043B\u044C '%1' \u043D\u0435 \u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u0430",ModelArg1:"\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043A\u043E\u043B\u044C\u043E\u0440\u0443 \u0434\u043B\u044F \u043C\u043E\u0434\u0435\u043B\u0456 %1 \u0432\u0438\u043C\u0430\u0433\u0430\u044E\u0442\u044C 3 \u0446\u0438\u0444\u0440\u0438",InvalidDecimalNumber:"\u041D\u0435\u0432\u0456\u0440\u043D\u0435 \u0434\u0435\u0441\u044F\u0442\u043A\u043E\u0432\u0435 \u0447\u0438\u0441\u043B\u043E",ModelArg2:"\u0417\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u043A\u043E\u043B\u044C\u043E\u0440\u0443 \u0434\u043B\u044F \u043C\u043E\u0434\u0435\u043B\u0456 %1 \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043C\u0456\u0436 \u0442\u0435\u0433\u0430\u043C\u0438 %2 \u0456 %3",InvalidNumber:"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E",NewextarrowArg1:"\u041F\u0435\u0440\u0448\u0438\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 %1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u043D\u0430\u0437\u0432\u043E\u044E \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u043A\u0435\u0440\u0456\u0432\u043D\u043E\u0457 \u043F\u043E\u0441\u043B\u0456\u0434\u043E\u0432\u043D\u043E\u0441\u0442\u0456",NewextarrowArg2:"\u0414\u0440\u0443\u0433\u0438\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0434\u0432\u043E\u043C\u0430 \u0446\u0456\u043B\u0438\u043C\u0438 \u0447\u0438\u0441\u043B\u0430\u043C\u0438, \u0440\u043E\u0437\u0434\u0456\u043B\u0435\u043D\u0438\u043C\u0438 \u043A\u043E\u043C\u0430\u043C\u0438",NewextarrowArg3:"\u0422\u0440\u0435\u0442\u0456\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1 \u043C\u0430\u0454 \u0431\u0443\u0442\u0438 \u0447\u0438\u0441\u043B\u043E\u0432\u0438\u043C \u044E\u043D\u0456\u043A\u043E\u0434\u043D\u0438\u043C \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u043C",NoClosingChar:"\u041D\u0435 \u043C\u043E\u0436\u043B\u0438\u0432\u043E \u0437\u043D\u0430\u0439\u0442\u0438 \u0432\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u043E\u0457 %1",IllegalControlSequenceName:"\u041D\u0435\u0432\u0456\u0440\u043D\u0435 \u0456\u043C'\u044F \u043A\u0435\u0440\u0456\u0432\u043D\u043E\u0457 \u043F\u043E\u0441\u043B\u0456\u0434\u043E\u0432\u043D\u043E\u0441\u0442\u0456 \u0434\u043B\u044F %1",IllegalParamNumber:"\u041D\u0435\u0432\u0456\u0440\u043D\u0435 \u0447\u0438\u0441\u043B\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0456\u0432, \u0437\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0445 \u0443 %1",MissingCS:"\u041F\u0456\u0441\u043B\u044F %1 \u043C\u0443\u0441\u0438\u0442\u044C \u0441\u043B\u0456\u0434\u0443\u0432\u0430\u0442\u0438 \u043A\u0435\u0440\u0456\u0432\u043D\u0430 \u043F\u043E\u0441\u043B\u0456\u0434\u043E\u0432\u043D\u0456\u0441\u0442\u044C",CantUseHash2:"\u041D\u0435\u0437\u0430\u043A\u043E\u043D\u043D\u0435 \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F # \u0443 \u0448\u0430\u0431\u043B\u043E\u043D\u0456 \u0434\u043B\u044F %1",SequentialParam:"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438 \u0434\u043B\u044F %1 \u043F\u043E\u0432\u0438\u043D\u043D\u0456 \u0431\u0443\u0442\u0438 \u043F\u0440\u043E\u043D\u0443\u043C\u0435\u0440\u043E\u0432\u0430\u043D\u0456 \u043F\u043E\u0441\u043B\u0456\u0434\u043E\u0432\u043D\u043E",MissingReplacementString:"\u0412\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \u0440\u044F\u0434\u043E\u043A \u0437\u0430\u043C\u0456\u043D\u0438 \u0434\u043B\u044F \u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F %1",MismatchUseDef:"\u0412\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u0430\u043D\u043D\u044F %1 \u043D\u0435 \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0454 \u0439\u043E\u0433\u043E \u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044E",RunawayArgument:"\u0412\u0442\u0440\u0430\u0447\u0435\u043D\u0438\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 \u0434\u043B\u044F %1?",NoClosingDelim:"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u043D\u0430\u0439\u0442\u0438 \u0437\u0430\u043A\u0440\u0438\u0432\u0430\u044E\u0447\u043E\u0433\u043E \u0440\u043E\u0437\u0434\u0456\u043B\u044C\u043D\u0438\u043A\u0430 \u0434\u043B\u044F%1"}});MathJax.Ajax.loadComplete("[MathJax]/localization/uk/TeX.js");
lobbin/cdnjs
ajax/libs/mathjax/2.5.3/localization/uk/TeX.js
JavaScript
mit
16,801
(function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):t(jQuery,moment)})(function(t,e){(e.defineLocale||e.lang).call(e,"bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"LT:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},ordinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(t){var e=t%10,n=t%100;return 0===t?t+"-ев":0===n?t+"-ен":n>10&&20>n?t+"-ти":1===e?t+"-ви":2===e?t+"-ри":7===e||8===e?t+"-ми":t+"-ти"},week:{dow:1,doy:7}}),t.fullCalendar.datepickerLang("bg","bg",{closeText:"затвори",prevText:"&#x3C;назад",nextText:"напред&#x3E;",nextBigText:"&#x3E;&#x3E;",currentText:"днес",monthNames:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:["Яну","Фев","Мар","Апр","Май","Юни","Юли","Авг","Сеп","Окт","Нов","Дек"],dayNames:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"],dayNamesShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб"],dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Съ"],weekHeader:"Wk",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),t.fullCalendar.lang("bg",{defaultButtonText:{month:"Месец",week:"Седмица",day:"Ден",list:"График"},allDayText:"Цял ден",eventLimitText:function(t){return"+още "+t}})});
danut007ro/cdnjs
ajax/libs/fullcalendar/2.2.7/lang/bg.js
JavaScript
mit
2,679
YUI.add('datatable-sort', function (Y, NAME) { /** Adds support for sorting the table data by API methods `table.sort(...)` or `table.toggleSort(...)` or by clicking on column headers in the rendered UI. @module datatable @submodule datatable-sort @since 3.5.0 **/ var YLang = Y.Lang, isBoolean = YLang.isBoolean, isString = YLang.isString, isArray = YLang.isArray, isObject = YLang.isObject, toArray = Y.Array, sub = YLang.sub, dirMap = { asc : 1, desc: -1, "1" : 1, "-1": -1 }; /** _API docs for this extension are included in the DataTable class._ This DataTable class extension adds support for sorting the table data by API methods `table.sort(...)` or `table.toggleSort(...)` or by clicking on column headers in the rendered UI. Sorting by the API is enabled automatically when this module is `use()`d. To enable UI triggered sorting, set the DataTable's `sortable` attribute to `true`. <pre><code> var table = new Y.DataTable({ columns: [ 'id', 'username', 'name', 'birthdate' ], data: [ ... ], sortable: true }); table.render('#table'); </code></pre> Setting `sortable` to `true` will enable UI sorting for all columns. To enable UI sorting for certain columns only, set `sortable` to an array of column keys, or just add `sortable: true` to the respective column configuration objects. This uses the default setting of `sortable: auto` for the DataTable instance. <pre><code> var table = new Y.DataTable({ columns: [ 'id', { key: 'username', sortable: true }, { key: 'name', sortable: true }, { key: 'birthdate', sortable: true } ], data: [ ... ] // sortable: 'auto' is the default }); // OR var table = new Y.DataTable({ columns: [ 'id', 'username', 'name', 'birthdate' ], data: [ ... ], sortable: [ 'username', 'name', 'birthdate' ] }); </code></pre> To disable UI sorting for all columns, set `sortable` to `false`. This still permits sorting via the API methods. As new records are inserted into the table's `data` ModelList, they will be inserted at the correct index to preserve the sort order. The current sort order is stored in the `sortBy` attribute. Assigning this value at instantiation will automatically sort your data. Sorting is done by a simple value comparison using &lt; and &gt; on the field value. If you need custom sorting, add a sort function in the column's `sortFn` property. Columns whose content is generated by formatters, but don't relate to a single `key`, require a `sortFn` to be sortable. <pre><code> function nameSort(a, b, desc) { var aa = a.get('lastName') + a.get('firstName'), bb = a.get('lastName') + b.get('firstName'), order = (aa > bb) ? 1 : -(aa < bb); return desc ? -order : order; } var table = new Y.DataTable({ columns: [ 'id', 'username', { key: name, sortFn: nameSort }, 'birthdate' ], data: [ ... ], sortable: [ 'username', 'name', 'birthdate' ] }); </code></pre> See the user guide for more details. @class DataTable.Sortable @for DataTable @since 3.5.0 **/ function Sortable() {} Sortable.ATTRS = { // Which columns in the UI should suggest and respond to sorting interaction // pass an empty array if no UI columns should show sortable, but you want the // table.sort(...) API /** Controls which column headers can trigger sorting by user clicks. Acceptable values are: * "auto" - (default) looks for `sortable: true` in the column configurations * `true` - all columns are enabled * `false - no UI sortable is enabled * {String[]} - array of key names to give sortable headers @attribute sortable @type {String|String[]|Boolean} @default "auto" @since 3.5.0 **/ sortable: { value: 'auto', validator: '_validateSortable' }, /** The current sort configuration to maintain in the data. Accepts column `key` strings or objects with a single property, the column `key`, with a value of 1, -1, "asc", or "desc". E.g. `{ username: 'asc' }`. String values are assumed to be ascending. Example values would be: * `"username"` - sort by the data's `username` field or the `key` associated to a column with that `name`. * `{ username: "desc" }` - sort by `username` in descending order. Alternately, use values "asc", 1 (same as "asc"), or -1 (same as "desc"). * `["lastName", "firstName"]` - ascending sort by `lastName`, but for records with the same `lastName`, ascending subsort by `firstName`. Array can have as many items as you want. * `[{ lastName: -1 }, "firstName"]` - descending sort by `lastName`, ascending subsort by `firstName`. Mixed types are ok. @attribute sortBy @type {String|String[]|Object|Object[]} @since 3.5.0 **/ sortBy: { validator: '_validateSortBy', getter: '_getSortBy' }, /** Strings containing language for sorting tooltips. @attribute strings @type {Object} @default (strings for current lang configured in the YUI instance config) @since 3.5.0 **/ strings: {} }; Y.mix(Sortable.prototype, { /** Sort the data in the `data` ModelList and refresh the table with the new order. Acceptable values for `fields` are `key` strings or objects with a single property, the column `key`, with a value of 1, -1, "asc", or "desc". E.g. `{ username: 'asc' }`. String values are assumed to be ascending. Example values would be: * `"username"` - sort by the data's `username` field or the `key` associated to a column with that `name`. * `{ username: "desc" }` - sort by `username` in descending order. Alternately, use values "asc", 1 (same as "asc"), or -1 (same as "desc"). * `["lastName", "firstName"]` - ascending sort by `lastName`, but for records with the same `lastName`, ascending subsort by `firstName`. Array can have as many items as you want. * `[{ lastName: -1 }, "firstName"]` - descending sort by `lastName`, ascending subsort by `firstName`. Mixed types are ok. @method sort @param {String|String[]|Object|Object[]} fields The field(s) to sort by @param {Object} [payload] Extra `sort` event payload you want to send along @return {DataTable} @chainable @since 3.5.0 **/ sort: function (fields, payload) { /** Notifies of an impending sort, either from clicking on a column header, or from a call to the `sort` or `toggleSort` method. The requested sort is available in the `sortBy` property of the event. The default behavior of this event sets the table's `sortBy` attribute. @event sort @param {String|String[]|Object|Object[]} sortBy The requested sort @preventable _defSortFn **/ return this.fire('sort', Y.merge((payload || {}), { sortBy: fields || this.get('sortBy') })); }, /** Template for the node that will wrap the header content for sortable columns. @property SORTABLE_HEADER_TEMPLATE @type {HTML} @value '<div class="{className}" tabindex="0"><span class="{indicatorClass}"></span></div>' @since 3.5.0 **/ SORTABLE_HEADER_TEMPLATE: '<div class="{className}" tabindex="0" unselectable="on"><span class="{indicatorClass}"></span></div>', /** Reverse the current sort direction of one or more fields currently being sorted by. Pass the `key` of the column or columns you want the sort order reversed for. @method toggleSort @param {String|String[]} fields The field(s) to reverse sort order for @param {Object} [payload] Extra `sort` event payload you want to send along @return {DataTable} @chainable @since 3.5.0 **/ toggleSort: function (columns, payload) { var current = this._sortBy, sortBy = [], i, len, j, col, index; // To avoid updating column configs or sortBy directly for (i = 0, len = current.length; i < len; ++i) { col = {}; col[current[i]._id] = current[i].sortDir; sortBy.push(col); } if (columns) { columns = toArray(columns); for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; index = -1; for (j = sortBy.length - 1; i >= 0; --i) { if (sortBy[j][col]) { sortBy[j][col] *= -1; break; } } } } else { for (i = 0, len = sortBy.length; i < len; ++i) { for (col in sortBy[i]) { if (sortBy[i].hasOwnProperty(col)) { sortBy[i][col] *= -1; break; } } } } return this.fire('sort', Y.merge((payload || {}), { sortBy: sortBy })); }, //-------------------------------------------------------------------------- // Protected properties and methods //-------------------------------------------------------------------------- /** Sorts the `data` ModelList based on the new `sortBy` configuration. @method _afterSortByChange @param {EventFacade} e The `sortByChange` event @protected @since 3.5.0 **/ _afterSortByChange: function () { // Can't use a setter because it's a chicken and egg problem. The // columns need to be set up to translate, but columns are initialized // from Core's initializer. So construction-time assignment would // fail. this._setSortBy(); // Don't sort unless sortBy has been set if (this._sortBy.length) { if (!this.data.comparator) { this.data.comparator = this._sortComparator; } this.data.sort(); } }, /** Applies the sorting logic to the new ModelList if the `newVal` is a new ModelList. @method _afterSortDataChange @param {EventFacade} e the `dataChange` event @protected @since 3.5.0 **/ _afterSortDataChange: function (e) { // object values always trigger a change event, but we only want to // call _initSortFn if the value passed to the `data` attribute was a // new ModelList, not a set of new data as an array, or even the same // ModelList. if (e.prevVal !== e.newVal || e.newVal.hasOwnProperty('_compare')) { this._initSortFn(); } }, /** Checks if any of the fields in the modified record are fields that are currently being sorted by, and if so, resorts the `data` ModelList. @method _afterSortRecordChange @param {EventFacade} e The Model's `change` event @protected @since 3.5.0 **/ _afterSortRecordChange: function (e) { var i, len; for (i = 0, len = this._sortBy.length; i < len; ++i) { if (e.changed[this._sortBy[i].key]) { this.data.sort(); break; } } }, /** Subscribes to state changes that warrant updating the UI, and adds the click handler for triggering the sort operation from the UI. @method _bindSortUI @protected @since 3.5.0 **/ _bindSortUI: function () { var handles = this._eventHandles; if (!handles.sortAttrs) { handles.sortAttrs = this.after( ['sortableChange', 'sortByChange', 'columnsChange'], Y.bind('_uiSetSortable', this)); } if (!handles.sortUITrigger && this._theadNode) { handles.sortUITrigger = this.delegate(['click','keydown'], Y.rbind('_onUITriggerSort', this), '.' + this.getClassName('sortable', 'column')); } }, /** Sets the `sortBy` attribute from the `sort` event's `e.sortBy` value. @method _defSortFn @param {EventFacade} e The `sort` event @protected @since 3.5.0 **/ _defSortFn: function (e) { this.set.apply(this, ['sortBy', e.sortBy].concat(e.details)); }, /** Getter for the `sortBy` attribute. Supports the special subattribute "sortBy.state" to get a normalized JSON version of the current sort state. Otherwise, returns the last assigned value. For example: <pre><code>var table = new Y.DataTable({ columns: [ ... ], data: [ ... ], sortBy: 'username' }); table.get('sortBy'); // 'username' table.get('sortBy.state'); // { key: 'username', dir: 1 } table.sort(['lastName', { firstName: "desc" }]); table.get('sortBy'); // ['lastName', { firstName: "desc" }] table.get('sortBy.state'); // [{ key: "lastName", dir: 1 }, { key: "firstName", dir: -1 }] </code></pre> @method _getSortBy @param {String|String[]|Object|Object[]} val The current sortBy value @param {String} detail String passed to `get(HERE)`. to parse subattributes @protected @since 3.5.0 **/ _getSortBy: function (val, detail) { var state, i, len, col; // "sortBy." is 7 characters. Used to catch detail = detail.slice(7); // TODO: table.get('sortBy.asObject')? table.get('sortBy.json')? if (detail === 'state') { state = []; for (i = 0, len = this._sortBy.length; i < len; ++i) { col = this._sortBy[i]; state.push({ column: col._id, dir: col.sortDir }); } // TODO: Always return an array? return { state: (state.length === 1) ? state[0] : state }; } else { return val; } }, /** Sets up the initial sort state and instance properties. Publishes events and subscribes to attribute change events to maintain internal state. @method initializer @protected @since 3.5.0 **/ initializer: function () { var boundParseSortable = Y.bind('_parseSortable', this); this._parseSortable(); this._setSortBy(); this._initSortFn(); this._initSortStrings(); this.after({ 'table:renderHeader': Y.bind('_renderSortable', this), dataChange : Y.bind('_afterSortDataChange', this), sortByChange : Y.bind('_afterSortByChange', this), sortableChange : boundParseSortable, columnsChange : boundParseSortable }); this.data.after(this.data.model.NAME + ":change", Y.bind('_afterSortRecordChange', this)); // TODO: this event needs magic, allowing async remote sorting this.publish('sort', { defaultFn: Y.bind('_defSortFn', this) }); }, /** Creates a `_compare` function for the `data` ModelList to allow custom sorting by multiple fields. @method _initSortFn @protected @since 3.5.0 **/ _initSortFn: function () { var self = this; // TODO: This should be a ModelList extension. // FIXME: Modifying a component of the host seems a little smelly // FIXME: Declaring inline override to leverage closure vs // compiling a new function for each column/sortable change or // binding the _compare implementation to this, resulting in an // extra function hop during sorting. Lesser of three evils? this.data._compare = function (a, b) { var cmp = 0, i, len, col, dir, cs, aa, bb; for (i = 0, len = self._sortBy.length; !cmp && i < len; ++i) { col = self._sortBy[i]; dir = col.sortDir, cs = col.caseSensitive; if (col.sortFn) { cmp = col.sortFn(a, b, (dir === -1)); } else { // FIXME? Requires columns without sortFns to have key aa = a.get(col.key) || ''; bb = b.get(col.key) || ''; if (!cs && typeof(aa) === "string" && typeof(bb) === "string"){// Not case sensitive aa = aa.toLowerCase(); bb = bb.toLowerCase(); } cmp = (aa > bb) ? dir : ((aa < bb) ? -dir : 0); } } return cmp; }; if (this._sortBy.length) { this.data.comparator = this._sortComparator; // TODO: is this necessary? Should it be elsewhere? this.data.sort(); } else { // Leave the _compare method in place to avoid having to set it // up again. Mistake? delete this.data.comparator; } }, /** Add the sort related strings to the `strings` map. @method _initSortStrings @protected @since 3.5.0 **/ _initSortStrings: function () { // Not a valueFn because other class extensions will want to add to it this.set('strings', Y.mix((this.get('strings') || {}), Y.Intl.get('datatable-sort'))); }, /** Fires the `sort` event in response to user clicks on sortable column headers. @method _onUITriggerSort @param {DOMEventFacade} e The `click` event @protected @since 3.5.0 **/ _onUITriggerSort: function (e) { var id = e.currentTarget.getAttribute('data-yui3-col-id'), sortBy = e.shiftKey ? this.get('sortBy') : [{}], column = id && this.getColumn(id), i, len; if (e.type === 'keydown' && e.keyCode !== 32) { return; } // In case a headerTemplate injected a link // TODO: Is this overreaching? e.preventDefault(); if (column) { if (e.shiftKey) { for (i = 0, len = sortBy.length; i < len; ++i) { if (id === sortBy[i] || Math.abs(sortBy[i][id]) === 1) { if (!isObject(sortBy[i])) { sortBy[i] = {}; } sortBy[i][id] = -(column.sortDir||0) || 1; break; } } if (i >= len) { sortBy.push(column._id); } } else { sortBy[0][id] = -(column.sortDir||0) || 1; } this.fire('sort', { originEvent: e, sortBy: sortBy }); } }, /** Normalizes the possible input values for the `sortable` attribute, storing the results in the `_sortable` property. @method _parseSortable @protected @since 3.5.0 **/ _parseSortable: function () { var sortable = this.get('sortable'), columns = [], i, len, col; if (isArray(sortable)) { for (i = 0, len = sortable.length; i < len; ++i) { col = sortable[i]; // isArray is called because arrays are objects, but will rely // on getColumn to nullify them for the subsequent if (col) if (!isObject(col, true) || isArray(col)) { col = this.getColumn(col); } if (col) { columns.push(col); } } } else if (sortable) { columns = this._displayColumns.slice(); if (sortable === 'auto') { for (i = columns.length - 1; i >= 0; --i) { if (!columns[i].sortable) { columns.splice(i, 1); } } } } this._sortable = columns; }, /** Initial application of the sortable UI. @method _renderSortable @protected @since 3.5.0 **/ _renderSortable: function () { this._uiSetSortable(); this._bindSortUI(); }, /** Parses the current `sortBy` attribute into a normalized structure for the `data` ModelList's `_compare` method. Also updates the column configurations' `sortDir` properties. @method _setSortBy @protected @since 3.5.0 **/ _setSortBy: function () { var columns = this._displayColumns, sortBy = this.get('sortBy') || [], sortedClass = ' ' + this.getClassName('sorted'), i, len, name, dir, field, column; this._sortBy = []; // Purge current sort state from column configs for (i = 0, len = columns.length; i < len; ++i) { column = columns[i]; delete column.sortDir; if (column.className) { // TODO: be more thorough column.className = column.className.replace(sortedClass, ''); } } sortBy = toArray(sortBy); for (i = 0, len = sortBy.length; i < len; ++i) { name = sortBy[i]; dir = 1; if (isObject(name)) { field = name; // Have to use a for-in loop to process sort({ foo: -1 }) for (name in field) { if (field.hasOwnProperty(name)) { dir = dirMap[field[name]]; break; } } } if (name) { // Allow sorting of any model field and any column // FIXME: this isn't limited to model attributes, but there's no // convenient way to get a list of the attributes for a Model // subclass *including* the attributes of its superclasses. column = this.getColumn(name) || { _id: name, key: name }; if (column) { column.sortDir = dir; if (!column.className) { column.className = ''; } column.className += sortedClass; this._sortBy.push(column); } } } }, /** Array of column configuration objects of those columns that need UI setup for user interaction. @property _sortable @type {Object[]} @protected @since 3.5.0 **/ //_sortable: null, /** Array of column configuration objects for those columns that are currently being used to sort the data. Fake column objects are used for fields that are not rendered as columns. @property _sortBy @type {Object[]} @protected @since 3.5.0 **/ //_sortBy: null, /** Replacement `comparator` for the `data` ModelList that defers sorting logic to the `_compare` method. The deferral is accomplished by returning `this`. @method _sortComparator @param {Model} item The record being evaluated for sort position @return {Model} The record @protected @since 3.5.0 **/ _sortComparator: function (item) { // Defer sorting to ModelList's _compare return item; }, /** Applies the appropriate classes to the `boundingBox` and column headers to indicate sort state and sortability. Also currently wraps the header content of sortable columns in a `<div>` liner to give a CSS anchor for sort indicators. @method _uiSetSortable @protected @since 3.5.0 **/ _uiSetSortable: function () { var columns = this._sortable || [], sortableClass = this.getClassName('sortable', 'column'), ascClass = this.getClassName('sorted'), descClass = this.getClassName('sorted', 'desc'), linerClass = this.getClassName('sort', 'liner'), indicatorClass= this.getClassName('sort', 'indicator'), sortableCols = {}, i, len, col, node, liner, title, desc; this.get('boundingBox').toggleClass( this.getClassName('sortable'), columns.length); for (i = 0, len = columns.length; i < len; ++i) { sortableCols[columns[i].id] = columns[i]; } // TODO: this.head.render() + decorate cells? this._theadNode.all('.' + sortableClass).each(function (node) { var col = sortableCols[node.get('id')], liner = node.one('.' + linerClass), indicator; if (col) { if (!col.sortDir) { node.removeClass(ascClass) .removeClass(descClass); } } else { node.removeClass(sortableClass) .removeClass(ascClass) .removeClass(descClass); if (liner) { liner.replace(liner.get('childNodes').toFrag()); } indicator = node.one('.' + indicatorClass); if (indicator) { indicator.remove().destroy(true); } } }); for (i = 0, len = columns.length; i < len; ++i) { col = columns[i]; node = this._theadNode.one('#' + col.id); desc = col.sortDir === -1; if (node) { liner = node.one('.' + linerClass); node.addClass(sortableClass); if (col.sortDir) { node.addClass(ascClass); node.toggleClass(descClass, desc); node.setAttribute('aria-sort', desc ? 'descending' : 'ascending'); } if (!liner) { liner = Y.Node.create(Y.Lang.sub( this.SORTABLE_HEADER_TEMPLATE, { className: linerClass, indicatorClass: indicatorClass })); liner.prepend(node.get('childNodes').toFrag()); node.append(liner); } title = sub(this.getString( (col.sortDir === 1) ? 'reverseSortBy' : 'sortBy'), { column: col.abbr || col.label || col.key || ('column ' + i) }); node.setAttribute('title', title); // To combat VoiceOver from reading the sort title as the // column header node.setAttribute('aria-labelledby', col.id); } } }, /** Allows values `true`, `false`, "auto", or arrays of column names through. @method _validateSortable @param {Any} val The input value to `set("sortable", VAL)` @return {Boolean} @protected @since 3.5.0 **/ _validateSortable: function (val) { return val === 'auto' || isBoolean(val) || isArray(val); }, /** Allows strings, arrays of strings, objects, or arrays of objects. @method _validateSortBy @param {String|String[]|Object|Object[]} val The new `sortBy` value @return {Boolean} @protected @since 3.5.0 **/ _validateSortBy: function (val) { return val === null || isString(val) || isObject(val, true) || (isArray(val) && (isString(val[0]) || isObject(val, true))); } }, true); Y.DataTable.Sortable = Sortable; Y.Base.mix(Y.DataTable, [Sortable]); }, '@VERSION@', {"requires": ["datatable-base"], "lang": ["en", "fr", "es"], "skinnable": true});
ruo91/cdnjs
ajax/libs/yui/3.10.0/datatable-sort/datatable-sort-debug.js
JavaScript
mit
27,854
YUI.add('datatable-column-widths', function (Y, NAME) { /** Adds basic, programmatic column width support to DataTable via column configuration property `width` and method `table.setColumnWidth(id, width);`. @module datatable @submodule datatable-column-widths @since 3.5.0 **/ var isNumber = Y.Lang.isNumber, arrayIndex = Y.Array.indexOf; Y.Features.add('table', 'badColWidth', { test: function () { var body = Y.one('body'), node, broken; if (body) { // In modern browsers, <col style="width:X"> will make columns, // *including padding and borders* X wide. The cell content width // is reduced. In old browsers and all Opera versions to date, the // col's width style is passed to the cells, which causes cell // padding/border to bloat the rendered width. node = body.insertBefore( '<table style="position:absolute;visibility:hidden;border:0 none">' + '<colgroup><col style="width:9px"></colgroup>' + '<tbody><tr>' + '<td style="' + 'padding:0 4px;' + 'font:normal 2px/2px arial;' + 'border:0 none">' + '.' + // Just something to give the cell dimension '</td></tr></tbody>' + '</table>', body.get('firstChild')); broken = node.one('td').getComputedStyle('width') !== '1px'; node.remove(true); } return broken; } }); /** _API docs for this extension are included in the DataTable class._ Adds basic, programmatic column width support to DataTable. Note, this does not add support for truncated columns. Due to the way HTML tables render, column width is more like a "recommended width". Column content wider than the assigned width will cause the column to expand, despite the configured width. Similarly if the table is too narrow to fit the column with the configured column width, the column width will be reduced. To set a column width, either add a `width` value to the column configuration or call the `setColumnWidth(id, width)` method. Note, assigning column widths is possible without this module, as each cell is decorated with a class appropriate for that column which you can statically target in your site's CSS. To achieve absolute column widths, with content truncation, you can either: 1. Use this module, configure *all* columns to have `width`s, then add `table-layout: fixed;` to your CSS for the appropriate `<table>`, or 2. Wrap the contents of all cells in the column with a `<div>` (using a `cellTemplate` or `formatter`), assign the div's style `width`, then assign the column `width` or add a CSS `width` to the column class created by DataTable. <pre><code>.yui3-datatable .yui3-datatable-col-foo { padding: 0; width: 125px; } .yui3-datatable .yui3-datatable-col-foo .yui3-datatable-liner { overflow: hidden; padding: 4px 10px; width: 125px; } </pre></code> <pre><code>var table = new Y.DataTable({ columns: [ { key: 'foo', cellTemplate: '&lt;td class="{className}">' + '&lt;div class="yui3-datatable-liner">{content}&lt;/div>' + '&lt;/td>' }, ... ], ... }); </code></pre> To add a liner to all columns, either provide a custom `bodyView` to the DataTable constructor or update the default `bodyView`'s `CELL_TEMPLATE` like so: <pre><code>table.on('table:renderBody', function (e) { e.view.CELL_TEMPLATE = e.view.CELL_TEMPLATE.replace(/\{content\}/, '&lt;div class="yui3-datatable-liner">{content}&lt;/div>'); }); </code></pre> Keep in mind that DataTable skins apply cell `padding`, so assign your CSS `width`s accordingly or override the `padding` style for that column's `<td>`s to 0, and add `padding` to the liner `<div>`'s styles as shown above. @class DataTable.ColumnWidths @for DataTable @since 3.5.0 **/ function ColumnWidths() {} Y.mix(ColumnWidths.prototype, { /** The HTML template used to create the table's `<col>`s. @property COL_TEMPLATE @type {HTML} @default '<col/>' @since 3.5.0 **/ COL_TEMPLATE: '<col/>', /** The HTML template used to create the table's `<colgroup>`. @property COLGROUP_TEMPLATE @type {HTML} @default '<colgroup/>' @since 3.5.0 **/ COLGROUP_TEMPLATE: '<colgroup/>', /** Assigns the style width of the `<col>` representing the column identifed by `id` and updates the column configuration. Pass the empty string for `width` to return a column to auto sizing. This does not trigger a `columnsChange` event today, but I can be convinced that it should. @method setColumnWidth @param {Number|String|Object} id The column config object or key, name, or index of a column in the host's `_displayColumns` array. @param {Number|String} width CSS width value. Numbers are treated as pixels @return {DataTable} @chainable @since 3.5.0 **/ setColumnWidth: function (id, width) { var col = this.getColumn(id), index = col && arrayIndex(this._displayColumns, col); if (index > -1) { if (isNumber(width)) { width += 'px'; } col.width = width; this._setColumnWidth(index, width); } return this; }, //-------------------------------------------------------------------------- // Protected properties and methods //-------------------------------------------------------------------------- /** Renders the table's `<colgroup>` and populates the `_colgroupNode` property. @method _createColumnGroup @protected @since 3.5.0 **/ _createColumnGroup: function () { return Y.Node.create(this.COLGROUP_TEMPLATE); }, /** Hooks up to the rendering lifecycle to also render the `<colgroup>` and subscribe to `columnChange` events. @method initializer @protected @since 3.5.0 **/ initializer: function () { this.after(['renderView', 'columnsChange'], this._uiSetColumnWidths); }, /** Sets a columns's `<col>` element width style. This is needed to get around browser rendering differences. The colIndex corresponds to the item index of the `<col>` in the table's `<colgroup>`. To unset the width, pass a falsy value for the `width`. @method _setColumnWidth @param {Number} colIndex The display column index @param {Number|String} width The desired width @protected @since 3.5.0 **/ // TODO: move this to a conditional module _setColumnWidth: function (colIndex, width) { // Opera (including Opera Next circa 1/13/2012) and IE7- pass on the // width style to the cells directly, allowing padding and borders to // expand the rendered width. Chrome 16, Safari 5.1.1, and FF 3.6+ all // make the rendered width equal the col's style width, reducing the // cells' calculated width. var colgroup = this._colgroupNode, col = colgroup && colgroup.all('col').item(colIndex), cell, getCStyle; if (col) { if (width && isNumber(width)) { width += 'px'; } col.setStyle('width', width); // Adjust the width for browsers that make // td.style.width === col.style.width if (width && Y.Features.test('table', 'badColWidth')) { cell = this.getCell([0, colIndex]); if (cell) { getCStyle = function (prop) { return parseInt(cell.getComputedStyle(prop), 10)||0; }; col.setStyle('width', // I hate this parseInt(width, 10) - getCStyle('paddingLeft') - getCStyle('paddingRight') - getCStyle('borderLeftWidth') - getCStyle('borderRightWidth') + 'px'); } } } }, /** Populates the table's `<colgroup>` with a `<col>` per item in the `columns` attribute without children. It is assumed that these are the columns that have data cells renderered for them. @method _uiSetColumnWidths @protected @since 3.5.0 **/ _uiSetColumnWidths: function () { if (!this.view) { return; } var template = this.COL_TEMPLATE, colgroup = this._colgroupNode, columns = this._displayColumns, i, len; if (!colgroup) { colgroup = this._colgroupNode = this._createColumnGroup(); this._tableNode.insertBefore( colgroup, this._tableNode.one('> thead, > tfoot, > tbody')); } else { colgroup.empty(); } for (i = 0, len = columns.length; i < len; ++i) { colgroup.append(template); this._setColumnWidth(i, columns[i].width); } } }, true); Y.DataTable.ColumnWidths = ColumnWidths; Y.Base.mix(Y.DataTable, [ColumnWidths]); }, '@VERSION@', {"requires": ["datatable-base"]});
ekeneijeoma/cdnjs
ajax/libs/yui/3.10.3/datatable-column-widths/datatable-column-widths.js
JavaScript
mit
9,486
webshims.register("form-number-date-api",function(a,b,c,d){"use strict";b.addInputType||b.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')"),b.getStep||(b.getStep=function(b,c){var d=a.attr(b,"step");return"any"===d?d:(c=c||i(b),f[c]&&f[c].step?(d=q.number.asNumber(d),(!isNaN(d)&&d>0?d:f[c].step)*(f[c].stepScaleFactor||1)):d)}),b.addMinMaxNumberToCache||(b.addMinMaxNumberToCache=function(a,b,c){a+"AsNumber"in c||(c[a+"AsNumber"]=f[c.type].asNumber(b.attr(a)),isNaN(c[a+"AsNumber"])&&a+"Default"in f[c.type]&&(c[a+"AsNumber"]=f[c.type][a+"Default"]))});var e=parseInt("NaN",10),f=b.inputTypes,g=function(a){return"number"==typeof a||a&&a==1*a},h=function(b){return a('<input type="'+b+'" />').prop("type")===b},i=function(a){return(a.getAttribute("type")||"").toLowerCase()},j=function(a){return a&&!isNaN(1*a)},k=b.addMinMaxNumberToCache,l=function(a,b){a=""+a,b-=a.length;for(var c=0;b>c;c++)a="0"+a;return a},m=1e-7,n=b.bugs.bustedValidity;b.addValidityRule("stepMismatch",function(a,c,d,e){if(""===c)return!1;if("type"in d||(d.type=i(a[0])),"week"==d.type)return!1;var g,h,j=(e||{}).stepMismatch||!1;if(f[d.type]&&f[d.type].step){if("step"in d||(d.step=b.getStep(a[0],d.type)),"any"==d.step)return!1;if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;k("min",a,d),g=d.minAsNumber,isNaN(g)&&(h=a.prop("defaultValue"))&&(g=f[d.type].asNumber(h)),isNaN(g)&&(g=f[d.type].stepBase||0),j=Math.abs((d.valueAsNumber-g)%d.step),j=!(m>=j||Math.abs(j-d.step)<=m)}return j}),[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(a){b.addValidityRule(a.name,function(b,c,d,e){var g=(e||{})[a.name]||!1;if(""===c)return g;if("type"in d||(d.type=i(b[0])),f[d.type]&&f[d.type].asNumber){if("valueAsNumber"in d||(d.valueAsNumber=f[d.type].asNumber(c)),isNaN(d.valueAsNumber))return!1;if(k(a.attr,b,d),isNaN(d[a.attr+"AsNumber"]))return g;g=d[a.attr+"AsNumber"]*a.factor<d.valueAsNumber*a.factor-m}return g})}),b.reflectProperties(["input"],["max","min","step"]);var o=b.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var b=this,c=i(b),d=f[c]&&f[c].asNumber?f[c].asNumber(a.prop(b,"value")):o.prop._supget&&o.prop._supget.apply(b,arguments);return null==d&&(d=e),d},set:function(c){var d=this,e=i(d);if(f[e]&&f[e].numberToString){if(isNaN(c))return void a.prop(d,"value","");var g=f[e].numberToString(c);g!==!1?a.prop(d,"value",g):b.error("INVALID_STATE_ERR: DOM Exception 11")}else o.prop._supset&&o.prop._supset.apply(d,arguments)}}}),p=b.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var b=this,c=i(b);return f[c]&&f[c].asDate&&!f[c].noAsDate?f[c].asDate(a.prop(b,"value")):p.prop._supget&&p.prop._supget.call(b)||null},set:function(c){var d=this,e=i(d);if(!f[e]||!f[e].dateToString||f[e].noAsDate)return p.prop._supset&&p.prop._supset.apply(d,arguments)||null;if(null===c)return a.prop(d,"value",""),"";var g=f[e].dateToString(c);return g!==!1?(a.prop(d,"value",g),g):void b.error("INVALID_STATE_ERR: DOM Exception 11")}}});a.each({stepUp:1,stepDown:-1},function(c,d){var e=b.defineNodeNameProperty("input",c,{prop:{value:function(c){var g,h,j,k,l,n,o,p=i(this);if(!f[p]||!f[p].asNumber){if(e.prop&&e.prop._supvalue)return e.prop._supvalue.apply(this,arguments);throw b.info("no step method for type: "+p),"invalid state error"}if(l={type:p},c||(c=1,b.warn("you should always use a factor for stepUp/stepDown")),c*=d,g=b.getStep(this,p),"any"==g)throw b.info("step is 'any' can't apply stepUp/stepDown"),"invalid state error";return b.addMinMaxNumberToCache("min",a(this),l),b.addMinMaxNumberToCache("max",a(this),l),h=a.prop(this,"valueAsNumber"),c>0&&!isNaN(l.minAsNumber)&&(isNaN(h)||l.minAsNumber>h)?void a.prop(this,"valueAsNumber",l.minAsNumber):0>c&&!isNaN(l.maxAsNumber)&&(isNaN(h)||l.maxAsNumber<h)?void a.prop(this,"valueAsNumber",l.maxAsNumber):(isNaN(h)&&(h=0),n=l.minAsNumber,isNaN(n)&&(o=a.prop(this,"defaultValue"))&&(n=f[p].asNumber(o)),n||(n=0),g*=c,h=1*(h+g).toFixed(5),j=(h-n)%g,j&&Math.abs(j)>m&&(k=h-j,k+=j>0?g:-g,h=1*k.toFixed(5)),!isNaN(l.maxAsNumber)&&h>l.maxAsNumber||!isNaN(l.minAsNumber)&&h<l.minAsNumber?void b.info("max/min overflow can't apply stepUp/stepDown"):void a.prop(this,"valueAsNumber",h))}}})});var q={number:{bad:function(a){return!g(a)},step:1,stepScaleFactor:1,asNumber:function(a){return g(a)?1*a:e},numberToString:function(a){return g(a)?a:!1}},range:{minDefault:0,maxDefault:100},color:{bad:function(){var a=/^\u0023[a-f0-9]{6}$/;return function(b){return!b||7!=b.length||!a.test(b)}}()},date:{bad:function(a){if(!a||!a.split||!/\d$/.test(a))return!0;var b,c=a.split(/\u002D/);if(3!==c.length)return!0;var d=!1;if(c[0].length<4||2!=c[1].length||c[1]>12||2!=c[2].length||c[2]>33)d=!0;else for(b=0;3>b;b++)if(!j(c[b])){d=!0;break}return d||a!==this.dateToString(this.asDate(a,!0))},step:1,stepScaleFactor:864e5,asDate:function(a,b){return!b&&this.bad(a)?null:new Date(this.asNumber(a,!0))},asNumber:function(a,b){var c=e;return(b||!this.bad(a))&&(a=a.split(/\u002D/),c=Date.UTC(a[0],a[1]-1,a[2])),c},numberToString:function(a){return g(a)?this.dateToString(new Date(1*a)):!1},dateToString:function(a){return a&&a.getFullYear?l(a.getUTCFullYear(),4)+"-"+l(a.getUTCMonth()+1,2)+"-"+l(a.getUTCDate(),2):!1}},time:{bad:function(b,c){if(!b||!b.split||!/\d$/.test(b))return!0;if(b=b.split(/\u003A/),b.length<2||b.length>3)return!0;var d,e=!1;return b[2]&&(b[2]=b[2].split(/\u002E/),d=parseInt(b[2][1],10),b[2]=b[2][0]),a.each(b,function(a,b){return j(b)&&2===b.length?void 0:(e=!0,!1)}),e?!0:b[0]>23||b[0]<0||b[1]>59||b[1]<0?!0:b[2]&&(b[2]>59||b[2]<0)?!0:d&&isNaN(d)?!0:(d&&(100>d?d*=100:10>d&&(d*=10)),c===!0?[b,d]:!1)},step:60,stepBase:0,stepScaleFactor:1e3,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e;return a=this.bad(a,!0),a!==!0&&(b=Date.UTC("1970",0,1,a[0][0],a[0][1],a[0][2]||0),a[1]&&(b+=a[1])),b},dateToString:function(a){if(a&&a.getUTCHours){var b=l(a.getUTCHours(),2)+":"+l(a.getUTCMinutes(),2),c=a.getSeconds();return"0"!=c&&(b+=":"+l(c,2)),c=a.getUTCMilliseconds(),"0"!=c&&(b+="."+l(c,3)),b}return!1}},month:{bad:function(a){return q.date.bad(a+"-01")},step:1,stepScaleFactor:!1,asDate:function(a){return new Date(q.date.asNumber(a+"-01"))},asNumber:function(a){var b=e;return a&&!this.bad(a)&&(a=a.split(/\u002D/),a[0]=1*a[0]-1970,a[1]=1*a[1]-1,b=12*a[0]+a[1]),b},numberToString:function(a){var b,c=!1;return g(a)&&(b=a%12,a=(a-b)/12+1970,b+=1,1>b&&(a-=1,b+=12),c=l(a,4)+"-"+l(b,2)),c},dateToString:function(a){if(a&&a.getUTCHours){var b=q.date.dateToString(a);return b.split&&(b=b.split(/\u002D/))?b[0]+"-"+b[1]:!1}return!1}},"datetime-local":{bad:function(a,b){return a&&a.split&&2===(a+"special").split(/\u0054/).length?(a=a.split(/\u0054/),q.date.bad(a[0])||q.time.bad(a[1],b)):!0},noAsDate:!0,asDate:function(a){return a=new Date(this.asNumber(a)),isNaN(a)?null:a},asNumber:function(a){var b=e,c=this.bad(a,!0);return c!==!0&&(a=a.split(/\u0054/)[0].split(/\u002D/),b=Date.UTC(a[0],a[1]-1,a[2],c[0][0],c[0][1],c[0][2]||0),c[1]&&(b+=c[1])),b},dateToString:function(a,b){return q.date.dateToString(a)+"T"+q.time.dateToString(a,b)}}};!n&&h("range")&&h("time")&&h("month")&&h("datetime-local")||(q.range=a.extend({},q.number,q.range),q.time=a.extend({},q.date,q.time),q.month=a.extend({},q.date,q.month),q["datetime-local"]=a.extend({},q.date,q.time,q["datetime-local"])),["number","month","range","date","time","color","datetime-local"].forEach(function(a){(n||!h(a))&&b.addInputType(a,q[a])}),null==a("<input />").prop("labels")&&b.defineNodeNamesProperty("button, input, keygen, meter, output, progress, select, textarea","labels",{prop:{get:function(){if("hidden"==this.type)return null;var b=this.id,c=a(this).closest("label").filter(function(){var a=this.attributes["for"]||{};return!a.specified||a.value==b});return b&&(c=c.add('label[for="'+b+'"]')),c.get()},writeable:!1}})});
schoren/cdnjs
ajax/libs/webshim/1.14.4-RC2/minified/shims/form-number-date-api.js
JavaScript
mit
8,018
<?php /** * @file * Definition of Drupal\Core\Ajax\DataCommand. */ namespace Drupal\Core\Ajax; use Drupal\Core\Ajax\CommandInterface; /** * An AJAX command for implementing jQuery's data() method. * * This instructs the client to attach the name=value pair of data to the * selector via jQuery's data cache. * * This command is implemented by Drupal.AjaxCommands.prototype.data() defined * in misc/ajax.js. * * @ingroup ajax */ class DataCommand implements CommandInterface { /** * A CSS selector string for elements to which data will be attached. * * If the command is a response to a request from an #ajax form element then * this value can be NULL. * * @var string */ protected $selector; /** * The key of the data attached to elements matched by the selector. * * @var string */ protected $name; /** * The value of the data to be attached to elements matched by the selector. * * The data is not limited to strings; it can be any format. * * @var mixed */ protected $value; /** * Constructs a DataCommand object. * * @param string $selector * A CSS selector for the elements to which the data will be attached. * @param string $name * The key of the data to be attached to elements matched by the selector. * @param type $value * The value of the data to be attached to elements matched by the selector. */ public function __construct($selector, $name, $value) { $this->selector = $selector; $this->name = $name; $this->value = $value; } /** * Implements Drupal\Core\Ajax\CommandInterface:render(). */ public function render() { return array( 'command' => 'data', 'selector' => $this->selector, 'name' => $this->name, 'value' => $this->value, ); } }
ital-lion/Drupal4Lions
core/lib/Drupal/Core/Ajax/DataCommand.php
PHP
mit
1,838
"use strict"; const conversions = require("webidl-conversions"); const utils = require("./utils.js"); const impl = utils.implSymbol; function Attr() { throw new TypeError("Illegal constructor"); } Attr.prototype.toString = function () { if (this === Attr.prototype) { return "[object AttrPrototype]"; } return this[impl].toString(); }; Object.defineProperty(Attr.prototype, "namespaceURI", { get() { return utils.tryWrapperForImpl(this[impl].namespaceURI); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "prefix", { get() { return utils.tryWrapperForImpl(this[impl].prefix); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "localName", { get() { return utils.tryWrapperForImpl(this[impl].localName); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "name", { get() { return utils.tryWrapperForImpl(this[impl].name); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "nodeName", { get() { return utils.tryWrapperForImpl(this[impl].nodeName); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "value", { get() { return utils.tryWrapperForImpl(this[impl].value); }, set(V) { V = conversions["DOMString"](V); this[impl].value = utils.tryImplForWrapper(V); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "nodeValue", { get() { return utils.tryWrapperForImpl(this[impl].nodeValue); }, set(V) { V = conversions["DOMString"](V, { treatNullAsEmptyString: true }); this[impl].nodeValue = utils.tryImplForWrapper(V); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "textContent", { get() { return utils.tryWrapperForImpl(this[impl].textContent); }, set(V) { V = conversions["DOMString"](V, { treatNullAsEmptyString: true }); this[impl].textContent = utils.tryImplForWrapper(V); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "ownerElement", { get() { return utils.tryWrapperForImpl(this[impl].ownerElement); }, enumerable: true, configurable: true }); Object.defineProperty(Attr.prototype, "specified", { get() { return utils.tryWrapperForImpl(this[impl].specified); }, enumerable: true, configurable: true }); module.exports = { mixedInto: [], is(obj) { if (obj) { if (obj[impl] instanceof Impl.implementation) { return true; } for (let i = 0; i < module.exports.mixedInto.length; ++i) { if (obj instanceof module.exports.mixedInto[i]) { return true; } } } return false; }, isImpl(obj) { if (obj) { if (obj instanceof Impl.implementation) { return true; } const wrapper = utils.wrapperForImpl(obj); for (let i = 0; i < module.exports.mixedInto.length; ++i) { if (wrapper instanceof module.exports.mixedInto[i]) { return true; } } } return false; }, create(constructorArgs, privateData) { let obj = Object.create(Attr.prototype); this.setup(obj, constructorArgs, privateData); return obj; }, createImpl(constructorArgs, privateData) { let obj = Object.create(Attr.prototype); this.setup(obj, constructorArgs, privateData); return utils.implForWrapper(obj); }, _internalSetup(obj) { }, setup(obj, constructorArgs, privateData) { if (!privateData) privateData = {}; privateData.wrapper = obj; this._internalSetup(obj); obj[impl] = new Impl.implementation(constructorArgs, privateData); obj[impl][utils.wrapperSymbol] = obj; }, interface: Attr, expose: { Window: { Attr: Attr } } }; const Impl = require("../attributes/Attr-impl.js");
pornvutp/tact
node_modules/jsdom/lib/jsdom/living/generated/Attr.js
JavaScript
mit
3,905
/*! * Bootstrap-select v1.7.4 (http://silviomoreto.github.io/bootstrap-select) * * Copyright 2013-2015 bootstrap-select * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) */ !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(a){a.fn.selectpicker.defaults={noneSelectedText:"Нищо избрано",noneResultsText:"Няма резултат за {0}",countSelectedText:function(a,b){return 1==a?"{0} избран елемент":"{0} избрани елемента"},maxOptionsText:function(a,b){return[1==a?"Лимита е достигнат ({n} елемент максимум)":"Лимита е достигнат ({n} елемента максимум)",1==b?"Груповия лимит е достигнат ({n} елемент максимум)":"Груповия лимит е достигнат ({n} елемента максимум)"]},selectAllText:"Избери всички",deselectAllText:"Размаркирай всички",multipleSeparator:", "}}(a)});
sympmarc/cdnjs
ajax/libs/bootstrap-select/1.7.4/js/i18n/defaults-bg_BG.min.js
JavaScript
mit
1,173
module.exports = function(grunt) { var TRAVIS = process.env.TRAVIS; var BROWSERS = TRAVIS ? 'Firefox' : 'Chrome'; /** * Run tests * * grunt test * grunt test:unit * grunt test:client * grunt test:e2e */ grunt.registerMultiTask('test', 'Run tests.', function() { var specDone = this.async(); var node = require('which').sync('node'); var path = require('path'); var cmd = path.join(__dirname, '..', 'bin', 'karma'); var spawnKarma = function(args, callback) { grunt.log.writeln(['Running', cmd].concat(args).join(' ')); var child; if (process.platform === 'win32') { child = grunt.util.spawn({cmd: node, args: [cmd].concat(args)}, callback); } else { child = grunt.util.spawn({cmd: cmd, args: args}, callback); } child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); }; var exec = function(args, failMsg) { spawnKarma(args, function(err, result, code) { if (code) { console.error(err); grunt.fail.fatal(failMsg, code); } else { specDone(); } }); }; // E2E tests if (this.target === 'e2e') { var tests = grunt.file.expand(this.data); var processToKill; var args = [ 'start', null, '--single-run', '--no-auto-watch', '--browsers=' + BROWSERS ]; var next = function(err, result, code) { if (processToKill) { processToKill.kill(); } if (err || code) { console.error(err); grunt.fail.fatal('E2E test "' + args[1] + '" failed.', code); } else { args[1] = tests.shift(); if (args[1]) { if (args[1] === 'test/e2e/angular-scenario/karma.conf.js') { processToKill = grunt.util.spawn({ cmd: node, args: ['test/e2e/angular-scenario/server.js'] }, function() {}); } spawnKarma(args, next); } else { specDone(); } } }; // run only e2e tests specified by args if (arguments.length) { var slicedArgs = Array.prototype.slice.call(arguments); tests = tests.filter(function(configFile) { return slicedArgs.some(function(test) { return configFile.indexOf(test) !== -1; }); }); } return next(); } // CLIENT unit tests if (this.target === 'client') { return exec(['start', this.data, '--single-run', '--no-auto-watch', '--reporters=dots', '--browsers=' + BROWSERS], 'Client unit tests failed.'); } // UNIT tests or TASK tests grunt.task.run([this.data]); specDone(); }); };
gorhgorh/karma
tasks/test.js
JavaScript
mit
2,762
define("ace/mode/vala_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var ValaHighlightRules = function() { this.$rules = { start: [ { token: [ 'meta.using.vala', 'keyword.other.using.vala', 'meta.using.vala', 'storage.modifier.using.vala', 'meta.using.vala', 'punctuation.terminator.vala' ], regex: '^(\\s*)(using)\\b(?:(\\s*)([^ ;$]+)(\\s*)((?:;)?))?' }, { include: '#code' } ], '#all-types': [ { include: '#primitive-arrays' }, { include: '#primitive-types' }, { include: '#object-types' } ], '#annotations': [ { token: [ 'storage.type.annotation.vala', 'punctuation.definition.annotation-arguments.begin.vala' ], regex: '(@[^ (]+)(\\()', push: [ { token: 'punctuation.definition.annotation-arguments.end.vala', regex: '\\)', next: 'pop' }, { token: [ 'constant.other.key.vala', 'text', 'keyword.operator.assignment.vala' ], regex: '(\\w*)(\\s*)(=)' }, { include: '#code' }, { token: 'punctuation.seperator.property.vala', regex: ',' }, { defaultToken: 'meta.declaration.annotation.vala' } ] }, { token: 'storage.type.annotation.vala', regex: '@\\w*' } ], '#anonymous-classes-and-new': [ { token: 'keyword.control.new.vala', regex: '\\bnew\\b', push_disabled: [ { token: 'text', regex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)', TODO: 'FIXME: regexp doesn\'t have js equivalent', originalRegex: '(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)', next: 'pop' }, { token: [ 'storage.type.vala', 'text' ], regex: '(\\w+)(\\s*)(?=\\[)', push: [ { token: 'text', regex: '}|(?=;|\\))', next: 'pop' }, { token: 'text', regex: '\\[', push: [ { token: 'text', regex: '\\]', next: 'pop' }, { include: '#code' } ] }, { token: 'text', regex: '{', push: [ { token: 'text', regex: '(?=})', next: 'pop' }, { include: '#code' } ] } ] }, { token: 'text', regex: '(?=\\w.*\\()', push: [ { token: 'text', regex: '(?<=\\))', TODO: 'FIXME: regexp doesn\'t have js equivalent', originalRegex: '(?<=\\))', next: 'pop' }, { include: '#object-types' }, { token: 'text', regex: '\\(', push: [ { token: 'text', regex: '\\)', next: 'pop' }, { include: '#code' } ] } ] }, { token: 'meta.inner-class.vala', regex: '{', push: [ { token: 'meta.inner-class.vala', regex: '}', next: 'pop' }, { include: '#class-body' }, { defaultToken: 'meta.inner-class.vala' } ] } ] } ], '#assertions': [ { token: [ 'keyword.control.assert.vala', 'meta.declaration.assertion.vala' ], regex: '\\b(assert|requires|ensures)(\\s)', push: [ { token: 'meta.declaration.assertion.vala', regex: '$', next: 'pop' }, { token: 'keyword.operator.assert.expression-seperator.vala', regex: ':' }, { include: '#code' }, { defaultToken: 'meta.declaration.assertion.vala' } ] } ], '#class': [ { token: 'meta.class.vala', regex: '(?=\\w?[\\w\\s]*(?:class|(?:@)?interface|enum|struct|namespace)\\s+\\w+)', push: [ { token: 'paren.vala', regex: '}', next: 'pop' }, { include: '#storage-modifiers' }, { include: '#comments' }, { token: [ 'storage.modifier.vala', 'meta.class.identifier.vala', 'entity.name.type.class.vala' ], regex: '(class|(?:@)?interface|enum|struct|namespace)(\\s+)([\\w\\.]+)' }, { token: 'storage.modifier.extends.vala', regex: ':', push: [ { token: 'meta.definition.class.inherited.classes.vala', regex: '(?={|,)', next: 'pop' }, { include: '#object-types-inherited' }, { include: '#comments' }, { defaultToken: 'meta.definition.class.inherited.classes.vala' } ] }, { token: [ 'storage.modifier.implements.vala', 'meta.definition.class.implemented.interfaces.vala' ], regex: '(,)(\\s)', push: [ { token: 'meta.definition.class.implemented.interfaces.vala', regex: '(?=\\{)', next: 'pop' }, { include: '#object-types-inherited' }, { include: '#comments' }, { defaultToken: 'meta.definition.class.implemented.interfaces.vala' } ] }, { token: 'paren.vala', regex: '{', push: [ { token: 'paren.vala', regex: '(?=})', next: 'pop' }, { include: '#class-body' }, { defaultToken: 'meta.class.body.vala' } ] }, { defaultToken: 'meta.class.vala' } ], comment: 'attempting to put namespace in here.' } ], '#class-body': [ { include: '#comments' }, { include: '#class' }, { include: '#enums' }, { include: '#methods' }, { include: '#annotations' }, { include: '#storage-modifiers' }, { include: '#code' } ], '#code': [ { include: '#comments' }, { include: '#class' }, { token: 'text', regex: '{', push: [ { token: 'text', regex: '}', next: 'pop' }, { include: '#code' } ] }, { include: '#assertions' }, { include: '#parens' }, { include: '#constants-and-special-vars' }, { include: '#anonymous-classes-and-new' }, { include: '#keywords' }, { include: '#storage-modifiers' }, { include: '#strings' }, { include: '#all-types' } ], '#comments': [ { token: 'punctuation.definition.comment.vala', regex: '/\\*\\*/' }, { include: 'text.html.javadoc' }, { include: '#comments-inline' } ], '#comments-inline': [ { token: 'punctuation.definition.comment.vala', regex: '/\\*', push: [ { token: 'punctuation.definition.comment.vala', regex: '\\*/', next: 'pop' }, { defaultToken: 'comment.block.vala' } ] }, { token: [ 'text', 'punctuation.definition.comment.vala', 'comment.line.double-slash.vala' ], regex: '(\\s*)(//)(.*$)' } ], '#constants-and-special-vars': [ { token: 'constant.language.vala', regex: '\\b(?:true|false|null)\\b' }, { token: 'variable.language.vala', regex: '\\b(?:this|base)\\b' }, { token: 'constant.numeric.vala', regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:[LlFfUuDd]|UL|ul)?\\b' }, { token: [ 'keyword.operator.dereference.vala', 'constant.other.vala' ], regex: '((?:\\.)?)\\b([A-Z][A-Z0-9_]+)(?!<|\\.class|\\s*\\w+\\s*=)\\b' } ], '#enums': [ { token: 'text', regex: '^(?=\\s*[A-Z0-9_]+\\s*(?:{|\\(|,))', push: [ { token: 'text', regex: '(?=;|})', next: 'pop' }, { token: 'constant.other.enum.vala', regex: '\\w+', push: [ { token: 'meta.enum.vala', regex: '(?=,|;|})', next: 'pop' }, { include: '#parens' }, { token: 'text', regex: '{', push: [ { token: 'text', regex: '}', next: 'pop' }, { include: '#class-body' } ] }, { defaultToken: 'meta.enum.vala' } ] } ] } ], '#keywords': [ { token: 'keyword.control.catch-exception.vala', regex: '\\b(?:try|catch|finally|throw)\\b' }, { token: 'keyword.control.vala', regex: '\\?|:|\\?\\?' }, { token: 'keyword.control.vala', regex: '\\b(?:return|break|case|continue|default|do|while|for|foreach|switch|if|else|in|yield|get|set|value)\\b' }, { token: 'keyword.operator.vala', regex: '\\b(?:typeof|is|as)\\b' }, { token: 'keyword.operator.comparison.vala', regex: '==|!=|<=|>=|<>|<|>' }, { token: 'keyword.operator.assignment.vala', regex: '=' }, { token: 'keyword.operator.increment-decrement.vala', regex: '\\-\\-|\\+\\+' }, { token: 'keyword.operator.arithmetic.vala', regex: '\\-|\\+|\\*|\\/|%' }, { token: 'keyword.operator.logical.vala', regex: '!|&&|\\|\\|' }, { token: 'keyword.operator.dereference.vala', regex: '\\.(?=\\S)', originalRegex: '(?<=\\S)\\.(?=\\S)' }, { token: 'punctuation.terminator.vala', regex: ';' }, { token: 'keyword.operator.ownership', regex: 'owned|unowned' } ], '#methods': [ { token: 'meta.method.vala', regex: '(?!new)(?=\\w.*\\s+)(?=[^=]+\\()', push: [ { token: 'paren.vala', regex: '}|(?=;)', next: 'pop' }, { include: '#storage-modifiers' }, { token: [ 'entity.name.function.vala', 'meta.method.identifier.vala' ], regex: '([\\~\\w\\.]+)(\\s*\\()', push: [ { token: 'meta.method.identifier.vala', regex: '\\)', next: 'pop' }, { include: '#parameters' }, { defaultToken: 'meta.method.identifier.vala' } ] }, { token: 'meta.method.return-type.vala', regex: '(?=\\w.*\\s+\\w+\\s*\\()', push: [ { token: 'meta.method.return-type.vala', regex: '(?=\\w+\\s*\\()', next: 'pop' }, { include: '#all-types' }, { defaultToken: 'meta.method.return-type.vala' } ] }, { include: '#throws' }, { token: 'paren.vala', regex: '{', push: [ { token: 'paren.vala', regex: '(?=})', next: 'pop' }, { include: '#code' }, { defaultToken: 'meta.method.body.vala' } ] }, { defaultToken: 'meta.method.vala' } ] } ], '#namespace': [ { token: 'text', regex: '^(?=\\s*[A-Z0-9_]+\\s*(?:{|\\(|,))', push: [ { token: 'text', regex: '(?=;|})', next: 'pop' }, { token: 'constant.other.namespace.vala', regex: '\\w+', push: [ { token: 'meta.namespace.vala', regex: '(?=,|;|})', next: 'pop' }, { include: '#parens' }, { token: 'text', regex: '{', push: [ { token: 'text', regex: '}', next: 'pop' }, { include: '#code' } ] }, { defaultToken: 'meta.namespace.vala' } ] } ], comment: 'This is not quite right. See the class grammar right now' } ], '#object-types': [ { token: 'storage.type.generic.vala', regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*<', push: [ { token: 'storage.type.generic.vala', regex: '>|[^\\w\\s,\\?<\\[()\\]]', TODO: 'FIXME: regexp doesn\'t have js equivalent', originalRegex: '>|[^\\w\\s,\\?<\\[(?:[,]+)\\]]', next: 'pop' }, { include: '#object-types' }, { token: 'storage.type.generic.vala', regex: '<', push: [ { token: 'storage.type.generic.vala', regex: '>|[^\\w\\s,\\[\\]<]', next: 'pop' }, { defaultToken: 'storage.type.generic.vala' } ], comment: 'This is just to support <>\'s with no actual type prefix' }, { defaultToken: 'storage.type.generic.vala' } ] }, { token: 'storage.type.object.array.vala', regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*(?=\\[)', push: [ { token: 'storage.type.object.array.vala', regex: '(?=[^\\]\\s])', next: 'pop' }, { token: 'text', regex: '\\[', push: [ { token: 'text', regex: '\\]', next: 'pop' }, { include: '#code' } ] }, { defaultToken: 'storage.type.object.array.vala' } ] }, { token: [ 'storage.type.vala', 'keyword.operator.dereference.vala', 'storage.type.vala' ], regex: '\\b(?:([a-z]\\w*)(\\.))*([A-Z]+\\w*\\b)' } ], '#object-types-inherited': [ { token: 'entity.other.inherited-class.vala', regex: '\\b(?:[a-z]\\w*\\.)*[A-Z]+\\w*<', push: [ { token: 'entity.other.inherited-class.vala', regex: '>|[^\\w\\s,<]', next: 'pop' }, { include: '#object-types' }, { token: 'storage.type.generic.vala', regex: '<', push: [ { token: 'storage.type.generic.vala', regex: '>|[^\\w\\s,<]', next: 'pop' }, { defaultToken: 'storage.type.generic.vala' } ], comment: 'This is just to support <>\'s with no actual type prefix' }, { defaultToken: 'entity.other.inherited-class.vala' } ] }, { token: [ 'entity.other.inherited-class.vala', 'keyword.operator.dereference.vala', 'entity.other.inherited-class.vala' ], regex: '\\b(?:([a-z]\\w*)(\\.))*([A-Z]+\\w*)' } ], '#parameters': [ { token: 'storage.modifier.vala', regex: 'final' }, { include: '#primitive-arrays' }, { include: '#primitive-types' }, { include: '#object-types' }, { token: 'variable.parameter.vala', regex: '\\w+' } ], '#parens': [ { token: 'text', regex: '\\(', push: [ { token: 'text', regex: '\\)', next: 'pop' }, { include: '#code' } ] } ], '#primitive-arrays': [ { token: 'storage.type.primitive.array.vala', regex: '\\b(?:bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|int8|int16|int32|int64|uint8|uint16|uint32|uint64)(?:\\[\\])*\\b' } ], '#primitive-types': [ { token: 'storage.type.primitive.vala', regex: '\\b(?:var|bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|object|short|ushort|string|void|signal|int8|int16|int32|int64|uint8|uint16|uint32|uint64)\\b', comment: 'var is not really a primitive, but acts like one in most cases' } ], '#storage-modifiers': [ { token: 'storage.modifier.vala', regex: '\\b(?:public|private|protected|internal|static|final|sealed|virtual|override|abstract|readonly|volatile|dynamic|async|unsafe|out|ref|weak|owned|unowned|const)\\b', comment: 'Not sure about unsafe and readonly' } ], '#strings': [ { token: 'punctuation.definition.string.begin.vala', regex: '@"', push: [ { token: 'punctuation.definition.string.end.vala', regex: '"', next: 'pop' }, { token: 'constant.character.escape.vala', regex: '\\\\.|%[\\w\\.\\-]+|\\$(?:\\w+|\\([\\w\\s\\+\\-\\*\\/]+\\))' }, { defaultToken: 'string.quoted.interpolated.vala' } ] }, { token: 'punctuation.definition.string.begin.vala', regex: '"', push: [ { token: 'punctuation.definition.string.end.vala', regex: '"', next: 'pop' }, { token: 'constant.character.escape.vala', regex: '\\\\.' }, { token: 'constant.character.escape.vala', regex: '%[\\w\\.\\-]+' }, { defaultToken: 'string.quoted.double.vala' } ] }, { token: 'punctuation.definition.string.begin.vala', regex: '\'', push: [ { token: 'punctuation.definition.string.end.vala', regex: '\'', next: 'pop' }, { token: 'constant.character.escape.vala', regex: '\\\\.' }, { defaultToken: 'string.quoted.single.vala' } ] }, { token: 'punctuation.definition.string.begin.vala', regex: '"""', push: [ { token: 'punctuation.definition.string.end.vala', regex: '"""', next: 'pop' }, { token: 'constant.character.escape.vala', regex: '%[\\w\\.\\-]+' }, { defaultToken: 'string.quoted.triple.vala' } ] } ], '#throws': [ { token: 'storage.modifier.vala', regex: 'throws', push: [ { token: 'meta.throwables.vala', regex: '(?={|;)', next: 'pop' }, { include: '#object-types' }, { defaultToken: 'meta.throwables.vala' } ] } ], '#values': [ { include: '#strings' }, { include: '#object-types' }, { include: '#constants-and-special-vars' } ] } this.normalizeRules(); }; ValaHighlightRules.metaData = { comment: 'Based heavily on the Java bundle\'s language syntax. TODO:\n* Closures\n* Delegates\n* Properties: Better support for properties.\n* Annotations\n* Error domains\n* Named arguments\n* Array slicing, negative indexes, multidimensional\n* construct blocks\n* lock blocks?\n* regex literals\n* DocBlock syntax highlighting. (Currently importing javadoc)\n* Folding rule for comments.\n', fileTypes: [ 'vala' ], foldingStartMarker: '(\\{\\s*(//.*)?$|^\\s*// \\{\\{\\{)', foldingStopMarker: '^\\s*(\\}|// \\}\\}\\}$)', name: 'Vala', scopeName: 'source.vala' } oop.inherits(ValaHighlightRules, TextHighlightRules); exports.ValaHighlightRules = ValaHighlightRules; }); define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { "use strict"; var oop = require("../../lib/oop"); var Range = require("../../range").Range; var BaseFoldMode = require("./fold_mode").FoldMode; var FoldMode = exports.FoldMode = function(commentRegex) { if (commentRegex) { this.foldingStartMarker = new RegExp( this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) ); this.foldingStopMarker = new RegExp( this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) ); } }; oop.inherits(FoldMode, BaseFoldMode); (function() { this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; this._getFoldWidgetBase = this.getFoldWidget; this.getFoldWidget = function(session, foldStyle, row) { var line = session.getLine(row); if (this.singleLineBlockCommentRe.test(line)) { if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) return ""; } var fw = this._getFoldWidgetBase(session, foldStyle, row); if (!fw && this.startRegionRe.test(line)) return "start"; // lineCommentRegionStart return fw; }; this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { var line = session.getLine(row); if (this.startRegionRe.test(line)) return this.getCommentRegionBlock(session, line, row); var match = line.match(this.foldingStartMarker); if (match) { var i = match.index; if (match[1]) return this.openingBracketBlock(session, match[1], row, i); var range = session.getCommentFoldRange(row, i + match[0].length, 1); if (range && !range.isMultiLine()) { if (forceMultiline) { range = this.getSectionRange(session, row); } else if (foldStyle != "all") range = null; } return range; } if (foldStyle === "markbegin") return; var match = line.match(this.foldingStopMarker); if (match) { var i = match.index + match[0].length; if (match[1]) return this.closingBracketBlock(session, match[1], row, i); return session.getCommentFoldRange(row, i, -1); } }; this.getSectionRange = function(session, row) { var line = session.getLine(row); var startIndent = line.search(/\S/); var startRow = row; var startColumn = line.length; row = row + 1; var endRow = row; var maxRow = session.getLength(); while (++row < maxRow) { line = session.getLine(row); var indent = line.search(/\S/); if (indent === -1) continue; if (startIndent > indent) break; var subRange = this.getFoldWidgetRange(session, "all", row); if (subRange) { if (subRange.start.row <= startRow) { break; } else if (subRange.isMultiLine()) { row = subRange.end.row; } else if (startIndent == indent) { break; } } endRow = row; } return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); }; this.getCommentRegionBlock = function(session, line, row) { var startColumn = line.search(/\s*$/); var maxRow = session.getLength(); var startRow = row; var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; var depth = 1; while (++row < maxRow) { line = session.getLine(row); var m = re.exec(line); if (!m) continue; if (m[1]) depth--; else depth++; if (!depth) break; } var endRow = row; if (endRow > startRow) { return new Range(startRow, startColumn, endRow, line.length); } }; }).call(FoldMode.prototype); }); define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { "use strict"; var Range = require("../range").Range; var MatchingBraceOutdent = function() {}; (function() { this.checkOutdent = function(line, input) { if (! /^\s+$/.test(line)) return false; return /^\s*\}/.test(input); }; this.autoOutdent = function(doc, row) { var line = doc.getLine(row); var match = line.match(/^(\s*\})/); if (!match) return 0; var column = match[1].length; var openBracePos = doc.findMatchingBracket({row: row, column: column}); if (!openBracePos || openBracePos.row == row) return 0; var indent = this.$getIndent(doc.getLine(openBracePos.row)); doc.replace(new Range(row, 0, row, column-1), indent); }; this.$getIndent = function(line) { return line.match(/^\s*/)[0]; }; }).call(MatchingBraceOutdent.prototype); exports.MatchingBraceOutdent = MatchingBraceOutdent; }); define("ace/mode/vala",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/vala_highlight_rules","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var Tokenizer = require("../tokenizer").Tokenizer; var ValaHighlightRules = require("./vala_highlight_rules").ValaHighlightRules; var FoldMode = require("./folding/cstyle").FoldMode; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var Mode = function() { this.HighlightRules = ValaHighlightRules; this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); (function() { this.lineCommentStart = "//"; this.blockComment = {start: "/*", end: "*/"}; this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); var tokenizedLine = this.getTokenizer().getLineTokens(line, state); var tokens = tokenizedLine.tokens; var endState = tokenizedLine.state; if (tokens.length && tokens[tokens.length-1].type == "comment") { return indent; } if (state == "start" || state == "no_regex") { var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); if (match) { indent += tab; } } else if (state == "doc-start") { if (endState == "start" || endState == "no_regex") { return ""; } var match = line.match(/^\s*(\/?)\*/); if (match) { if (match[1]) { indent += " "; } indent += "* "; } } return indent; }; this.checkOutdent = function(state, line, input) { return this.$outdent.checkOutdent(line, input); }; this.autoOutdent = function(state, doc, row) { this.$outdent.autoOutdent(doc, row); }; this.$id = "ace/mode/vala" }).call(Mode.prototype); exports.Mode = Mode; });
DonLang/Play_IDE
public/assets/ace/mode-vala-81ceeebdc6a271228514b0e2b7b14b82bf8a7d03be7e61a89bfc74453d29cd30.js
JavaScript
mit
27,394
/* Highcharts JS v5.0.8 (2017-03-08) Highstock as a plugin for Highcharts (c) 2017 Torstein Honsi License: www.highcharts.com/license */ (function(J){"object"===typeof module&&module.exports?module.exports=J:J(Highcharts)})(function(J){(function(a){var F=a.addEvent,n=a.Axis,x=a.Chart,A=a.css,G=a.dateFormat,B=a.defined,I=a.each,w=a.extend,v=a.noop,l=a.Series,m=a.timeUnits;a=a.wrap;a(l.prototype,"init",function(a){var b;a.apply(this,Array.prototype.slice.call(arguments,1));(b=this.xAxis)&&b.options.ordinal&&F(this,"updatedData",function(){delete b.ordinalIndex})});a(n.prototype,"getTimeTicks",function(a,b,c,e,q,y,H,f){var d=0,t,g,h= {},u,E,k,z=[],p=-Number.MAX_VALUE,r=this.options.tickPixelInterval;if(!this.options.ordinal&&!this.options.breaks||!y||3>y.length||void 0===c)return a.call(this,b,c,e,q);E=y.length;for(t=0;t<E;t++){k=t&&y[t-1]>e;y[t]<c&&(d=t);if(t===E-1||y[t+1]-y[t]>5*H||k){if(y[t]>p){for(g=a.call(this,b,y[d],y[t],q);g.length&&g[0]<=p;)g.shift();g.length&&(p=g[g.length-1]);z=z.concat(g)}d=t+1}if(k)break}a=g.info;if(f&&a.unitRange<=m.hour){t=z.length-1;for(d=1;d<t;d++)G("%d",z[d])!==G("%d",z[d-1])&&(h[z[d]]="day", u=!0);u&&(h[z[0]]="day");a.higherRanks=h}z.info=a;if(f&&B(r)){f=a=z.length;t=[];var C;for(u=[];f--;)d=this.translate(z[f]),C&&(u[f]=C-d),t[f]=C=d;u.sort();u=u[Math.floor(u.length/2)];u<.6*r&&(u=null);f=z[a-1]>e?a-1:a;for(C=void 0;f--;)d=t[f],e=Math.abs(C-d),C&&e<.8*r&&(null===u||e<.8*u)?(h[z[f]]&&!h[z[f+1]]?(e=f+1,C=d):e=f,z.splice(e,1)):C=d}return z});w(n.prototype,{beforeSetTickPositions:function(){var a,b=[],c=!1,e,q=this.getExtremes(),y=q.min,m=q.max,f,d=this.isXAxis&&!!this.options.breaks,q= this.options.ordinal,t=this.chart.options.chart.ignoreHiddenSeries;if(q||d){I(this.series,function(f,h){if(!(t&&!1===f.visible||!1===f.takeOrdinalPosition&&!d)&&(b=b.concat(f.processedXData),a=b.length,b.sort(function(h,f){return h-f}),a))for(h=a-1;h--;)b[h]===b[h+1]&&b.splice(h,1)});a=b.length;if(2<a){e=b[1]-b[0];for(f=a-1;f--&&!c;)b[f+1]-b[f]!==e&&(c=!0);!this.options.keepOrdinalPadding&&(b[0]-y>e||m-b[b.length-1]>e)&&(c=!0)}c?(this.ordinalPositions=b,e=this.ordinal2lin(Math.max(y,b[0]),!0),f=Math.max(this.ordinal2lin(Math.min(m, b[b.length-1]),!0),1),this.ordinalSlope=m=(m-y)/(f-e),this.ordinalOffset=y-e*m):this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0}this.isOrdinal=q&&c;this.groupIntervalFactor=null},val2lin:function(a,b){var c=this.ordinalPositions;if(c){var e=c.length,q,g;for(q=e;q--;)if(c[q]===a){g=q;break}for(q=e-1;q--;)if(a>c[q]||0===q){a=(a-c[q])/(c[q+1]-c[q]);g=q+a;break}b=b?g:this.ordinalSlope*(g||0)+this.ordinalOffset}else b=a;return b},lin2val:function(a,b){var c=this.ordinalPositions;if(c){var e= this.ordinalSlope,q=this.ordinalOffset,g=c.length-1,m;if(b)0>a?a=c[0]:a>g?a=c[g]:(g=Math.floor(a),m=a-g);else for(;g--;)if(b=e*g+q,a>=b){e=e*(g+1)+q;m=(a-b)/(e-b);break}return void 0!==m&&void 0!==c[g]?c[g]+(m?m*(c[g+1]-c[g]):0):a}return a},getExtendedPositions:function(){var a=this.chart,b=this.series[0].currentDataGrouping,c=this.ordinalIndex,e=b?b.count+b.unitName:"raw",q=this.getExtremes(),m,l;c||(c=this.ordinalIndex={});c[e]||(m={series:[],chart:a,getExtremes:function(){return{min:q.dataMin, max:q.dataMax}},options:{ordinal:!0},val2lin:n.prototype.val2lin,ordinal2lin:n.prototype.ordinal2lin},I(this.series,function(f){l={xAxis:m,xData:f.xData,chart:a,destroyGroupedData:v};l.options={dataGrouping:b?{enabled:!0,forced:!0,approximation:"open",units:[[b.unitName,[b.count]]]}:{enabled:!1}};f.processData.apply(l);m.series.push(l)}),this.beforeSetTickPositions.apply(m),c[e]=m.ordinalPositions);return c[e]},getGroupIntervalFactor:function(a,b,c){var e;c=c.processedXData;var q=c.length,g=[];e= this.groupIntervalFactor;if(!e){for(e=0;e<q-1;e++)g[e]=c[e+1]-c[e];g.sort(function(a,f){return a-f});g=g[Math.floor(q/2)];a=Math.max(a,c[0]);b=Math.min(b,c[q-1]);this.groupIntervalFactor=e=q*g/(b-a)}return e},postProcessTickInterval:function(a){var b=this.ordinalSlope;return b?this.options.breaks?this.closestPointRange:a/(b/this.closestPointRange):a}});n.prototype.ordinal2lin=n.prototype.val2lin;a(x.prototype,"pan",function(a,b){var c=this.xAxis[0],e=b.chartX,q=!1;if(c.options.ordinal&&c.series.length){var g= this.mouseDownX,m=c.getExtremes(),f=m.dataMax,d=m.min,t=m.max,D=this.hoverPoints,h=c.closestPointRange,g=(g-e)/(c.translationSlope*(c.ordinalSlope||h)),u={ordinalPositions:c.getExtendedPositions()},h=c.lin2val,E=c.val2lin,k;u.ordinalPositions?1<Math.abs(g)&&(D&&I(D,function(h){h.setState()}),0>g?(D=u,k=c.ordinalPositions?c:u):(D=c.ordinalPositions?c:u,k=u),u=k.ordinalPositions,f>u[u.length-1]&&u.push(f),this.fixedRange=t-d,g=c.toFixedRange(null,null,h.apply(D,[E.apply(D,[d,!0])+g,!0]),h.apply(k,[E.apply(k, [t,!0])+g,!0])),g.min>=Math.min(m.dataMin,d)&&g.max<=Math.max(f,t)&&c.setExtremes(g.min,g.max,!0,!1,{trigger:"pan"}),this.mouseDownX=e,A(this.container,{cursor:"move"})):q=!0}else q=!0;q&&a.apply(this,Array.prototype.slice.call(arguments,1))});l.prototype.gappedPath=function(){var a=this.options.gapSize,b=this.points.slice(),c=b.length-1;if(a&&0<c)for(;c--;)b[c+1].x-b[c].x>this.closestPointRange*a&&b.splice(c+1,0,{isNull:!0});return this.getGraphPath(b)}})(J);(function(a){function F(){return Array.prototype.slice.call(arguments, 1)}function n(a){a.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,x(this.pointArrayMap,["y"]))}var x=a.pick,A=a.wrap,G=a.each,B=a.extend,I=a.isArray,w=a.fireEvent,v=a.Axis,l=a.Series;B(v.prototype,{isInBreak:function(a,g){var b=a.repeat||Infinity,c=a.from,e=a.to-a.from;g=g>=c?(g-c)%b:b-(c-g)%b;return a.inclusive?g<=e:g<e&&0!==g},isInAnyBreak:function(a,g){var b=this.options.breaks,c=b&&b.length,e,q,m;if(c){for(;c--;)this.isInBreak(b[c],a)&&(e=!0,q||(q=x(b[c].showPoints,this.isXAxis? !1:!0)));m=e&&g?e&&!q:e}return m}});A(v.prototype,"setTickPositions",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var g=this.tickPositions,b=this.tickPositions.info,c=[],e;for(e=0;e<g.length;e++)this.isInAnyBreak(g[e])||c.push(g[e]);this.tickPositions=c;this.tickPositions.info=b}});A(v.prototype,"init",function(a,g,b){var c=this;b.breaks&&b.breaks.length&&(b.ordinal=!1);a.call(this,g,b);a=this.options.breaks;c.isBroken=I(a)&&!!a.length;c.isBroken&&(c.val2lin= function(a){var e=a,b,g;for(g=0;g<c.breakArray.length;g++)if(b=c.breakArray[g],b.to<=a)e-=b.len;else if(b.from>=a)break;else if(c.isInBreak(b,a)){e-=a-b.from;break}return e},c.lin2val=function(a){var e,b;for(b=0;b<c.breakArray.length&&!(e=c.breakArray[b],e.from>=a);b++)e.to<a?a+=e.len:c.isInBreak(e,a)&&(a+=e.len);return a},c.setExtremes=function(a,c,b,g,f){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(c);)c-=this.closestPointRange;v.prototype.setExtremes.call(this,a, c,b,g,f)},c.setAxisTranslation=function(a){v.prototype.setAxisTranslation.call(this,a);var b=c.options.breaks;a=[];var e=[],g=0,f,d,t=c.userMin||c.min,m=c.userMax||c.max,h=x(c.pointRangePadding,0),u,E;for(E in b)d=b[E],f=d.repeat||Infinity,c.isInBreak(d,t)&&(t+=d.to%f-t%f),c.isInBreak(d,m)&&(m-=m%f-d.from%f);for(E in b){d=b[E];u=d.from;for(f=d.repeat||Infinity;u-f>t;)u-=f;for(;u<t;)u+=f;for(;u<m;u+=f)a.push({value:u,move:"in"}),a.push({value:u+(d.to-d.from),move:"out",size:d.breakSize})}a.sort(function(h, a){return h.value===a.value?("in"===h.move?0:1)-("in"===a.move?0:1):h.value-a.value});b=0;u=t;for(E in a)d=a[E],b+="in"===d.move?1:-1,1===b&&"in"===d.move&&(u=d.value),0===b&&(e.push({from:u,to:d.value,len:d.value-u-(d.size||0)}),g+=d.value-u-(d.size||0));c.breakArray=e;c.unitLength=m-t-g+h;w(c,"afterBreaks");c.transA=c.options.staticScale?c.options.staticScale:(m-c.min+h)/c.unitLength*c.transA;h&&(c.minPixelPadding=c.transA*c.minPointOffset);c.min=t;c.max=m})});A(l.prototype,"generatePoints",function(a){a.apply(this, F(arguments));var g=this.xAxis,b=this.yAxis,c=this.points,e,m=c.length,l=this.options.connectNulls,w;if(g&&b&&(g.options.breaks||b.options.breaks))for(;m--;)e=c[m],w=null===e.y&&!1===l,w||!g.isInAnyBreak(e.x,!0)&&!b.isInAnyBreak(e.y,!0)||(c.splice(m,1),this.data[m]&&this.data[m].destroyElements())});a.Series.prototype.drawBreaks=function(a,g){var b=this,c=b.points,e,m,l,v;a&&G(g,function(f){e=a.breakArray||[];m=a.isXAxis?a.min:x(b.options.threshold,a.min);G(c,function(d){v=x(d["stack"+f.toUpperCase()], d[f]);G(e,function(f){l=!1;if(m<f.from&&v>f.to||m>f.from&&v<f.from)l="pointBreak";else if(m<f.from&&v>f.from&&v<f.to||m>f.from&&v>f.to&&v<f.from)l="pointInBreak";l&&w(a,l,{point:d,brk:f})})})})};A(a.seriesTypes.column.prototype,"drawPoints",n);A(a.Series.prototype,"drawPoints",n)})(J);(function(a){var F=a.arrayMax,n=a.arrayMin,x=a.Axis,A=a.defaultPlotOptions,G=a.defined,B=a.each,I=a.extend,w=a.format,v=a.isNumber,l=a.merge,m=a.pick,g=a.Point,b=a.Tooltip,c=a.wrap,e=a.Series.prototype,q=e.processData, y=e.generatePoints,H=e.destroy,f={approximation:"average",groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y", "%Y","-%Y"]}},d={line:{},spline:{},area:{},areaspline:{},column:{approximation:"sum",groupPixelWidth:10},arearange:{approximation:"range"},areasplinerange:{approximation:"range"},columnrange:{approximation:"range",groupPixelWidth:10},candlestick:{approximation:"ohlc",groupPixelWidth:10},ohlc:{approximation:"ohlc",groupPixelWidth:5}},t=a.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day", [1]],["week",[1]],["month",[1,3,6]],["year",null]],D={sum:function(h){var a=h.length,f;if(!a&&h.hasNulls)f=null;else if(a)for(f=0;a--;)f+=h[a];return f},average:function(a){var h=a.length;a=D.sum(a);v(a)&&h&&(a/=h);return a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?F(a):a.hasNulls?null:void 0},low:function(a){return a.length?n(a):a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0},ohlc:function(a,f,d, k){a=D.open(a);f=D.high(f);d=D.low(d);k=D.close(k);if(v(a)||v(f)||v(d)||v(k))return[a,f,d,k]},range:function(a,f){a=D.low(a);f=D.high(f);if(v(a)||v(f))return[a,f]}};e.groupData=function(a,f,d,k){var h=this.data,p=this.options.data,r=[],u=[],c=[],E=a.length,b,e,g=!!f,m=[[],[],[],[]];k="function"===typeof k?k:D[k];var t=this.pointArrayMap,q=t&&t.length,l,w=0;for(l=e=0;l<=E&&!(a[l]>=d[0]);l++);for(l;l<=E;l++){for(;(void 0!==d[w+1]&&a[l]>=d[w+1]||l===E)&&(b=d[w],this.dataGroupInfo={start:e,length:m[0].length}, e=k.apply(this,m),void 0!==e&&(r.push(b),u.push(e),c.push(this.dataGroupInfo)),e=l,m[0]=[],m[1]=[],m[2]=[],m[3]=[],w+=1,l!==E););if(l===E)break;if(t){b=this.cropStart+l;b=h&&h[b]||this.pointClass.prototype.applyOptions.apply({series:this},[p[b]]);var B,y;for(B=0;B<q;B++)y=b[t[B]],v(y)?m[B].push(y):null===y&&(m[B].hasNulls=!0)}else b=g?f[l]:null,v(b)?m[0].push(b):null===b&&(m[0].hasNulls=!0)}return[r,u,c]};e.processData=function(){var a=this.chart,f=this.options.dataGrouping,d=!1!==this.allowDG&&f&& m(f.enabled,a.options.isStock),k=this.visible||!a.options.chart.ignoreHiddenSeries,c;this.forceCrop=d;this.groupPixelWidth=null;this.hasProcessed=!0;if(!1!==q.apply(this,arguments)&&d){this.destroyGroupedData();var p=this.processedXData,r=this.processedYData,C=a.plotSizeX,a=this.xAxis,b=a.options.ordinal,K=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth();if(K){this.isDirty=c=!0;var g=a.getExtremes(),d=g.min,g=g.max,b=b&&a.getGroupIntervalFactor(d,g,this)||1,C=K*(g-d)/C*b,K=a.getTimeTicks(a.normalizeTimeTickInterval(C, f.units||t),Math.min(d,p[0]),Math.max(g,p[p.length-1]),a.options.startOfWeek,p,this.closestPointRange),p=e.groupData.apply(this,[p,r,K,f.approximation]),r=p[0],b=p[1];if(f.smoothed){f=r.length-1;for(r[f]=Math.min(r[f],g);f--&&0<f;)r[f]+=C/2;r[0]=Math.max(r[0],d)}this.currentDataGrouping=K.info;this.closestPointRange=K.info.totalRange;this.groupMap=p[2];G(r[0])&&r[0]<a.dataMin&&k&&(a.min===a.dataMin&&(a.min=r[0]),a.dataMin=r[0]);this.processedXData=r;this.processedYData=b}else this.currentDataGrouping= this.groupMap=null;this.hasGroupedData=c}};e.destroyGroupedData=function(){var a=this.groupedData;B(a||[],function(f,d){f&&(a[d]=f.destroy?f.destroy():null)});this.groupedData=null};e.generatePoints=function(){y.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};c(g.prototype,"update",function(f){this.dataGroup?a.error(24):f.apply(this,[].slice.call(arguments,1))});c(b.prototype,"tooltipFooterHeaderFormatter",function(f,d,c){var h=d.series,b=h.tooltipOptions, p=h.options.dataGrouping,r=b.xDateFormat,C,u=h.xAxis,e=a.dateFormat;return u&&"datetime"===u.options.type&&p&&v(d.key)?(f=h.currentDataGrouping,p=p.dateTimeLabelFormats,f?(u=p[f.unitName],1===f.count?r=u[0]:(r=u[1],C=u[2])):!r&&p&&(r=this.getXDateFormat(d,b,u)),r=e(r,d.key),C&&(r+=e(C,d.key+f.totalRange-1)),w(b[(c?"footer":"header")+"Format"],{point:I(d.point,{key:r}),series:h})):f.call(this,d,c)});e.destroy=function(){for(var a=this.groupedData||[],f=a.length;f--;)a[f]&&a[f].destroy();H.apply(this)}; c(e,"setOptions",function(a,c){a=a.call(this,c);var h=this.type,k=this.chart.options.plotOptions,b=A[h].dataGrouping;d[h]&&(b||(b=l(f,d[h])),a.dataGrouping=l(b,k.series&&k.series.dataGrouping,k[h].dataGrouping,c.dataGrouping));this.chart.options.isStock&&(this.requireSorting=!0);return a});c(x.prototype,"setScale",function(a){a.call(this);B(this.series,function(a){a.hasProcessed=!1})});x.prototype.getGroupPixelWidth=function(){var a=this.series,f=a.length,d,c=0,b=!1,p;for(d=f;d--;)(p=a[d].options.dataGrouping)&& (c=Math.max(c,p.groupPixelWidth));for(d=f;d--;)(p=a[d].options.dataGrouping)&&a[d].hasProcessed&&(f=(a[d].processedXData||a[d].data).length,a[d].groupPixelWidth||f>this.chart.plotSizeX/c||f&&p.forced)&&(b=!0);return b?c:0};x.prototype.setDataGrouping=function(a,f){var d;f=m(f,!0);a||(a={forced:!1,units:null});if(this instanceof x)for(d=this.series.length;d--;)this.series[d].update({dataGrouping:a},!1);else B(this.chart.options.series,function(f){f.dataGrouping=a},!1);f&&this.chart.redraw()}})(J); (function(a){var F=a.each,n=a.Point,x=a.seriesType,A=a.seriesTypes;x("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'\x3cspan style\x3d"color:{point.color}"\x3e\u25cf\x3c/span\x3e \x3cb\x3e {series.name}\x3c/b\x3e\x3cbr/\x3eOpen: {point.open}\x3cbr/\x3eHigh: {point.high}\x3cbr/\x3eLow: {point.low}\x3cbr/\x3eClose: {point.close}\x3cbr/\x3e'},threshold:null,states:{hover:{lineWidth:3}}},{pointArrayMap:["open","high","low","close"],toYData:function(a){return[a.open,a.high,a.low,a.close]},pointValKey:"high", pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},pointAttribs:function(a,B){B=A.column.prototype.pointAttribs.call(this,a,B);var n=this.options;delete B.fill;!a.options.color&&n.upColor&&a.open<a.close&&(B.stroke=n.upColor);return B},translate:function(){var a=this,B=a.yAxis,n=!!a.modifyValue,w=["plotOpen","yBottom","plotClose"];A.column.prototype.translate.apply(a);F(a.points,function(v){F([v.open,v.low,v.close],function(l,m){null!==l&&(n&&(l=a.modifyValue(l)),v[w[m]]=B.toPixels(l, !0))})})},drawPoints:function(){var a=this,B=a.chart;F(a.points,function(n){var w,v,l,m,g=n.graphic,b,c=!g;void 0!==n.plotY&&(g||(n.graphic=g=B.renderer.path().add(a.group)),g.attr(a.pointAttribs(n,n.selected&&"select")),v=g.strokeWidth()%2/2,b=Math.round(n.plotX)-v,l=Math.round(n.shapeArgs.width/2),m=["M",b,Math.round(n.yBottom),"L",b,Math.round(n.plotY)],null!==n.open&&(w=Math.round(n.plotOpen)+v,m.push("M",b,w,"L",b-l,w)),null!==n.close&&(w=Math.round(n.plotClose)+v,m.push("M",b,w,"L",b+l,w)), g[c?"attr":"animate"]({d:m}).addClass(n.getClassName(),!0))})},animate:null},{getClassName:function(){return n.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}})})(J);(function(a){var F=a.defaultPlotOptions,n=a.each,x=a.merge,A=a.seriesType,G=a.seriesTypes;A("candlestick","ohlc",x(F.column,{states:{hover:{lineWidth:2}},tooltip:F.ohlc.tooltip,threshold:null,lineColor:"#000000",lineWidth:1,upColor:"#ffffff"}),{pointAttribs:function(a,n){var w= G.column.prototype.pointAttribs.call(this,a,n),v=this.options,l=a.open<a.close,m=v.lineColor||this.color;w["stroke-width"]=v.lineWidth;w.fill=a.options.color||(l?v.upColor||this.color:this.color);w.stroke=a.lineColor||(l?v.upLineColor||m:m);n&&(a=v.states[n],w.fill=a.color||w.fill,w.stroke=a.lineColor||w.stroke,w["stroke-width"]=a.lineWidth||w["stroke-width"]);return w},drawPoints:function(){var a=this,x=a.chart;n(a.points,function(n){var v=n.graphic,l,m,g,b,c,e,q,y=!v;void 0!==n.plotY&&(v||(n.graphic= v=x.renderer.path().add(a.group)),v.attr(a.pointAttribs(n,n.selected&&"select")).shadow(a.options.shadow),c=v.strokeWidth()%2/2,e=Math.round(n.plotX)-c,l=n.plotOpen,m=n.plotClose,g=Math.min(l,m),l=Math.max(l,m),q=Math.round(n.shapeArgs.width/2),m=Math.round(g)!==Math.round(n.plotY),b=l!==n.yBottom,g=Math.round(g)+c,l=Math.round(l)+c,c=[],c.push("M",e-q,l,"L",e-q,g,"L",e+q,g,"L",e+q,l,"Z","M",e,g,"L",e,m?Math.round(n.plotY):g,"M",e,l,"L",e,b?Math.round(n.yBottom):l),v[y?"attr":"animate"]({d:c}).addClass(n.getClassName(), !0))})}})})(J);(function(a){var F=a.addEvent,n=a.each,x=a.merge,A=a.noop,G=a.Renderer,B=a.seriesType,I=a.seriesTypes,w=a.TrackerMixin,v=a.VMLRenderer,l=a.SVGRenderer.prototype.symbols;B("flags","column",{pointRange:0,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}\x3cbr/\x3e"},threshold:null,y:-30,fillColor:"#ffffff",lineWidth:1,states:{hover:{lineColor:"#000000",fillColor:"#ccd6eb"}},style:{fontSize:"11px",fontWeight:"bold"}},{sorted:!1,noSharedTooltip:!0,allowDG:!1, takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:a.Series.prototype.init,pointAttribs:function(a,g){var b=this.options,c=a&&a.color||this.color,e=b.lineColor,m=a&&a.lineWidth;a=a&&a.fillColor||b.fillColor;g&&(a=b.states[g].fillColor,e=b.states[g].lineColor,m=b.states[g].lineWidth);return{fill:a||c,stroke:e||c,"stroke-width":m||b.lineWidth||0}},translate:function(){I.column.prototype.translate.apply(this);var a=this.options,g=this.chart,b=this.points,c=b.length-1,e,q,l=a.onSeries; e=l&&g.get(l);var a=a.onKey||"y",l=e&&e.options.step,v=e&&e.points,f=v&&v.length,d=this.xAxis,t=d.getExtremes(),D=0,h,u,E;if(e&&e.visible&&f)for(D=(e.pointXOffset||0)+(e.barW||0)/2,e=e.currentDataGrouping,u=v[f-1].x+(e?e.totalRange:0),b.sort(function(a,f){return a.x-f.x}),a="plot"+a[0].toUpperCase()+a.substr(1);f--&&b[c]&&!(e=b[c],h=v[f],h.x<=e.x&&void 0!==h[a]&&(e.x<=u&&(e.plotY=h[a],h.x<e.x&&!l&&(E=v[f+1])&&void 0!==E[a]&&(e.plotY+=(e.x-h.x)/(E.x-h.x)*(E[a]-h[a]))),c--,f++,0>c)););n(b,function(a, f){var p;void 0===a.plotY&&(a.x>=t.min&&a.x<=t.max?a.plotY=g.chartHeight-d.bottom-(d.opposite?d.height:0)+d.offset-g.plotTop:a.shapeArgs={});a.plotX+=D;(q=b[f-1])&&q.plotX===a.plotX&&(void 0===q.stackIndex&&(q.stackIndex=0),p=q.stackIndex+1);a.stackIndex=p})},drawPoints:function(){var a=this.points,g=this.chart,b=g.renderer,c,e,l=this.options,n=l.y,v,f,d,t,D,h,u,E=this.yAxis;for(f=a.length;f--;)d=a[f],u=d.plotX>this.xAxis.len,c=d.plotX,t=d.stackIndex,v=d.options.shape||l.shape,e=d.plotY,void 0!== e&&(e=d.plotY+n-(void 0!==t&&t*l.stackDistance)),D=t?void 0:d.plotX,h=t?void 0:d.plotY,t=d.graphic,void 0!==e&&0<=c&&!u?(t||(t=d.graphic=b.label("",null,null,v,null,null,l.useHTML).attr(this.pointAttribs(d)).css(x(l.style,d.style)).attr({align:"flag"===v?"left":"center",width:l.width,height:l.height,"text-align":l.textAlign}).addClass("highcharts-point").add(this.markerGroup),t.shadow(l.shadow)),0<c&&(c-=t.strokeWidth()%2),t.attr({text:d.options.title||l.title||"A",x:c,y:e,anchorX:D,anchorY:h}),d.tooltipPos= g.inverted?[E.len+E.pos-g.plotLeft-e,this.xAxis.len-c]:[c,e+E.pos-g.plotTop]):t&&(d.graphic=t.destroy())},drawTracker:function(){var a=this.points;w.drawTrackerPoint.apply(this);n(a,function(g){var b=g.graphic;b&&F(b.element,"mouseover",function(){0<g.stackIndex&&!g.raised&&(g._y=b.y,b.attr({y:g._y-8}),g.raised=!0);n(a,function(a){a!==g&&a.raised&&a.graphic&&(a.graphic.attr({y:a._y}),a.raised=!1)})})})},animate:A,buildKDTree:A,setClip:A});l.flag=function(a,g,b,c,e){return["M",e&&e.anchorX||a,e&&e.anchorY|| g,"L",a,g+c,a,g,a+b,g,a+b,g+c,a,g+c,"Z"]};n(["circle","square"],function(a){l[a+"pin"]=function(g,b,c,e,m){var n=m&&m.anchorX;m=m&&m.anchorY;"circle"===a&&e>c&&(g-=Math.round((e-c)/2),c=e);g=l[a](g,b,c,e);n&&m&&g.push("M",n,b>m?b:b+e,"L",n,m);return g}});G===v&&n(["flag","circlepin","squarepin"],function(a){v.prototype.symbols[a]=l[a]})})(J);(function(a){function F(a,d,c){this.init(a,d,c)}var n=a.addEvent,x=a.Axis,A=a.correctFloat,G=a.defaultOptions,B=a.defined,I=a.destroyObjectProperties,w=a.doc, v=a.each,l=a.fireEvent,m=a.hasTouch,g=a.isTouchDevice,b=a.merge,c=a.pick,e=a.removeEvent,q=a.wrap,y,H={height:g?20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:a.svg&&!g,margin:10,minWidth:6,step:.2,zIndex:3,barBackgroundColor:"#cccccc",barBorderWidth:1,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"#333333",trackBackgroundColor:"#f2f2f2",trackBorderColor:"#f2f2f2",trackBorderWidth:1};G.scrollbar= b(!0,H,G.scrollbar);a.swapXY=y=function(a,d){var f=a.length,c;if(d)for(d=0;d<f;d+=3)c=a[d+1],a[d+1]=a[d+2],a[d+2]=c;return a};F.prototype={init:function(a,d,e){this.scrollbarButtons=[];this.renderer=a;this.userOptions=d;this.options=b(H,d);this.chart=e;this.size=c(this.options.size,this.options.height);d.enabled&&(this.render(),this.initEvents(),this.addEvents())},render:function(){var a=this.renderer,d=this.options,c=this.size,b;this.group=b=a.g("scrollbar").attr({zIndex:d.zIndex,translateY:-99999}).add(); this.track=a.rect().addClass("highcharts-scrollbar-track").attr({x:0,r:d.trackBorderRadius||0,height:c,width:c}).add(b);this.track.attr({fill:d.trackBackgroundColor,stroke:d.trackBorderColor,"stroke-width":d.trackBorderWidth});this.trackBorderWidth=this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=a.g().add(b);this.scrollbar=a.rect().addClass("highcharts-scrollbar-thumb").attr({height:c,width:c,r:d.barBorderRadius||0}).add(this.scrollbarGroup);this.scrollbarRifles= a.path(y(["M",-3,c/4,"L",-3,2*c/3,"M",0,c/4,"L",0,2*c/3,"M",3,c/4,"L",3,2*c/3],d.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);this.scrollbar.attr({fill:d.barBackgroundColor,stroke:d.barBorderColor,"stroke-width":d.barBorderWidth});this.scrollbarRifles.attr({stroke:d.rifleColor,"stroke-width":1});this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);this.drawScrollbarButton(0); this.drawScrollbarButton(1)},position:function(a,d,c,b){var f=this.options.vertical,e=0,g=this.rendered?"animate":"attr";this.x=a;this.y=d+this.trackBorderWidth;this.width=c;this.xOffset=this.height=b;this.yOffset=e;f?(this.width=this.yOffset=c=e=this.size,this.xOffset=d=0,this.barWidth=b-2*c,this.x=a+=this.options.margin):(this.height=this.xOffset=b=d=this.size,this.barWidth=c-2*b,this.y+=this.options.margin);this.group[g]({translateX:a,translateY:this.y});this.track[g]({width:c,height:b});this.scrollbarButtons[1][g]({translateX:f? 0:c-d,translateY:f?b-e:0})},drawScrollbarButton:function(a){var f=this.renderer,c=this.scrollbarButtons,b=this.options,h=this.size,e;e=f.g().add(this.group);c.push(e);e=f.rect().addClass("highcharts-scrollbar-button").add(e);e.attr({stroke:b.buttonBorderColor,"stroke-width":b.buttonBorderWidth,fill:b.buttonBackgroundColor});e.attr(e.crisp({x:-.5,y:-.5,width:h+1,height:h+1,r:b.buttonBorderRadius},e.strokeWidth()));e=f.path(y(["M",h/2+(a?-1:1),h/2-3,"L",h/2+(a?-1:1),h/2+3,"L",h/2+(a?2:-2),h/2],b.vertical)).addClass("highcharts-scrollbar-arrow").add(c[a]); e.attr({fill:b.buttonArrowColor})},setRange:function(a,d){var f=this.options,c=f.vertical,b=f.minWidth,e=this.barWidth,g,k,z=this.rendered&&!this.hasDragged?"animate":"attr";B(e)&&(a=Math.max(a,0),g=e*a,this.calculatedWidth=k=A(e*Math.min(d,1)-g),k<b&&(g=(e-b+k)*a,k=b),b=Math.floor(g+this.xOffset+this.yOffset),e=k/2-.5,this.from=a,this.to=d,c?(this.scrollbarGroup[z]({translateY:b}),this.scrollbar[z]({height:k}),this.scrollbarRifles[z]({translateY:e}),this.scrollbarTop=b,this.scrollbarLeft=0):(this.scrollbarGroup[z]({translateX:b}), this.scrollbar[z]({width:k}),this.scrollbarRifles[z]({translateX:e}),this.scrollbarLeft=b,this.scrollbarTop=0),12>=k?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0),!1===f.showFull&&(0>=a&&1<=d?this.group.hide():this.group.show()),this.rendered=!0)},initEvents:function(){var a=this;a.mouseMoveHandler=function(d){var c=a.chart.pointer.normalize(d),b=a.options.vertical?"chartY":"chartX",f=a.initPositions;!a.grabbedCenter||d.touches&&0===d.touches[0][b]||(c=a.cursorToScrollbarPosition(c)[b], b=a[b],b=c-b,a.hasDragged=!0,a.updatePosition(f[0]+b,f[1]+b),a.hasDragged&&l(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:d.type,DOMEvent:d}))};a.mouseUpHandler=function(d){a.hasDragged&&l(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMType:d.type,DOMEvent:d});a.grabbedCenter=a.hasDragged=a.chartX=a.chartY=null};a.mouseDownHandler=function(d){d=a.chart.pointer.normalize(d);d=a.cursorToScrollbarPosition(d);a.chartX=d.chartX;a.chartY=d.chartY;a.initPositions=[a.from,a.to];a.grabbedCenter= !0};a.buttonToMinClick=function(d){var c=A(a.to-a.from)*a.options.step;a.updatePosition(A(a.from-c),A(a.to-c));l(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:d})};a.buttonToMaxClick=function(d){var c=(a.to-a.from)*a.options.step;a.updatePosition(a.from+c,a.to+c);l(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:d})};a.trackClick=function(d){var c=a.chart.pointer.normalize(d),b=a.to-a.from,f=a.y+a.scrollbarTop,e=a.x+a.scrollbarLeft;a.options.vertical&&c.chartY>f||!a.options.vertical&& c.chartX>e?a.updatePosition(a.from+b,a.to+b):a.updatePosition(a.from-b,a.to-b);l(a,"changed",{from:a.from,to:a.to,trigger:"scrollbar",DOMEvent:d})}},cursorToScrollbarPosition:function(a){var d=this.options,d=d.minWidth>this.calculatedWidth?d.minWidth:0;return{chartX:(a.chartX-this.x-this.xOffset)/(this.barWidth-d),chartY:(a.chartY-this.y-this.yOffset)/(this.barWidth-d)}},updatePosition:function(a,d){1<d&&(a=A(1-A(d-a)),d=1);0>a&&(d=A(d-a),a=0);this.from=a;this.to=d},update:function(a){this.destroy(); this.init(this.chart.renderer,b(!0,this.options,a),this.chart)},addEvents:function(){var a=this.options.inverted?[1,0]:[0,1],d=this.scrollbarButtons,c=this.scrollbarGroup.element,b=this.mouseDownHandler,e=this.mouseMoveHandler,g=this.mouseUpHandler,a=[[d[a[0]].element,"click",this.buttonToMinClick],[d[a[1]].element,"click",this.buttonToMaxClick],[this.track.element,"click",this.trackClick],[c,"mousedown",b],[w,"mousemove",e],[w,"mouseup",g]];m&&a.push([c,"touchstart",b],[w,"touchmove",e],[w,"touchend", g]);v(a,function(a){n.apply(null,a)});this._events=a},removeEvents:function(){v(this._events,function(a){e.apply(null,a)});this._events=void 0},destroy:function(){var a=this.chart.scroller;this.removeEvents();v(["track","scrollbarRifles","scrollbar","scrollbarGroup","group"],function(a){this[a]&&this[a].destroy&&(this[a]=this[a].destroy())},this);a&&this===a.scrollbar&&(a.scrollbar=null,I(a.scrollbarButtons))}};q(x.prototype,"init",function(a){var d=this;a.apply(d,[].slice.call(arguments,1));d.options.scrollbar&& d.options.scrollbar.enabled&&(d.options.scrollbar.vertical=!d.horiz,d.options.startOnTick=d.options.endOnTick=!1,d.scrollbar=new F(d.chart.renderer,d.options.scrollbar,d.chart),n(d.scrollbar,"changed",function(a){var b=Math.min(c(d.options.min,d.min),d.min,d.dataMin),e=Math.max(c(d.options.max,d.max),d.max,d.dataMax)-b,f;d.horiz&&!d.reversed||!d.horiz&&d.reversed?(f=b+e*this.to,b+=e*this.from):(f=b+e*(1-this.from),b+=e*(1-this.to));d.setExtremes(b,f,!0,!1,a)}))});q(x.prototype,"render",function(a){var b= Math.min(c(this.options.min,this.min),this.min,this.dataMin),e=Math.max(c(this.options.max,this.max),this.max,this.dataMax),f=this.scrollbar,h;a.apply(this,[].slice.call(arguments,1));f&&(this.horiz?f.position(this.left,this.top+this.height+this.offset+2+(this.opposite?0:this.axisTitleMargin),this.width,this.height):f.position(this.left+this.width+2+this.offset+(this.opposite?this.axisTitleMargin:0),this.top,this.width,this.height),isNaN(b)||isNaN(e)||!B(this.min)||!B(this.max)?f.setRange(0,0):(h= (this.min-b)/(e-b),b=(this.max-b)/(e-b),this.horiz&&!this.reversed||!this.horiz&&this.reversed?f.setRange(h,b):f.setRange(1-b,1-h)))});q(x.prototype,"getOffset",function(a){var b=this.horiz?2:1,c=this.scrollbar;a.apply(this,[].slice.call(arguments,1));c&&(this.chart.axisOffset[b]+=c.size+c.options.margin)});q(x.prototype,"destroy",function(a){this.scrollbar&&(this.scrollbar=this.scrollbar.destroy());a.apply(this,[].slice.call(arguments,1))});a.Scrollbar=F})(J);(function(a){function F(a){this.init(a)} var n=a.addEvent,x=a.Axis,A=a.Chart,G=a.color,B=a.defaultOptions,I=a.defined,w=a.destroyObjectProperties,v=a.doc,l=a.each,m=a.erase,g=a.error,b=a.extend,c=a.grep,e=a.hasTouch,q=a.isNumber,y=a.isObject,H=a.merge,f=a.pick,d=a.removeEvent,t=a.Scrollbar,D=a.Series,h=a.seriesTypes,u=a.wrap,E=a.swapXY,k=[].concat(a.defaultDataGroupingUnits),z=function(a){var p=c(arguments,q);if(p.length)return Math[a].apply(0,p)};k[4]=["day",[1,2,3,4]];k[5]=["week",[1,2,3]];h=void 0===h.areaspline?"line":"areaspline";b(B, {navigator:{height:40,margin:25,maskInside:!0,handles:{backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:G("#6685c2").setOpacity(.3).get(),outlineColor:"#cccccc",outlineWidth:1,series:{type:h,color:"#335cad",fillOpacity:.05,lineWidth:1,compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:k},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},pointRange:0,shadow:!1, threshold:null},xAxis:{className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#999999"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}});F.prototype={drawHandle:function(a,r,b,c){this.handles[r][c](b?{translateX:Math.round(this.left+ this.height/2-8),translateY:Math.round(this.top+parseInt(a,10)+.5)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-8)})},getHandlePath:function(a){return E(["M",-4.5,.5,"L",3.5,.5,"L",3.5,15.5,"L",-4.5,15.5,"L",-4.5,.5,"M",-1.5,4,"L",-1.5,12,"M",.5,4,"L",.5,12],a)},drawOutline:function(a,b,c,d){var p=this.navigatorOptions.maskInside,r=this.outline.strokeWidth(),e=r/2,r=r%2/2,f=this.outlineHeight,C=this.scrollbarHeight,h=this.size,k=this.left-C,g=this.top; c?(k-=e,c=g+b+r,b=g+a+r,a=["M",k+f,g-C-r,"L",k+f,c,"L",k,c,"L",k,b,"L",k+f,b,"L",k+f,g+h+C].concat(p?["M",k+f,c-e,"L",k+f,b+e]:[])):(a+=k+C-r,b+=k+C-r,g+=e,a=["M",k,g,"L",a,g,"L",a,g+f,"L",b,g+f,"L",b,g,"L",k+h+2*C,g].concat(p?["M",a-e,g,"L",b+e,g]:[]));this.outline[d]({d:a})},drawMasks:function(a,b,c,d){var p=this.left,r=this.top,e=this.height,f,C,k,h;c?(k=[p,p,p],h=[r,r+a,r+b],C=[e,e,e],f=[a,b-a,this.size-b]):(k=[p,p+a,p+b],h=[r,r,r],C=[a,b-a,this.size-b],f=[e,e,e]);l(this.shades,function(a,p){a[d]({x:k[p], y:h[p],width:C[p],height:f[p]})})},renderElements:function(){var a=this,b=a.navigatorOptions,c=b.maskInside,d=a.chart,e=d.inverted,f=d.renderer,k;a.navigatorGroup=k=f.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();var h={cursor:e?"ns-resize":"ew-resize"};l([!c,c,!c],function(p,c){a.shades[c]=f.rect().addClass("highcharts-navigator-mask"+(1===c?"-inside":"-outside")).attr({fill:p?b.maskFill:"transparent"}).css(1===c&&h).add(k)});a.outline=f.path().addClass("highcharts-navigator-outline").attr({"stroke-width":b.outlineWidth, stroke:b.outlineColor}).add(k);l([0,1],function(p){a.handles[p]=f.path(a.getHandlePath(e)).attr({zIndex:7-p}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][p]).add(k);var c=b.handles;a.handles[p].attr({fill:c.backgroundColor,stroke:c.borderColor,"stroke-width":1}).css(h)})},update:function(a){this.destroy();H(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)},render:function(a,b,c,d){var p=this.chart,r,e,k=this.scrollbarHeight,h,g=this.xAxis; r=this.navigatorEnabled;var C,z=this.rendered;e=p.inverted;var u=p.xAxis[0].minRange;if(!this.hasDragged||I(c)){if(!q(a)||!q(b))if(z)c=0,d=g.width;else return;this.left=f(g.left,p.plotLeft+k+(e?p.plotWidth:0));this.size=C=h=f(g.len,(e?p.plotHeight:p.plotWidth)-2*k);p=e?k:h+2*k;c=f(c,g.toPixels(a,!0));d=f(d,g.toPixels(b,!0));q(c)&&Infinity!==Math.abs(c)||(c=0,d=p);a=g.toValue(c,!0);b=g.toValue(d,!0);if(Math.abs(b-a)<u)if(this.grabbedLeft)c=g.toPixels(b-u,!0);else if(this.grabbedRight)d=g.toPixels(a+ u,!0);else return;this.zoomedMax=Math.min(Math.max(c,d,0),C);this.zoomedMin=Math.min(Math.max(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(c,d),0),C);this.range=this.zoomedMax-this.zoomedMin;C=Math.round(this.zoomedMax);c=Math.round(this.zoomedMin);r&&(this.navigatorGroup.attr({visibility:"visible"}),z=z&&!this.hasDragged?"animate":"attr",this.drawMasks(c,C,e,z),this.drawOutline(c,C,e,z),this.drawHandle(c,0,e,z),this.drawHandle(C,1,e,z));this.scrollbar&&(e?(e=this.top-k,r=this.left-k+(r? 0:this.height),k=h+2*k):(e=this.top+(r?this.height:-k),r=this.left-k),this.scrollbar.position(r,e,p,k),this.scrollbar.setRange(c/h,C/h));this.rendered=!0}},addMouseEvents:function(){var a=this,b=a.chart,c=b.container,d=[],f,k,h=e?["touchstart","touchmove","touchend"]:["mousedown","mousemove","mouseup"];a.mouseMoveHandler=f=function(p){a.onMouseMove(p)};a.mouseUpHandler=k=function(p){a.onMouseUp(p)};d=a.getPartsEvents(h[0]);d.push(n(c,h[1],f),n(v,h[2],k));a.eventsToUnbind=d;a.series&&a.series[0]&& d.push(n(a.series[0].xAxis,"foundExtremes",function(){b.navigator.modifyNavigatorAxisExtremes()}))},getPartsEvents:function(a){var p=this,b=[];l(["shades","handles"],function(c){l(p[c],function(d,r){b.push(n(d.element,a,function(a){p[c+"Mousedown"](a,r)}))})});return b},shadesMousedown:function(a,b){a=this.chart.pointer.normalize(a);var c=this.chart,p=this.xAxis,d=this.zoomedMin,r=this.left,e=this.size,f=this.range,k=a.chartX,h;c.inverted&&(k=a.chartY,r=this.top);1===b?(this.grabbedCenter=k,this.fixedWidth= f,this.dragOffset=k-d):(a=k-r-f/2,0===b?a=Math.max(0,a):2===b&&a+f>=e&&(a=e-f,h=this.getUnionExtremes().dataMax),a!==d&&(this.fixedWidth=f,b=p.toFixedRange(a,a+f,null,h),c.xAxis[0].setExtremes(Math.min(b.min,b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"})))},handlesMousedown:function(a,b){this.chart.pointer.normalize(a);a=this.chart;var c=a.xAxis[0],p=a.inverted&&!c.reversed||!a.inverted&&c.reversed;0===b?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=p?c.min: c.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=p?c.max:c.min);a.fixedRange=null},onMouseMove:function(a){var b=this,c=b.chart,p=b.left,d=b.navigatorSize,e=b.range,f=b.dragOffset,k=c.inverted;a.touches&&0===a.touches[0].pageX||(a=c.pointer.normalize(a),c=a.chartX,k&&(p=b.top,c=a.chartY),b.grabbedLeft?(b.hasDragged=!0,b.render(0,0,c-p,b.otherHandlePos)):b.grabbedRight?(b.hasDragged=!0,b.render(0,0,b.otherHandlePos,c-p)):b.grabbedCenter&&(b.hasDragged=!0,c<f?c=f:c> d+f-e&&(c=d+f-e),b.render(0,0,c-f,c-f+e)),b.hasDragged&&b.scrollbar&&b.scrollbar.options.liveRedraw&&(a.DOMType=a.type,setTimeout(function(){b.onMouseUp(a)},0)))},onMouseUp:function(a){var b=this.chart,c=this.xAxis,p=this.scrollbar,d,e,f=a.DOMEvent||a;(!this.hasDragged||p&&p.hasDragged)&&"scrollbar"!==a.trigger||(this.zoomedMin===this.otherHandlePos?d=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&(e=this.fixedExtreme),this.zoomedMax===this.size&&(e=this.getUnionExtremes().dataMax),c=c.toFixedRange(this.zoomedMin, this.zoomedMax,d,e),I(c.min)&&b.xAxis[0].setExtremes(Math.min(c.min,c.max),Math.max(c.min,c.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:f}));"mousemove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null)},removeEvents:function(){this.eventsToUnbind&&(l(this.eventsToUnbind,function(a){a()}),this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()}, removeBaseSeriesEvents:function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&!1!==this.navigatorOptions.adaptToUpdatedData&&(l(a,function(a){d(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&d(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))},init:function(a){var b=a.options,c=b.navigator,d=c.enabled,e=b.scrollbar,p=e.enabled,b=d?c.height:0,k=p?e.height:0;this.handles=[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=b;this.scrollbarHeight=k;this.scrollbarEnabled= p;this.navigatorEnabled=d;this.navigatorOptions=c;this.scrollbarOptions=e;this.outlineHeight=b+k;this.opposite=f(c.opposite,!d&&a.inverted);var h=this,e=h.baseSeries,p=a.xAxis.length,g=a.yAxis.length,E=e&&e[0]&&e[0].xAxis||a.xAxis[0];a.extraMargin={type:h.opposite?"plotTop":"marginBottom",value:(d||!a.inverted?h.outlineHeight:0)+c.margin};a.inverted&&(a.extraMargin.type=h.opposite?"marginRight":"plotLeft");a.isDirtyBox=!0;h.navigatorEnabled?(h.xAxis=new x(a,H({breaks:E.options.breaks,ordinal:E.options.ordinal}, c.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:p,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[k,0,-k,0],width:b}:{offsets:[0,-k,0,k],height:b})),h.yAxis=new x(a,H(c.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:g,zoomEnabled:!1},a.inverted?{width:b}:{height:b})),e||c.series.data?h.addBaseSeries():0===a.series.length&&u(a,"redraw",function(b,c){0<a.series.length&&!h.series&& (h.setBaseSeries(),a.redraw=b);b.call(a,c)}),h.renderElements(),h.addMouseEvents()):h.xAxis={translate:function(b,c){var d=a.xAxis[0],e=d.getExtremes(),p=d.len-2*k,f=z("min",d.options.min,e.dataMin),d=z("max",d.options.max,e.dataMax)-f;return c?b*d/p+f:p*(b-f)/d},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)},toFixedRange:x.prototype.toFixedRange,fake:!0};a.options.scrollbar.enabled&&(a.scrollbar=h.scrollbar=new t(a.renderer,H(a.options.scrollbar,{margin:h.navigatorEnabled? 0:10,vertical:a.inverted}),a),n(h.scrollbar,"changed",function(b){var c=h.size,d=c*this.to,c=c*this.from;h.hasDragged=h.scrollbar.hasDragged;h.render(0,0,c,d);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType)&&setTimeout(function(){h.onMouseUp(b)})}));h.addBaseSeriesEvents();h.addChartEvents()},getUnionExtremes:function(a){var b=this.chart.xAxis[0],c=this.xAxis,d=c.options,e=b.options,p;a&&null===b.dataMin||(p={dataMin:f(d&&d.min,z("min",e.min,b.dataMin,c.dataMin,c.min)),dataMax:f(d&&d.max, z("max",e.max,b.dataMax,c.dataMax,c.max))});return p},setBaseSeries:function(a){var b=this.chart,c;a=a||b.options&&b.options.navigator.baseSeries||0;this.series&&(this.removeBaseSeriesEvents(),l(this.series,function(a){a.destroy()}));c=this.baseSeries=[];l(b.series||[],function(b,d){(b.options.showInNavigator||(d===a||b.options.id===a)&&!1!==b.options.showInNavigator)&&c.push(b)});this.xAxis&&!this.xAxis.fake&&this.addBaseSeries()},addBaseSeries:function(){var a=this,b=a.chart,c=a.series=[],d=a.baseSeries, e,f,h=a.navigatorOptions.series,k,g={enableMouseTracking:!1,index:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0,visible:!0};d?l(d,function(d,p){g.name="Navigator "+(p+1);e=d.options||{};k=e.navigatorOptions||{};f=H(e,g,h,k);p=k.data||h.data;a.hasNavigatorData=a.hasNavigatorData||!!p;f.data=p||e.data&&e.data.slice(0);d.navigatorSeries=b.initSeries(f);c.push(d.navigatorSeries)}):(f=H(h,g),f.data=h.data,a.hasNavigatorData=!!f.data, c.push(b.initSeries(f)));this.addBaseSeriesEvents()},addBaseSeriesEvents:function(){var a=this,b=a.baseSeries||[];b[0]&&b[0].xAxis&&n(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);!1!==this.navigatorOptions.adaptToUpdatedData&&l(b,function(b){b.xAxis&&n(b,"updatedData",this.updatedDataHandler);n(b,"remove",function(){this.navigatorSeries&&(m(a.series,this.navigatorSeries),this.navigatorSeries.remove(!1),delete this.navigatorSeries)})},this)},modifyNavigatorAxisExtremes:function(){var a= this.xAxis,b;a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))},modifyBaseAxisExtremes:function(){var a=this.chart.navigator,b=this.getExtremes(),c=b.dataMin,d=b.dataMax,b=b.max-b.min,e=a.stickToMin,f=a.stickToMax,h,k,g=a.series&&a.series[0],z=!!this.setExtremes;this.eventArgs&&"rangeSelectorButton"===this.eventArgs.trigger||(e&&(k=c,h=k+b),f&&(h=d,e||(k=Math.max(h-b,g&&g.xData?g.xData[0]:-Number.MAX_VALUE))),z&&(e||f)&&q(k)&& (this.min=this.userMin=k,this.max=this.userMax=h));a.stickToMin=a.stickToMax=null},updatedDataHandler:function(){var a=this.chart.navigator,b=this.navigatorSeries;a.stickToMin=q(this.xAxis.min)&&this.xAxis.min<=this.xData[0];a.stickToMax=Math.round(a.zoomedMax)>=Math.round(a.size);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],b.setData(this.options.data,!1,null,!1))},addChartEvents:function(){n(this.chart,"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&& a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]);b&&a.render(b.min,b.max)})},destroy:function(){this.removeEvents();this.xAxis&&(m(this.chart.xAxis,this.xAxis),m(this.chart.axes,this.xAxis));this.yAxis&&(m(this.chart.yAxis,this.yAxis),m(this.chart.axes,this.yAxis));l(this.series||[],function(a){a.destroy&&a.destroy()});l("series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" "),function(a){this[a]&&this[a].destroy&&this[a].destroy(); this[a]=null},this);l([this.handles],function(a){w(a)},this)}};a.Navigator=F;u(x.prototype,"zoom",function(a,b,c){var d=this.chart,e=d.options,f=e.chart.zoomType,h=e.navigator,e=e.rangeSelector,k;this.isXAxis&&(h&&h.enabled||e&&e.enabled)&&("x"===f?d.resetZoomButton="blocked":"y"===f?k=!1:"xy"===f&&(d=this.previousZoom,I(b)?this.previousZoom=[this.min,this.max]:d&&(b=d[0],c=d[1],delete this.previousZoom)));return void 0!==k?k:a.call(this,b,c)});u(A.prototype,"init",function(a,b,c){n(this,"beforeRender", function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=this.navigator=new F(this)});a.call(this,b,c)});u(A.prototype,"setChartSize",function(a){var b=this.legend,c=this.navigator,d,e,k,h;a.apply(this,[].slice.call(arguments,1));c&&(e=b.options,k=c.xAxis,h=c.yAxis,d=c.scrollbarHeight,this.inverted?(c.left=c.opposite?this.chartWidth-d-c.height:this.spacing[3]+d,c.top=this.plotTop+d):(c.left=this.plotLeft+d,c.top=c.navigatorOptions.top||this.chartHeight-c.height-d-this.spacing[2]- ("bottom"===e.verticalAlign&&e.enabled&&!e.floating?b.legendHeight+f(e.margin,10):0)),k&&h&&(this.inverted?k.options.left=h.options.left=c.left:k.options.top=h.options.top=c.top,k.setAxisSize(),h.setAxisSize()))});u(D.prototype,"addPoint",function(a,b,c,d,e){var f=this.options.turboThreshold;f&&this.xData.length>f&&y(b,!0)&&this.chart.navigator&&g(20,!0);a.call(this,b,c,d,e)});u(A.prototype,"addSeries",function(a,b,c,d){a=a.call(this,b,!1,d);this.navigator&&this.navigator.setBaseSeries();f(c,!0)&& this.redraw();return a});u(D.prototype,"update",function(a,b,c){a.call(this,b,!1);this.chart.navigator&&this.chart.navigator.setBaseSeries();f(c,!0)&&this.chart.redraw()});A.prototype.callbacks.push(function(a){var b=a.navigator;b&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))})})(J);(function(a){function F(a){this.init(a)}var n=a.addEvent,x=a.Axis,A=a.Chart,G=a.css,B=a.createElement,I=a.dateFormat,w=a.defaultOptions,v=w.global.useUTC,l=a.defined,m=a.destroyObjectProperties,g=a.discardElement, b=a.each,c=a.extend,e=a.fireEvent,q=a.Date,y=a.isNumber,H=a.merge,f=a.pick,d=a.pInt,t=a.splat,D=a.wrap;c(w,{rangeSelector:{buttonTheme:{"stroke-width":0,width:28,height:18,padding:2,zIndex:7},height:35,inputPosition:{align:"right"},labelStyle:{color:"#666666"}}});w.lang=H(w.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});F.prototype={clickButton:function(a,c){var d=this,e=d.chart,h=d.buttonOptions[a],g=e.xAxis[0],r=e.scroller&&e.scroller.getUnionExtremes()||g||{},u= r.dataMin,l=r.dataMax,m,q=g&&Math.round(Math.min(g.max,f(l,g.max))),w=h.type,B,r=h._range,L,M,N,A=h.dataGrouping;if(null!==u&&null!==l){e.fixedRange=r;A&&(this.forcedDataGrouping=!0,x.prototype.setDataGrouping.call(g||{chart:this.chart},A,!1));if("month"===w||"year"===w)g?(w={range:h,max:q,dataMin:u,dataMax:l},m=g.minFromRange.call(w),y(w.newMax)&&(q=w.newMax)):r=h;else if(r)m=Math.max(q-r,u),q=Math.min(m+r,l);else if("ytd"===w)if(g)void 0===l&&(u=Number.MAX_VALUE,l=Number.MIN_VALUE,b(e.series,function(a){a= a.xData;u=Math.min(a[0],u);l=Math.max(a[a.length-1],l)}),c=!1),q=d.getYTDExtremes(l,u,v),m=L=q.min,q=q.max;else{n(e,"beforeRender",function(){d.clickButton(a)});return}else"all"===w&&g&&(m=u,q=l);d.setSelected(a);g?g.setExtremes(m,q,f(c,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:h}):(B=t(e.options.xAxis)[0],N=B.range,B.range=r,M=B.min,B.min=L,n(e,"load",function(){B.range=N;B.min=M}))}},setSelected:function(a){this.selected=this.options.selected=a},defaultButtons:[{type:"month",count:1, text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],init:function(a){var c=this,d=a.options.rangeSelector,f=d.buttons||[].concat(c.defaultButtons),h=d.selected,g=function(){var a=c.minInput,b=c.maxInput;a&&a.blur&&e(a,"blur");b&&b.blur&&e(b,"blur")};c.chart=a;c.options=d;c.buttons=[];a.extraTopMargin=d.height;c.buttonOptions=f;this.unMouseDown=n(a.container,"mousedown",g);this.unResize=n(a,"resize", g);b(f,c.computeButtonRange);void 0!==h&&f[h]&&this.clickButton(h,!1);n(a,"load",function(){n(a.xAxis[0],"setExtremes",function(b){this.max-this.min!==a.fixedRange&&"rangeSelectorButton"!==b.trigger&&"updatedData"!==b.trigger&&c.forcedDataGrouping&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var a=this.chart,c=a.xAxis[0],d=Math.round(c.max-c.min),e=!c.hasVisibleSeries,a=a.scroller&&a.scroller.getUnionExtremes()||c,f=a.dataMin,g=a.dataMax,a=this.getYTDExtremes(g,f,v),r=a.min,l=a.max, m=this.selected,n=y(m),q=this.options.allButtonsEnabled,t=this.buttons;b(this.buttonOptions,function(a,b){var k=a._range,h=a.type,p=a.count||1;a=t[b];var z=0;b=b===m;var u=k>g-f,E=k<c.minRange,C=!1,v=!1,k=k===d;("month"===h||"year"===h)&&d>=864E5*{month:28,year:365}[h]*p&&d<=864E5*{month:31,year:366}[h]*p?k=!0:"ytd"===h?(k=l-r===d,C=!b):"all"===h&&(k=c.max-c.min>=g-f,v=!b&&n&&k);h=!q&&(u||E||v||e);k=b&&k||k&&!n&&!C;h?z=3:k&&(n=!0,z=2);a.state!==z&&a.setState(z)})},computeButtonRange:function(a){var b= a.type,c=a.count||1,d={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(d[b])a._range=d[b]*c;else if("month"===b||"year"===b)a._range=864E5*{month:30,year:365}[b]*c},setInputValue:function(a,b){var c=this.chart.options.rangeSelector,d=this[a+"Input"];l(b)&&(d.previousValue=d.HCTime,d.HCTime=b);d.value=I(c.inputEditDateFormat||"%Y-%m-%d",d.HCTime);this[a+"DateBox"].attr({text:I(c.inputDateFormat||"%b %e, %Y",d.HCTime)})},showInput:function(a){var b=this.inputGroup,c=this[a+"DateBox"]; G(this[a+"Input"],{left:b.translateX+c.x+"px",top:b.translateY+"px",width:c.width-2+"px",height:c.height-2+"px",border:"2px solid silver"})},hideInput:function(a){G(this[a+"Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(a)},drawInput:function(a){function b(){var a=n.value,b=(r.inputDateParser||Date.parse)(a),c=f.xAxis[0],g=f.scroller&&f.scroller.xAxis?f.scroller.xAxis:c,k=g.dataMin,g=g.dataMax;b!==n.previousValue&&(n.previousValue=b,y(b)||(b=a.split("-"),b=Date.UTC(d(b[0]),d(b[1])- 1,d(b[2]))),y(b)&&(v||(b+=6E4*(new Date).getTimezoneOffset()),m?b>e.maxInput.HCTime?b=void 0:b<k&&(b=k):b<e.minInput.HCTime?b=void 0:b>g&&(b=g),void 0!==b&&c.setExtremes(m?b:c.min,m?c.max:b,void 0,void 0,{trigger:"rangeSelectorInput"})))}var e=this,f=e.chart,g=f.renderer.style||{},h=f.renderer,r=f.options.rangeSelector,l=e.div,m="min"===a,n,q,t=this.inputGroup;this[a+"Label"]=q=h.label(w.lang[m?"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(t); t.offset+=q.width+5;this[a+"DateBox"]=h=h.label("",t.offset).addClass("highcharts-range-input").attr({padding:2,width:r.inputBoxWidth||90,height:r.inputBoxHeight||17,stroke:r.inputBoxBorderColor||"#cccccc","stroke-width":1,"text-align":"center"}).on("click",function(){e.showInput(a);e[a+"Input"].focus()}).add(t);t.offset+=h.width+(m?10:0);this[a+"Input"]=n=B("input",{name:a,className:"highcharts-range-selector",type:"text"},{top:f.plotTop+"px"},l);q.css(H(g,r.labelStyle));h.css(H({color:"#333333"}, g,r.inputStyle));G(n,c({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:g.fontSize,fontFamily:g.fontFamily,left:"-9em"},r.inputStyle));n.onfocus=function(){e.showInput(a)};n.onblur=function(){e.hideInput(a)};n.onchange=b;n.onkeypress=function(a){13===a.keyCode&&b()}},getPosition:function(){var a=this.chart,b=a.options.rangeSelector,a=f((b.buttonPosition||{}).y,a.plotTop-a.axisOffset[0]-b.height);return{buttonTop:a,inputTop:a-10}},getYTDExtremes:function(a, b,c){var d=new q(a),e=d[q.hcGetFullYear]();c=c?q.UTC(e,0,1):+new q(e,0,1);b=Math.max(b||0,c);d=d.getTime();return{max:Math.min(a||d,d),min:b}},render:function(a,d){var e=this,g=e.chart,h=g.renderer,p=g.container,r=g.options,m=r.exporting&&!1!==r.exporting.enabled&&r.navigation&&r.navigation.buttonOptions,n=r.rangeSelector,u=e.buttons,r=w.lang,q=e.div,q=e.inputGroup,v=n.buttonTheme,t=n.buttonPosition||{},y=n.inputEnabled,x=v&&v.states,A=g.plotLeft,D,F=this.getPosition(),G=e.group,H=e.rendered;!1!== n.enabled&&(H||(e.group=G=h.g("range-selector-buttons").add(),e.zoomText=h.text(r.rangeSelectorZoom,f(t.x,A),15).css(n.labelStyle).add(G),D=f(t.x,A)+e.zoomText.getBBox().width+5,b(e.buttonOptions,function(a,b){u[b]=h.button(a.text,D,0,function(){e.clickButton(b);e.isActive=!0},v,x&&x.hover,x&&x.select,x&&x.disabled).attr({"text-align":"center"}).add(G);D+=u[b].width+f(n.buttonSpacing,5)}),!1!==y&&(e.div=q=B("div",null,{position:"relative",height:0,zIndex:1}),p.parentNode.insertBefore(q,p),e.inputGroup= q=h.g("input-group").add(),q.offset=0,e.drawInput("min"),e.drawInput("max"))),e.updateButtonStates(),G[H?"animate":"attr"]({translateY:F.buttonTop}),!1!==y&&(q.align(c({y:F.inputTop,width:q.offset,x:m&&F.inputTop<(m.y||0)+m.height-g.spacing[0]?-40:0},n.inputPosition),!0,g.spacingBox),l(y)||(g=G.getBBox(),q[q.alignAttr.translateX<g.x+g.width+10?"hide":"show"]()),e.setInputValue("min",a),e.setInputValue("max",d)),e.rendered=!0)},update:function(a){var b=this.chart;H(!0,b.options.rangeSelector,a);this.destroy(); this.init(b)},destroy:function(){var a=this.minInput,b=this.maxInput,c;this.unMouseDown();this.unResize();m(this.buttons);a&&(a.onfocus=a.onblur=a.onchange=null);b&&(b.onfocus=b.onblur=b.onchange=null);for(c in this)this[c]&&"chart"!==c&&(this[c].destroy?this[c].destroy():this[c].nodeType&&g(this[c])),this[c]!==F.prototype[c]&&(this[c]=null)}};x.prototype.toFixedRange=function(a,b,c,d){var e=this.chart&&this.chart.fixedRange;a=f(c,this.translate(a,!0,!this.horiz));b=f(d,this.translate(b,!0,!this.horiz)); c=e&&(b-a)/e;.7<c&&1.3>c&&(d?a=b-e:b=a+e);y(a)||(a=b=void 0);return{min:a,max:b}};x.prototype.minFromRange=function(){var a=this.range,b={month:"Month",year:"FullYear"}[a.type],c,d=this.max,e,g,r=function(a,c){var d=new Date(a);d["set"+b](d["get"+b]()+c);return d.getTime()-a};y(a)?(c=d-a,g=a):(c=d+r(d,-a.count),this.chart&&(this.chart.fixedRange=d-c));e=f(this.dataMin,Number.MIN_VALUE);y(c)||(c=e);c<=e&&(c=e,void 0===g&&(g=r(c,a.count)),this.newMax=Math.min(c+g,this.dataMax));y(d)||(c=void 0);return c}; D(A.prototype,"init",function(a,b,c){n(this,"init",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new F(this))});a.call(this,b,c)});A.prototype.callbacks.push(function(a){function b(){c=a.xAxis[0].getExtremes();y(c.min)&&d.render(c.min,c.max)}var c,d=a.rangeSelector,e,f;d&&(f=n(a.xAxis[0],"afterSetExtremes",function(a){d.render(a.min,a.max)}),e=n(a,"redraw",b),b());n(a,"destroy",function(){d&&(e(),f())})});a.RangeSelector=F})(J);(function(a){var F=a.arrayMax,n=a.arrayMin,x=a.Axis, A=a.Chart,G=a.defined,B=a.each,I=a.extend,w=a.format,v=a.inArray,l=a.isNumber,m=a.isString,g=a.map,b=a.merge,c=a.pick,e=a.Point,q=a.Renderer,y=a.Series,H=a.splat,f=a.SVGRenderer,d=a.VMLRenderer,t=a.wrap,D=y.prototype,h=D.init,u=D.processData,E=e.prototype.tooltipFormatter;a.StockChart=a.stockChart=function(d,e,f){var k=m(d)||d.nodeName,h=arguments[k?1:0],p=h.series,l=a.getOptions(),n,z=c(h.navigator&&h.navigator.enabled,l.navigator.enabled,!0),q=z?{startOnTick:!1,endOnTick:!1}:null,v={marker:{enabled:!1, radius:2}},t={shadow:!1,borderWidth:0};h.xAxis=g(H(h.xAxis||{}),function(a){return b({minPadding:0,maxPadding:0,ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},l.xAxis,a,{type:"datetime",categories:null},q)});h.yAxis=g(H(h.yAxis||{}),function(a){n=c(a.opposite,!0);return b({labels:{y:-2},opposite:n,showLastLabel:!1,title:{text:null}},l.yAxis,a)});h.series=null;h=b({chart:{panning:!0,pinchType:"x"},navigator:{enabled:z},scrollbar:{enabled:c(l.scrollbar.enabled,!0)},rangeSelector:{enabled:c(l.rangeSelector.enabled, !0)},title:{text:null},tooltip:{shared:!0,crosshairs:!0},legend:{enabled:!1},plotOptions:{line:v,spline:v,area:v,areaspline:v,arearange:v,areasplinerange:v,column:t,columnrange:t,candlestick:t,ohlc:t}},h,{isStock:!0});h.series=p;return k?new A(d,h,f):new A(h,e)};t(x.prototype,"autoLabelAlign",function(a){var b=this.chart,c=this.options,b=b._labelPanes=b._labelPanes||{},d=this.options.labels;return this.chart.options.isStock&&"yAxis"===this.coll&&(c=c.top+","+c.height,!b[c]&&d.enabled)?(15===d.x&& (d.x=0),void 0===d.align&&(d.align="right"),b[c]=this,"right"):a.call(this,[].slice.call(arguments,1))});t(x.prototype,"destroy",function(a){var b=this.chart,c=this.options&&this.options.top+","+this.options.height;c&&b._labelPanes&&b._labelPanes[c]===this&&delete b._labelPanes[c];return a.call(this,Array.prototype.slice.call(arguments,1))});t(x.prototype,"getPlotLinePath",function(a,b,d,e,f,h){var k=this,p=this.isLinked&&!this.series?this.linkedParent.series:this.series,r=k.chart,n=r.renderer,q= k.left,z=k.top,t,u,w,C,x=[],y=[],A,D;if("colorAxis"===k.coll)return a.apply(this,[].slice.call(arguments,1));y=function(a){var b="xAxis"===a?"yAxis":"xAxis";a=k.options[b];return l(a)?[r[b][a]]:m(a)?[r.get(a)]:g(p,function(a){return a[b]})}(k.coll);B(k.isXAxis?r.yAxis:r.xAxis,function(a){if(G(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?"yAxis":"xAxis",b=G(a.options[b])?r[b][a.options[b]]:r[b][0];k===b&&y.push(a)}});A=y.length?[]:[k.isXAxis?r.yAxis[0]:r.xAxis[0]];B(y,function(a){-1=== v(a,A)&&A.push(a)});D=c(h,k.translate(b,null,null,e));l(D)&&(k.horiz?B(A,function(a){var b;u=a.pos;C=u+a.len;t=w=Math.round(D+k.transB);if(t<q||t>q+k.width)f?t=w=Math.min(Math.max(q,t),q+k.width):b=!0;b||x.push("M",t,u,"L",w,C)}):B(A,function(a){var b;t=a.pos;w=t+a.len;u=C=Math.round(z+k.height-D);if(u<z||u>z+k.height)f?u=C=Math.min(Math.max(z,u),k.top+k.height):b=!0;b||x.push("M",t,u,"L",w,C)}));return 0<x.length?n.crispPolyLine(x,d||1):null});x.prototype.getPlotBandPath=function(a,b){b=this.getPlotLinePath(b, null,null,!0);a=this.getPlotLinePath(a,null,null,!0);var c=[],d;if(a&&b)if(a.toString()===b.toString())c=a,c.flat=!0;else for(d=0;d<a.length;d+=6)c.push("M",a[d+1],a[d+2],"L",a[d+4],a[d+5],b[d+4],b[d+5],b[d+1],b[d+2],"z");else c=null;return c};f.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=Math.round(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=Math.round(a[c+2])+b%2/2);return a};q===d&&(d.prototype.crispPolyLine=f.prototype.crispPolyLine); t(x.prototype,"hideCrosshair",function(a,b){a.call(this,b);this.crossLabel&&(this.crossLabel=this.crossLabel.hide())});t(x.prototype,"drawCrosshair",function(a,b,d){var e,f;a.call(this,b,d);if(G(this.crosshair.label)&&this.crosshair.label.enabled&&this.cross){a=this.chart;var g=this.options.crosshair.label,h=this.horiz;e=this.opposite;f=this.left;var k=this.top,l=this.crossLabel,m,n=g.format,p="",q="inside"===this.options.tickPosition,t=!1!==this.crosshair.snap,u=0;b||(b=this.cross&&this.cross.e); m=h?"center":e?"right"===this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";l||(l=this.crossLabel=a.renderer.label(null,null,null,g.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&" highcharts-color-"+this.series[0].colorIndex)).attr({align:g.align||m,padding:c(g.padding,8),r:c(g.borderRadius,3),zIndex:2}).add(this.labelGroup),l.attr({fill:g.backgroundColor||this.series[0]&&this.series[0].color||"#666666",stroke:g.borderColor||"","stroke-width":g.borderWidth|| 0}).css(I({color:"#ffffff",fontWeight:"normal",fontSize:"11px",textAlign:"center"},g.style)));h?(m=t?d.plotX+f:b.chartX,k+=e?0:this.height):(m=e?this.width+f:0,k=t?d.plotY+k:b.chartY);n||g.formatter||(this.isDatetimeAxis&&(p="%b %d, %Y"),n="{value"+(p?":"+p:"")+"}");b=t?d[this.isXAxis?"x":"y"]:this.toValue(h?b.chartX:b.chartY);l.attr({text:n?w(n,{value:b}):g.formatter.call(this,b),x:m,y:k,visibility:"visible"});b=l.getBBox();if(h){if(q&&!e||!q&&e)k=l.y-b.height}else k=l.y-b.height/2;h?(e=f-b.x,f= f+this.width-b.x):(e="left"===this.labelAlign?f:0,f="right"===this.labelAlign?f+this.width:a.chartWidth);l.translateX<e&&(u=e-l.translateX);l.translateX+b.width>=f&&(u=-(l.translateX+b.width-f));l.attr({x:m+u,y:k,anchorX:h?m:this.opposite?0:a.chartWidth,anchorY:h?this.opposite?a.chartHeight:0:k+b.height/2})}});D.init=function(){h.apply(this,arguments);this.setCompare(this.options.compare)};D.setCompare=function(a){this.modifyValue="value"===a||"percent"===a?function(b,c){var d=this.compareValue;if(void 0!== b&&void 0!==d)return b="value"===a?b-d:b/d*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};D.processData=function(){var a,b=-1,c,d,e,f;u.apply(this,arguments);if(this.xAxis&&this.processedYData)for(c=this.processedXData,d=this.processedYData,e=d.length,this.pointArrayMap&&(b=v("close",this.pointArrayMap),-1===b&&(b=v(this.pointValKey||"y",this.pointArrayMap))),a=0;a<e-1;a++)if(f=-1<b?d[a][b]:d[a],l(f)&&c[a+1]>= this.xAxis.min&&0!==f){this.compareValue=f;break}};t(D,"getExtremes",function(a){var b;a.apply(this,[].slice.call(arguments,1));this.modifyValue&&(b=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)],this.dataMin=n(b),this.dataMax=F(b))});x.prototype.setCompare=function(a,b){this.isXAxis||(B(this.series,function(b){b.setCompare(a)}),c(b,!0)&&this.chart.redraw())};e.prototype.tooltipFormatter=function(b){b=b.replace("{point.change}",(0<this.change?"+":"")+a.numberFormat(this.change,c(this.series.tooltipOptions.changeDecimals, 2)));return E.apply(this,[b])};t(y.prototype,"render",function(a){this.chart.is3d&&this.chart.is3d()||this.chart.polar||!this.xAxis||this.xAxis.isRadial||(!this.clipBox&&this.animate?(this.clipBox=b(this.chart.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len):this.chart[this.sharedClipKey]?this.chart[this.sharedClipKey].attr({width:this.xAxis.len,height:this.yAxis.len}):this.clipBox&&(this.clipBox.width=this.xAxis.len,this.clipBox.height=this.yAxis.len));a.call(this)})})(J)});
dakshshah96/cdnjs
ajax/libs/highmaps/5.0.8/modules/stock.js
JavaScript
mit
60,441