view $/vendor.js @ 1:f38015048f48 tip

Added GPL
author Daniel Wolff
date Sat, 13 Feb 2016 20:43:38 +0100
parents 493bcb69166c
children
line wrap: on
line source
/*! jQuery v2.1.1 | (c) 2005, 2014 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.1",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)>=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=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"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=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)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(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||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(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 I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(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 ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(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 typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),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))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),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===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(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?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.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 fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.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},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.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=fb.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=fb.selectors={cacheLength:50,createPseudo:hb,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(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===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]||fb.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]&&fb.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(cb,db).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("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.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+" ").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()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(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),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).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:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(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]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.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?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(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 sb(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 tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(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 vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(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?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(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 vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(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]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.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(cb,db),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(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(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+Math.random()}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 ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={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,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(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 kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(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 ob(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 pb(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=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(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(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$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=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.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=jb(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=jb(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(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(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(ob(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&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(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(ob(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&&eb.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(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}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 qb,rb={};function sb(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 tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.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 yb(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),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 zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(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 Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(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",tb(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=xb(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]=Fb(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=Bb.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]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[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?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[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}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),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=wb(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 Jb(this,!0)},hide:function(){return Jb(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 Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,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=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):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):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.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}}},Kb.propHooks.scrollTop=Kb.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=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.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 Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(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 Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(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")||tb(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],Nb.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?tb(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=Ub(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 Wb(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 Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),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:Lb||Sb(),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(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,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(Xb,{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],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.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=Xb(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&&Pb.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(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("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(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=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(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=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 Yb,Zb,$b=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)?Zb:Yb)),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}}}}}),Zb={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=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?: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")||_b.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 ac=/[\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(ac," "):" ")){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(ac," "):"")){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(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\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(bc,""):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 cc=n.now(),dc=/\?/;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 ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(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 sc(a,b,c,d){var e={},f=a===oc;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 tc(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 uc(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 vc(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:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,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?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),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=ic.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||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),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]?", "+pc+"; 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=sc(oc,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=uc(k,v,f)),u=vc(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.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),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 wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(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)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},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")&&Ac.test(this.nodeName)&&!zc.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(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;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 Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[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=Dc[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 Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.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(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.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,Gc.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 Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.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.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(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=Kc(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||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),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=Kc(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]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.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 Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
(function($,undefined){var getElemClasses=function(domEl){if(domEl.classList){return $.makeArray(domEl.classList)}else{return $.trim(domEl.className).split(/\s+/)}};$.bem={generateBlock:function(tag,blockName,modifiers){if(blockName===undefined){blockName=tag;tag="div"}else if(Array.isArray(blockName)){modifiers=blockName;blockName=tag;tag="div"}var $block=$("<"+tag+"/>").addClass(blockName);if(Array.isArray(modifiers)){for(var i=0;i<modifiers.length;i++){$block.addClass(blockName+"_"+modifiers[i])}}return $block},generateElement:function(tag,blockName,elementName,modifiers){if(elementName===undefined){elementName=blockName;blockName=tag;tag="div"}else if(Array.isArray(elementName)){modifiers=elementName;elementName=blockName;blockName=tag;tag="div"}var elementClassName=blockName+"__"+elementName;var $element=$("<"+tag+"/>").addClass(elementClassName);if(Array.isArray(modifiers)){for(var i=0;i<modifiers.length;i++){$element.addClass(elementClassName+"_"+modifiers[i])}}return $element}};$.extend($.fn,{getMod:function(block,elem,modName){if(modName===undefined){modName=elem;elem=undefined}if(this.length){var classPattern=block+(elem!==undefined?"__"+elem:"")+"_"+modName,modVal=false;$.each(getElemClasses(this.get(0)),function(i,c){if(c===classPattern){modVal=true;return false}else if(c.indexOf(classPattern)===0&&c.substr(classPattern.length,1)==="_"){modVal=c.substr(classPattern.length+1);return false}});return modVal}else return undefined},setMod:function(block,elem,modName,modVal){if(modVal===undefined){modVal=modName;modName=elem;elem=undefined}return this.each(function(){var $this=$(this),classPattern=block+(elem!==undefined?"__"+elem:"")+"_"+modName;if(modVal===false){$.each(getElemClasses(this),function(i,c){if(c.indexOf(classPattern)===0){var afterPattern=c.substr(classPattern.length,1);if(afterPattern===undefined||afterPattern==="_"){$this.removeClass(c)}}})}else if(modVal===true){$this.addClass(classPattern)}else{$.each(getElemClasses(this),function(i,c){if(c.indexOf(classPattern)===0&&c.substr(classPattern.length,1)==="_"){$this.removeClass(c)}});$this.addClass(classPattern+"_"+modVal)}})},hasMod:function(block,elem,modName){return!!this.getMod(block,elem,modName)}})})(jQuery);
/*!
 Sticky-kit v1.0.4 | WTFPL | Leaf Corcoran 2014 | http://leafo.net
*/
(function(){var b,m;b=this.jQuery;m=b(window);b.fn.stick_in_parent=function(e){var u,n,f,p,B,l,C;null==e&&(e={});p=e.sticky_class;u=e.inner_scrolling;f=e.parent;n=e.offset_top;null==n&&(n=0);null==f&&(f=void 0);null==u&&(u=!0);null==p&&(p="is_stuck");B=function(a,e,l,v,y,q,t){var r,z,k,w,c,d,A,x,g,h;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);d=a.parent();null!=f&&(d=d.closest(f));if(!d.length)throw"failed to find stick parent";r=k=!1;g=b("<div />");g.css("position",a.css("position"));A=function(){var c,b;c=parseInt(d.css("border-top-width"),10);b=parseInt(d.css("padding-top"),10);e=parseInt(d.css("padding-bottom"),10);l=d.offset().top+c+b;v=d.height();c=k?(k=!1,r=!1,a.insertAfter(g).css({position:"",top:"",width:"",bottom:""}).removeClass(p),g.detach(),!0):void 0;y=a.offset().top-parseInt(a.css("margin-top"),10)-n;q=a.outerHeight(!0);t=a.css("float");g.css({width:a.outerWidth(!0),height:q,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":t});if(c)return h()};A();if(q!==v)return w=void 0,c=n,h=function(){var b,h,s,f;s=m.scrollTop();null!=w&&(h=s-w);w=s;k?(f=s+q+c>v+l,r&&!f&&(r=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom")),s<y&&(k=!1,c=n,"left"!==t&&"right"!==t||a.insertAfter(g),g.detach(),b={position:"",width:"",top:""},a.css(b).removeClass(p).trigger("sticky_kit:unstick")),u&&(b=m.height(),q>b&&!r&&(c-=h,c=Math.max(b-q,c),c=Math.min(n,c),k&&a.css({top:c+"px"})))):s>y&&(k=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(p).after(g),"left"!==t&&"right"!==t||g.append(a),a.trigger("sticky_kit:stick"));if(k&&(null==f&&(f=s+q+c>v+l),!r&&f))return r=!0,"static"===d.css("position")&&d.css({position:"relative"}),a.css({position:"absolute",bottom:e,top:"auto"}).trigger("sticky_kit:bottom")},x=function(){A();return h()},z=function(){m.off("scroll",h);b(document.body).off("sticky_kit:recalc",x);a.off("sticky_kit:detach",z);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:""});d.position("position","");if(k)return a.insertAfter(g).removeClass(p),g.remove()},m.on("touchmove",h),m.on("scroll",h),m.on("resize",x),b(document.body).on("sticky_kit:recalc",x),a.on("sticky_kit:detach",z),setTimeout(h,0)}};l=0;for(C=this.length;l<C;l++)e=this[l],B(b(e));return this}}).call(this);
/*!
 * jQuery Hotkeys Plugin
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Based upon the plugin by Tzury Bar Yochay:
 * http://github.com/tzuryby/hotkeys
 *
 * Original idea by:
 * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
 */
(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",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",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],options:{filterTextInputs:true}};function keyHandler(handleObj){if(typeof handleObj.data==="string"){handleObj.data={keys:handleObj.data}}if(!handleObj.data||!handleObj.data.keys||typeof handleObj.data.keys!=="string"){return}var origHandler=handleObj.handler,keys=handleObj.data.keys.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||jQuery.hotkeys.options.filterTextInputs&&jQuery.inArray(event.target.type,jQuery.hotkeys.textAcceptingInputTypes)>-1)){return}var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),modif="",possible={};jQuery.each(["alt","ctrl","shift"],function(index,specialKey){if(event[specialKey+"Key"]&&special!==specialKey){modif+=specialKey+"+"}});if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+"}if(event.metaKey&&special!=="meta"&&modif.indexOf("alt+ctrl+shift+")>-1){modif=modif.replace("alt+ctrl+shift+","hyper+")}if(special){possible[modif+special]=true}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true}}for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments)}}}}jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler}})})(jQuery||this.jQuery||window.jQuery);
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 3.1.12
 *
 * Requires: jQuery 1.2.2+
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){factory(require("jquery"))}else{factory(jQuery)}})(function($){var browserType,textrange={get:function(property){return _textrange[browserType].get.apply(this,[property])},set:function(start,length){var s=parseInt(start),l=parseInt(length),e;if(typeof start==="undefined"){s=0}else if(start<0){s=this[0].value.length+s}if(typeof length!=="undefined"){if(length>=0){e=s+l}else{e=this[0].value.length+l}}_textrange[browserType].set.apply(this,[s,e]);return this},setcursor:function(position){return this.textrange("set",position,0)},replace:function(text){_textrange[browserType].replace.apply(this,[String(text)]);return this},insert:function(text){return this.textrange("replace",text)}},_textrange={xul:{get:function(property){var props={position:this[0].selectionStart,start:this[0].selectionStart,end:this[0].selectionEnd,length:this[0].selectionEnd-this[0].selectionStart,text:this.val().substring(this[0].selectionStart,this[0].selectionEnd)};return typeof property==="undefined"?props:props[property]},set:function(start,end){if(typeof end==="undefined"){end=this[0].value.length}this[0].selectionStart=start;this[0].selectionEnd=end},replace:function(text){var start=this[0].selectionStart;var end=this[0].selectionEnd;var val=this.val();this.val(val.substring(0,start)+text+val.substring(end,val.length));this[0].selectionStart=start;this[0].selectionEnd=start+text.length}},msie:{get:function(property){var range=document.selection.createRange();if(typeof range==="undefined"){var props={position:0,start:0,end:this.val().length,length:this.val().length,text:this.val()};return typeof property==="undefined"?props:props[property]}var start=0;var end=0;var length=this[0].value.length;var lfValue=this[0].value.replace(/\r\n/g,"\n");var rangeText=this[0].createTextRange();var rangeTextEnd=this[0].createTextRange();rangeText.moveToBookmark(range.getBookmark());rangeTextEnd.collapse(false);if(rangeText.compareEndPoints("StartToEnd",rangeTextEnd)===-1){start=-rangeText.moveStart("character",-length);start+=lfValue.slice(0,start).split("\n").length-1;if(rangeText.compareEndPoints("EndToEnd",rangeTextEnd)===-1){end=-rangeText.moveEnd("character",-length);end+=lfValue.slice(0,end).split("\n").length-1}else{end=length}}else{start=length;end=length}var props={position:start,start:start,end:end,length:length,text:range.text};return typeof property==="undefined"?props:props[property]},set:function(start,end){var range=this[0].createTextRange();if(typeof range==="undefined"){return}if(typeof end==="undefined"){end=this[0].value.length}var ieStart=start-(this[0].value.slice(0,start).split("\r\n").length-1);var ieEnd=end-(this[0].value.slice(0,end).split("\r\n").length-1);range.collapse(true);range.moveEnd("character",ieEnd);range.moveStart("character",ieStart);range.select()},replace:function(text){document.selection.createRange().text=text}}};$.fn.textrange=function(method){if(typeof this[0]==="undefined"){return this}if(typeof browserType==="undefined"){browserType="selectionStart"in this[0]?"xul":document.selection?"msie":"unknown"}if(browserType==="unknown"){return this}if(document.activeElement!==this[0]){this[0].focus()}if(typeof method==="undefined"||typeof method!=="string"){return textrange.get.apply(this)}else if(typeof textrange[method]==="function"){return textrange[method].apply(this,Array.prototype.slice.call(arguments,1))}else{$.error("Method "+method+" does not exist in jQuery.textrange")}}});
(function($){if(!navigator.userAgent.match(/Macintosh/)){return}var is_chrome=navigator.userAgent.indexOf("Chrome")>-1;var is_safari=navigator.userAgent.indexOf("Safari")>-1;var is_firefox=navigator.userAgent.indexOf("Firefox")>-1;if(is_chrome||is_safari||is_firefox){$(window).mousewheel(function(e,d,x,y){var prevent_left,prevent_up;absX=Math.abs(x);absY=Math.abs(y);prevent_left=absY<=absX&&x<0&&!_($(e.target).parents()).detect(function(el){return $(el).scrollLeft()>0});prevent_up=absX<=absY&&y>0&&!_($(e.target).parents()).detect(function(el){return $(el).scrollTop()>0});prevent_right=absY<=absX&&x>0&&!_($(e.target).parents()).detect(function(el){var $el=$(el);if($el.css("overflow")!="scroll"){return false}var scrollLeft=$el.scrollLeft();var childrenOuterWidth=$el.children().outerWidth();var ownWidth=el.clientWidth;return ownWidth&&childrenOuterWidth>ownWidth&&childrenOuterWidth-scrollLeft>ownWidth});if(prevent_left||prevent_up||prevent_right){e.preventDefault()}})}})(jQuery);
(function(root,factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){factory(require("jquery"))}else{if(root.jQuery){factory(root.jQuery)}else{factory(root.Zepto)}}})(this,function($,undefined){$.fn.jPlayer=function(options){var name="jPlayer";var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_"){return returnValue}if(isMethodCall){this.each(function(){var instance=$(this).data(name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false}})}else{this.each(function(){var instance=$(this).data(name);if(instance){instance.option(options||{})}else{$(this).data(name,new $.jPlayer(options,this))}})}return returnValue};$.jPlayer=function(options,element){if(arguments.length){this.element=$(element);this.options=$.extend(true,{},this.options,options);var self=this;this.element.bind("remove.jPlayer",function(){self.destroy()});this._init()}};if(typeof $.fn.stop!=="function"){$.fn.stop=function(){}}$.jPlayer.emulateMethods="load play pause";$.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";$.jPlayer.emulateOptions="muted volume";$.jPlayer.reservedEvent="ready flashreset resize repeat error warning";$.jPlayer.event={};$.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){$.jPlayer.event[this]="jPlayer_"+this});$.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"];$.jPlayer.pause=function(){$.jPlayer.prototype.destroyRemoved();$.each($.jPlayer.prototype.instances,function(i,element){if(element.data("jPlayer").status.srcSet){element.jPlayer("pause")}})};$.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};var ConvertTime=function(){this.init()};ConvertTime.prototype={init:function(){this.options={timeFormat:$.jPlayer.timeFormat}},time:function(s){s=s&&typeof s==="number"?s:0;var myTime=new Date(s*1e3),hour=myTime.getUTCHours(),min=this.options.timeFormat.showHour?myTime.getUTCMinutes():myTime.getUTCMinutes()+hour*60,sec=this.options.timeFormat.showMin?myTime.getUTCSeconds():myTime.getUTCSeconds()+min*60,strHour=this.options.timeFormat.padHour&&hour<10?"0"+hour:hour,strMin=this.options.timeFormat.padMin&&min<10?"0"+min:min,strSec=this.options.timeFormat.padSec&&sec<10?"0"+sec:sec,strTime="";strTime+=this.options.timeFormat.showHour?strHour+this.options.timeFormat.sepHour:"";strTime+=this.options.timeFormat.showMin?strMin+this.options.timeFormat.sepMin:"";strTime+=this.options.timeFormat.showSec?strSec+this.options.timeFormat.sepSec:"";return strTime}};var myConvertTime=new ConvertTime;$.jPlayer.convertTime=function(s){return myConvertTime.time(s)};$.jPlayer.uaBrowser=function(userAgent){var ua=userAgent.toLowerCase();var rwebkit=/(webkit)[ \/]([\w.]+)/;var ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/;var rmsie=/(msie) ([\w.]+)/;var rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/;var match=rwebkit.exec(ua)||ropera.exec(ua)||rmsie.exec(ua)||ua.indexOf("compatible")<0&&rmozilla.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}};$.jPlayer.uaPlatform=function(userAgent){var ua=userAgent.toLowerCase();var rplatform=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/;var rtablet=/(ipad|playbook)/;var randroid=/(android)/;var rmobile=/(mobile)/;var platform=rplatform.exec(ua)||[];var tablet=rtablet.exec(ua)||!rmobile.exec(ua)&&randroid.exec(ua)||[];if(platform[1]){platform[1]=platform[1].replace(/\s/g,"_")}return{platform:platform[1]||"",tablet:tablet[1]||""}};$.jPlayer.browser={};$.jPlayer.platform={};var browserMatch=$.jPlayer.uaBrowser(navigator.userAgent);if(browserMatch.browser){$.jPlayer.browser[browserMatch.browser]=true;$.jPlayer.browser.version=browserMatch.version}var platformMatch=$.jPlayer.uaPlatform(navigator.userAgent);if(platformMatch.platform){$.jPlayer.platform[platformMatch.platform]=true;$.jPlayer.platform.mobile=!platformMatch.tablet;$.jPlayer.platform.tablet=!!platformMatch.tablet}$.jPlayer.getDocMode=function(){var docMode;if($.jPlayer.browser.msie){if(document.documentMode){docMode=document.documentMode}else{docMode=5;if(document.compatMode){if(document.compatMode==="CSS1Compat"){docMode=7}}}}return docMode};$.jPlayer.browser.documentMode=$.jPlayer.getDocMode();$.jPlayer.nativeFeatures={init:function(){var d=document,v=d.createElement("video"),spec={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},specOrder=["w3c","moz","webkit","webkitVideo","ms"],fs,i,il;this.fullscreen=fs={support:{w3c:!!d[spec.w3c[0]],moz:!!d[spec.moz[0]],webkit:typeof d[spec.webkit[3]]==="function",webkitVideo:typeof v[spec.webkitVideo[2]]==="function",ms:typeof v[spec.ms[2]]==="function"},used:{}};for(i=0,il=specOrder.length;i<il;i++){var n=specOrder[i];if(fs.support[n]){fs.spec=n;fs.used[n]=true;break}}if(fs.spec){var s=spec[fs.spec];fs.api={fullscreenEnabled:true,fullscreenElement:function(elem){elem=elem?elem:d;return elem[s[1]]},requestFullscreen:function(elem){return elem[s[2]]()},exitFullscreen:function(elem){elem=elem?elem:d;return elem[s[3]]()}};fs.event={fullscreenchange:s[4],fullscreenerror:s[5]}}else{fs.api={fullscreenEnabled:false,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}};fs.event={}}}};$.jPlayer.nativeFeatures.init();$.jPlayer.focus=null;$.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var keyBindings=function(event){var f=$.jPlayer.focus,ignoreKey;if(f){$.each($.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(i,name){if(event.target.nodeName.toUpperCase()===name.toUpperCase()){ignoreKey=true;return false}});if(!ignoreKey){$.each(f.options.keyBindings,function(action,binding){if(binding&&$.isFunction(binding.fn)&&(typeof binding.key==="number"&&event.which===binding.key||typeof binding.key==="string"&&event.key===binding.key)){event.preventDefault();binding.fn(f);return false}})}}};$.jPlayer.keys=function(en){var event="keydown.jPlayer";$(document.documentElement).unbind(event);if(en){$(document.documentElement).bind(event,keyBindings)}};$.jPlayer.keys(true);$.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:false,remainingDuration:false,toggleDuration:false,captureDuration:true,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:false,autoBlur:true,smoothPlayBar:false,fullScreen:false,fullWindow:false,autohide:{restored:false,full:true,fadeIn:200,fadeOut:600,hold:1e3},loop:false,repeat:function(event){if(event.jPlayer.options.loop){$(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){$(this).jPlayer("play")})}else{$(this).unbind(".jPlayerRepeat")}},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:false,audioFullScreen:false,keyBindings:{play:{key:80,fn:function(f){if(f.status.paused){f.play()}else{f.pause()}}},fullScreen:{key:70,fn:function(f){if(f.status.video||f.options.audioFullScreen){f._setOption("fullScreen",!f.options.fullScreen)}}},muted:{key:77,fn:function(f){f._muted(!f.options.muted)}},volumeUp:{key:190,fn:function(f){f.volume(f.options.volume+.1)}},volumeDown:{key:188,fn:function(f){f.volume(f.options.volume-.1)}},loop:{key:76,fn:function(f){f._loop(!f.options.loop)}}},verticalVolume:false,verticalPlaybackRate:false,globalVolume:false,idPrefix:"jp",noConflict:"jQuery",emulateHtml:false,consoleAlerts:true,errorAlerts:false,warningAlerts:false},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:false},solution:{html:true,aurora:true,flash:true},format:{mp3:{codec:"audio/mpeg",flashCanPlay:true,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:false,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:false,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:false,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:false,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:true,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:true,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:false,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:false,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:false,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:true,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:true,media:"video"}},_init:function(){var self=this;this.element.empty();this.status=$.extend({},this.status);this.internal=$.extend({},this.internal);this.options.timeFormat=$.extend({},$.jPlayer.timeFormat,this.options.timeFormat);this.internal.cmdsIgnored=$.jPlayer.platform.ipad||$.jPlayer.platform.iphone||$.jPlayer.platform.ipod;this.internal.domNode=this.element.get(0);if(this.options.keyEnabled&&!$.jPlayer.focus){$.jPlayer.focus=this}this.androidFix={setMedia:false,play:false,pause:false,time:NaN};if($.jPlayer.platform.android){this.options.preload=this.options.preload!=="auto"?"metadata":"auto"}this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.aurora={};this.aurora.formats=[];this.aurora.properties=[];this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=[];this.options.volume=this._limitValue(this.options.volume,0,1);$.each(this.options.supplied.toLowerCase().split(","),function(index1,value1){var format=value1.replace(/^\s+|\s+$/g,"");if(self.format[format]){var dupFound=false;$.each(self.formats,function(index2,value2){if(format===value2){dupFound=true;return false}});if(!dupFound){self.formats.push(format)}}});$.each(this.options.solution.toLowerCase().split(","),function(index1,value1){var solution=value1.replace(/^\s+|\s+$/g,"");if(self.solution[solution]){var dupFound=false;$.each(self.solutions,function(index2,value2){if(solution===value2){dupFound=true;return false}});if(!dupFound){self.solutions.push(solution)}}});$.each(this.options.auroraFormats.toLowerCase().split(","),function(index1,value1){var format=value1.replace(/^\s+|\s+$/g,"");if(self.format[format]){var dupFound=false;$.each(self.aurora.formats,function(index2,value2){if(format===value2){dupFound=true;return false}});if(!dupFound){self.aurora.formats.push(format)}}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;if(!this.element.attr("id")){this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count)}this.internal.self=$.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=$.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:undefined});this.internal.video=$.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:undefined});this.internal.flash=$.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:undefined,swf:this.options.swfPath+(this.options.swfPath.toLowerCase().slice(-4)!==".swf"?(this.options.swfPath&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"jquery.jplayer.swf":"")});this.internal.poster=$.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:undefined});$.each($.jPlayer.event,function(eventName,eventType){if(self.options[eventName]!==undefined){self.element.bind(eventType+".jPlayer",self.options[eventName]);self.options[eventName]=undefined}});this.require.audio=false;this.require.video=false;$.each(this.formats,function(priority,format){self.require[self.format[format].media]=true});if(this.require.video){this.options=$.extend(true,{},this.optionsVideo,this.options)}else{this.options=$.extend(true,{},this.optionsAudio,this.options)}this._setSize();this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this.status.noVolume=this._uaBlocklist(this.options.noVolume);if($.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled){this._fullscreenAddEventListeners()}this._restrictNativeVideoControls();this.htmlElement.poster=document.createElement("img");this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!self.status.video||self.status.waitForPlay){self.internal.poster.jq.show()}};this.element.append(this.htmlElement.poster);this.internal.poster.jq=$("#"+this.internal.poster.id);this.internal.poster.jq.css({width:this.status.width,height:this.status.height});this.internal.poster.jq.hide();this.internal.poster.jq.bind("click.jPlayer",function(){self._trigger($.jPlayer.event.click)});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=document.createElement("audio");this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)}this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement("video");this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)}this.flash.available=this._checkForFlash(10.1);this.html.canPlay={};this.aurora.canPlay={};this.flash.canPlay={};$.each(this.formats,function(priority,format){self.html.canPlay[format]=self.html[self.format[format].media].available&&""!==self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);self.aurora.canPlay[format]=$.inArray(format,self.aurora.formats)>-1;self.flash.canPlay[format]=self.format[format].flashCanPlay&&self.flash.available});this.html.desired=false;this.aurora.desired=false;this.flash.desired=false;$.each(this.solutions,function(solutionPriority,solution){if(solutionPriority===0){self[solution].desired=true}else{var audioCanPlay=false;var videoCanPlay=false;$.each(self.formats,function(formatPriority,format){if(self[self.solutions[0]].canPlay[format]){if(self.format[format].media==="video"){videoCanPlay=true}else{audioCanPlay=true}}});self[solution].desired=self.require.audio&&!audioCanPlay||self.require.video&&!videoCanPlay}});this.html.support={};this.aurora.support={};this.flash.support={};$.each(this.formats,function(priority,format){self.html.support[format]=self.html.canPlay[format]&&self.html.desired;self.aurora.support[format]=self.aurora.canPlay[format]&&self.aurora.desired;self.flash.support[format]=self.flash.canPlay[format]&&self.flash.desired});this.html.used=false;this.aurora.used=false;this.flash.used=false;$.each(this.solutions,function(solutionPriority,solution){$.each(self.formats,function(formatPriority,format){if(self[solution].support[format]){self[solution].used=true;return false}})});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);if(!(this.html.used||this.aurora.used||this.flash.used)){this._error({type:$.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SOLUTION,hint:$.jPlayer.errorHint.NO_SOLUTION});if(this.css.jq.noSolution.length){this.css.jq.noSolution.show()}}else{if(this.css.jq.noSolution.length){this.css.jq.noSolution.hide()}}if(this.flash.used){var htmlObj,flashVars="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if($.jPlayer.browser.msie&&(Number($.jPlayer.browser.version)<9||$.jPlayer.browser.documentMode<9)){var objStr='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>';var paramStr=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+flashVars+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];htmlObj=document.createElement(objStr);for(var i=0;i<paramStr.length;i++){htmlObj.appendChild(document.createElement(paramStr[i]))}}else{var createParam=function(el,n,v){var p=document.createElement("param");p.setAttribute("name",n);p.setAttribute("value",v);el.appendChild(p)};htmlObj=document.createElement("object");htmlObj.setAttribute("id",this.internal.flash.id);htmlObj.setAttribute("name",this.internal.flash.id);htmlObj.setAttribute("data",this.internal.flash.swf);htmlObj.setAttribute("type","application/x-shockwave-flash");htmlObj.setAttribute("width","1");htmlObj.setAttribute("height","1");htmlObj.setAttribute("tabindex","-1");createParam(htmlObj,"flashvars",flashVars);createParam(htmlObj,"allowscriptaccess","always");createParam(htmlObj,"bgcolor",this.options.backgroundColor);createParam(htmlObj,"wmode",this.options.wmode)}this.element.append(htmlObj);this.internal.flash.jq=$(htmlObj)}if(this.html.used&&!this.flash.used){this.status.playbackRateEnabled=this._testPlaybackRate("audio")}else{this.status.playbackRateEnabled=false}this._updatePlaybackRate();if(this.html.used){if(this.html.audio.available){this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio);this.element.append(this.htmlElement.audio);this.internal.audio.jq=$("#"+this.internal.audio.id)}if(this.html.video.available){this._addHtmlEventListeners(this.htmlElement.video,this.html.video);this.element.append(this.htmlElement.video);this.internal.video.jq=$("#"+this.internal.video.id);if(this.status.nativeVideoControls){this.internal.video.jq.css({width:this.status.width,height:this.status.height})}else{this.internal.video.jq.css({width:"0px",height:"0px"})}this.internal.video.jq.bind("click.jPlayer",function(){self._trigger($.jPlayer.event.click)})}}if(this.aurora.used){}if(this.options.emulateHtml){this._emulateHtmlBridge()}if((this.html.used||this.aurora.used)&&!this.flash.used){setTimeout(function(){self.internal.ready=true;self.version.flash="n/a";self._trigger($.jPlayer.event.repeat);self._trigger($.jPlayer.event.ready)},100)}this._updateNativeVideoControls();if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide()}$.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();if(this.css.jq.currentTime.length){this.css.jq.currentTime.text("")}if(this.css.jq.duration.length){this.css.jq.duration.text("")}$.each(this.css.jq,function(fn,jq){if(jq.length){jq.unbind(".jPlayer")}});this.internal.poster.jq.unbind(".jPlayer");if(this.internal.video.jq){this.internal.video.jq.unbind(".jPlayer")}this._fullscreenRemoveEventListeners();if(this===$.jPlayer.focus){$.jPlayer.focus=null}if(this.options.emulateHtml){this._destroyHtmlBridge()}this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},destroyRemoved:function(){var self=this;$.each(this.instances,function(i,element){if(self.element!==element){if(!element.data("jPlayer")){element.jPlayer("destroy");delete self.instances[i]}}})},enable:function(){},disable:function(){},_testCanPlayType:function(elem){try{elem.canPlayType(this.format.mp3.codec);return true}catch(err){return false}},_testPlaybackRate:function(type){var el,rate=.5;type=typeof type==="string"?type:"audio";el=document.createElement(type);try{if("playbackRate"in el){el.playbackRate=rate;return el.playbackRate===rate}else{return false}}catch(err){return false}},_uaBlocklist:function(list){var ua=navigator.userAgent.toLowerCase(),block=false;$.each(list,function(p,re){if(re&&re.test(ua)){block=true;return false}});return block},_restrictNativeVideoControls:function(){if(this.require.audio){if(this.status.nativeVideoControls){this.status.nativeVideoControls=false;this.status.noFullWindow=true}}},_updateNativeVideoControls:function(){if(this.html.video.available&&this.html.used){this.htmlElement.video.controls=this.status.nativeVideoControls;this._updateAutohide();if(this.status.nativeVideoControls&&this.require.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}else if(this.status.waitForPlay&&this.status.video){this.internal.poster.jq.show();this.internal.video.jq.css({width:"0px",height:"0px"})}}},_addHtmlEventListeners:function(mediaElement,entity){var self=this;mediaElement.preload=this.options.preload;mediaElement.muted=this.options.muted;mediaElement.volume=this.options.volume;if(this.status.playbackRateEnabled){mediaElement.defaultPlaybackRate=this.options.defaultPlaybackRate;mediaElement.playbackRate=this.options.playbackRate}mediaElement.addEventListener("progress",function(){if(entity.gate){if(self.internal.cmdsIgnored&&this.readyState>0){self.internal.cmdsIgnored=false}self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.progress)}},false);mediaElement.addEventListener("loadeddata",function(){if(entity.gate){self.androidFix.setMedia=false;if(self.androidFix.play){self.androidFix.play=false;self.play(self.androidFix.time)}if(self.androidFix.pause){self.androidFix.pause=false;self.pause(self.androidFix.time)}self._trigger($.jPlayer.event.loadeddata)}},false);mediaElement.addEventListener("timeupdate",function(){if(entity.gate){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.timeupdate)}},false);mediaElement.addEventListener("durationchange",function(){if(entity.gate){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.durationchange)}},false);mediaElement.addEventListener("play",function(){if(entity.gate){self._updateButtons(true);self._html_checkWaitForPlay();self._trigger($.jPlayer.event.play)}},false);mediaElement.addEventListener("playing",function(){if(entity.gate){self._updateButtons(true);self._seeked();self._trigger($.jPlayer.event.playing)}},false);mediaElement.addEventListener("pause",function(){if(entity.gate){self._updateButtons(false);self._trigger($.jPlayer.event.pause)}},false);mediaElement.addEventListener("waiting",function(){if(entity.gate){self._seeking();self._trigger($.jPlayer.event.waiting)}},false);mediaElement.addEventListener("seeking",function(){if(entity.gate){self._seeking();self._trigger($.jPlayer.event.seeking)}},false);mediaElement.addEventListener("seeked",function(){if(entity.gate){self._seeked();self._trigger($.jPlayer.event.seeked)}},false);mediaElement.addEventListener("volumechange",function(){if(entity.gate){self.options.volume=mediaElement.volume;self.options.muted=mediaElement.muted;self._updateMute();self._updateVolume();self._trigger($.jPlayer.event.volumechange)}},false);mediaElement.addEventListener("ratechange",function(){if(entity.gate){self.options.defaultPlaybackRate=mediaElement.defaultPlaybackRate;self.options.playbackRate=mediaElement.playbackRate;self._updatePlaybackRate();self._trigger($.jPlayer.event.ratechange)}},false);mediaElement.addEventListener("suspend",function(){if(entity.gate){self._seeked();self._trigger($.jPlayer.event.suspend)}},false);mediaElement.addEventListener("ended",function(){if(entity.gate){if(!$.jPlayer.browser.webkit){self.htmlElement.media.currentTime=0}self.htmlElement.media.pause();self._updateButtons(false);self._getHtmlStatus(mediaElement,true);self._updateInterface();self._trigger($.jPlayer.event.ended)}},false);mediaElement.addEventListener("error",function(){if(entity.gate){self._updateButtons(false);self._seeked();if(self.status.srcSet){clearTimeout(self.internal.htmlDlyCmdId);self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video&&!self.status.nativeVideoControls){self.internal.video.jq.css({width:"0px",height:"0px"})}if(self._validString(self.status.media.poster)&&!self.status.nativeVideoControls){self.internal.poster.jq.show()}if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show()}self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL})}}},false);$.each($.jPlayer.htmlEvent,function(i,eventType){mediaElement.addEventListener(this,function(){if(entity.gate){self._trigger($.jPlayer.event[eventType])}},false)})},_addAuroraEventListeners:function(player,entity){var self=this;player.volume=this.options.volume*100;player.on("progress",function(){if(entity.gate){if(self.internal.cmdsIgnored&&this.readyState>0){self.internal.cmdsIgnored=false}self._getAuroraStatus(player);self._updateInterface();self._trigger($.jPlayer.event.progress);if(player.duration>0){self._trigger($.jPlayer.event.timeupdate)}}},false);player.on("ready",function(){if(entity.gate){self._trigger($.jPlayer.event.loadeddata)}},false);player.on("duration",function(){if(entity.gate){self._getAuroraStatus(player);self._updateInterface();self._trigger($.jPlayer.event.durationchange)}},false);player.on("end",function(){if(entity.gate){self._updateButtons(false);self._getAuroraStatus(player,true);self._updateInterface();self._trigger($.jPlayer.event.ended)}},false);player.on("error",function(){if(entity.gate){self._updateButtons(false);self._seeked();if(self.status.srcSet){self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video&&!self.status.nativeVideoControls){self.internal.video.jq.css({width:"0px",height:"0px"})}if(self._validString(self.status.media.poster)&&!self.status.nativeVideoControls){self.internal.poster.jq.show()}if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show()}self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL})}}},false)},_getHtmlStatus:function(media,override){var ct=0,cpa=0,sp=0,cpr=0;if(isFinite(media.duration)){this.status.duration=media.duration}ct=media.currentTime;cpa=this.status.duration>0?100*ct/this.status.duration:0;if(typeof media.seekable==="object"&&media.seekable.length>0){sp=this.status.duration>0?100*media.seekable.end(media.seekable.length-1)/this.status.duration:100;cpr=this.status.duration>0?100*media.currentTime/media.seekable.end(media.seekable.length-1):0}else{sp=100;cpr=cpa}if(override){ct=0;cpr=0;cpa=0}this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=media.videoWidth;this.status.videoHeight=media.videoHeight;this.status.readyState=media.readyState;this.status.networkState=media.networkState;this.status.playbackRate=media.playbackRate;this.status.ended=media.ended},_getAuroraStatus:function(player,override){var ct=0,cpa=0,sp=0,cpr=0;this.status.duration=player.duration/1e3;ct=player.currentTime/1e3;cpa=this.status.duration>0?100*ct/this.status.duration:0;if(player.buffered>0){sp=this.status.duration>0?player.buffered*this.status.duration/this.status.duration:100;cpr=this.status.duration>0?ct/(player.buffered*this.status.duration):0}else{sp=100;cpr=cpa}if(override){ct=0;cpr=0;cpa=0}this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=false},_resetStatus:function(){this.status=$.extend({},this.status,$.jPlayer.prototype.status)},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.options=$.extend(true,{},this.options);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.aurora=$.extend(true,{},this.aurora);event.jPlayer.flash=$.extend(true,{},this.flash);if(error){event.jPlayer.error=$.extend({},error)}if(warning){event.jPlayer.warning=$.extend({},warning)}this.element.trigger(event)},jPlayerFlashEvent:function(eventType,status){if(eventType===$.jPlayer.event.ready){if(!this.internal.ready){this.internal.ready=true;this.internal.flash.jq.css({width:"0px",height:"0px"});this.version.flash=status.version;if(this.version.needFlash!==this.version.flash){this._error({type:$.jPlayer.error.VERSION,context:this.version.flash,message:$.jPlayer.errorMsg.VERSION+this.version.flash,hint:$.jPlayer.errorHint.VERSION})}this._trigger($.jPlayer.event.repeat);this._trigger(eventType)}else{if(this.flash.gate){if(this.status.srcSet){var currentTime=this.status.currentTime,paused=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);if(currentTime>0){if(paused){this.pause(currentTime)}else{this.play(currentTime)}}}this._trigger($.jPlayer.event.flashreset)
}}}if(this.flash.gate){switch(eventType){case $.jPlayer.event.progress:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.timeupdate:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(eventType);break;case $.jPlayer.event.pause:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.ended:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.click:this._trigger(eventType);break;case $.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;if(this.status.video){this.internal.flash.jq.css({width:"0px",height:"0px"})}if(this._validString(this.status.media.poster)){this.internal.poster.jq.show()}if(this.css.jq.videoPlay.length&&this.status.video){this.css.jq.videoPlay.show()}if(this.status.video){this._flash_setVideo(this.status.media)}else{this._flash_setAudio(this.status.media)}this._updateButtons(false);this._error({type:$.jPlayer.error.URL,context:status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});break;case $.jPlayer.event.seeking:this._seeking();this._trigger(eventType);break;case $.jPlayer.event.seeked:this._seeked();this._trigger(eventType);break;case $.jPlayer.event.ready:break;default:this._trigger(eventType)}}return false},_getFlashStatus:function(status){this.status.seekPercent=status.seekPercent;this.status.currentPercentRelative=status.currentPercentRelative;this.status.currentPercentAbsolute=status.currentPercentAbsolute;this.status.currentTime=status.currentTime;this.status.duration=status.duration;this.status.remaining=status.duration-status.currentTime;this.status.videoWidth=status.videoWidth;this.status.videoHeight=status.videoHeight;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=false},_updateButtons:function(playing){if(playing===undefined){playing=!this.status.paused}else{this.status.paused=!playing}if(playing){this.addStateClass("playing")}else{this.removeStateClass("playing")}if(!this.status.noFullWindow&&this.options.fullWindow){this.addStateClass("fullScreen")}else{this.removeStateClass("fullScreen")}if(this.options.loop){this.addStateClass("looped")}else{this.removeStateClass("looped")}if(this.css.jq.play.length&&this.css.jq.pause.length){if(playing){this.css.jq.play.hide();this.css.jq.pause.show()}else{this.css.jq.play.show();this.css.jq.pause.hide()}}if(this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length){if(this.status.noFullWindow){this.css.jq.fullScreen.hide();this.css.jq.restoreScreen.hide()}else if(this.options.fullWindow){this.css.jq.fullScreen.hide();this.css.jq.restoreScreen.show()}else{this.css.jq.fullScreen.show();this.css.jq.restoreScreen.hide()}}if(this.css.jq.repeat.length&&this.css.jq.repeatOff.length){if(this.options.loop){this.css.jq.repeat.hide();this.css.jq.repeatOff.show()}else{this.css.jq.repeat.show();this.css.jq.repeatOff.hide()}}},_updateInterface:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.width(this.status.seekPercent+"%")}if(this.css.jq.playBar.length){if(this.options.smoothPlayBar){this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear")}else{this.css.jq.playBar.width(this.status.currentPercentRelative+"%")}}var currentTimeText="";if(this.css.jq.currentTime.length){currentTimeText=this._convertTime(this.status.currentTime);if(currentTimeText!==this.css.jq.currentTime.text()){this.css.jq.currentTime.text(this._convertTime(this.status.currentTime))}}var durationText="",duration=this.status.duration,remaining=this.status.remaining;if(this.css.jq.duration.length){if(typeof this.status.media.duration==="string"){durationText=this.status.media.duration}else{if(typeof this.status.media.duration==="number"){duration=this.status.media.duration;remaining=duration-this.status.currentTime}if(this.options.remainingDuration){durationText=(remaining>0?"−":"")+this._convertTime(remaining)}else{durationText=this._convertTime(duration)}}if(durationText!==this.css.jq.duration.text()){this.css.jq.duration.text(durationText)}}},_convertTime:ConvertTime.prototype.time,_seeking:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.addClass("jp-seeking-bg")}this.addStateClass("seeking")},_seeked:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.removeClass("jp-seeking-bg")}this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=false;this.html.video.gate=false;this.aurora.gate=false;this.flash.gate=false},_resetActive:function(){this.html.active=false;this.aurora.active=false;this.flash.active=false},_escapeHtml:function(s){return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},_qualifyURL:function(url){var el=document.createElement("div");el.innerHTML='<a href="'+this._escapeHtml(url)+'">x</a>';return el.firstChild.href},_absoluteMediaUrls:function(media){var self=this;$.each(media,function(type,url){if(url&&self.format[type]&&url.substr(0,5)!=="data:"){media[type]=self._qualifyURL(url)}});return media},addStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.addClass(this.options.stateClass[state])}},removeStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.options.stateClass[state])}},setMedia:function(media){var self=this,supported=false,posterChanged=this.status.media.poster!==media.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=false;this.androidFix.play=false;this.androidFix.pause=false;media=this._absoluteMediaUrls(media);$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==="video";$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==="html";var isAurora=solution==="aurora";if(isVideo){if(isHtml){self.html.video.gate=true;self._html_setVideo(media);self.html.active=true}else{self.flash.gate=true;self._flash_setVideo(media);self.flash.active=true}if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show()}self.status.video=true}else{if(isHtml){self.html.audio.gate=true;self._html_setAudio(media);self.html.active=true;if($.jPlayer.platform.android){self.androidFix.setMedia=true}}else if(isAurora){self.aurora.gate=true;self._aurora_setAudio(media);self.aurora.active=true}else{self.flash.gate=true;self._flash_setAudio(media);self.flash.active=true}if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.hide()}self.status.video=false}supported=true;return false}});if(supported){return false}});if(supported){if(!(this.status.nativeVideoControls&&this.html.video.gate)){if(this._validString(media.poster)){if(posterChanged){this.htmlElement.poster.src=media.poster}else{this.internal.poster.jq.show()}}}if(typeof media.title==="string"){if(this.css.jq.title.length){this.css.jq.title.html(media.title)}if(this.htmlElement.audio){this.htmlElement.audio.setAttribute("title",media.title)}if(this.htmlElement.video){this.htmlElement.video.setAttribute("title",media.title)}}this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface();this._trigger($.jPlayer.event.setmedia)}else{this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT})}},_resetMedia:function(){this._resetStatus();this._updateButtons(false);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_resetMedia()}else if(this.aurora.active){this._aurora_resetMedia()}else if(this.flash.active){this._flash_resetMedia()}},clearMedia:function(){this._resetMedia();if(this.html.active){this._html_clearMedia()}else if(this.aurora.active){this._aurora_clearMedia()}else if(this.flash.active){this._flash_clearMedia()}this._resetGate();this._resetActive()},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load()}else if(this.aurora.active){this._aurora_load()}else if(this.flash.active){this._flash_load()}}else{this._urlNotSetError("load")}},focus:function(){if(this.options.keyEnabled){$.jPlayer.focus=this}},play:function(time){var guiAction=typeof time==="object";if(guiAction&&this.options.useStateClassSkin&&!this.status.paused){this.pause(time)}else{time=typeof time==="number"?time:NaN;if(this.status.srcSet){this.focus();if(this.html.active){this._html_play(time)}else if(this.aurora.active){this._aurora_play(time)}else if(this.flash.active){this._flash_play(time)}}else{this._urlNotSetError("play")}}},videoPlay:function(){this.play()},pause:function(time){time=typeof time==="number"?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time)}else if(this.aurora.active){this._aurora_pause(time)}else if(this.flash.active){this._flash_pause(time)}}else{this._urlNotSetError("pause")}},tellOthers:function(command,conditions){var self=this,hasConditions=typeof conditions==="function",args=Array.prototype.slice.call(arguments);if(typeof command!=="string"){return}if(hasConditions){args.splice(1,1)}$.jPlayer.prototype.destroyRemoved();$.each(this.instances,function(){if(self.element!==this){if(!hasConditions||conditions.call(this.data("jPlayer"),self)){this.jPlayer.apply(this,args)}}})},pauseOthers:function(time){this.tellOthers("pause",function(){return this.status.srcSet},time)},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0)}else if(this.aurora.active){this._aurora_pause(0)}else if(this.flash.active){this._flash_pause(0)}}else{this._urlNotSetError("stop")}},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p)}else if(this.aurora.active){this._aurora_playHead(p)}else if(this.flash.active){this._flash_playHead(p)}}else{this._urlNotSetError("playHead")}},_muted:function(muted){this.mutedWorker(muted);if(this.options.globalVolume){this.tellOthers("mutedWorker",function(){return this.options.globalVolume},muted)}},mutedWorker:function(muted){this.options.muted=muted;if(this.html.used){this._html_setProperty("muted",muted)}if(this.aurora.used){this._aurora_mute(muted)}if(this.flash.used){this._flash_mute(muted)}if(!this.html.video.gate&&!this.html.audio.gate){this._updateMute(muted);this._updateVolume(this.options.volume);this._trigger($.jPlayer.event.volumechange)}},mute:function(mute){var guiAction=typeof mute==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.muted){this._muted(false)}else{mute=mute===undefined?true:!!mute;this._muted(mute)}},unmute:function(unmute){unmute=unmute===undefined?true:!!unmute;this._muted(!unmute)},_updateMute:function(mute){if(mute===undefined){mute=this.options.muted}if(mute){this.addStateClass("muted")}else{this.removeStateClass("muted")}if(this.css.jq.mute.length&&this.css.jq.unmute.length){if(this.status.noVolume){this.css.jq.mute.hide();this.css.jq.unmute.hide()}else if(mute){this.css.jq.mute.hide();this.css.jq.unmute.show()}else{this.css.jq.mute.show();this.css.jq.unmute.hide()}}},volume:function(v){this.volumeWorker(v);if(this.options.globalVolume){this.tellOthers("volumeWorker",function(){return this.options.globalVolume},v)}},volumeWorker:function(v){v=this._limitValue(v,0,1);this.options.volume=v;if(this.html.used){this._html_setProperty("volume",v)}if(this.aurora.used){this._aurora_volume(v)}if(this.flash.used){this._flash_volume(v)}if(!this.html.video.gate&&!this.html.audio.gate){this._updateVolume(v);this._trigger($.jPlayer.event.volumechange)}},volumeBar:function(e){if(this.css.jq.volumeBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height();if(this.options.verticalVolume){this.volume(y/h)}else{this.volume(x/w)}}if(this.options.muted){this._muted(false)}},_updateVolume:function(v){if(v===undefined){v=this.options.volume}v=this.options.muted?0:v;if(this.status.noVolume){this.addStateClass("noVolume");if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.hide()}if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.hide()}if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.hide()}}else{this.removeStateClass("noVolume");if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.show()}if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.show();this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](v*100+"%")}if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.show()}}},volumeMax:function(){this.volume(1);if(this.options.muted){this._muted(false)}},_cssSelectorAncestor:function(ancestor){var self=this;this.options.cssSelectorAncestor=ancestor;this._removeUiClass();this.ancestorJq=ancestor?$(ancestor):[];if(ancestor&&this.ancestorJq.length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:ancestor,message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT})}this._addUiClass();$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel)});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();this._updateMute()},_cssSelector:function(fn,cssSel){var self=this;if(typeof cssSel==="string"){if($.jPlayer.prototype.options.cssSelector[fn]){if(this.css.jq[fn]&&this.css.jq[fn].length){this.css.jq[fn].unbind(".jPlayer")}this.options.cssSelector[fn]=cssSel;this.css.cs[fn]=this.options.cssSelectorAncestor+" "+cssSel;if(cssSel){this.css.jq[fn]=$(this.css.cs[fn])}else{this.css.jq[fn]=[]}if(this.css.jq[fn].length&&this[fn]){var handler=function(e){e.preventDefault();self[fn](e);if(self.options.autoBlur){$(this).blur()}else{$(this).focus()}};this.css.jq[fn].bind("click.jPlayer",handler)}if(cssSel&&this.css.jq[fn].length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[fn],message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[fn].length+" found for "+fn+" method.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT})}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_METHOD,context:fn,message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD})}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_STRING,context:cssSel,message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING})}},duration:function(e){if(this.options.toggleDuration){if(this.options.captureDuration){e.stopPropagation()}this._setOption("remainingDuration",!this.options.remainingDuration)}},seekBar:function(e){if(this.css.jq.seekBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),p=100*x/w;this.playHead(p)}},playbackRate:function(pbr){this._setOption("playbackRate",pbr)},playbackRateBar:function(e){if(this.css.jq.playbackRateBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height(),ratio,pbr;if(this.options.verticalPlaybackRate){ratio=y/h}else{ratio=x/w}pbr=ratio*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate;this.playbackRate(pbr)}},_updatePlaybackRate:function(){var pbr=this.options.playbackRate,ratio=(pbr-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);if(this.status.playbackRateEnabled){if(this.css.jq.playbackRateBar.length){this.css.jq.playbackRateBar.show()}if(this.css.jq.playbackRateBarValue.length){this.css.jq.playbackRateBarValue.show();this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](ratio*100+"%")}}else{if(this.css.jq.playbackRateBar.length){this.css.jq.playbackRateBar.hide()}if(this.css.jq.playbackRateBarValue.length){this.css.jq.playbackRateBarValue.hide()}}},repeat:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.loop){this._loop(false)}else{this._loop(true)}},repeatOff:function(){this._loop(false)},_loop:function(loop){if(this.options.loop!==loop){this.options.loop=loop;this._updateButtons();this._trigger($.jPlayer.event.repeat)}},option:function(key,value){var options=key;if(arguments.length===0){return $.extend(true,{},this.options)}if(typeof key==="string"){var keys=key.split(".");if(value===undefined){var opt=$.extend(true,{},this.options);for(var i=0;i<keys.length;i++){if(opt[keys[i]]!==undefined){opt=opt[keys[i]]}else{this._warning({type:$.jPlayer.warning.OPTION_KEY,context:key,message:$.jPlayer.warningMsg.OPTION_KEY,hint:$.jPlayer.warningHint.OPTION_KEY});return undefined}}return opt}options={};var opts=options;for(var j=0;j<keys.length;j++){if(j<keys.length-1){opts[keys[j]]={};opts=opts[keys[j]]}else{opts[keys[j]]=value}}}this._setOptions(options);return this},_setOptions:function(options){var self=this;$.each(options,function(key,value){self._setOption(key,value)});return this},_setOption:function(key,value){var self=this;switch(key){case"volume":this.volume(value);break;case"muted":this._muted(value);break;case"globalVolume":this.options[key]=value;break;case"cssSelectorAncestor":this._cssSelectorAncestor(value);break;case"cssSelector":$.each(value,function(fn,cssSel){self._cssSelector(fn,cssSel)});break;case"playbackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate,this.options.maxPlaybackRate);if(this.html.used){this._html_setProperty("playbackRate",value)}this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate,this.options.maxPlaybackRate);if(this.html.used){this._html_setProperty("defaultPlaybackRate",value)}this._updatePlaybackRate();break;case"minPlaybackRate":this.options[key]=value=this._limitValue(value,.1,this.options.maxPlaybackRate-.1);this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate+.1,16);this._updatePlaybackRate();break;case"fullScreen":if(this.options[key]!==value){var wkv=$.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;if(!wkv||wkv&&!this.status.waitForPlay){if(!wkv){this.options[key]=value}if(value){this._requestFullscreen()}else{this._exitFullscreen()}if(!wkv){this._setOption("fullWindow",value)}}}break;case"fullWindow":if(this.options[key]!==value){this._removeUiClass();this.options[key]=value;this._refreshSize()}break;case"size":if(!this.options.fullWindow&&this.options[key].cssClass!==value.cssClass){this._removeUiClass()}this.options[key]=$.extend({},this.options[key],value);this._refreshSize();break;case"sizeFull":if(this.options.fullWindow&&this.options[key].cssClass!==value.cssClass){this._removeUiClass()}this.options[key]=$.extend({},this.options[key],value);this._refreshSize();break;case"autohide":this.options[key]=$.extend({},this.options[key],value);this._updateAutohide();break;case"loop":this._loop(value);break;case"remainingDuration":this.options[key]=value;this._updateInterface();break;case"toggleDuration":this.options[key]=value;break;case"nativeVideoControls":this.options[key]=$.extend({},this.options[key],value);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case"noFullWindow":this.options[key]=$.extend({},this.options[key],value);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case"noVolume":this.options[key]=$.extend({},this.options[key],value);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case"emulateHtml":if(this.options[key]!==value){this.options[key]=value;if(value){this._emulateHtmlBridge()}else{this._destroyHtmlBridge()}}break;case"timeFormat":this.options[key]=$.extend({},this.options[key],value);break;case"keyEnabled":this.options[key]=value;if(!value&&this===$.jPlayer.focus){$.jPlayer.focus=null}break;case"keyBindings":this.options[key]=$.extend(true,{},this.options[key],value);break;case"audioFullScreen":this.options[key]=value;break;case"autoBlur":this.options[key]=value;break}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger($.jPlayer.event.resize)},_setSize:function(){if(this.options.fullWindow){this.status.width=this.options.sizeFull.width;this.status.height=this.options.sizeFull.height;this.status.cssClass=this.options.sizeFull.cssClass}else{this.status.width=this.options.size.width;this.status.height=this.options.size.height;this.status.cssClass=this.options.size.cssClass}this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.addClass(this.status.cssClass)}},_removeUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.status.cssClass)}},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});if(!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls){this.internal.video.jq.css({width:this.status.width,height:this.status.height})}else if(!this.status.waitForPlay&&this.flash.active&&this.status.video){this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}},_updateAutohide:function(){var self=this,event="mousemove.jPlayer",namespace=".jPlayerAutohide",eventType=event+namespace,handler=function(event){var moved=false,deltaX,deltaY;if(typeof self.internal.mouse!=="undefined"){deltaX=self.internal.mouse.x-event.pageX;deltaY=self.internal.mouse.y-event.pageY;moved=Math.floor(deltaX)>0||Math.floor(deltaY)>0}else{moved=true}self.internal.mouse={x:event.pageX,y:event.pageY};if(moved){self.css.jq.gui.fadeIn(self.options.autohide.fadeIn,function(){clearTimeout(self.internal.autohideId);self.internal.autohideId=setTimeout(function(){self.css.jq.gui.fadeOut(self.options.autohide.fadeOut)},self.options.autohide.hold)})}};if(this.css.jq.gui.length){this.css.jq.gui.stop(true,true);clearTimeout(this.internal.autohideId);delete this.internal.mouse;this.element.unbind(namespace);this.css.jq.gui.unbind(namespace);if(!this.status.nativeVideoControls){if(this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored){this.element.bind(eventType,handler);this.css.jq.gui.bind(eventType,handler);this.css.jq.gui.hide()}else{this.css.jq.gui.show()}}else{this.css.jq.gui.hide()}}},fullScreen:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.fullScreen){this._setOption("fullScreen",false)}else{this._setOption("fullScreen",true)}},restoreScreen:function(){this._setOption("fullScreen",false)},_fullscreenAddEventListeners:function(){var self=this,fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.api.fullscreenEnabled){if(fs.event.fullscreenchange){if(typeof this.internal.fullscreenchangeHandler!=="function"){this.internal.fullscreenchangeHandler=function(){self._fullscreenchange()}}document.addEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false)}}},_fullscreenRemoveEventListeners:function(){var fs=$.jPlayer.nativeFeatures.fullscreen;if(this.internal.fullscreenchangeHandler){document.removeEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false)}},_fullscreenchange:function(){if(this.options.fullScreen&&!$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()){this._setOption("fullScreen",false)}},_requestFullscreen:function(){var e=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.used.webkitVideo){e=this.htmlElement.video}if(fs.api.fullscreenEnabled){fs.api.requestFullscreen(e)}},_exitFullscreen:function(){var fs=$.jPlayer.nativeFeatures.fullscreen,e;if(fs.used.webkitVideo){e=this.htmlElement.video}if(fs.api.fullscreenEnabled){fs.api.exitFullscreen(e)}},_html_initMedia:function(media){var $media=$(this.htmlElement.media).empty();$.each(media.track||[],function(i,v){var track=document.createElement("track");track.setAttribute("kind",v.kind?v.kind:"");track.setAttribute("src",v.src?v.src:"");track.setAttribute("srclang",v.srclang?v.srclang:"");track.setAttribute("label",v.label?v.label:"");if(v.def){track.setAttribute("default",v.def)}$media.append(track)});this.htmlElement.media.src=this.status.src;if(this.options.preload!=="none"){this._html_load()}this._trigger($.jPlayer.event.timeupdate)},_html_setFormat:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.html.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}})},_html_setAudio:function(media){this._html_setFormat(media);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(media)},_html_setVideo:function(media){this._html_setFormat(media);if(this.status.nativeVideoControls){this.htmlElement.video.poster=this._validString(media.poster)?media.poster:""}this.htmlElement.media=this.htmlElement.video;this._html_initMedia(media)},_html_resetMedia:function(){if(this.htmlElement.media){if(this.htmlElement.media.id===this.internal.video.id&&!this.status.nativeVideoControls){this.internal.video.jq.css({width:"0px",height:"0px"})}this.htmlElement.media.pause()}},_html_clearMedia:function(){if(this.htmlElement.media){this.htmlElement.media.src="about:blank";this.htmlElement.media.load()}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.load()}clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(time){var self=this,media=this.htmlElement.media;this.androidFix.pause=false;this._html_load();if(this.androidFix.setMedia){this.androidFix.play=true;this.androidFix.time=time}else if(!isNaN(time)){if(this.internal.cmdsIgnored){media.play()}try{if(!media.seekable||typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=time;media.play()}else{throw 1}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.play(time)},250);return}}else{media.play()}this._html_checkWaitForPlay()},_html_pause:function(time){var self=this,media=this.htmlElement.media;this.androidFix.play=false;if(time>0){this._html_load()}else{clearTimeout(this.internal.htmlDlyCmdId)}media.pause();if(this.androidFix.setMedia){this.androidFix.pause=true;this.androidFix.time=time}else if(!isNaN(time)){try{if(!media.seekable||typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=time}else{throw 1}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.pause(time)},250);return}}if(time>0){this._html_checkWaitForPlay()}},_html_playHead:function(percent){var self=this,media=this.htmlElement.media;this._html_load();try{if(typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=percent*media.seekable.end(media.seekable.length-1)/100}else if(media.duration>0&&!isNaN(media.duration)){media.currentTime=percent*media.duration/100}else{throw"e"}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.playHead(percent)},250);return}if(!this.status.waitForLoad){this._html_checkWaitForPlay()}},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide()}if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({width:this.status.width,height:this.status.height})}}},_html_setProperty:function(property,value){if(this.html.audio.available){this.htmlElement.audio[property]=value}if(this.html.video.available){this.htmlElement.video[property]=value}},_aurora_setAudio:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.aurora.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}});this.aurora.player=new AV.Player.fromURL(this.status.src);this._addAuroraEventListeners(this.aurora.player,this.aurora);if(this.options.preload==="auto"){this._aurora_load();this.status.waitForLoad=false}},_aurora_resetMedia:function(){if(this.aurora.player){this.aurora.player.stop()}},_aurora_clearMedia:function(){},_aurora_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.aurora.player.preload()}},_aurora_play:function(time){if(!this.status.waitForLoad){if(!isNaN(time)){this.aurora.player.seek(time)}}if(!this.aurora.player.playing){this.aurora.player.play()}this.status.waitForLoad=false;this._aurora_checkWaitForPlay();this._updateButtons(true);this._trigger($.jPlayer.event.play)},_aurora_pause:function(time){if(!isNaN(time)){this.aurora.player.seek(time*1e3)}this.aurora.player.pause();if(time>0){this._aurora_checkWaitForPlay()}this._updateButtons(false);this._trigger($.jPlayer.event.pause)},_aurora_playHead:function(percent){if(this.aurora.player.duration>0){this.aurora.player.seek(percent*this.aurora.player.duration/100)}if(!this.status.waitForLoad){this._aurora_checkWaitForPlay()}},_aurora_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false}},_aurora_volume:function(v){this.aurora.player.volume=v*100},_aurora_mute:function(m){if(m){this.aurora.properties.lastvolume=this.aurora.player.volume;this.aurora.player.volume=0}else{this.aurora.player.volume=this.aurora.properties.lastvolume}this.aurora.properties.muted=m},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":case"fla":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break;case"rtmpa":self._getMovie().fl_setAudio_rtmp(media[format]);break}self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}});if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(err){this._flashError(err)}},_flash_setVideo:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4v":case"flv":self._getMovie().fl_setVideo_m4v(media[format]);break;case"rtmpv":self._getMovie().fl_setVideo_rtmp(media[format]);break}self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false}});if(this.options.preload==="auto"){this._flash_load();this.status.waitForLoad=false}}catch(err){this._flashError(err)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(err){this._flashError(err)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(err){this._flashError(err)}this.status.waitForLoad=false},_flash_play:function(time){try{this._getMovie().fl_play(time)}catch(err){this._flashError(err)}this.status.waitForLoad=false;this._flash_checkWaitForPlay()},_flash_pause:function(time){try{this._getMovie().fl_pause(time)}catch(err){this._flashError(err)}if(time>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay()}},_flash_playHead:function(p){try{this._getMovie().fl_play_head(p)}catch(err){this._flashError(err)}if(!this.status.waitForLoad){this._flash_checkWaitForPlay()}},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide()
}if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({width:this.status.width,height:this.status.height})}}},_flash_volume:function(v){try{this._getMovie().fl_volume(v)}catch(err){this._flashError(err)}},_flash_mute:function(m){try{this._getMovie().fl_mute(m)}catch(err){this._flashError(err)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var version=0,flash;if(window.ActiveXObject){try{flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(flash){var v=flash.GetVariable("$version");if(v){v=v.split(" ")[1].split(",");version=parseInt(v[0],10)+"."+parseInt(v[1],10)}}}catch(e){}}else if(navigator.plugins&&navigator.mimeTypes.length>0){flash=navigator.plugins["Shockwave Flash"];if(flash){version=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")}}return version*1},_checkForFlash:function(version){var flashOk=false;if(this._getFlashPluginVersion()>=version){flashOk=true}return flashOk},_validString:function(url){return url&&typeof url==="string"},_limitValue:function(value,min,max){return value<min?min:value>max?max:value},_urlNotSetError:function(context){this._error({type:$.jPlayer.error.URL_NOT_SET,context:context,message:$.jPlayer.errorMsg.URL_NOT_SET,hint:$.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(error){var errorType;if(!this.internal.ready){errorType="FLASH"}else{errorType="FLASH_DISABLED"}this._error({type:$.jPlayer.error[errorType],context:this.internal.flash.swf,message:$.jPlayer.errorMsg[errorType]+error.message,hint:$.jPlayer.errorHint[errorType]});this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts){this._alert("Error!"+(error.message?"\n"+error.message:"")+(error.hint?"\n"+error.hint:"")+"\nContext: "+error.context)}},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts){this._alert("Warning!"+(warning.message?"\n"+warning.message:"")+(warning.hint?"\n"+warning.hint:"")+"\nContext: "+warning.context)}},_alert:function(message){var msg="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message;if(!this.options.consoleAlerts){alert(msg)}else if(window.console&&window.console.log){window.console.log(msg)}},_emulateHtmlBridge:function(){var self=this;$.each($.jPlayer.emulateMethods.split(/\s+/g),function(i,name){self.internal.domNode[name]=function(arg){self[name](arg)}});$.each($.jPlayer.event,function(eventName,eventType){var nativeEvent=true;$.each($.jPlayer.reservedEvent.split(/\s+/g),function(i,name){if(name===eventName){nativeEvent=false;return false}});if(nativeEvent){self.element.bind(eventType+".jPlayer.jPlayerHtml",function(){self._emulateHtmlUpdate();var domEvent=document.createEvent("Event");domEvent.initEvent(eventName,false,true);self.internal.domNode.dispatchEvent(domEvent)})}})},_emulateHtmlUpdate:function(){var self=this;$.each($.jPlayer.emulateStatus.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.status[name]});$.each($.jPlayer.emulateOptions.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.options[name]})},_destroyHtmlBridge:function(){var self=this;this.element.unbind(".jPlayerHtml");var emulated=$.jPlayer.emulateMethods+" "+$.jPlayer.emulateStatus+" "+$.jPlayer.emulateOptions;$.each(emulated.split(/\s+/g),function(i,name){delete self.internal.domNode[name]})}};$.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
/*! jQuery UI - v1.11.0 - 2014-06-26
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={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:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(g.inline?t.parent()[0]:g.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function o(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function r(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.0",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(){var t=this.css("position"),i="absolute"===t,s=this.parents().filter(function(){var t=e(this);return i&&"static"===t.css("position")?!1:/(auto|scroll)/.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==t&&s.length?s:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var h=0,l=Array.prototype.slice;e.cleanData=function(t){return function(i){for(var s,n=0;null!=(s=i[n]);n++)try{e(s).triggerHandler("remove")}catch(a){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=l.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=l.call(arguments,1),r=this;return n=!a&&o.length?e.widget.extend.apply(null,[n].concat(o)):n,a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))}),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.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:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var u=!1;e(document).mouseup(function(){u=!1}),e.widget("ui.mouse",{version:"1.11.0",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),u=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),N=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=N[0],M.top+=N[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+N[0],p[1]+N[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,e.top+p+f+m>u&&(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>d&&(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.0",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=h&&l.down||l,d=function(){o._toggleComplete(i)};return"number"==typeof u&&(a=u),"string"==typeof u&&(n=u),n=n||u.easing||l.easing,a=a||u.duration||l.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:d,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?r+=i.now:"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,d):e.animate(this.showProps,a,n,d)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1
}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(t.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(t.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.find(this.options.items).filter(function(){return r.test(e(this).text())})),s.length?(this.focus(t,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}}),e.widget("ui.autocomplete",{version:"1.11.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&jQuery.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var d,c="ui-button ui-widget ui-state-default ui-corner-all",p="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},m=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.0",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(c).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===d&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];m(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),d=this,t.document.one("mouseup",function(){d=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(c+" ui-state-active "+p).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?m(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(p),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.0",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.0"}});var g;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var r,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),o(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,r,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),o(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))
}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,r,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(o(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,g=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a");var i,s=this._getNumberOfMonths(t),n=s[1],a=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n=RegExp("^\\d{1,"+s+"}"),a=i.substring(h).match(n);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,N,C,A,I,P,z,H,F,E,j,O,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,N+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(M+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),I=(this._getFirstDayOfMonth(et,Z)-u+7)%7,P=Math.ceil((I+A)/7),z=Q?this.maxRows>P?this.maxRows:P:P,this.maxRows=z,H=this._daylightSavingAdjust(new Date(et,Z,1-I)),F=0;z>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(H)+"</td>":"",x=0;7>x;x++)j=g?g.apply(e.input?e.input[0]:null,[H]):[!0,""],O=H.getMonth()!==Z,W=O&&!y||!j[0]||X&&X>H||$&&H>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(H.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===H.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+j[1]+(H.getTime()===G.getTime()?" "+this._currentClass:"")+(H.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===R.getTime()?" ui-state-highlight":"")+(H.getTime()===G.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.0",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.document[0],s=this.options;try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(n){}return this.helper||s.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(s.iframeFix===!0?"iframe":s.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this._removeHandleClassName(),e(this.options.handle||this.element).addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.element.find(".ui-draggable-handle").addBack().removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relative_container=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}
},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i,s){var n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParent[0]!==i.document[0]&&"HTML"!==i.scrollParent[0].tagName&&(i.overflowOffset=i.scrollParent.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.document[0];s.scrollParent[0]!==o&&"HTML"!==s.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(s.scrollParent[0].scrollTop=a=s.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+s.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(s.scrollParent[0].scrollLeft=a=s.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(o).scrollTop()<n.scrollSensitivity?a=e(o).scrollTop(e(o).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(o).scrollTop())<n.scrollSensitivity&&(a=e(o).scrollTop(e(o).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(o).scrollLeft()<n.scrollSensitivity?a=e(o).scrollLeft(e(o).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(o).scrollLeft())<n.scrollSensitivity&&(a=e(o).scrollLeft(e(o).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left,l=h+s.snapElements[c].width,u=s.snapElements[c].top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left-s.margins.left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top-s.margins.top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top-s.margins.top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left-s.margins.left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left-s.margins.left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.originalPosition={left:i,top:s},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=t.pageX-a.left||0,h=t.pageY-a.top||0,l=this._change[o];return this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height},l?(i=l.apply(this,[t,r,h]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==this.prevPosition.top&&(n.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(n.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(n.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition,prevSize:this.prevSize,prevPosition:this.prevPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t,i){var s,n,a,o,r=e(this).resizable("instance"),h=r.options,l=r.containerOffset,u=r.position,d=r._aspectRatio||t.shiftKey,c={top:0,left:0},p=r.containerElement,f=!0;p[0]!==document&&/static/.test(p.css("position"))&&(c=l),u.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-c.left),d&&(r.size.height=r.size.width/r.aspectRatio,f=!1),r.position.left=h.helper?l.left:0),u.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),d&&(r.size.width=r.size.height*r.aspectRatio,f=!1),r.position.top=r._helper?l.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top,s=Math.abs((r._helper?r.offset.left-c.left:r.offset.left-l.left)+r.sizeDiff.width),n=Math.abs((r._helper?r.offset.top-c.top:r.offset.top-l.top)+r.sizeDiff.height),a=r.containerElement.get(0)===r.element.parent().get(0),o=/relative|absolute/.test(r.containerElement.css("position")),a&&o&&(s-=Math.abs(r.parentData.left)),s+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-s,d&&(r.size.height=r.size.width/r.aspectRatio,f=!1)),n+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-n,d&&(r.size.width=r.size.height*r.aspectRatio,f=!1)),f||(r.position.left=i.prevPosition.left,r.position.top=i.prevPosition.top,r.size.width=i.prevSize.width,r.size.height=i.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,d=Math.round((s.height-n.height)/l)*l,c=n.width+u,p=n.height+d,f=i.maxWidth&&c>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>c,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(c+=h),v&&(p+=l),f&&(c-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=c,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=c,t.size.height=p,t.position.top=a.top-d):/^(sw)$/.test(o)?(t.size.width=c,t.size.height=p,t.position.left=a.left-u):(p-l>0?(t.size.height=p,t.position.top=a.top-d):(t.size.height=l,t.position.top=a.top+n.height-l),c-h>0?(t.size.width=c,t.position.left=a.left-u):(t.size.width=h,t.position.left=a.left+n.width-h))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.0",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()
}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._untrackInstance(),this._trackingInstances().unshift(this),this._focusedElement=e(t.target)}})},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.0",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e(this).droppable("instance");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,h=o+t.helperProportions.width,l=r+t.helperProportions.height,u=i.offset.left,d=i.offset.top,c=u+i.proportions().width,p=d+i.proportions().height;switch(s){case"fit":return o>=u&&c>=h&&r>=d&&p>=l;case"intersect":return o+t.helperProportions.width/2>u&&c>h-t.helperProportions.width/2&&r+t.helperProportions.height/2>d&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,d,i.proportions().height)&&e(n,u,i.proportions().width);case"touch":return(r>=d&&p>=r||l>=d&&p>=l||d>r&&l>p)&&(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var v="ui-effects-";e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.0",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(v+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(v+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.0",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.0",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this,i=this.element.attr("tabindex");this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:i||this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._setOption("width",this.options.width),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this._setOption("width",this.options.width)},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{click:"_toggle",keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&(t||(t=this.element.outerWidth()),this.button.outerWidth(t))},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.attr("value"),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.0",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.0",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},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||this._isFloating(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),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},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.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(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),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"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);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 t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return 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(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[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")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.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 t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].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,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:r(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:r(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:r(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:r(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(r(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.0",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]
}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),s._trigger("load",i,r)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.0",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){e.data("ui-tooltip-open")&&n._delay(function(){t&&(t.type=a),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,a.is(":hidden")||a.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i),a.length)return a.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:a}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}},i[0]!==this.element[0]&&(o.remove=function(){this._removeTooltip(a)}),t&&"mouseover"!==t.type||(o.mouseleave="close"),t&&"focusin"!==t.type||(o.focusout="close"),this._on(!0,i,o)}},close:function(t){var i=this,s=e(t?t.currentTarget:this.element),n=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.stop(!0),this._hide(n,this.options.hide,function(){i._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,s){e(s.element).attr("title",s.title),delete i.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:n}),this.closing=!1)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]=t,i},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0),e("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
var ScrollFix=function(elem){var startY,startTopScroll;elem=elem||document.querySelector(elem);if(!elem)return;elem.addEventListener("touchstart",function(event){startY=event.touches[0].pageY;startTopScroll=elem.scrollTop;if(startTopScroll<=0)elem.scrollTop=1;if(startTopScroll+elem.offsetHeight>=elem.scrollHeight)elem.scrollTop=elem.scrollHeight-elem.offsetHeight-1},false)};
/*!
 * lions-mark.com/jquery/scrollTo/
 */
$.fn.scrollTo=function(target,options,callback){if(typeof options=="function"&&arguments.length==2){callback=options;options=target}var settings=$.extend({scrollTarget:target,offsetTop:50,duration:500,easing:"swing"},options);return this.each(function(){var scrollPane=$(this);var scrollTarget=typeof settings.scrollTarget=="number"?settings.scrollTarget:$(settings.scrollTarget);var scrollY=typeof scrollTarget=="number"?scrollTarget:scrollTarget.offset().top+scrollPane.scrollTop()-parseInt(settings.offsetTop);scrollPane.animate({scrollTop:scrollY},parseInt(settings.duration),settings.easing,function(){if(typeof callback=="function"){callback.call(this)}})})};
/*!
 * js-logger - http://github.com/jonnyreeves/js-logger 
 * Jonny Reeves, http://jonnyreeves.co.uk/
 * js-logger may be freely distributed under the MIT license. 
 */
(function(global){"use strict";var Logger={};Logger.VERSION="0.9.14";var logHandler;var contextualLoggersByNameMap={};var bind=function(scope,func){return function(){return func.apply(scope,arguments)}};var merge=function(){var args=arguments,target=args[0],key,i;for(i=1;i<args.length;i++){for(key in args[i]){if(!(key in target)&&args[i].hasOwnProperty(key)){target[key]=args[i][key]}}}return target};var defineLogLevel=function(value,name){return{value:value,name:name}};Logger.DEBUG=defineLogLevel(1,"DEBUG");Logger.INFO=defineLogLevel(2,"INFO");Logger.WARN=defineLogLevel(4,"WARN");Logger.ERROR=defineLogLevel(8,"ERROR");Logger.OFF=defineLogLevel(99,"OFF");var ContextualLogger=function(defaultContext){this.context=defaultContext;this.setLevel(defaultContext.filterLevel);this.log=this.info};ContextualLogger.prototype={setLevel:function(newLevel){if(newLevel&&"value"in newLevel){this.context.filterLevel=newLevel}},enabledFor:function(lvl){var filterLevel=this.context.filterLevel;return lvl.value>=filterLevel.value},debug:function(){this.invoke(Logger.DEBUG,arguments)},info:function(){this.invoke(Logger.INFO,arguments)},warn:function(){this.invoke(Logger.WARN,arguments)},error:function(){this.invoke(Logger.ERROR,arguments)},invoke:function(level,msgArgs){if(logHandler&&this.enabledFor(level)){logHandler(msgArgs,merge({level:level},this.context))}}};var globalLogger=new ContextualLogger({filterLevel:Logger.OFF});(function(){var L=Logger;L.enabledFor=bind(globalLogger,globalLogger.enabledFor);L.debug=bind(globalLogger,globalLogger.debug);L.info=bind(globalLogger,globalLogger.info);L.warn=bind(globalLogger,globalLogger.warn);L.error=bind(globalLogger,globalLogger.error);L.log=L.info})();Logger.setHandler=function(func){logHandler=func};Logger.setLevel=function(level){globalLogger.setLevel(level);for(var key in contextualLoggersByNameMap){if(contextualLoggersByNameMap.hasOwnProperty(key)){contextualLoggersByNameMap[key].setLevel(level)}}};Logger.get=function(name){return contextualLoggersByNameMap[name]||(contextualLoggersByNameMap[name]=new ContextualLogger(merge({name:name},globalLogger.context)))};Logger.useDefaults=function(defaultLevel){if(typeof console==="undefined"){return}Logger.setLevel(defaultLevel||Logger.DEBUG);Logger.setHandler(function(messages,context){var hdlr=console.log;if(context.name){messages[0]="["+context.name+"] "+messages[0]}if(context.level===Logger.WARN&&console.warn){hdlr=console.warn}else if(context.level===Logger.ERROR&&console.error){hdlr=console.error}else if(context.level===Logger.INFO&&console.info){hdlr=console.info}Function.prototype.apply.call(hdlr,console,messages)})};if(typeof define==="function"&&define.amd){define(Logger)}else if(typeof module!=="undefined"&&module.exports){module.exports=Logger}else{Logger._prevLogger=global.Logger;Logger.noConflict=function(){global.Logger=Logger._prevLogger;return Logger};global.Logger=Logger}})(this);
(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=d(e,i,4);var o=!w(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=b(r,e);for(var u=null!=t&&t.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t){var r=S.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||o,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=S[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var e=this,u=e._,i=Array.prototype,o=Object.prototype,a=Function.prototype,c=i.push,l=i.slice,f=o.toString,s=o.hasOwnProperty,p=Array.isArray,h=Object.keys,v=a.bind,g=Object.create,y=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):e._=m,m.VERSION="1.8.2";var d=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},b=function(n,t,r){return null==n?m.identity:m.isFunction(n)?d(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return b(n,t,1/0)};var x=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var l=o[c];t&&r[l]!==void 0||(r[l]=i[l])}return r}},_=function(n){if(!m.isObject(n))return{};if(g)return g(n);y.prototype=n;var t=new y;return y.prototype=null,t},j=Math.pow(2,53)-1,w=function(n){var t=n&&n.length;return"number"==typeof t&&t>=0&&j>=t};m.each=m.forEach=function(n,t,r){t=d(t,r);var e,u;if(w(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=w(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=b(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(b(t)),r)},m.every=m.all=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r){return w(n)||(n=m.values(n)),m.indexOf(n,t,"number"==typeof r&&r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=w(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(w(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=b(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var A=function(n){return function(t,r,e){var u={};return r=b(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=A(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=A(function(n,t,r){n[r]=t}),m.countBy=A(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):w(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:w(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=b(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var k=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(w(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=k(c,t,r));var l=0,f=c.length;for(u.length+=f;f>l;)u[i++]=c[l++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return k(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){if(null==n)return[];m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=b(r,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],l=r?r(c,o,n):c;t?(o&&i===l||u.push(c),i=l):r?m.contains(i,l)||(i.push(l),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(k(arguments,!0,!0))},m.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=k(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,"length").length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=n&&n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.indexOf=function(n,t,r){var e=0,u=n&&n.length;if("number"==typeof r)e=0>r?Math.max(0,u+r):r;else if(r&&u)return e=m.sortedIndex(n,t),n[e]===t?e:-1;if(t!==t)return m.findIndex(l.call(n,e),m.isNaN);for(;u>e;e++)if(n[e]===t)return e;return-1},m.lastIndexOf=function(n,t,r){var e=n?n.length:0;if("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1)),t!==t)return m.findLastIndex(l.call(n,0,e),m.isNaN);for(;--e>=0;)if(n[e]===t)return e;return-1},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=b(r,e,1);for(var u=r(t),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var O=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=_(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(v&&n.bind===v)return v.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return O(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return O(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var l=m.now();a||r.leading!==!1||(a=l);var f=t-(l-a);return e=this,u=arguments,0>=f||f>t?(o&&(clearTimeout(o),o=null),a=l,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,f)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var l=m.now()-o;t>l&&l>=0?e=setTimeout(c,t-l):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(h)return h(n);var t=[];for(var e in n)m.has(n,e)&&t.push(e);return F&&r(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var e in n)t.push(e);return F&&r(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=x(m.allKeys),m.extendOwn=m.assign=x(m.keys),m.findKey=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=d(t,r)):(u=k(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var l=u[a],f=o[l];e(f,l,o)&&(i[l]=f)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(k(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=x(m.allKeys,!0),m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var E=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=f.call(n);if(u!==f.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!E(n[c],t[c],r,e))return!1}else{var l,s=m.keys(n);if(c=s.length,m.keys(t).length!==c)return!1;for(;c--;)if(l=s[c],!m.has(t,l)||!E(n[l],t[l],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return E(n,t)},m.isEmpty=function(n){return null==n?!0:w(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=p||function(n){return"[object Array]"===f.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return f.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===f.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&s.call(n,t)},m.noConflict=function(){return e._=u,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=function(n){return function(t){return null==t?void 0:t[n]}},m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=d(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},N=m.invert(M),I=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=I(M),m.unescape=I(N),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var B=0;m.uniqueId=function(n){var t=++B+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+R[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||T).source,(t.interpolate||T).source,(t.evaluate||T).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(q,K),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},l=t.variable||"obj";return c.source="function("+l+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var z=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),z(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],z(this,r)}}),m.each(["concat","join","slice"],function(n){var t=i[n];m.prototype[n]=function(){return z(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;n.length>r;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(1>n)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;g>l;l++)if(d=e(t[l]),"string"===d)m.push(t[l]);else if("array"===d){if(a=t[l],a[2])for(i=u[p],o=0;a[2].length>o;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return e=null==e?"":n(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),r=~~r,r>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e),r=n(r);for(var t=0,u=0,i=r.length;;){if(u=e.indexOf(r,u),-1===u)break;t++,u+=i}return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r?!0:null==e?!1:-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e),e.slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){return null==e?"":(e=n(e).toLowerCase(),e.replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()}))},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",r>=e.length)return e;var u=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},i=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,u);return i=i.slice(i.length-2).match(/\w\w/)?i.replace(/\s*\S+$/,""):g.rtrim(i.slice(0,i.length-1)),(i+t).length>e.length?e:e.slice(0,i.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e),e.match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):0/0):0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",u=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(u,function(e){var n=r.indexOf(e);return t.charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;l>o;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return c>a?-1:1}}return u.length===i.length?u.length-i.length:r>e?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;r.length>=l;l++)for(var o=0;e.length>=o;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:(e=g.trim(e),r(e,n||["true","1"])?!0:r(e,t||["false","0"])?!1:void 0)}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String);
(function(root,factory){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(_,$,exports){root.Backbone=factory(root,exports,_,$)})}else if(typeof exports!=="undefined"){var _=require("underscore");factory(root,exports,_)}else{root.Backbone=factory(root,{},root._,root.jQuery||root.Zepto||root.ender||root.$)}})(this,function(root,Backbone,_,$){var previousBackbone=root.Backbone;var array=[];var push=array.push;var slice=array.slice;var splice=array.splice;Backbone.VERSION="1.1.2";Backbone.$=$;Backbone.noConflict=function(){root.Backbone=previousBackbone;return this};Backbone.emulateHTTP=false;Backbone.emulateJSON=false;var Events=Backbone.Events={on:function(name,callback,context){if(!eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=_.once(function(){self.off(name,once);callback.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events=void 0;return this}names=name?[name]:_.keys(this._events);for(i=0,l=names.length;i<l;i++){name=names[i];if(events=this._events[name]){this._events[name]=retain=[];if(callback||context){for(j=0,k=events.length;j<k;j++){ev=events[j];if(callback&&callback!==ev.callback&&callback!==ev.callback._callback||context&&context!==ev.context){retain.push(ev)}}}if(!retain.length)delete this._events[name]}}return this},trigger:function(name){if(!this._events)return this;var args=slice.call(arguments,1);if(!eventsApi(this,"trigger",name,args))return this;var events=this._events[name];var allEvents=this._events.all;if(events)triggerEvents(events,args);if(allEvents)triggerEvents(allEvents,arguments);return this},stopListening:function(obj,name,callback){var listeningTo=this._listeningTo;if(!listeningTo)return this;var remove=!name&&!callback;if(!callback&&typeof name==="object")callback=this;if(obj)(listeningTo={})[obj._listenId]=obj;for(var id in listeningTo){obj=listeningTo[id];obj.off(name,callback,this);if(remove||_.isEmpty(obj._events))delete this._listeningTo[id]}return this}};var eventSplitter=/\s+/;var eventsApi=function(obj,action,name,rest){if(!name)return true;if(typeof name==="object"){for(var key in name){obj[action].apply(obj,[key,name[key]].concat(rest))}return false}if(eventSplitter.test(name)){var names=name.split(eventSplitter);for(var i=0,l=names.length;i<l;i++){obj[action].apply(obj,[names[i]].concat(rest))}return false}return true};var triggerEvents=function(events,args){var ev,i=-1,l=events.length,a1=args[0],a2=args[1],a3=args[2];switch(args.length){case 0:while(++i<l)(ev=events[i]).callback.call(ev.ctx);return;case 1:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1);return;case 2:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2);return;case 3:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2,a3);return;default:while(++i<l)(ev=events[i]).callback.apply(ev.ctx,args);return}};var listenMethods={listenTo:"on",listenToOnce:"once"};_.each(listenMethods,function(implementation,method){Events[method]=function(obj,name,callback){var listeningTo=this._listeningTo||(this._listeningTo={});var id=obj._listenId||(obj._listenId=_.uniqueId("l"));listeningTo[id]=obj;if(!callback&&typeof name==="object")callback=this;obj[implementation](name,callback,this);return this}});Events.bind=Events.on;Events.unbind=Events.off;_.extend(Backbone,Events);var Model=Backbone.Model=function(attributes,options){var attrs=attributes||{};options||(options={});this.cid=_.uniqueId(this.cidPrefix||"c");this.attributes={};if(options.collection)this.collection=options.collection;if(options.parse)attrs=this.parse(attrs,options)||{};attrs=_.defaults({},attrs,_.result(this,"defaults"));this.set(attrs,options);this.changed={};this.initialize.apply(this,arguments)};_.extend(Model.prototype,Events,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(options){return _.clone(this.attributes)},sync:function(){return Backbone.sync.apply(this,arguments)},get:function(attr){return this.attributes[attr]},escape:function(attr){return _.escape(this.get(attr))},has:function(attr){return this.get(attr)!=null},set:function(key,val,options){var attr,attrs,unset,changes,silent,changing,prev,current;if(key==null)return this;if(typeof key==="object"){attrs=key;options=val}else{(attrs={})[key]=val}options||(options={});if(!this._validate(attrs,options))return false;unset=options.unset;silent=options.silent;changes=[];changing=this._changing;this._changing=true;if(!changing){this._previousAttributes=_.clone(this.attributes);this.changed={}}current=this.attributes,prev=this._previousAttributes;if(this.idAttribute in attrs)this.id=attrs[this.idAttribute];for(attr in attrs){val=attrs[attr];if(!_.isEqual(current[attr],val))changes.push(attr);if(!_.isEqual(prev[attr],val)){this.changed[attr]=val}else{delete this.changed[attr]}unset?delete current[attr]:current[attr]=val}if(!silent){if(changes.length)this._pending=options;for(var i=0,l=changes.length;i<l;i++){this.trigger("change:"+changes[i],this,current[changes[i]],options)}}if(changing)return this;if(!silent){while(this._pending){options=this._pending;this._pending=false;this.trigger("change",this,options)}}this._pending=false;this._changing=false;return this},unset:function(attr,options){return this.set(attr,void 0,_.extend({},options,{unset:true}))},clear:function(options){var attrs={};for(var key in this.attributes)attrs[key]=void 0;return this.set(attrs,_.extend({},options,{unset:true}))},hasChanged:function(attr){if(attr==null)return!_.isEmpty(this.changed);return _.has(this.changed,attr)},changedAttributes:function(diff){if(!diff)return this.hasChanged()?_.clone(this.changed):false;var val,changed=false;var old=this._changing?this._previousAttributes:this.attributes;for(var attr in diff){if(_.isEqual(old[attr],val=diff[attr]))continue;(changed||(changed={}))[attr]=val}return changed},previous:function(attr){if(attr==null||!this._previousAttributes)return null;return this._previousAttributes[attr]},previousAttributes:function(){return _.clone(this._previousAttributes)},fetch:function(options){options=options?_.clone(options):{};if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){if(!model.set(model.parse(resp,options),options))return false;if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);return this.sync("read",this,options)},save:function(key,val,options){var attrs,method,xhr,attributes=this.attributes;if(key==null||typeof key==="object"){attrs=key;options=val}else{(attrs={})[key]=val}options=_.extend({validate:true},options);if(attrs&&!options.wait){if(!this.set(attrs,options))return false}else{if(!this._validate(attrs,options))return false}if(attrs&&options.wait){this.attributes=_.extend({},attributes,attrs)}if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){model.attributes=attributes;var serverAttrs=model.parse(resp,options);if(options.wait)serverAttrs=_.extend(attrs||{},serverAttrs);if(_.isObject(serverAttrs)&&!model.set(serverAttrs,options)){return false}if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);method=this.isNew()?"create":options.patch?"patch":"update";if(method==="patch")options.attrs=attrs;xhr=this.sync(method,this,options);if(attrs&&options.wait)this.attributes=attributes;return xhr},destroy:function(options){options=options?_.clone(options):{};var model=this;var success=options.success;var destroy=function(){model.trigger("destroy",model,model.collection,options)};options.success=function(resp){if(options.wait||model.isNew())destroy();if(success)success(model,resp,options);if(!model.isNew())model.trigger("sync",model,resp,options)};if(this.isNew()){options.success();return false}wrapError(this,options);var xhr=this.sync("delete",this,options);if(!options.wait)destroy();return xhr},url:function(){var base=_.result(this,"urlRoot")||_.result(this.collection,"url")||urlError();if(this.isNew())return base;return base.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(resp,options){return resp},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(options){return this._validate({},_.extend(options||{},{validate:true}))},_validate:function(attrs,options){if(!options.validate||!this.validate)return true;attrs=_.extend({},this.attributes,attrs);var error=this.validationError=this.validate(attrs,options)||null;if(!error)return true;this.trigger("invalid",this,error,_.extend(options,{validationError:error}));return false}});var modelMethods=["keys","values","pairs","invert","pick","omit"];_.each(modelMethods,function(method){Model.prototype[method]=function(){var args=slice.call(arguments);args.unshift(this.attributes);return _[method].apply(_,args)}});var Collection=Backbone.Collection=function(models,options){options||(options={});if(options.model)this.model=options.model;if(options.comparator!==void 0)this.comparator=options.comparator;this._reset();this.initialize.apply(this,arguments);if(models)this.reset(models,_.extend({silent:true},options))};var setOptions={add:true,remove:true,merge:true};var addOptions={add:true,remove:false};_.extend(Collection.prototype,Events,{model:Model,initialize:function(){},toJSON:function(options){return this.map(function(model){return model.toJSON(options)})},sync:function(){return Backbone.sync.apply(this,arguments)},add:function(models,options){return this.set(models,_.extend({merge:false},options,addOptions))},remove:function(models,options){var singular=!_.isArray(models);models=singular?[models]:_.clone(models);options||(options={});var i,l,index,model;for(i=0,l=models.length;i<l;i++){model=models[i]=this.get(models[i]);if(!model)continue;delete this._byId[model.id];delete this._byId[model.cid];index=this.indexOf(model);this.models.splice(index,1);this.length--;if(!options.silent){options.index=index;model.trigger("remove",model,this,options)}this._removeReference(model,options)}return singular?models[0]:models},set:function(models,options){options=_.defaults({},options,setOptions);if(options.parse)models=this.parse(models,options);var singular=!_.isArray(models);models=singular?models?[models]:[]:_.clone(models);var i,l,id,model,attrs,existing,sort;var at=options.at;var targetModel=this.model;var sortable=this.comparator&&at==null&&options.sort!==false;var sortAttr=_.isString(this.comparator)?this.comparator:null;var toAdd=[],toRemove=[],modelMap={};var add=options.add,merge=options.merge,remove=options.remove;var order=!sortable&&add&&remove?[]:false;for(i=0,l=models.length;i<l;i++){attrs=models[i]||{};if(attrs instanceof Model){id=model=attrs}else{id=attrs[targetModel.prototype.idAttribute||"id"]}if(existing=this.get(id)){if(remove)modelMap[existing.cid]=true;if(merge){attrs=attrs===model?model.attributes:attrs;if(options.parse)attrs=existing.parse(attrs,options);existing.set(attrs,options);if(sortable&&!sort&&existing.hasChanged(sortAttr))sort=true}models[i]=existing}else if(add){model=models[i]=this._prepareModel(attrs,options);if(!model)continue;toAdd.push(model);this._addReference(model,options)}model=existing||model;if(order&&(model.isNew()||!modelMap[model.id]))order.push(model);modelMap[model.id]=true}if(remove){for(i=0,l=this.length;i<l;++i){if(!modelMap[(model=this.models[i]).cid])toRemove.push(model)}if(toRemove.length)this.remove(toRemove,options)}if(toAdd.length||order&&order.length){if(sortable)sort=true;this.length+=toAdd.length;if(at!=null){for(i=0,l=toAdd.length;i<l;i++){this.models.splice(at+i,0,toAdd[i])}}else{if(order)this.models.length=0;var orderedModels=order||toAdd;for(i=0,l=orderedModels.length;i<l;i++){this.models.push(orderedModels[i])}}}if(sort)this.sort({silent:true});if(!options.silent){for(i=0,l=toAdd.length;i<l;i++){(model=toAdd[i]).trigger("add",model,this,options)}if(sort||order&&order.length)this.trigger("sort",this,options)}return singular?models[0]:models},reset:function(models,options){options||(options={});for(var i=0,l=this.models.length;i<l;i++){this._removeReference(this.models[i],options)}options.previousModels=this.models;this._reset();models=this.add(models,_.extend({silent:true},options));if(!options.silent)this.trigger("reset",this,options);return models},push:function(model,options){return this.add(model,_.extend({at:this.length},options))},pop:function(options){var model=this.at(this.length-1);this.remove(model,options);return model},unshift:function(model,options){return this.add(model,_.extend({at:0},options))},shift:function(options){var model=this.at(0);this.remove(model,options);return model},slice:function(){return slice.apply(this.models,arguments)},get:function(obj){if(obj==null)return void 0;return this._byId[obj]||this._byId[obj.id]||this._byId[obj.cid]},at:function(index){return this.models[index]},where:function(attrs,first){if(_.isEmpty(attrs))return first?void 0:[];return this[first?"find":"filter"](function(model){for(var key in attrs){if(attrs[key]!==model.get(key))return false}return true})},findWhere:function(attrs){return this.where(attrs,true)},sort:function(options){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");options||(options={});if(_.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(_.bind(this.comparator,this))}if(!options.silent)this.trigger("sort",this,options);return this},pluck:function(attr){return _.invoke(this.models,"get",attr)},fetch:function(options){options=options?_.clone(options):{};if(options.parse===void 0)options.parse=true;var success=options.success;var collection=this;options.success=function(resp){var method=options.reset?"reset":"set";collection[method](resp,options);if(success)success(collection,resp,options);collection.trigger("sync",collection,resp,options)};wrapError(this,options);return this.sync("read",this,options)},create:function(model,options){options=options?_.clone(options):{};if(!(model=this._prepareModel(model,options)))return false;if(!options.wait)this.add(model,options);var collection=this;var success=options.success;options.success=function(model,resp){if(options.wait)collection.add(model,options);if(success)success(model,resp,options)};model.save(null,options);return model},parse:function(resp,options){return resp},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(attrs,options){if(attrs instanceof Model)return attrs;options=options?_.clone(options):{};options.collection=this;var model=new this.model(attrs,options);if(!model.validationError)return model;this.trigger("invalid",this,model.validationError,options);return false},_addReference:function(model,options){this._byId[model.cid]=model;if(model.id!=null)this._byId[model.id]=model;if(!model.collection)model.collection=this;model.on("all",this._onModelEvent,this)},_removeReference:function(model,options){if(this===model.collection)delete model.collection;model.off("all",this._onModelEvent,this)},_onModelEvent:function(event,model,collection,options){if((event==="add"||event==="remove")&&collection!==this)return;if(event==="destroy")this.remove(model,options);if(model&&event==="change:"+model.idAttribute){delete this._byId[model.previous(model.idAttribute)];if(model.id!=null)this._byId[model.id]=model}this.trigger.apply(this,arguments)}});var methods=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];_.each(methods,function(method){Collection.prototype[method]=function(){var args=slice.call(arguments);args.unshift(this.models);return _[method].apply(_,args)}});var attributeMethods=["groupBy","countBy","sortBy","indexBy"];_.each(attributeMethods,function(method){Collection.prototype[method]=function(value,context){var iterator=_.isFunction(value)?value:function(model){return model.get(value)};return _[method](this.models,iterator,context)}});var View=Backbone.View=function(options){this.cid=_.uniqueId("view");options||(options={});_.extend(this,_.pick(options,viewOptions));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var delegateEventSplitter=/^(\S+)\s*(.*)$/;var viewOptions=["model","collection","el","id","attributes","className","tagName","events"];_.extend(View.prototype,Events,{tagName:"div",$:function(selector){return this.$el.find(selector)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(element,delegate){if(this.$el)this.undelegateEvents();this.$el=element instanceof Backbone.$?element:Backbone.$(element);this.el=this.$el[0];if(delegate!==false)this.delegateEvents();return this},delegateEvents:function(events){if(!(events||(events=_.result(this,"events"))))return this;this.undelegateEvents();for(var key in events){var method=events[key];if(!_.isFunction(method))method=this[events[key]];if(!method)continue;var match=key.match(delegateEventSplitter);var eventName=match[1],selector=match[2];method=_.bind(method,this);eventName+=".delegateEvents"+this.cid;if(selector===""){this.$el.on(eventName,method)}else{this.$el.on(eventName,selector,method)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var attrs=_.extend({},_.result(this,"attributes"));if(this.id)attrs.id=_.result(this,"id");if(this.className)attrs["class"]=_.result(this,"className");var $el=Backbone.$("<"+_.result(this,"tagName")+">").attr(attrs);this.setElement($el,false)}else{this.setElement(_.result(this,"el"),false)}}});Backbone.sync=function(method,model,options){var type=methodMap[method];_.defaults(options||(options={}),{emulateHTTP:Backbone.emulateHTTP,emulateJSON:Backbone.emulateJSON});var params={type:type,dataType:"json"};if(!options.url){params.url=_.result(model,"url")||urlError()}if(options.data==null&&model&&(method==="create"||method==="update"||method==="patch")){params.contentType="application/json";params.data=JSON.stringify(options.attrs||model.toJSON(options))}if(options.emulateJSON){params.contentType="application/x-www-form-urlencoded";params.data=params.data?{model:params.data}:{}}if(options.emulateHTTP&&(type==="PUT"||type==="DELETE"||type==="PATCH")){params.type="POST";if(options.emulateJSON)params.data._method=type;var beforeSend=options.beforeSend;options.beforeSend=function(xhr){xhr.setRequestHeader("X-HTTP-Method-Override",type);if(beforeSend)return beforeSend.apply(this,arguments)}}if(params.type!=="GET"&&!options.emulateJSON){params.processData=false}if(params.type==="PATCH"&&noXhrPatch){params.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var xhr=options.xhr=Backbone.ajax(_.extend(params,options));model.trigger("request",model,xhr,options);return xhr};var noXhrPatch=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var methodMap={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};Backbone.ajax=function(){return Backbone.$.ajax.apply(Backbone.$,arguments)};var Router=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var optionalParam=/\((.*?)\)/g;var namedParam=/(\(\?)?:\w+/g;var splatParam=/\*\w+/g;var escapeRegExp=/[\-{}\[\]+?.,\\\^$|#\s]/g;_.extend(Router.prototype,Events,{initialize:function(){},route:function(route,name,callback){if(!_.isRegExp(route))route=this._routeToRegExp(route);if(_.isFunction(name)){callback=name;name=""}if(!callback)callback=this[name];var router=this;Backbone.history.route(route,function(fragment){var args=router._extractParameters(route,fragment);router.execute(callback,args);router.trigger.apply(router,["route:"+name].concat(args));router.trigger("route",name,args);Backbone.history.trigger("route",router,name,args)});return this},execute:function(callback,args){if(callback)callback.apply(this,args)},navigate:function(fragment,options){Backbone.history.navigate(fragment,options);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=_.result(this,"routes");var route,routes=_.keys(this.routes);while((route=routes.pop())!=null){this.route(route,this.routes[route])}},_routeToRegExp:function(route){route=route.replace(escapeRegExp,"\\$&").replace(optionalParam,"(?:$1)?").replace(namedParam,function(match,optional){return optional?match:"([^/?]+)"}).replace(splatParam,"([^?]*?)");return new RegExp("^"+route+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(route,fragment){var params=route.exec(fragment).slice(1);return _.map(params,function(param,i){if(i===params.length-1)return param||null;return param?decodeURIComponent(param):null})}});var History=Backbone.History=function(){this.handlers=[];_.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var routeStripper=/^[#\/]|\s+$/g;var rootStripper=/^\/+|\/+$/g;var isExplorer=/msie [\w.]+/;var trailingSlash=/\/$/;var pathStripper=/#.*$/;History.started=false;_.extend(History.prototype,Events,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(window){var match=(window||this).location.href.match(/#(.*)$/);return match?match[1]:""},getFragment:function(fragment,forcePushState){if(fragment==null){if(this._hasPushState||!this._wantsHashChange||forcePushState){fragment=decodeURI(this.location.pathname+this.location.search);var root=this.root.replace(trailingSlash,"");if(!fragment.indexOf(root))fragment=fragment.slice(root.length)}else{fragment=this.getHash()}}return fragment.replace(routeStripper,"")},start:function(options){if(History.started)throw new Error("Backbone.history has already been started");History.started=true;this.options=_.extend({root:"/"},this.options,options);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var fragment=this.getFragment();var docMode=document.documentMode;var oldIE=isExplorer.exec(navigator.userAgent.toLowerCase())&&(!docMode||docMode<=7);this.root=("/"+this.root+"/").replace(rootStripper,"/");if(oldIE&&this._wantsHashChange){var frame=Backbone.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=frame.hide().appendTo("body")[0].contentWindow;this.navigate(fragment)}if(this._hasPushState){Backbone.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!oldIE){Backbone.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=fragment;var loc=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&loc.hash){this.fragment=this.getHash().replace(routeStripper,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){Backbone.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);History.started=false},route:function(route,callback){this.handlers.unshift({route:route,callback:callback})},checkUrl:function(e){var current=this.getFragment();if(current===this.fragment&&this.iframe){current=this.getFragment(this.getHash(this.iframe))}if(current===this.fragment)return false;if(this.iframe)this.navigate(current);this.loadUrl()},loadUrl:function(fragment){fragment=this.fragment=this.getFragment(fragment);return _.any(this.handlers,function(handler){if(handler.route.test(fragment)){handler.callback(fragment);return true}})},navigate:function(fragment,options){if(!History.started)return false;if(!options||options===true)options={trigger:!!options};var url=this.root+(fragment=this.getFragment(fragment||""));fragment=fragment.replace(pathStripper,"");if(this.fragment===fragment)return;this.fragment=fragment;if(fragment===""&&url!=="/")url=url.slice(0,-1);if(this._hasPushState){this.history[options.replace?"replaceState":"pushState"]({},document.title,url)}else if(this._wantsHashChange){this._updateHash(this.location,fragment,options.replace);if(this.iframe&&fragment!==this.getFragment(this.getHash(this.iframe))){if(!options.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,fragment,options.replace)}}else{return this.location.assign(url)}if(options.trigger)return this.loadUrl(fragment)},_updateHash:function(location,fragment,replace){if(replace){var href=location.href.replace(/(javascript:|#).*$/,"");location.replace(href+"#"+fragment)}else{location.hash="#"+fragment}}});Backbone.history=new History;var extend=function(protoProps,staticProps){var parent=this;var child;if(protoProps&&_.has(protoProps,"constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}_.extend(child,parent,staticProps);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;if(protoProps)_.extend(child.prototype,protoProps);child.__super__=parent.prototype;return child};Model.extend=Collection.extend=Router.extend=View.extend=History.extend=extend;var urlError=function(){throw new Error('A "url" property or function must be specified')};var wrapError=function(model,options){var error=options.error;options.error=function(resp){if(error)error(model,resp,options);model.trigger("error",model,resp,options)}};return Backbone});
/*!
 * Includes BabySitter
 * https://github.com/marionettejs/backbone.babysitter/
 *
 * Includes Wreqr
 * https://github.com/marionettejs/backbone.wreqr/
 */
(function(e,t){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(i,n){return e.Marionette=e.Mn=t(e,i,n)});else if("undefined"!=typeof exports){var i=require("backbone"),n=require("underscore");module.exports=t(e,i,n)}else e.Marionette=e.Mn=t(e,e.Backbone,e._)})(this,function(e,t,i){"use strict";(function(e,t){var i=e.ChildViewContainer;return e.ChildViewContainer=function(e,t){var i=function(e){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(e,this.add,this)};t.extend(i.prototype,{add:function(e,t){var i=e.cid;return this._views[i]=e,e.model&&(this._indexByModel[e.model.cid]=i),t&&(this._indexByCustom[t]=i),this._updateLength(),this},findByModel:function(e){return this.findByModelCid(e.cid)},findByModelCid:function(e){var t=this._indexByModel[e];return this.findByCid(t)},findByCustom:function(e){var t=this._indexByCustom[e];return this.findByCid(t)},findByIndex:function(e){return t.values(this._views)[e]},findByCid:function(e){return this._views[e]},remove:function(e){var i=e.cid;return e.model&&delete this._indexByModel[e.model.cid],t.any(this._indexByCustom,function(e,t){return e===i?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[i],this._updateLength(),this},call:function(e){this.apply(e,t.tail(arguments))},apply:function(e,i){t.each(this._views,function(n){t.isFunction(n[e])&&n[e].apply(n,i||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(e){i.prototype[e]=function(){var i=t.values(this._views),n=[i].concat(t.toArray(arguments));return t[e].apply(t,n)}}),i}(e,t),e.ChildViewContainer.VERSION="0.1.5",e.ChildViewContainer.noConflict=function(){return e.ChildViewContainer=i,this},e.ChildViewContainer})(t,i),function(e,t){var i=e.Wreqr,n=e.Wreqr={};return e.Wreqr.VERSION="1.3.1",e.Wreqr.noConflict=function(){return e.Wreqr=i,this},n.Handlers=function(e,t){var i=function(e){this.options=e,this._wreqrHandlers={},t.isFunction(this.initialize)&&this.initialize(e)};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events,{setHandlers:function(e){t.each(e,function(e,i){var n=null;t.isObject(e)&&!t.isFunction(e)&&(n=e.context,e=e.callback),this.setHandler(i,e,n)},this)},setHandler:function(e,t,i){var n={callback:t,context:i};this._wreqrHandlers[e]=n,this.trigger("handler:add",e,t,i)},hasHandler:function(e){return!!this._wreqrHandlers[e]},getHandler:function(e){var t=this._wreqrHandlers[e];if(t)return function(){var e=Array.prototype.slice.apply(arguments);return t.callback.apply(t.context,e)}},removeHandler:function(e){delete this._wreqrHandlers[e]},removeAllHandlers:function(){this._wreqrHandlers={}}}),i}(e,t),n.CommandStorage=function(){var i=function(e){this.options=e,this._commands={},t.isFunction(this.initialize)&&this.initialize(e)};return t.extend(i.prototype,e.Events,{getCommands:function(e){var t=this._commands[e];return t||(t={command:e,instances:[]},this._commands[e]=t),t},addCommand:function(e,t){var i=this.getCommands(e);i.instances.push(t)},clearCommands:function(e){var t=this.getCommands(e);t.instances=[]}}),i}(),n.Commands=function(e){return e.Handlers.extend({storageType:e.CommandStorage,constructor:function(t){this.options=t||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var i=Array.prototype.slice.call(arguments);e.Handlers.prototype.constructor.apply(this,i)},execute:function(e,t){e=arguments[0],t=Array.prototype.slice.call(arguments,1),this.hasHandler(e)?this.getHandler(e).apply(this,t):this.storage.addCommand(e,t)},_executeCommands:function(e,i,n){var r=this.storage.getCommands(e);t.each(r.instances,function(e){i.apply(n,e)}),this.storage.clearCommands(e)},_initializeStorage:function(e){var i,n=e.storageType||this.storageType;i=t.isFunction(n)?new n:n,this.storage=i}})}(n),n.RequestResponse=function(e){return e.Handlers.extend({request:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return this.hasHandler(e)?this.getHandler(e).apply(this,t):void 0}})}(n),n.EventAggregator=function(e,t){var i=function(){};return i.extend=e.Model.extend,t.extend(i.prototype,e.Events),i}(e,t),n.Channel=function(){var i=function(t){this.vent=new e.Wreqr.EventAggregator,this.reqres=new e.Wreqr.RequestResponse,this.commands=new e.Wreqr.Commands,this.channelName=t};return t.extend(i.prototype,{reset:function(){return this.vent.off(),this.vent.stopListening(),this.reqres.removeAllHandlers(),this.commands.removeAllHandlers(),this},connectEvents:function(e,t){return this._connect("vent",e,t),this},connectCommands:function(e,t){return this._connect("commands",e,t),this},connectRequests:function(e,t){return this._connect("reqres",e,t),this},_connect:function(e,i,n){if(i){n=n||this;var r="vent"===e?"on":"setHandler";t.each(i,function(i,s){this[e][r](s,t.bind(i,n))},this)}}}),i}(n),n.radio=function(e){var i=function(){this._channels={},this.vent={},this.commands={},this.reqres={},this._proxyMethods()};t.extend(i.prototype,{channel:function(e){if(!e)throw Error("Channel must receive a name");return this._getChannel(e)},_getChannel:function(t){var i=this._channels[t];return i||(i=new e.Channel(t),this._channels[t]=i),i},_proxyMethods:function(){t.each(["vent","commands","reqres"],function(e){t.each(n[e],function(t){this[e][t]=r(this,e,t)},this)},this)}});var n={vent:["on","off","trigger","once","stopListening","listenTo","listenToOnce"],commands:["execute","setHandler","setHandlers","removeHandler","removeAllHandlers"],reqres:["request","setHandler","setHandlers","removeHandler","removeAllHandlers"]},r=function(e,t,i){return function(n){var r=e._getChannel(n)[t],s=Array.prototype.slice.call(arguments,1);return r[i].apply(r,s)}};return new i}(n),e.Wreqr}(t,i);var n=e.Marionette,r=t.Marionette={};r.VERSION="2.3.2",r.noConflict=function(){return e.Marionette=n,this},t.Marionette=r,r.Deferred=t.$.Deferred,r.extend=t.Model.extend,r.isNodeAttached=function(e){return t.$.contains(document.documentElement,e)},r.getOption=function(e,t){return e&&t?e.options&&void 0!==e.options[t]?e.options[t]:e[t]:void 0},r.proxyGetOption=function(e){return r.getOption(this,e)},r._getValue=function(e,t,n){return i.isFunction(e)&&(n=n||[],e=e.apply(t,n)),e},r.normalizeMethods=function(e){return i.reduce(e,function(e,t,n){return i.isFunction(t)||(t=this[t]),t&&(e[n]=t),e},{},this)},r.normalizeUIString=function(e,t){return e.replace(/@ui\.[a-zA-Z_$0-9]*/g,function(e){return t[e.slice(4)]})},r.normalizeUIKeys=function(e,t){return i.reduce(e,function(e,i,n){var s=r.normalizeUIString(n,t);return e[s]=i,e},{})},r.normalizeUIValues=function(e,t){return i.each(e,function(n,s){i.isString(n)&&(e[s]=r.normalizeUIString(n,t))}),e},r.actAsCollection=function(e,t){var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];i.each(n,function(n){e[n]=function(){var e=i.values(i.result(this,t)),r=[e].concat(i.toArray(arguments));return i[n].apply(i,r)}})};var s=r.deprecate=function(e,t){i.isObject(e)&&(e=e.prev+" is going to be removed in the future. "+"Please use "+e.next+" instead."+(e.url?" See: "+e.url:"")),void 0!==t&&t||s._cache[e]||(s._warn("Deprecation warning: "+e),s._cache[e]=!0)};s._warn="undefined"!=typeof console&&(console.warn||console.log)||function(){},s._cache={},r._triggerMethod=function(){function e(e,t,i){return i.toUpperCase()}var t=/(^|:)(\w)/gi;return function(n,r,s){var o=3>arguments.length;o&&(s=r,r=s[0]);var h,a="on"+r.replace(t,e),l=n[a];return i.isFunction(l)&&(h=l.apply(n,o?i.rest(s):s)),i.isFunction(n.trigger)&&(o+s.length>1?n.trigger.apply(n,o?s:[r].concat(i.rest(s,0))):n.trigger(r)),h}}(),r.triggerMethod=function(){return r._triggerMethod(this,arguments)},r.triggerMethodOn=function(e){var t=i.isFunction(e.triggerMethod)?e.triggerMethod:r.triggerMethod;return t.apply(e,i.rest(arguments))},r.MonitorDOMRefresh=function(e){function t(){e._isShown=!0,s()}function n(){e._isRendered=!0,s()}function s(){e._isShown&&e._isRendered&&r.isNodeAttached(e.el)&&i.isFunction(e.triggerMethod)&&e.triggerMethod("dom:refresh")}e.on({show:t,render:n})},function(e){function t(t,n,r,s){var o=s.split(/\s+/);i.each(o,function(i){var s=t[i];if(!s)throw new e.Error('Method "'+i+'" was configured as an event handler, but does not exist.');t.listenTo(n,r,s)})}function n(e,t,i,n){e.listenTo(t,i,n)}function r(e,t,n,r){var s=r.split(/\s+/);i.each(s,function(i){var r=e[i];e.stopListening(t,n,r)})}function s(e,t,i,n){e.stopListening(t,i,n)}function o(t,n,r,s,o){if(n&&r){if(!i.isObject(r))throw new e.Error({message:"Bindings must be an object or function.",url:"marionette.functions.html#marionettebindentityevents"});r=e._getValue(r,t),i.each(r,function(e,r){i.isFunction(e)?s(t,n,r,e):o(t,n,r,e)})}}e.bindEntityEvents=function(e,i,r){o(e,i,r,n,t)},e.unbindEntityEvents=function(e,t,i){o(e,t,i,s,r)},e.proxyBindEntityEvents=function(t,i){return e.bindEntityEvents(this,t,i)},e.proxyUnbindEntityEvents=function(t,i){return e.unbindEntityEvents(this,t,i)}}(r);var o=["description","fileName","lineNumber","name","message","number"];return r.Error=r.extend.call(Error,{urlRoot:"http://marionettejs.com/docs/v"+r.VERSION+"/",constructor:function(e,t){i.isObject(e)?(t=e,e=t.message):t||(t={});var n=Error.call(this,e);i.extend(this,i.pick(n,o),i.pick(t,o)),this.captureStackTrace(),t.url&&(this.url=this.urlRoot+t.url)},captureStackTrace:function(){Error.captureStackTrace&&Error.captureStackTrace(this,r.Error)},toString:function(){return this.name+": "+this.message+(this.url?" See: "+this.url:"")}}),r.Error.extend=r.extend,r.Callbacks=function(){this._deferred=r.Deferred(),this._callbacks=[]},i.extend(r.Callbacks.prototype,{add:function(e,t){var n=i.result(this._deferred,"promise");this._callbacks.push({cb:e,ctx:t}),n.then(function(i){t&&(i.context=t),e.call(i.context,i.options)})},run:function(e,t){this._deferred.resolve({options:e,context:t})},reset:function(){var e=this._callbacks;this._deferred=r.Deferred(),this._callbacks=[],i.each(e,function(e){this.add(e.cb,e.ctx)},this)}}),r.Controller=function(e){this.options=e||{},i.isFunction(this.initialize)&&this.initialize(this.options)},r.Controller.extend=r.extend,i.extend(r.Controller.prototype,t.Events,{destroy:function(){return r._triggerMethod(this,"before:destroy",arguments),r._triggerMethod(this,"destroy",arguments),this.stopListening(),this.off(),this},triggerMethod:r.triggerMethod,getOption:r.proxyGetOption}),r.Object=function(e){this.options=i.extend({},i.result(this,"options"),e),this.initialize.apply(this,arguments)},r.Object.extend=r.extend,i.extend(r.Object.prototype,t.Events,{initialize:function(){},destroy:function(){this.triggerMethod("before:destroy"),this.triggerMethod("destroy"),this.stopListening()},triggerMethod:r.triggerMethod,getOption:r.proxyGetOption,bindEntityEvents:r.proxyBindEntityEvents,unbindEntityEvents:r.proxyUnbindEntityEvents}),r.Region=r.Object.extend({constructor:function(e){if(this.options=e||{},this.el=this.getOption("el"),this.el=this.el instanceof t.$?this.el[0]:this.el,!this.el)throw new r.Error({name:"NoElError",message:'An "el" must be specified for a region.'});this.$el=this.getEl(this.el),r.Object.call(this,e)},show:function(e,t){if(this._ensureElement()){this._ensureViewIsIntact(e);var i=t||{},n=e!==this.currentView,s=!!i.preventDestroy,o=!!i.forceShow,h=!!this.currentView,a=n&&!s,l=n||o;if(h&&this.triggerMethod("before:swapOut",this.currentView,this,t),this.currentView&&delete this.currentView._parent,a?this.empty():h&&l&&this.currentView.off("destroy",this.empty,this),l){e.once("destroy",this.empty,this),e.render(),e._parent=this,h&&this.triggerMethod("before:swap",e,this,t),this.triggerMethod("before:show",e,this,t),r.triggerMethodOn(e,"before:show",e,this,t),h&&this.triggerMethod("swapOut",this.currentView,this,t);var u=r.isNodeAttached(this.el),d=[],c=i.triggerBeforeAttach||this.triggerBeforeAttach,g=i.triggerAttach||this.triggerAttach;return u&&c&&(d=this._displayedViews(e),this._triggerAttach(d,"before:")),this.attachHtml(e),this.currentView=e,u&&g&&(d=this._displayedViews(e),this._triggerAttach(d)),h&&this.triggerMethod("swap",e,this,t),this.triggerMethod("show",e,this,t),r.triggerMethodOn(e,"show",e,this,t),this}return this}},triggerBeforeAttach:!0,triggerAttach:!0,_triggerAttach:function(e,t){var n=(t||"")+"attach";i.each(e,function(e){r.triggerMethodOn(e,n,e,this)},this)},_displayedViews:function(e){return i.union([e],i.result(e,"_getNestedViews")||[])},_ensureElement:function(){if(i.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),!this.$el||0===this.$el.length){if(this.getOption("allowMissingEl"))return!1;throw new r.Error('An "el" '+this.$el.selector+" must exist in DOM")}return!0},_ensureViewIsIntact:function(e){if(!e)throw new r.Error({name:"ViewNotValid",message:"The view passed is undefined and therefore invalid. You must pass a view instance to show."});if(e.isDestroyed)throw new r.Error({name:"ViewDestroyedError",message:'View (cid: "'+e.cid+'") has already been destroyed and cannot be used.'})},getEl:function(e){return t.$(e,r._getValue(this.options.parentEl,this))},attachHtml:function(e){this.$el.contents().detach(),this.el.appendChild(e.el)},empty:function(){var e=this.currentView;if(e)return e.off("destroy",this.empty,this),this.triggerMethod("before:empty",e),this._destroyView(),this.triggerMethod("empty",e),delete this.currentView,this},_destroyView:function(){var e=this.currentView;e.destroy&&!e.isDestroyed?e.destroy():e.remove&&(e.remove(),e.isDestroyed=!0)},attachView:function(e){return this.currentView=e,this},hasView:function(){return!!this.currentView},reset:function(){return this.empty(),this.$el&&(this.el=this.$el.selector),delete this.$el,this}},{buildRegion:function(e,t){if(i.isString(e))return this._buildRegionFromSelector(e,t);if(e.selector||e.el||e.regionClass)return this._buildRegionFromObject(e,t);if(i.isFunction(e))return this._buildRegionFromRegionClass(e);throw new r.Error({message:"Improper region configuration type.",url:"marionette.region.html#region-configuration-types"})},_buildRegionFromSelector:function(e,t){return new t({el:e})},_buildRegionFromObject:function(e,t){var n=e.regionClass||t,r=i.omit(e,"selector","regionClass");return e.selector&&!r.el&&(r.el=e.selector),new n(r)},_buildRegionFromRegionClass:function(e){return new e}}),r.RegionManager=r.Controller.extend({constructor:function(e){this._regions={},r.Controller.call(this,e),this.addRegions(this.getOption("regions"))},addRegions:function(e,t){return e=r._getValue(e,this,arguments),i.reduce(e,function(e,n,r){return i.isString(n)&&(n={selector:n}),n.selector&&(n=i.defaults({},n,t)),e[r]=this.addRegion(r,n),e},{},this)},addRegion:function(e,t){var i;return i=t instanceof r.Region?t:r.Region.buildRegion(t,r.Region),this.triggerMethod("before:add:region",e,i),i._parent=this,this._store(e,i),this.triggerMethod("add:region",e,i),i},get:function(e){return this._regions[e]},getRegions:function(){return i.clone(this._regions)},removeRegion:function(e){var t=this._regions[e];return this._remove(e,t),t},removeRegions:function(){var e=this.getRegions();return i.each(this._regions,function(e,t){this._remove(t,e)},this),e},emptyRegions:function(){var e=this.getRegions();return i.invoke(e,"empty"),e},destroy:function(){return this.removeRegions(),r.Controller.prototype.destroy.apply(this,arguments)},_store:function(e,t){this._regions[e]=t,this._setLength()},_remove:function(e,t){this.triggerMethod("before:remove:region",e,t),t.empty(),t.stopListening(),delete t._parent,delete this._regions[e],this._setLength(),this.triggerMethod("remove:region",e,t)},_setLength:function(){this.length=i.size(this._regions)}}),r.actAsCollection(r.RegionManager.prototype,"_regions"),r.TemplateCache=function(e){this.templateId=e},i.extend(r.TemplateCache,{templateCaches:{},get:function(e){var t=this.templateCaches[e];return t||(t=new r.TemplateCache(e),this.templateCaches[e]=t),t.load()},clear:function(){var e,t=i.toArray(arguments),n=t.length;if(n>0)for(e=0;n>e;e++)delete this.templateCaches[t[e]];else this.templateCaches={}}}),i.extend(r.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var e=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(e),this.compiledTemplate},loadTemplate:function(e){var i=t.$(e).html();if(!i||0===i.length)throw new r.Error({name:"NoTemplateError",message:'Could not find template: "'+e+'"'});return i},compileTemplate:function(e){return i.template(e)}}),r.Renderer={render:function(e,t){if(!e)throw new r.Error({name:"TemplateNotFoundError",message:"Cannot render the template since its false, null or undefined."});var n=i.isFunction(e)?e:r.TemplateCache.get(e);return n(t)}},r.View=t.View.extend({isDestroyed:!1,constructor:function(e){i.bindAll(this,"render"),e=r._getValue(e,this),this.options=i.extend({},i.result(this,"options"),e),this._behaviors=r.Behaviors(this),t.View.apply(this,arguments),r.MonitorDOMRefresh(this),this.on("show",this.onShowCalled)},getTemplate:function(){return this.getOption("template")},serializeModel:function(e){return e.toJSON.apply(e,i.rest(arguments))},mixinTemplateHelpers:function(e){e=e||{};var t=this.getOption("templateHelpers");return t=r._getValue(t,this),i.extend(e,t)},normalizeUIKeys:function(e){var t=i.result(this,"_uiBindings");return r.normalizeUIKeys(e,t||i.result(this,"ui"))},normalizeUIValues:function(e){var t=i.result(this,"ui"),n=i.result(this,"_uiBindings");return r.normalizeUIValues(e,n||t)},configureTriggers:function(){if(this.triggers){var e=this.normalizeUIKeys(i.result(this,"triggers"));return i.reduce(e,function(e,t,i){return e[i]=this._buildViewTrigger(t),e},{},this)}},delegateEvents:function(e){return this._delegateDOMEvents(e),this.bindEntityEvents(this.model,this.getOption("modelEvents")),this.bindEntityEvents(this.collection,this.getOption("collectionEvents")),i.each(this._behaviors,function(e){e.bindEntityEvents(this.model,e.getOption("modelEvents")),e.bindEntityEvents(this.collection,e.getOption("collectionEvents"))},this),this},_delegateDOMEvents:function(e){var n=r._getValue(e||this.events,this);n=this.normalizeUIKeys(n),i.isUndefined(e)&&(this.events=n);var s={},o=i.result(this,"behaviorEvents")||{},h=this.configureTriggers(),a=i.result(this,"behaviorTriggers")||{};i.extend(s,o,n,h,a),t.View.prototype.delegateEvents.call(this,s)},undelegateEvents:function(){return t.View.prototype.undelegateEvents.apply(this,arguments),this.unbindEntityEvents(this.model,this.getOption("modelEvents")),this.unbindEntityEvents(this.collection,this.getOption("collectionEvents")),i.each(this._behaviors,function(e){e.unbindEntityEvents(this.model,e.getOption("modelEvents")),e.unbindEntityEvents(this.collection,e.getOption("collectionEvents"))},this),this},onShowCalled:function(){},_ensureViewIsIntact:function(){if(this.isDestroyed)throw new r.Error({name:"ViewDestroyedError",message:'View (cid: "'+this.cid+'") has already been destroyed and cannot be used.'})},destroy:function(){if(!this.isDestroyed){var e=i.toArray(arguments);return this.triggerMethod.apply(this,["before:destroy"].concat(e)),this.isDestroyed=!0,this.triggerMethod.apply(this,["destroy"].concat(e)),this.unbindUIElements(),this.remove(),i.invoke(this._behaviors,"destroy",e),this}},bindUIElements:function(){this._bindUIElements(),i.invoke(this._behaviors,this._bindUIElements)},_bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var e=i.result(this,"_uiBindings");this.ui={},i.each(e,function(e,t){this.ui[t]=this.$(e)},this)}},unbindUIElements:function(){this._unbindUIElements(),i.invoke(this._behaviors,this._unbindUIElements)},_unbindUIElements:function(){this.ui&&this._uiBindings&&(i.each(this.ui,function(e,t){delete this.ui[t]},this),this.ui=this._uiBindings,delete this._uiBindings)},_buildViewTrigger:function(e){var t=i.isObject(e),n=i.defaults({},t?e:{},{preventDefault:!0,stopPropagation:!0}),r=t?n.event:e;return function(e){e&&(e.preventDefault&&n.preventDefault&&e.preventDefault(),e.stopPropagation&&n.stopPropagation&&e.stopPropagation());var t={view:this,model:this.model,collection:this.collection};this.triggerMethod(r,t)}},setElement:function(){var e=t.View.prototype.setElement.apply(this,arguments);return i.invoke(this._behaviors,"proxyViewProperties",this),e},triggerMethod:function(){for(var e=r._triggerMethod,t=e(this,arguments),i=this._behaviors,n=0,s=i&&i.length;s>n;n++)e(i[n],arguments);return t},_getImmediateChildren:function(){return[]},_getNestedViews:function(){var e=this._getImmediateChildren();return e.length?i.reduce(e,function(e,t){return t._getNestedViews?e.concat(t._getNestedViews()):e},e):e},normalizeMethods:r.normalizeMethods,getOption:r.proxyGetOption,bindEntityEvents:r.proxyBindEntityEvents,unbindEntityEvents:r.proxyUnbindEntityEvents}),r.ItemView=r.View.extend({constructor:function(){r.View.apply(this,arguments)},serializeData:function(){if(!this.model&&!this.collection)return{};var e=[this.model||this.collection];return arguments.length&&e.push.apply(e,arguments),this.model?this.serializeModel.apply(this,e):{items:this.serializeCollection.apply(this,e)}},serializeCollection:function(e){return e.toJSON.apply(e,i.rest(arguments))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderTemplate(),this.bindUIElements(),this.triggerMethod("render",this),this},_renderTemplate:function(){var e=this.getTemplate();if(e!==!1){if(!e)throw new r.Error({name:"UndefinedTemplateError",message:"Cannot render the template since it is null or undefined."});var t=this.serializeData();t=this.mixinTemplateHelpers(t);var i=r.Renderer.render(e,t,this);return this.attachElContent(i),this}},attachElContent:function(e){return this.$el.html(e),this}}),r.CollectionView=r.View.extend({childViewEventPrefix:"childview",constructor:function(e){var t=e||{};i.isUndefined(this.sort)&&(this.sort=i.isUndefined(t.sort)?!0:t.sort),this.once("render",this._initialEvents),this._initChildViewStorage(),r.View.apply(this,arguments),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this._triggerBeforeShowBufferedChildren(),this.attachBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()},_triggerBeforeShowBufferedChildren:function(){this._isShown&&i.each(this._bufferedChildren,i.partial(this._triggerMethodOnChild,"before:show"))},_triggerShowBufferedChildren:function(){this._isShown&&(i.each(this._bufferedChildren,i.partial(this._triggerMethodOnChild,"show")),this._bufferedChildren=[])},_triggerMethodOnChild:function(e,t){r.triggerMethodOn(t,e)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(e){this.destroyEmptyView();var t=this.getChildView(e),i=this.collection.indexOf(e);this.addChild(e,t,i)},_onCollectionRemove:function(e){var t=this.children.findByModel(e);this.removeChildView(t),this.checkEmpty()},onShowCalled:function(){this.children.each(i.partial(this._triggerMethodOnChild,"show"))},render:function(){return this._ensureViewIsIntact(),this.triggerMethod("before:render",this),this._renderChildren(),this.triggerMethod("render",this),this},resortView:function(){this.render()},_sortViews:function(){var e=this.collection.find(function(e,t){var i=this.children.findByModel(e);return!i||i._index!==t},this);e&&this.resortView()},_emptyViewIndex:-1,_renderChildren:function(){this.destroyEmptyView(),this.destroyChildren(),this.isEmpty(this.collection)?this.showEmptyView():(this.triggerMethod("before:render:collection",this),this.startBuffering(),this.showCollection(),this.endBuffering(),this.triggerMethod("render:collection",this))},showCollection:function(){var e;this.collection.each(function(t,i){e=this.getChildView(t),this.addChild(t,e,i)},this)},showEmptyView:function(){var e=this.getEmptyView();if(e&&!this._showingEmptyView){this.triggerMethod("before:render:empty"),this._showingEmptyView=!0;var i=new t.Model;this.addEmptyView(i,e),this.triggerMethod("render:empty")}},destroyEmptyView:function(){this._showingEmptyView&&(this.triggerMethod("before:remove:empty"),this.destroyChildren(),delete this._showingEmptyView,this.triggerMethod("remove:empty"))},getEmptyView:function(){return this.getOption("emptyView")},addEmptyView:function(e,t){var n=this.getOption("emptyViewOptions")||this.getOption("childViewOptions");i.isFunction(n)&&(n=n.call(this,e,this._emptyViewIndex));var s=this.buildChildView(e,t,n);s._parent=this,this.proxyChildEvents(s),this._isShown&&r.triggerMethodOn(s,"before:show"),this.children.add(s),this.renderChildView(s,this._emptyViewIndex),this._isShown&&r.triggerMethodOn(s,"show")},getChildView:function(){var e=this.getOption("childView");if(!e)throw new r.Error({name:"NoChildViewError",message:'A "childView" must be specified'});return e},addChild:function(e,t,i){var n=this.getOption("childViewOptions");n=r._getValue(n,this,[e,i]);var s=this.buildChildView(e,t,n);return this._updateIndices(s,!0,i),this._addChildView(s,i),s._parent=this,s},_updateIndices:function(e,t,i){this.sort&&(t&&(e._index=i),this.children.each(function(i){i._index>=e._index&&(i._index+=t?1:-1)}))},_addChildView:function(e,t){this.proxyChildEvents(e),this.triggerMethod("before:add:child",e),this.children.add(e),this.renderChildView(e,t),this._isShown&&!this.isBuffering&&r.triggerMethodOn(e,"show"),this.triggerMethod("add:child",e)},renderChildView:function(e,t){return e.render(),this.attachHtml(this,e,t),e},buildChildView:function(e,t,n){var r=i.extend({model:e},n);return new t(r)},removeChildView:function(e){return e&&(this.triggerMethod("before:remove:child",e),e.destroy?e.destroy():e.remove&&e.remove(),delete e._parent,this.stopListening(e),this.children.remove(e),this.triggerMethod("remove:child",e),this._updateIndices(e,!1)),e},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},attachBuffer:function(e,t){e.$el.append(t)},attachHtml:function(e,t,i){e.isBuffering?(e.elBuffer.appendChild(t.el),e._bufferedChildren.push(t)):e._insertBefore(t,i)||e._insertAfter(t)},_insertBefore:function(e,t){var i,n=this.sort&&this.children.length-1>t;return n&&(i=this.children.find(function(e){return e._index===t+1})),i?(i.$el.before(e.el),!0):!1},_insertAfter:function(e){this.$el.append(e.el)},_initChildViewStorage:function(){this.children=new t.ChildViewContainer},destroy:function(){return this.isDestroyed?void 0:(this.triggerMethod("before:destroy:collection"),this.destroyChildren(),this.triggerMethod("destroy:collection"),r.View.prototype.destroy.apply(this,arguments))},destroyChildren:function(){var e=this.children.map(i.identity);return this.children.each(this.removeChildView,this),this.checkEmpty(),e},proxyChildEvents:function(e){var t=this.getOption("childViewEventPrefix");this.listenTo(e,"all",function(){var n=i.toArray(arguments),r=n[0],s=this.normalizeMethods(i.result(this,"childEvents"));n[0]=t+":"+r,n.splice(1,0,e),s!==void 0&&i.isFunction(s[r])&&s[r].apply(this,n.slice(1)),this.triggerMethod.apply(this,n)},this)},_getImmediateChildren:function(){return i.values(this.children._views)}}),r.CompositeView=r.CollectionView.extend({constructor:function(){r.CollectionView.apply(this,arguments)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"remove",this._onCollectionRemove),this.listenTo(this.collection,"reset",this._renderChildren),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},getChildView:function(){var e=this.getOption("childView")||this.constructor;return e},serializeData:function(){var e={};return this.model&&(e=i.partial(this.serializeModel,this.model).apply(this,arguments)),e},render:function(){return this._ensureViewIsIntact(),this.isRendered=!0,this.resetChildViewContainer(),this.triggerMethod("before:render",this),this._renderTemplate(),this._renderChildren(),this.triggerMethod("render",this),this},_renderChildren:function(){this.isRendered&&r.CollectionView.prototype._renderChildren.call(this)},_renderTemplate:function(){var e={};e=this.serializeData(),e=this.mixinTemplateHelpers(e),this.triggerMethod("before:render:template");var t=this.getTemplate(),i=r.Renderer.render(t,e,this);this.attachElContent(i),this.bindUIElements(),this.triggerMethod("render:template")},attachElContent:function(e){return this.$el.html(e),this},attachBuffer:function(e,t){var i=this.getChildViewContainer(e);i.append(t)},_insertAfter:function(e){var t=this.getChildViewContainer(this,e);t.append(e.el)},getChildViewContainer:function(e){if("$childViewContainer"in e)return e.$childViewContainer;var t,i=r.getOption(e,"childViewContainer");if(i){var n=r._getValue(i,e);if(t="@"===n.charAt(0)&&e.ui?e.ui[n.substr(4)]:e.$(n),0>=t.length)throw new r.Error({name:"ChildViewContainerMissingError",message:'The specified "childViewContainer" was not found: '+e.childViewContainer})}else t=e.$el;return e.$childViewContainer=t,t},resetChildViewContainer:function(){this.$childViewContainer&&delete this.$childViewContainer}}),r.LayoutView=r.ItemView.extend({regionClass:r.Region,constructor:function(e){e=e||{},this._firstRender=!0,this._initializeRegions(e),r.ItemView.call(this,e)},render:function(){return this._ensureViewIsIntact(),this._firstRender?this._firstRender=!1:this._reInitializeRegions(),r.ItemView.prototype.render.apply(this,arguments)},destroy:function(){return this.isDestroyed?this:(this.regionManager.destroy(),r.ItemView.prototype.destroy.apply(this,arguments))},addRegion:function(e,t){var i={};return i[e]=t,this._buildRegions(i)[e]},addRegions:function(e){return this.regions=i.extend({},this.regions,e),this._buildRegions(e)},removeRegion:function(e){return delete this.regions[e],this.regionManager.removeRegion(e)},getRegion:function(e){return this.regionManager.get(e)},getRegions:function(){return this.regionManager.getRegions()},_buildRegions:function(e){var t={regionClass:this.getOption("regionClass"),parentEl:i.partial(i.result,this,"el")};return this.regionManager.addRegions(e,t)},_initializeRegions:function(e){var t;this._initRegionManager(),t=r._getValue(this.regions,this,[e])||{};var n=this.getOption.call(e,"regions");n=r._getValue(n,this,[e]),i.extend(t,n),t=this.normalizeUIValues(t),this.addRegions(t)},_reInitializeRegions:function(){this.regionManager.invoke("reset")},getRegionManager:function(){return new r.RegionManager},_initRegionManager:function(){this.regionManager=this.getRegionManager(),this.regionManager._parent=this,this.listenTo(this.regionManager,"before:add:region",function(e){this.triggerMethod("before:add:region",e)}),this.listenTo(this.regionManager,"add:region",function(e,t){this[e]=t,this.triggerMethod("add:region",e,t)}),this.listenTo(this.regionManager,"before:remove:region",function(e){this.triggerMethod("before:remove:region",e)}),this.listenTo(this.regionManager,"remove:region",function(e,t){delete this[e],this.triggerMethod("remove:region",e,t)})},_getImmediateChildren:function(){return i.chain(this.regionManager.getRegions()).pluck("currentView").compact().value()}}),r.Behavior=r.Object.extend({constructor:function(e,t){this.view=t,this.defaults=i.result(this,"defaults")||{},this.options=i.extend({},this.defaults,e),r.Object.apply(this,arguments)
},$:function(){return this.view.$.apply(this.view,arguments)},destroy:function(){this.stopListening()},proxyViewProperties:function(e){this.$el=e.$el,this.el=e.el}}),r.Behaviors=function(e,t){function i(e,n){return t.isObject(e.behaviors)?(n=i.parseBehaviors(e,n||t.result(e,"behaviors")),i.wrap(e,n,t.keys(s)),n):{}}function n(e,i){this._view=e,this._viewUI=t.result(e,"ui"),this._behaviors=i,this._triggers={}}var r=/^(\S+)\s*(.*)$/,s={behaviorTriggers:function(e,t){var i=new n(this,t);return i.buildBehaviorTriggers()},behaviorEvents:function(i,n){var s={},o=this._uiBindings||t.result(this,"ui");return t.each(n,function(i,n){var h={},a=t.clone(t.result(i,"events"))||{},l=i._uiBindings||t.result(i,"ui"),u=t.extend({},o,l);a=e.normalizeUIKeys(a,u);var d=0;t.each(a,function(e,s){var o=s.match(r),a=o[1]+"."+[this.cid,n,d++," "].join(""),l=o[2],u=a+l,c=t.isFunction(e)?e:i[e];h[u]=t.bind(c,i)},this),s=t.extend(s,h)},this),s}};return t.extend(i,{behaviorsLookup:function(){throw new e.Error({message:"You must define where your behaviors are stored.",url:"marionette.behaviors.html#behaviorslookup"})},getBehaviorClass:function(t,n){return t.behaviorClass?t.behaviorClass:e._getValue(i.behaviorsLookup,this,[t,n])[n]},parseBehaviors:function(e,n){return t.chain(n).map(function(n,r){var s=i.getBehaviorClass(n,r),o=new s(n,e),h=i.parseBehaviors(e,t.result(o,"behaviors"));return[o].concat(h)}).flatten().value()},wrap:function(e,i,n){t.each(n,function(n){e[n]=t.partial(s[n],e[n],i)})}}),t.extend(n.prototype,{buildBehaviorTriggers:function(){return t.each(this._behaviors,this._buildTriggerHandlersForBehavior,this),this._triggers},_buildTriggerHandlersForBehavior:function(i,n){var r=t.extend({},this._viewUI,t.result(i,"ui")),s=t.clone(t.result(i,"triggers"))||{};s=e.normalizeUIKeys(s,r),t.each(s,t.bind(this._setHandlerForBehavior,this,i,n))},_setHandlerForBehavior:function(e,t,i,n){var r=n.replace(/^\S+/,function(e){return e+"."+"behaviortriggers"+t});this._triggers[r]=this._view._buildViewTrigger(i)}}),i}(r,i),r.AppRouter=t.Router.extend({constructor:function(e){this.options=e||{},t.Router.apply(this,arguments);var i=this.getOption("appRoutes"),n=this._getController();this.processAppRoutes(n,i),this.on("route",this._processOnRoute,this)},appRoute:function(e,t){var i=this._getController();this._addAppRoute(i,e,t)},_processOnRoute:function(e,t){if(i.isFunction(this.onRoute)){var n=i.invert(this.getOption("appRoutes"))[e];this.onRoute(e,n,t)}},processAppRoutes:function(e,t){if(t){var n=i.keys(t).reverse();i.each(n,function(i){this._addAppRoute(e,i,t[i])},this)}},_getController:function(){return this.getOption("controller")},_addAppRoute:function(e,t,n){var s=e[n];if(!s)throw new r.Error('Method "'+n+'" was not found on the controller');this.route(t,n,i.bind(s,e))},getOption:r.proxyGetOption,triggerMethod:r.triggerMethod,bindEntityEvents:r.proxyBindEntityEvents,unbindEntityEvents:r.proxyUnbindEntityEvents}),r.Application=r.Object.extend({constructor:function(e){this._initializeRegions(e),this._initCallbacks=new r.Callbacks,this.submodules={},i.extend(this,e),this._initChannel(),r.Object.call(this,e)},execute:function(){this.commands.execute.apply(this.commands,arguments)},request:function(){return this.reqres.request.apply(this.reqres,arguments)},addInitializer:function(e){this._initCallbacks.add(e)},start:function(e){this.triggerMethod("before:start",e),this._initCallbacks.run(e,this),this.triggerMethod("start",e)},addRegions:function(e){return this._regionManager.addRegions(e)},emptyRegions:function(){return this._regionManager.emptyRegions()},removeRegion:function(e){return this._regionManager.removeRegion(e)},getRegion:function(e){return this._regionManager.get(e)},getRegions:function(){return this._regionManager.getRegions()},module:function(e,t){var n=r.Module.getClass(t),s=i.toArray(arguments);return s.unshift(this),n.create.apply(n,s)},getRegionManager:function(){return new r.RegionManager},_initializeRegions:function(e){var t=i.isFunction(this.regions)?this.regions(e):this.regions||{};this._initRegionManager();var n=r.getOption(e,"regions");return i.isFunction(n)&&(n=n.call(this,e)),i.extend(t,n),this.addRegions(t),this},_initRegionManager:function(){this._regionManager=this.getRegionManager(),this._regionManager._parent=this,this.listenTo(this._regionManager,"before:add:region",function(){r._triggerMethod(this,"before:add:region",arguments)}),this.listenTo(this._regionManager,"add:region",function(e,t){this[e]=t,r._triggerMethod(this,"add:region",arguments)}),this.listenTo(this._regionManager,"before:remove:region",function(){r._triggerMethod(this,"before:remove:region",arguments)}),this.listenTo(this._regionManager,"remove:region",function(e){delete this[e],r._triggerMethod(this,"remove:region",arguments)})},_initChannel:function(){this.channelName=i.result(this,"channelName")||"global",this.channel=i.result(this,"channel")||t.Wreqr.radio.channel(this.channelName),this.vent=i.result(this,"vent")||this.channel.vent,this.commands=i.result(this,"commands")||this.channel.commands,this.reqres=i.result(this,"reqres")||this.channel.reqres}}),r.Module=function(e,t,n){this.moduleName=e,this.options=i.extend({},this.options,n),this.initialize=n.initialize||this.initialize,this.submodules={},this._setupInitializersAndFinalizers(),this.app=t,i.isFunction(this.initialize)&&this.initialize(e,t,this.options)},r.Module.extend=r.extend,i.extend(r.Module.prototype,t.Events,{startWithParent:!0,initialize:function(){},addInitializer:function(e){this._initializerCallbacks.add(e)},addFinalizer:function(e){this._finalizerCallbacks.add(e)},start:function(e){this._isInitialized||(i.each(this.submodules,function(t){t.startWithParent&&t.start(e)}),this.triggerMethod("before:start",e),this._initializerCallbacks.run(e,this),this._isInitialized=!0,this.triggerMethod("start",e))},stop:function(){this._isInitialized&&(this._isInitialized=!1,this.triggerMethod("before:stop"),i.invoke(this.submodules,"stop"),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),this.triggerMethod("stop"))},addDefinition:function(e,t){this._runModuleDefinition(e,t)},_runModuleDefinition:function(e,n){if(e){var s=i.flatten([this,this.app,t,r,t.$,i,n]);e.apply(this,s)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new r.Callbacks,this._finalizerCallbacks=new r.Callbacks},triggerMethod:r.triggerMethod}),i.extend(r.Module,{create:function(e,t,n){var r=e,s=i.rest(arguments,3);t=t.split(".");var o=t.length,h=[];return h[o-1]=n,i.each(t,function(t,i){var o=r;r=this._getModule(o,t,e,n),this._addModuleDefinition(o,r,h[i],s)},this),r},_getModule:function(e,t,n,r){var s=i.extend({},r),o=this.getClass(r),h=e[t];return h||(h=new o(t,n,s),e[t]=h,e.submodules[t]=h),h},getClass:function(e){var t=r.Module;return e?e.prototype instanceof t?e:e.moduleClass||t:t},_addModuleDefinition:function(e,t,i,n){var r=this._getDefine(i),s=this._getStartWithParent(i,t);r&&t.addDefinition(r,n),this._addStartWithParent(e,t,s)},_getStartWithParent:function(e,t){var n;return i.isFunction(e)&&e.prototype instanceof r.Module?(n=t.constructor.prototype.startWithParent,i.isUndefined(n)?!0:n):i.isObject(e)?(n=e.startWithParent,i.isUndefined(n)?!0:n):!0},_getDefine:function(e){return!i.isFunction(e)||e.prototype instanceof r.Module?i.isObject(e)?e.define:null:e},_addStartWithParent:function(e,t,i){t.startWithParent=t.startWithParent&&i,t.startWithParent&&!t.startWithParentIsConfigured&&(t.startWithParentIsConfigured=!0,e.addInitializer(function(e){t.startWithParent&&t.start(e)}))}}),r});
Backbone.Marionette.TemplateCache.prototype.loadTemplate=function(templateId){var $template=Backbone.$(templateId);if(!$template.length){throw new Marionette.Error({name:"NoTemplateError",message:'Could not find template: "'+templateId+'"'})}return $template.html()};
!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=da.length;r>e;++e){var u=da[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new l;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){ta.event.preventDefault()}function k(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function E(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function A(n){return ya(n,_a),n}function N(n){return"function"==typeof n?n:function(){return Ma(n,this)}}function C(n){return"function"==typeof n?n:function(){return xa(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function q(n){return n.trim().replace(/\s+/g," ")}function L(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=L(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",q(u+" "+n))):e.setAttribute("class",q(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return ba(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function Z(n){return ya(n,Sa),n}function V(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=$;a>0&&(n=n.slice(0,a));var l=ka.get(n);return l&&(n=l,c=B),a?t?u:r:t?b:i}function $(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Aa,u="click"+r,i=ta.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ea&&(Ea="onselectstart"in e?!1:x(e.style,"userSelect")),Ea){var o=n(e).style,a=o[Ea];o[Ea]="none"}return function(n){if(i.on(r,null),Ea&&(o[Ea]=a),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Na){var i=t(n);if(i.scrollX||i.scrollY){r=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Na=!(o.f||o.e),r.remove()}}return Na?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ta.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?qa:Math.acos(n)}function tt(n){return n>1?Ra:-1>n?-Ra:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Da)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Xa,r=pt(r)*$a,i=pt(i)*Ba,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Pa,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,n>>8&255,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){n=n.toLowerCase();var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=Ga.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Xa),u=vt((.2126729*n+.7151522*t+.072175*e)/$a),i=vt((.0193339*n+.119192*t+.9503041*e)/Ba);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nt(t,e,n,r)}}function Nt(n,t,e,r){function u(){var n,t=c.status;if(!t&&zt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return void o.error.call(i,r)}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(Ct(r))}function Ct(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function zt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qt(){var n=Lt(),t=Tt()-n;t>24?(isFinite(t)&&(clearTimeout(tc),tc=setTimeout(qt,t)),nc=0):(nc=1,rc(qt))}function Lt(){var n=Date.now();for(ec=Ka;ec;)n>=ec.t&&(ec.f=ec.c(n-ec.t)),ec=ec.n;return n}function Tt(){for(var n,t=Ka,e=1/0;t;)t.f?t=n?n.n=t.n:Ka=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Qa=n,e}function Rt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Dt(n,t){var e=Math.pow(10,3*ga(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Pt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=ic.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=oc.get(g)||Ut;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Ut(n){return n+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new cc(e-1)),1),e}function i(n,e){return t(n=new cc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{cc=jt;var r=new jt;return r._=n,o(r,t,e)}finally{cc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ht(n);return c.floor=c,c.round=Ht(r),c.ceil=Ht(u),c.offset=Ht(i),c.range=a,n}function Ht(n){return function(t,e){try{cc=jt;var r=new jt;return r._=t,n(r,e)._}finally{cc=Date}}}function Ot(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=sc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&cc!==jt,o=new(i?jt:cc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in sc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{cc=jt;var t=new cc;return t._=n,r(t)}finally{cc=Date}}var r=t(n);return e.parse=function(n){try{cc=jt;var t=r.parse(n);return t&&t._}finally{cc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ae;var M=ta.map(),x=Yt(v),b=Zt(v),_=Yt(d),w=Zt(d),S=Yt(m),k=Zt(m),E=Yt(y),A=Zt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+ac.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(ac.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(ac.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:Qt,e:Qt,H:te,I:te,j:ne,L:ue,m:Kt,M:ee,p:s,S:re,U:Xt,w:Vt,W:$t,x:c,X:l,y:Wt,Y:Bt,Z:Jt,"%":oe};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Yt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Zt(n){for(var t=new l,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Vt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Xt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function $t(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Bt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Wt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.y=Gt(+r[0]),e+r[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n){return n+(n>68?1900:2e3)}function Kt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Qt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function ne(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function te(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ee(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function re(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ue(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=ga(t)/60|0,u=ga(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function oe(n,t,e){hc.lastIndex=0;var r=hc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ae(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ce(){}function le(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function se(n,t){n&&dc.hasOwnProperty(n.type)&&dc[n.type](n,t)}function fe(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function he(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)fe(n[e],t,1);t.polygonEnd()}function ge(){function n(n,t){n*=Da,t=t*Da/2+qa/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);yc.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;Mc.point=function(o,a){Mc.point=n,r=(t=o)*Da,u=Math.cos(a=(e=a)*Da/2+qa/4),i=Math.sin(a)},Mc.lineEnd=function(){n(t,e)}}function pe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ve(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function me(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ye(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Me(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function xe(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function be(n,t){return ga(n[0]-t[0])<Ca&&ga(n[1]-t[1])<Ca}function _e(n,t){n*=Da;var e=Math.cos(t*=Da);we(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function we(n,t,e){++xc,_c+=(n-_c)/xc,wc+=(t-wc)/xc,Sc+=(e-Sc)/xc}function Se(){function n(n,u){n*=Da;var i=Math.cos(u*=Da),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);bc+=l,kc+=l*(t+(t=o)),Ec+=l*(e+(e=a)),Ac+=l*(r+(r=c)),we(t,e,r)}var t,e,r;qc.point=function(u,i){u*=Da;var o=Math.cos(i*=Da);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),qc.point=n,we(t,e,r)}}function ke(){qc.point=_e}function Ee(){function n(n,t){n*=Da;var e=Math.cos(t*=Da),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Nc+=p*l,Cc+=p*s,zc+=p*f,bc+=v,kc+=v*(r+(r=o)),Ec+=v*(u+(u=a)),Ac+=v*(i+(i=c)),we(r,u,i)}var t,e,r,u,i;qc.point=function(o,a){t=o,e=a,qc.point=n,o*=Da;var c=Math.cos(a*=Da);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),we(r,u,i)},qc.lineEnd=function(){n(t,e),qc.lineEnd=ke,qc.point=_e}}function Ae(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ne(){return!0}function Ce(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(be(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return void u.lineEnd()}var c=new qe(e,n,null,!0),l=new qe(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new qe(r,n,null,!1),l=new qe(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),ze(i),ze(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ze(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function qe(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Le(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Te))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=Fe(m,p);g.length?(b||(i.polygonStart(),b=!0),Ce(g,De,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Re(),x=t(M),b=!1;return y}}function Te(n){return n.length>1}function Re(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function De(n,t){return((n=n.x)[0]<0?n[1]-Ra-Ca:Ra-n[1])-((t=t.x)[0]<0?t[1]-Ra-Ca:Ra-t[1])}function Pe(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?qa:-qa,c=ga(i-e);ga(c-qa)<Ca?(n.point(e,r=(r+o)/2>0?Ra:-Ra),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=qa&&(ga(e-u)<Ca&&(e-=u*Ca),ga(i-a)<Ca&&(i-=a*Ca),r=Ue(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function Ue(n,t,e,r){var u,i,o=Math.sin(n-e);return ga(o)>Ca?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function je(n,t,e,r){var u;if(null==n)u=e*Ra,r.point(-qa,u),r.point(0,u),r.point(qa,u),r.point(qa,0),r.point(qa,-u),r.point(0,-u),r.point(-qa,-u),r.point(-qa,0),r.point(-qa,u);else if(ga(n[0]-t[0])>Ca){var i=n[0]<t[0]?qa:-qa;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Fe(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;yc.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+qa/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+qa/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>qa,k=p*M;if(yc.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*La:b,S^h>=e^m>=e){var E=de(pe(f),pe(n));Me(E);var A=de(u,E);Me(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ca>i||Ca>i&&0>yc)^1&o}function He(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?qa:-qa),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(be(e,g)||be(p,g))&&(p[0]+=Ca,p[1]+=Ca,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&be(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=pe(n),u=pe(t),o=[1,0,0],a=de(r,u),c=ve(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=de(o,a),p=ye(o,f),v=ye(a,h);me(p,v);var d=g,m=ve(p,d),y=ve(d,d),M=m*m-y*(ve(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=ye(d,(-m-x)/y);if(me(b,p),b=xe(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=ga(A-qa)<Ca,C=N||Ca>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(ga(b[0]-w)<Ca?k:E):k<=b[1]&&b[1]<=E:A>qa^(w<=b[0]&&b[0]<=S)){var z=ye(d,(-m+x)/y);return me(z,p),[b,xe(z)]}}}function u(t,e){var r=o?n:qa-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ga(i)>Ca,c=gr(n,6*Da);return Le(t,e,c,o?[0,-n]:[-qa,n-qa])}function Oe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return ga(r[0]-n)<Ca?u>0?0:3:ga(r[0]-e)<Ca?u>0?2:1:ga(r[1]-t)<Ca?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Tc,Math.min(Tc,n)),t=Math.max(-Tc,Math.min(Tc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=Re(),N=Oe(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&Ce(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ye(n){var t=0,e=qa/3,r=ir(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*qa/180,e=n[1]*qa/180):[t/qa*180,e/qa*180]},u}function Ze(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Ve(){function n(n,t){Dc+=u*n-r*t,r=n,u=t}var t,e,r,u;Hc.point=function(i,o){Hc.point=n,t=r=i,e=u=o},Hc.lineEnd=function(){n(t,e)}}function Xe(n,t){Pc>n&&(Pc=n),n>jc&&(jc=n),Uc>t&&(Uc=t),t>Fc&&(Fc=t)}function $e(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Be(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Be(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Be(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function We(n,t){_c+=n,wc+=t,++Sc}function Je(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);kc+=o*(t+n)/2,Ec+=o*(e+r)/2,Ac+=o,We(t=n,e=r)}var t,e;Ic.point=function(r,u){Ic.point=n,We(t=r,e=u)}}function Ge(){Ic.point=We}function Ke(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);kc+=o*(r+n)/2,Ec+=o*(u+t)/2,Ac+=o,o=u*n-r*t,Nc+=o*(r+n),Cc+=o*(u+t),zc+=3*o,We(r=n,u=t)}var t,e,r,u;Ic.point=function(i,o){Ic.point=n,We(t=r=i,e=u=o)},Ic.lineEnd=function(){n(t,e)}}function Qe(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,La)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function nr(n){function t(n){return(a?r:e)(n)}function e(t){return rr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=pe([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c
},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ga(ga(w)-1)<Ca||ga(r-h)<Ca?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;(L*L/x>i||ga((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Da),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function tr(n){var t=nr(function(t,e){return n([t*Pa,e*Pa])});return function(n){return or(t(n))}}function er(n){this.stream=n}function rr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ur(n){return ir(function(){return n})()}function ir(n){function t(n){return n=a(n[0]*Da,n[1]*Da),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Pa,n[1]*Pa]}function r(){a=Ae(o=lr(m,M,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=nr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Lc,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=or(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Lc):He((w=+n)*Da),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Da,d=n[1]%360*Da,r()):[v*Pa,d*Pa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Da,M=n[1]%360*Da,x=n.length>2?n[2]%360*Da:0,r()):[m*Pa,M*Pa,x*Pa]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function or(n){return rr(n,function(t,e){n.point(t*Da,e*Da)})}function ar(n,t){return[n,t]}function cr(n,t){return[n>qa?n-La:-qa>n?n+La:n,t]}function lr(n,t,e){return n?t||e?Ae(fr(n),hr(t,e)):fr(n):t||e?hr(t,e):cr}function sr(n){return function(t,e){return t+=n,[t>qa?t-La:-qa>t?t+La:t,e]}}function fr(n){var t=sr(n);return t.invert=sr(-n),t}function hr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function gr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=pr(e,u),i=pr(e,i),(o>0?i>u:u>i)&&(u+=o*La)):(u=n+o*La,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=xe([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function pr(n,t){var e=pe(t);e[0]-=n,Me(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ca)%(2*Math.PI)}function vr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function dr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function mr(n){return n.source}function yr(n){return n.target}function Mr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Pa,Math.atan2(o,Math.sqrt(r*r+u*u))*Pa]}:function(){return[n*Pa,t*Pa]};return p.distance=h,p}function xr(){function n(n,u){var i=Math.sin(u*=Da),o=Math.cos(u),a=ga((n*=Da)-t),c=Math.cos(a);Yc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Zc.point=function(u,i){t=u*Da,e=Math.sin(i*=Da),r=Math.cos(i),Zc.point=n},Zc.lineEnd=function(){Zc.point=Zc.lineEnd=b}}function br(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function _r(n,t){function e(n,t){o>0?-Ra+Ca>t&&(t=-Ra+Ca):t>Ra-Ca&&(t=Ra-Ca);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(qa/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Ra]},e):Sr}function wr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ga(u)<Ca?ar:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Sr(n,t){return[n,Math.log(Math.tan(qa/4+t/2))]}function kr(n){var t,e=ur(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=qa*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Er(n,t){return[Math.log(Math.tan(qa/4+t/2)),-n]}function Ar(n){return n[0]}function Nr(n){return n[1]}function Cr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function zr(n,t){return n[0]-t[0]||n[1]-t[1]}function qr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Lr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Tr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Rr(){tu(this),this.edge=this.site=this.circle=null}function Dr(n){var t=el.pop()||new Rr;return t.site=n,t}function Pr(n){Xr(n),Qc.remove(n),el.push(n),tu(n)}function Ur(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Pr(n);for(var c=i;c.circle&&ga(e-c.circle.x)<Ca&&ga(r-c.circle.cy)<Ca;)i=c.P,a.unshift(c),Pr(c),c=i;a.unshift(c),Xr(c);for(var l=o;l.circle&&ga(e-l.circle.x)<Ca&&ga(r-l.circle.cy)<Ca;)o=l.N,a.push(l),Pr(l),l=o;a.push(l),Xr(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Kr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Jr(c.site,l.site,null,u),Vr(c),Vr(l)}function jr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Qc._;a;)if(r=Fr(a,o)-i,r>Ca)a=a.L;else{if(u=i-Hr(a,o),!(u>Ca)){r>-Ca?(t=a.P,e=a):u>-Ca?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Dr(n);if(Qc.insert(t,c),t||e){if(t===e)return Xr(t),e=Dr(t.site),Qc.insert(c,e),c.edge=e.edge=Jr(t.site,c.site),Vr(t),void Vr(e);if(!e)return void(c.edge=Jr(t.site,c.site));Xr(t),Xr(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Kr(e.edge,l,p,x),c.edge=Jr(l,n,null,x),e.edge=Jr(n,p,null,x),Vr(t),Vr(e)}}function Fr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Hr(n,t){var e=n.N;if(e)return Fr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Or(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Kc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(ga(r-t)>Ca||ga(u-e)>Ca)&&(a.splice(o,0,new Qr(Gr(i.site,s,ga(r-f)<Ca&&p-u>Ca?{x:f,y:ga(t-f)<Ca?e:p}:ga(u-p)<Ca&&h-r>Ca?{x:ga(e-p)<Ca?t:h,y:p}:ga(r-h)<Ca&&u-g>Ca?{x:h,y:ga(t-h)<Ca?e:g}:ga(u-g)<Ca&&r-f>Ca?{x:ga(e-g)<Ca?t:f,y:g}:null),i.site,null)),++c)}function Yr(n,t){return t.angle-n.angle}function Zr(){tu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-za)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=rl.pop()||new Zr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=tl._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}tl.insert(y,m),y||(nl=m)}}}}function Xr(n){var t=n.circle;t&&(t.P||(nl=t.N),tl.remove(t),rl.push(t),tu(t),n.circle=null)}function $r(n){for(var t,e=Gc,r=Oe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Br(t,n)||!r(t)||ga(t.a.x-t.b.x)<Ca&&ga(t.a.y-t.b.y)<Ca)&&(t.a=t.b=null,e.splice(u,1))}function Br(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Wr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Jr(n,t,e,r){var u=new Wr(n,t);return Gc.push(u),e&&Kr(u,n,t,e),r&&Kr(u,t,n,r),Kc[n.i].edges.push(new Qr(u,n,t)),Kc[t.i].edges.push(new Qr(u,t,n)),u}function Gr(n,t,e){var r=new Wr(n,null);return r.a=t,r.b=e,Gc.push(r),r}function Kr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Qr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function nu(){this._=null}function tu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function eu(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ru(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function uu(n){for(;n.L;)n=n.L;return n}function iu(n,t){var e,r,u,i=n.sort(ou).pop();for(Gc=[],Kc=new Array(n.length),Qc=new nu,tl=new nu;;)if(u=nl,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Kc[i.i]=new Or(i),jr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Ur(u.arc)}t&&($r(t),Ir(t));var o={cells:Kc,edges:Gc};return Qc=tl=Gc=Kc=null,o}function ou(n,t){return t.y-n.y||t.x-n.x}function au(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function cu(n){return n.x}function lu(n){return n.y}function su(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function fu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&fu(n,c[0],e,r,o,a),c[1]&&fu(n,c[1],o,r,u,a),c[2]&&fu(n,c[2],e,a,o,i),c[3]&&fu(n,c[3],o,a,u,i)}}function hu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function gu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function pu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=mu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function vu(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function du(n,t){var e,r,u,i=il.lastIndex=ol.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=il.exec(n))&&(r=ol.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:vu(e,r)})),i=ol.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function mu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function yu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(mu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Mu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function xu(n){return function(t){return 1-n(1-t)}}function bu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function _u(n){return n*n}function wu(n){return n*n*n}function Su(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function ku(n){return function(t){return Math.pow(t,n)}}function Eu(n){return 1-Math.cos(n*Ra)}function Au(n){return Math.pow(2,10*(n-1))}function Nu(n){return 1-Math.sqrt(1-n*n)}function Cu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/La*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*La/t)}}function zu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function qu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Lu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Tu(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Pu(n){var t=[n.a,n.b],e=[n.c,n.d],r=ju(t),u=Uu(t,e),i=ju(Fu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Pa,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Pa:0}function Uu(n,t){return n[0]*t[0]+n[1]*t[1]}function ju(n){var t=Math.sqrt(Uu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Fu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Hu(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:vu(a[0],c[0])},{i:3,x:vu(a[1],c[1])})):r.push(c[0]||c[1]?"translate("+c+")":""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vu(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:vu(g[0],p[0])},{i:e-2,x:vu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Ou(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Yu(n){for(var t=n.source,e=n.target,r=Vu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Zu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Vu(n,t){if(n===t)return n;for(var e=Zu(n),r=Zu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Xu(n){n.fixed|=2}function $u(n){n.fixed&=-7}function Bu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Wu(n){n.fixed&=-5}function Ju(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Ju(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Gu(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ri,n}function Ku(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Qu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ni(n){return n.children}function ti(n){return n.value}function ei(n,t){return t.value-n.value}function ri(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ui(n){return n.x}function ii(n){return n.y}function oi(n,t,e){n.y0=t,n.y=e}function ai(n){return ta.range(n.length)}function ci(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function li(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function si(n){return n.reduce(fi,0)}function fi(n,t){return n+t[1]}function hi(n,t){return gi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function gi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function pi(n){return[ta.min(n),ta.max(n)]}function vi(n,t){return n.value-t.value}function di(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function mi(n,t){n._pack_next=t,t._pack_prev=n}function yi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Mi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(xi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],wi(r,u,i),t(i),di(r,i),r._pack_prev=i,di(i,u),u=r._pack_next,o=3;l>o;o++){wi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(yi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!yi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?mi(r,u=a):mi(r=c,u),o--):(di(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(bi)}}function xi(n){n._pack_next=n._pack_prev=n}function bi(n){delete n._pack_next,delete n._pack_prev}function _i(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)_i(u[i],t,e,r)}function wi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function Si(n,t){return n.parent==t.parent?1:2}function ki(n){var t=n.children;return t.length?t[0]:n.t}function Ei(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ai(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ni(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Ci(n,t,e){return n.a.parent===t.parent?n.a:e}function zi(n){return 1+ta.max(n,function(n){return n.y})}function qi(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Li(n){var t=n.children;return t&&t.length?Li(t[0]):n}function Ti(n){var t,e=n.children;return e&&(t=e.length)?Ti(e[t-1]):n}function Ri(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Di(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Pi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ui(n){return n.rangeExtent?n.rangeExtent():Pi(n.range())}function ji(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Fi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Hi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ml}function Oi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Oi:ji,c=r?Iu:Ou;return o=u(n,t,c,e),a=u(t,n,c,mu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Du)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Xi(n,t)},i.tickFormat=function(t,e){return $i(n,t,e)},i.nice=function(t){return Zi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Yi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Zi(n,t){return Fi(n,Hi(Vi(n,t)[2]))}function Vi(n,t){null==t&&(t=10);var e=Pi(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Xi(n,t){return ta.range.apply(ta,Vi(n,t))}function $i(n,t,e){var r=Vi(n,t);if(e){var u=ic.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(ga(r[0]),ga(r[1])));return u[7]||(u[7]="."+Bi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Wi(u[8],r)),e=u.join("")}else e=",."+Bi(r[2])+"f";return ta.format(e)}function Bi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Wi(n,t){var e=Bi(t[2]);return n in yl?Math.abs(e-Bi(Math.max(ga(t[0]),ga(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Ji(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Fi(r.map(u),e?Math:xl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Pi(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Ml;arguments.length<2?t=Ml:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Ji(n.copy(),t,e,r)},Yi(o,n)}function Gi(n,t,e){function r(t){return n(u(t))}var u=Ki(t),i=Ki(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Xi(e,n)},r.tickFormat=function(n,t){return $i(e,n,t)},r.nice=function(n){return r.domain(Zi(e,n))},r.exponent=function(o){return arguments.length?(u=Ki(t=o),i=Ki(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Gi(n.copy(),t,e)},Yi(r,n)}function Ki(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Qi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new l;for(var i,o=-1,a=r.length;++o<a;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):(l-c)/(n.length-1+a)|0;return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Pi(t.a[0])},e.copy=function(){return Qi(n,t)},e.domain(n)}function no(n,t){function i(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ta.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ta.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},o.range=function(n){return arguments.length?(t=n,i()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[0/0,0/0]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return no(n,t)},i()}function to(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return to(n,t,e)},u()}function eo(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return eo(n,t)},e}function ro(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Xi(n,t)},t.tickFormat=function(t,e){return $i(n,t,e)},t.copy=function(){return ro(n)},t}function uo(){return 0}function io(n){return n.innerRadius}function oo(n){return n.outerRadius}function ao(n){return n.startAngle}function co(n){return n.endAngle}function lo(n){return n&&n.padAngle}function so(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function fo(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function ho(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Ar,r=Nr,u=Ne,i=go,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=El.get(n)||go).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function go(n){return n.join("L")}function po(n){return go(n)+"Z"}function vo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function Mo(n,t){return n.length<4?go(n):n[1]+_o(n.slice(1,-1),wo(n,t))}function xo(n,t){return n.length<3?go(n):n[0]+_o((n.push(n[0]),n),wo([n[n.length-2]].concat(n,[n[1]]),t))}function bo(n,t){return n.length<3?go(n):n[0]+_o(n,wo(n,t))}function _o(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return go(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function wo(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function So(n){if(n.length<3)return go(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",No(Cl,o),",",No(Cl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Co(c,o,a);return n.pop(),c.push("L",r),c.join("")}function ko(n){if(n.length<4)return go(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(No(Cl,i)+","+No(Cl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Co(e,i,o);return e.join("")}function Eo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[No(Cl,o),",",No(Cl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Co(t,o,a);return t.join("")}function Ao(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return So(n)}function No(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Co(n,t,e){n.push("C",No(Al,t),",",No(Al,e),",",No(Nl,t),",",No(Nl,e),",",No(Cl,t),",",No(Cl,e))}function zo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function qo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=zo(u,i);++t<e;)r[t]=(o+(o=zo(u=i,i=n[t+1])))/2;return r[t]=o,r}function Lo(n){for(var t,e,r,u,i=[],o=qo(n),a=-1,c=n.length-1;++a<c;)t=zo(n[a],n[a+1]),ga(t)<Ca?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function To(n){return n.length<3?go(n):n[0]+_o(n,Lo(n))}function Ro(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ra,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Do(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Ar,r=Ar,u=0,i=Nr,o=Ne,a=go,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r
},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=El.get(n)||go).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Po(n){return n.radius}function Uo(n){return[n.x,n.y]}function jo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ra;return[e*Math.cos(r),e*Math.sin(r)]}}function Fo(){return 64}function Ho(){return"circle"}function Oo(n){var t=Math.sqrt(n/qa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n){return function(){var t,e;(t=this[n])&&(e=t[t.active])&&(--t.count?delete t[t.active]:delete this[n],t.active+=.5,e.event&&e.event.interrupt.call(this,this.__data__,e.index))}}function Yo(n,t,e){return ya(n,Pl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var a=u.time;o=i[r]={tween:new l,time:a,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++i.count,ta.timer(function(u){function c(e){if(i.active>r)return s();var u=i[i.active];u&&(--i.count,delete i[i.active],u.event&&u.event.interrupt.call(n,n.__data__,u.index)),i.active=r,o.event&&o.event.start.call(n,n.__data__,t),o.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&v.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return p.c=l(e||1)?Ne:l,1},0,a)}function l(e){if(i.active!==r)return 1;for(var u=e/f,a=h(u),c=v.length;c>0;)v[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,n.__data__,t),s()):void 0}function s(){return--i.count?delete i[r]:delete n[e],1}var f,h,g=o.delay,p=ec,v=[];return p.t=g+a,u>=g?c(u-g):void(p.c=c)},0,a)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Vl,u);return i==Vl.length?[t.year,Vi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Vl[i-1]<Vl[i]/u?i-1:i]:[Bl,Vi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Pi(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Fi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Pi(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Yi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.6"},ea=[].slice,ra=function(n){return ea.call(n)},ua=this.document;if(ua)try{ra(ua.documentElement.childNodes)[0].nodeType}catch(ia){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),ua)try{ua.createElement("DIV").style.setProperty("opacity",0,"")}catch(oa){var aa=this.Element.prototype,ca=aa.setAttribute,la=aa.setAttributeNS,sa=this.CSSStyleDeclaration.prototype,fa=sa.setProperty;aa.setAttribute=function(n,t){ca.call(this,n,t+"")},aa.setAttributeNS=function(n,t,e){la.call(this,n,t,e+"")},sa.setProperty=function(n,t,e){fa.call(this,n,t+"",e)}}ta.ascending=e,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)u(e=+n[o])&&(r+=e);else for(;++o<i;)u(e=+t.call(n,n[o],o))&&(r+=e);return r},ta.mean=function(n,t){var e,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)u(e=r(n[a]))?i+=e:--c;else for(;++a<o;)u(e=r(t.call(n,n[a],a)))?i+=e:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(n,t){var i,o=[],a=n.length,c=-1;if(1===arguments.length)for(;++c<a;)u(i=r(n[c]))&&o.push(i);else for(;++c<a;)u(i=r(t.call(n,n[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(e),.5):void 0},ta.variance=function(n,t){var e,i,o=n.length,a=0,c=0,l=-1,s=0;if(1===arguments.length)for(;++l<o;)u(e=r(n[l]))&&(i=e-a,a+=i/++s,c+=i*(e-a));else for(;++l<o;)u(e=r(t.call(n,n[l],l)))&&(i=e-a,a+=i/++s,c+=i*(e-a));return s>1?c/(s-1):void 0},ta.deviation=function(){var n=ta.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ha=i(e);ta.bisectLeft=ha.left,ta.bisect=ta.bisectRight=ha.right,ta.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,o),e=new Array(t);++n<t;)for(var r,u=-1,i=e[n]=new Array(r);++u<r;)i[u]=arguments[u][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ga=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=a(ga(e)),o=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++o)>t;)u.push(r/i);else for(;(r=n+e*++o)<t;)u.push(r/i);return u},ta.map=function(n,t){var e=new l;if(n instanceof l)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var pa="__proto__",va="\x00";c(l,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),ta.nest=function(){function n(t,o,a){if(a>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var c,s,f,h,g=-1,p=o.length,v=i[a++],d=new l;++g<p;)(h=d.get(c=v(s=o[g])))?h.push(s):d.set(c,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,a))}):(s={},f=function(e,r){s[e]=n(t,r,a)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},c(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var da=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(ma,"\\$&")};var ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ya={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ma=function(n,t){return t.querySelector(n)},xa=function(n,t){return t.querySelectorAll(n)},ba=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(ba=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Ma=function(n,t){return Sizzle(n,t)[0]||null},xa=Sizzle,ba=Sizzle.matchesSelector),ta.selection=function(){return ta.select(ua.documentElement)};var _a=ta.selection.prototype=[];_a.select=function(n){var t,e,r,u,i=[];n=N(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return A(i)},_a.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return A(r)};var wa={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/"};ta.ns={prefix:wa,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),wa.hasOwnProperty(e)?{space:wa[e],local:n}:n}},_a.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},_a.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!L(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},_a.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},_a.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},_a.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},_a.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},_a.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},_a.insert=function(n,t){return n=j(n),t=N(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},_a.remove=function(){return this.each(F)},_a.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new l,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,a.push(p),c.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var a=Z([]),c=A([]),s=A([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return c.enter=function(){return a},c.exit=function(){return s},c},_a.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},_a.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return A(u)},_a.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},_a.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},_a.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},_a.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},_a.empty=function(){return!this.node()},_a.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},_a.size=function(){var n=0;return Y(this,function(){++n}),n};var Sa=[];ta.selection.enter=Z,ta.selection.enter.prototype=Sa,Sa.append=_a.append,Sa.empty=_a.empty,Sa.node=_a.node,Sa.call=_a.call,Sa.size=_a.size,Sa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return A(o)},Sa.insert=function(n,t){return arguments.length<2&&(t=V(this)),_a.insert.call(this,n,t)},ta.select=function(t){var e;return"string"==typeof t?(e=[Ma(t,ua)],e.parentNode=ua.documentElement):(e=[t],e.parentNode=n(t)),A([e])},ta.selectAll=function(n){var t;return"string"==typeof n?(t=ra(xa(n,ua)),t.parentNode=ua.documentElement):(t=n,t.parentNode=null),A([t])},_a.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var ka=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});ua&&ka.forEach(function(n){"on"+n in ua&&ka.remove(n)});var Ea,Aa=0;ta.mouse=function(n){return J(n,k())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(n,t,e,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(e(f)).on(i+d,a).on(o+d,c),y=W(f),M=t(h,v);u?(l=u.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var r=E(n,"drag","dragstart","dragend"),u=null,i=e(b,ta.mouse,t,"mousemove","mouseup"),o=e(G,ta.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},ta.rebind(n,r,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ra(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Ca=1e-6,za=Ca*Ca,qa=Math.PI,La=2*qa,Ta=La-Ca,Ra=qa/2,Da=qa/180,Pa=180/qa,Ua=Math.SQRT2,ja=2,Fa=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(ja*h)*(e*ut(Ua*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Ua*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Ua*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Fa*f)/(2*i*ja*h),p=(c*c-i*i-Fa*f)/(2*c*ja*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Ua;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(q,f).on(Oa+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,o)),i(d=e,r),t=ta.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function c(n){z++||n({type:"zoomstart"})}function l(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){f=1,i(ta.mouse(u),g),l(a)}function r(){h.on(L,null).on(T,null),p(f&&ta.event.target===o),s(a)}var u=this,o=ta.event.target,a=D.of(u,arguments),f=0,h=ta.select(t(u)).on(L,n).on(T,r),g=e(ta.mouse(u)),p=W(u);Dl.call(u),c(a)}function h(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ta.event.target;ta.select(t).on(x,r).on(b,a),_.push(t);for(var e=ta.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var c=n(),l=Date.now();if(1===c.length){if(500>l-M){var s=c[0];o(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=l}else if(c.length>1){var s=c[0],f=c[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,o=ta.touches(p);Dl.call(p);for(var a=0,c=o.length;c>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),l(v)}function a(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(_).on(y,null),w.on(q,f).on(R,h),E(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=ta.select(p),E=W(p);t(),c(v),w.on(q,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Dl.call(this),v=e(d=m||ta.mouse(this)),c(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Ha())*k.k),i(d,v),l(n)}function p(){var n=ta.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ta.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},A=[960,500],N=Ia,C=250,z=0,q="mousedown.zoom",L="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=E(n,"zoomstart","zoom","zoomend");return Oa||(Oa="onwheel"in ua?(Ha=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Ha=function(){return ta.event.wheelDelta},"mousewheel"):(Ha=function(){return-ta.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Tl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},c(n)}).tween("zoom:zoom",function(){var e=A[0],r=A[1],u=d?d[0]:e/2,i=d?d[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},l(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,c(n),l(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?Ia:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],n):A},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ta.rebind(n,D,"on")};var Ha,Oa,Ia=[0,1/0];ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var Ya=at.prototype=new ot;Ya.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},Ya.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Za=lt.prototype=new ot;Za.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Va*(arguments.length?n:1)))},Za.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Va*(arguments.length?n:1)))},Za.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Va=18,Xa=.95047,$a=1,Ba=1.08883,Wa=ft.prototype=new ot;Wa.brighter=function(n){return new ft(Math.min(100,this.l+Va*(arguments.length?n:1)),this.a,this.b)},Wa.darker=function(n){return new ft(Math.max(0,this.l-Va*(arguments.length?n:1)),this.a,this.b)},Wa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var Ja=mt.prototype=new ot;Ja.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},Ja.hsl=function(){return _t(this.r,this.g,this.b)},Ja.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ga=ta.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});Ga.forEach(function(n,t){Ga.set(n,yt(t))}),ta.functor=Et,ta.xhr=At(y),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Nt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv("	","text/tab-separated-values");var Ka,Qa,nc,tc,ec,rc=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Qa?Qa.n=i:Ka=i,Qa=i,nc||(tc=clearTimeout(tc),nc=1,rc(qt))},ta.timer.flush=function(){Lt(),Tt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var uc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Rt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),uc[8+e/3]};var ic=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Rt(n,t))).toFixed(Math.max(0,Math.min(20,Rt(n*(1+1e-15),t))))}}),ac=ta.time={},cc=Date;jt.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(){lc.setUTCDate.apply(this._,arguments)},setDay:function(){lc.setUTCDay.apply(this._,arguments)},setFullYear:function(){lc.setUTCFullYear.apply(this._,arguments)},setHours:function(){lc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lc.setUTCSeconds.apply(this._,arguments)},setTime:function(){lc.setTime.apply(this._,arguments)}};var lc=Date.prototype;ac.year=Ft(function(n){return n=ac.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ac.years=ac.year.range,ac.years.utc=ac.year.utc.range,ac.day=Ft(function(n){var t=new cc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ac.days=ac.day.range,ac.days.utc=ac.day.utc.range,ac.dayOfYear=function(n){var t=ac.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ac[n]=Ft(function(n){return(n=ac.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ac[n+"s"]=e.range,ac[n+"s"].utc=e.utc.range,ac[n+"OfYear"]=function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)}}),ac.week=ac.sunday,ac.weeks=ac.sunday.range,ac.weeks.utc=ac.sunday.utc.range,ac.weekOfYear=ac.sundayOfYear;var sc={"-":"",_:" ",0:"0"},fc=/^\s*\d+/,hc=/^%/;ta.locale=function(n){return{numberFormat:Pt(n),timeFormat:Ot(n)}};var gc=ta.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"]});ta.format=gc.numberFormat,ta.geo={},ce.prototype={s:0,t:0,add:function(n){le(n,this.t,pc),le(pc.s,this.s,this),this.s?this.t+=pc.t:this.s=pc.t
},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pc=new ce;ta.geo.stream=function(n,t){n&&vc.hasOwnProperty(n.type)?vc[n.type](n,t):se(n,t)};var vc={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)se(e[r].geometry,t)}},dc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){fe(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)fe(e[r],t,0)},Polygon:function(n,t){he(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)se(e[r],t)}};ta.geo.area=function(n){return mc=0,ta.geo.stream(n,Mc),mc};var mc,yc=new ce,Mc={sphere:function(){mc+=4*qa},point:b,lineStart:b,lineEnd:b,polygonStart:function(){yc.reset(),Mc.lineStart=ge},polygonEnd:function(){var n=2*yc;mc+=0>n?4*qa+n:n,Mc.lineStart=Mc.lineEnd=Mc.point=b}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=pe([t*Da,e*Da]);if(m){var u=de(m,r),i=[u[1],-u[0],0],o=de(i,u);Me(o),o=xe(o);var c=t-p,l=c>0?1:-1,v=o[0]*Pa*l,d=ga(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Pa;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Pa;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ga(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Mc.point(n,e),t(n,e)}function i(){Mc.lineStart()}function o(){u(v,d),Mc.lineEnd(),ga(y)>Ca&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>yc?(s=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){xc=bc=_c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,qc);var t=Nc,e=Cc,r=zc,u=t*t+e*e+r*r;return za>u&&(t=kc,e=Ec,r=Ac,Ca>bc&&(t=_c,e=wc,r=Sc),u=t*t+e*e+r*r,za>u)?[0/0,0/0]:[Math.atan2(e,t)*Pa,tt(r/Math.sqrt(u))*Pa]};var xc,bc,_c,wc,Sc,kc,Ec,Ac,Nc,Cc,zc,qc={sphere:b,point:_e,lineStart:Se,lineEnd:ke,polygonStart:function(){qc.lineStart=Ee},polygonEnd:function(){qc.lineStart=Se}},Lc=Le(Ne,Pe,je,[-qa,-qa/2]),Tc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ye(Ze)}).raw=Ze,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ca,f+.12*l+Ca],[s-.214*l-Ca,f+.234*l-Ca]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ca,f+.166*l+Ca],[s-.115*l-Ca,f+.234*l-Ca]]).stream(c).point,n},n.scale(1070)};var Rc,Dc,Pc,Uc,jc,Fc,Hc={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Dc=0,Hc.lineStart=Ve},polygonEnd:function(){Hc.lineStart=Hc.lineEnd=Hc.point=b,Rc+=ga(Dc/2)}},Oc={point:Xe,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ic={point:We,lineStart:Je,lineEnd:Ge,polygonStart:function(){Ic.lineStart=Ke},polygonEnd:function(){Ic.point=We,Ic.lineStart=Je,Ic.lineEnd=Ge}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Rc=0,ta.geo.stream(n,u(Hc)),Rc},n.centroid=function(n){return _c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,u(Ic)),zc?[Nc/zc,Cc/zc]:Ac?[kc/Ac,Ec/Ac]:Sc?[_c/Sc,wc/Sc]:[0/0,0/0]},n.bounds=function(n){return jc=Fc=-(Pc=Uc=1/0),ta.geo.stream(n,u(Oc)),[[Pc,Uc],[jc,Fc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||tr(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new $e:new Qe(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new er(t);for(var r in n)e[r]=n[r];return e}}},er.prototype={point:function(n,t){this.stream.point(n,t)},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()}},ta.geo.projection=ur,ta.geo.projectionMutator=ir,(ta.geo.equirectangular=function(){return ur(ar)}).raw=ar.invert=ar,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t}return n=lr(n[0]%360*Da,n[1]*Da,n.length>2?n[2]*Da:0),t.invert=function(t){return t=n.invert(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t},t},cr.invert=ar,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=lr(-n[0]*Da,-n[1]*Da,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Pa,n[1]*=Pa}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=gr((t=+r)*Da,u*Da),n):t},n.precision=function(r){return arguments.length?(e=gr(t*Da,(u=+r)*Da),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Da,u=n[1]*Da,i=t[1]*Da,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ga(n%d)>Ca}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ga(n%m)>Ca}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=vr(a,o,90),f=dr(r,e,y),h=vr(l,c,90),g=dr(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=mr,u=yr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return Mr(n[0]*Da,n[1]*Da,t[0]*Da,t[1]*Da)},ta.geo.length=function(n){return Yc=0,ta.geo.stream(n,Zc),Yc};var Yc,Zc={sphere:b,point:b,lineStart:xr,lineEnd:b,polygonStart:b,polygonEnd:b},Vc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ur(Vc)}).raw=Vc;var Xc=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(ta.geo.azimuthalEquidistant=function(){return ur(Xc)}).raw=Xc,(ta.geo.conicConformal=function(){return Ye(_r)}).raw=_r,(ta.geo.conicEquidistant=function(){return Ye(wr)}).raw=wr;var $c=br(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ur($c)}).raw=$c,Sr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ra]},(ta.geo.mercator=function(){return kr(Sr)}).raw=Sr;var Bc=br(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ur(Bc)}).raw=Bc;var Wc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ur(Wc)}).raw=Wc,Er.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ra]},(ta.geo.transverseMercator=function(){var n=kr(Er),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Er,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(zr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Cr(a),s=Cr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Ar,r=Nr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return ya(n,Jc),n};var Jc=ta.geom.polygon.prototype=[];Jc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Jc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Jc.clip=function(n){for(var t,e,r,u,i,o,a=Tr(n),c=-1,l=this.length-Tr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],qr(o,s,u)?(qr(i,s,u)||n.push(Lr(i,o,s,u)),n.push(o)):qr(i,s,u)&&n.push(Lr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var Gc,Kc,Qc,nl,tl,el=[],rl=[];Or.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Yr),t.length},Qr.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}},nu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=uu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(eu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,eu(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?uu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,eu(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ru(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,eu(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,eu(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ru(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return iu(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var r=Ar,u=Nr,i=r,o=u,a=ul;return n?t(n):(t.links=function(n){return iu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return iu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Yr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&au(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?ul:n,t):a===ul?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===ul?null:a&&a[1]},t)};var ul=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(ga(c-e)+ga(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=su()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=su();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){fu(n,k,v,d,m,y)},k.find=function(n){return hu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Ar,c=Nr;return(o=arguments.length)?(a=cu,c=lu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=gu,ta.interpolateObject=pu,ta.interpolateNumber=vu,ta.interpolateString=du;var il=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(il.source,"g");ta.interpolate=mu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ga.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?gu:du:t instanceof ot?gu:Array.isArray(t)?yu:"object"===e&&isNaN(t)?pu:vu)(n,t)}],ta.interpolateArray=yu;var al=function(){return y},cl=ta.map({linear:al,poly:ku,quad:function(){return _u},cubic:function(){return wu},sin:function(){return Eu},exp:function(){return Au},circle:function(){return Nu},elastic:Cu,back:zu,bounce:function(){return qu}}),ll=ta.map({"in":y,out:xu,"in-out":bu,"out-in":function(n){return bu(xu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=cl.get(e)||al,r=ll.get(r)||y,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:sl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Yu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(La-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=fl,h=hl,g=-30,p=gl,v=.1,d=.64,m=[],M=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,y,x,b=m.length,_=M.length;for(e=0;_>e;++e)a=M[e],f=a.source,h=a.target,y=h.x-f.x,x=h.y-f.y,(p=y*y+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,y*=p,x*=p,h.x-=y*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=y*(d=1-d),f.y+=x*d);if((d=r*v)&&(y=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(y-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Ju(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(M=n,a):M},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=M[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=M.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=M[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,M[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,M[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(y).on("dragstart.force",Xu).on("drag.force",t).on("dragend.force",$u)),arguments.length?void this.on("mouseover.force",Bu).on("mouseout.force",Wu).call(e):e},ta.rebind(a,c,"on")};var fl=20,hl=1,gl=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ei,e=ni,r=ti;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ku(t,function(n){n.children&&(n.value=0)}),Qu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Gu(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===pl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=pl,r=0,u=La,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var pl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=y,e=ai,r=ci,u=oi,i=ui,o=ii;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:vl.get(t)||ai,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:dl.get(t)||ci,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var vl=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(li),i=n.map(si),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ai}),dl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ci});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=pi,u=hi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return gi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Qu(a,function(n){n.r=+s(n.value)}),Qu(a,Mi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Qu(a,function(n){n.r+=f}),Qu(a,Mi),Qu(a,function(n){n.r-=f})}return _i(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(vi),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Gu(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(Qu(h,e),h.parent.m=-h.z,Ku(h,r),l)Ku(f,i);else{var g=f,p=f,v=f;Ku(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Ku(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ni(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ei(o),u=ki(u),o&&u;)c=ki(c),i=Ei(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ai(Ci(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ei(i)&&(i.t=o,i.m+=f-s),u&&!ki(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=Si,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Gu(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Qu(c,function(n){var t=n.children;t&&t.length?(n.x=qi(t),n.y=zi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Li(c),f=Ti(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Qu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=Si,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Gu(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Ri,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));
return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ri(t):Di(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Di(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ri:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Gu(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var ml={floor:y,ceil:y};ta.scale.linear=function(){return Ii([0,1],[0,1],mu,!1)};var yl={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Ji(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var Ml=ta.format(".0e"),xl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Gi(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return Qi([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(bl)},ta.scale.category20=function(){return ta.scale.ordinal().range(_l)},ta.scale.category20b=function(){return ta.scale.ordinal().range(wl)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Sl)};var bl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),_l=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),wl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return no([],[])},ta.scale.quantize=function(){return to(0,1,[0,1])},ta.scale.threshold=function(){return eo([.5],[0,1])},ta.scale.identity=function(){return ro([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ra,f=a.apply(this,arguments)-Ra,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ta)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===kl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=qa?0:1;if(A&&so(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=qa?0:1;if(E&&so(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Lr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=fo(null==S?[_,w]:[S,k],[y,M],l,H,g),I=fo([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^so(O[1][0],O[1][1],I[1][0],I[1][1]),",",g," ",I[1],"A",H,",",H," 0 0,",v," ",I[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",I[0])}else N.push("M",y,",",M);if(null!=S){var Y=Math.min(p,(n-F)/(j-1)),Z=fo([y,M],[S,k],n,-Y,g),V=fo([_,w],null==x?[y,M]:[x,b],n,-Y,g);p===Y?N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^so(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",Y,",",Y," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=io,r=oo,u=uo,i=kl,o=ao,a=co,c=lo;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==kl?kl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ra;return[Math.cos(t)*n,Math.sin(t)*n]},n};var kl="auto";ta.svg.line=function(){return ho(y)};var El=ta.map({linear:go,"linear-closed":po,step:vo,"step-before":mo,"step-after":yo,basis:So,"basis-open":ko,"basis-closed":Eo,bundle:Ao,cardinal:bo,"cardinal-open":Mo,"cardinal-closed":xo,monotone:To});El.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=ho(Ro);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},mo.reverse=yo,yo.reverse=mo,ta.svg.area=function(){return Do(y)},ta.svg.area.radial=function(){var n=Do(Ro);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-Ra,s=l.call(n,u,r)-Ra;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>qa)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=mr,o=yr,a=Po,c=ao,l=co;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=mr,e=yr,r=Uo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=Uo,e=n.projection;return n.projection=function(n){return arguments.length?e(jo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(zl.get(t.call(this,n,r))||Oo)(e.call(this,n,r))}var t=Ho,e=Fo;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var zl=ta.map({circle:Oo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ll)),e=t*Ll;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=zl.keys();var ql=Math.sqrt(3),Ll=Math.tan(30*Da);_a.transition=function(n){for(var t,e,r=Tl||++Ul,u=Xo(n),i=[],o=Rl||{time:Date.now(),ease:Su,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Yo(i,u,r)},_a.interrupt=function(n){return this.each(null==n?Dl:Io(Xo(n)))};var Tl,Rl,Dl=Io(Xo()),Pl=[],Ul=0;Pl.call=_a.call,Pl.empty=_a.empty,Pl.node=_a.node,Pl.size=_a.size,ta.transition=function(n,t){return n&&n.transition?Tl?n.transition(t):n:ta.selection().transition(n)},ta.transition.prototype=Pl,Pl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=N(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Yo(o,i,u)},Pl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=C(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Yo(c,a,o)},Pl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Yo(u,this.namespace,this.id)},Pl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Pl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Hu:mu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Pl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Pl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=mu(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Zo(this,"style."+n,e,i)},Pl.styleTween=function(n,e,r){function u(u,i){var o=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Pl.text=function(n){return Zo(this,"text",n,Vo)},Pl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),Y(this,function(r){r[e][t].ease=n}))},Pl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Pl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Pl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Rl,i=Tl;try{Tl=e,Y(this,function(t,u,i){Rl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Rl=u,Tl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Pl.transition=function(){for(var n,t,e,r,u=this.id,i=++Ul,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Yo(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):y:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),d=ta.transition(p.exit()).style("opacity",Ca).remove(),m=ta.transition(p.order()).style("opacity",1),M=Math.max(u,0)+o,x=Ui(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ta.transition(b));v.append("line"),v.append("text");var w,S,k,E,A=v.select("line"),N=m.select("line"),C=p.select("text").text(g),z=v.select("text"),q=m.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,w="x",k="y",S="x2",E="y2",C.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+L*i+"V0H"+x[1]+"V"+L*i)):(n=Wo,w="y",k="x",S="y2",E="x2",C.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),_.attr("d","M"+L*i+","+x[0]+"H0V"+x[1]+"H"+L*i)),A.attr(E,L*u),z.attr(k,L*M),N.attr(S,0).attr(E,L*u),q.attr(w,0).attr(k,L*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=jl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Fl?t+"":jl,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var jl="bottom",Fl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(t){t.each(function(){var t=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,y);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Hl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var c,f=ta.transition(t),h=ta.transition(o);l&&(c=Ui(l),h.attr("x",c[0]).attr("width",c[1]-c[0]),r(f)),s&&(c=Ui(s),h.attr("y",c[0]).attr("height",c[1]-c[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ta.event.keyCode&&(C||(M=null,q[0]-=f[1],q[1]-=h[1],C=2),S())}function v(){32==ta.event.keyCode&&2==C&&(q[0]+=f[1],q[1]+=h[1],C=0,S())}function d(){var n=ta.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ta.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),q[0]=f[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),A&&m(n,l,0)&&(r(k),t=!0),N&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Ui(t),c=i[0],l=i[1],s=q[e],v=e?h:f,d=v[1]-v[0];return C&&(c-=s,l-=d+s),r=(e?p:g)?Math.max(c,Math.min(l,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(c,Math.min(l,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?a=null:o=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ta.select(ta.event.target),w=c.of(b,arguments),k=ta.select(b),E=_.datum(),A=!/^(n|s)$/.test(E)&&l,N=!/^(e|w)$/.test(E)&&s,C=_.classed("extent"),z=W(b),q=ta.mouse(b),L=ta.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(ta.event.changedTouches?L.on("touchmove.brush",d).on("touchend.brush",y):L.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=f[0]-q[0],q[1]=h[0]-q[1];else if(E){var T=+/w$/.test(E),R=+/^n/.test(E);x=[f[1-T]-q[0],h[1-R]-q[1]],q[0]=f[T],q[1]=h[R]}else ta.event.altKey&&(M=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,c=E(n,"brushstart","brush","brushend"),l=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Ol[0];return n.event=function(n){n.each(function(){var n=c.of(this,arguments),t={x:f,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Tl?ta.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=yu(f,t.x),r=yu(h,t.y);return o=a=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(l=t,v=Ol[!l<<1|!s],n):l},n.y=function(t){return arguments.length?(s=t,v=Ol[!l<<1|!s],n):s},n.clamp=function(t){return arguments.length?(l&&s?(g=!!t[0],p=!!t[1]):l?g=!!t:s&&(p=!!t),n):l&&s?[g,p]:l?g:s?p:null},n.extent=function(t){var e,r,u,i,c;return arguments.length?(l&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),o=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(c=e,e=r,r=c),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],l&&(u=u[1],i=i[1]),a=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(c=u,u=i,i=c),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(l&&(o?(e=o[0],r=o[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(c=e,e=r,r=c))),s&&(a?(u=a[0],i=a[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(c=u,u=i,i=c))),l&&s?[[e,u],[r,i]]:l?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!l&&f[0]==f[1]||!!s&&h[0]==h[1]},ta.rebind(n,c,"on")};var Hl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ol=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Il=ac.format=gc.timeFormat,Yl=Il.utc,Zl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Il.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:Zl,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=Zl.toString,ac.second=Ft(function(n){return new cc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ac.seconds=ac.second.range,ac.seconds.utc=ac.second.utc.range,ac.minute=Ft(function(n){return new cc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ac.minutes=ac.minute.range,ac.minutes.utc=ac.minute.utc.range,ac.hour=Ft(function(n){var t=n.getTimezoneOffset()/60;return new cc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ac.hours=ac.hour.range,ac.hours.utc=ac.hour.utc.range,ac.month=Ft(function(n){return n=ac.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ac.months=ac.month.range,ac.months.utc=ac.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ac.second,1],[ac.second,5],[ac.second,15],[ac.second,30],[ac.minute,1],[ac.minute,5],[ac.minute,15],[ac.minute,30],[ac.hour,1],[ac.hour,3],[ac.hour,6],[ac.hour,12],[ac.day,1],[ac.day,2],[ac.week,1],[ac.month,1],[ac.month,3],[ac.year,1]],$l=Il.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ne]]),Bl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:y,ceil:y};Xl.year=ac.year,ac.scale=function(){return Go(ta.scale.linear(),Xl,$l)};var Wl=Xl.map(function(n){return[n[0].utc,n[1]]}),Jl=Yl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ne]]);Wl.year=ac.year.utc,ac.scale.utc=function(){return Go(ta.scale.linear(),Wl,Jl)},ta.text=At(function(n){return n.responseText}),ta.json=function(n,t){return Nt(n,"application/json",Qo,t)},ta.html=function(n,t){return Nt(n,"text/html",na,t)},ta.xml=At(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();
!function(){function t(t,a){return{type:"Feature",id:t.id,properties:t.properties,geometry:n(t.geometry,a)}}function n(t,a){if(!t)return null;if("GeometryCollection"===t.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return n(t,a)})};if(!la.hasOwnProperty(t.type))return null;var r=la[t.type];return d3.geo.stream(t,a(r)),r.result()}function a(){}function r(t){if((n=t.length)<4)return!1;for(var n,a=0,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++a<n;)r+=t[a-1][1]*t[a][0]-t[a-1][0]*t[a][1];return 0>=r}function e(t,n){for(var a=n[0],r=n[1],e=!1,o=0,i=t.length,h=i-1;i>o;h=o++){var u=t[o],M=u[0],s=u[1],c=t[h],f=c[0],v=c[1];s>r^v>r&&(f-M)*(r-s)/(v-s)+M>a&&(e=!e)}return e}function o(t){return t?t/Math.sin(t):1}function i(t){return t>0?1:0>t?-1:0}function h(t){return t>1?pa:-1>t?-pa:Math.asin(t)}function u(t){return t>1?0:-1>t?ba:Math.acos(t)}function M(t){return t>0?Math.sqrt(t):0}function s(t){function n(t,n){var a=Math.cos(t),e=Math.cos(n),o=Math.sin(n),i=e*a,h=-((1-i?Math.log(.5*(1+i))/(1-i):-.5)+r/(1+i));return[h*e*Math.sin(t),h*o]}var a=Math.tan(.5*t),r=2*Math.log(Math.cos(.5*t))/(a*a);return n.invert=function(n,a){var e,o=Math.sqrt(n*n+a*a),i=t*-.5,u=50;if(!o)return[0,0];do{var M=.5*i,s=Math.cos(M),c=Math.sin(M),f=Math.tan(M),v=Math.log(1/s);i-=e=(2/f*v-r*f-o)/(-v/(c*c)+1-r/(2*s*s))}while(Math.abs(e)>ga&&--u>0);var l=Math.sin(i);return[Math.atan2(n*l,o*Math.cos(i)),h(a*l/o)]},n}function c(){var t=pa,n=Sa(s),a=n(t);return a.radius=function(a){return arguments.length?n(t=a*ba/180):180*(t/ba)},a}function f(t,n){var a=Math.cos(n),r=o(u(a*Math.cos(t/=2)));return[2*a*Math.sin(t)*r,Math.sin(n)*r]}function v(t){function n(t,n){var h=Math.cos(n),u=Math.cos(t/=2);return[(1+h)*Math.sin(t),(e*n>-Math.atan2(u,o)-.001?0:10*-e)+i+Math.sin(n)*r-(1+h)*a*u]}var a=Math.sin(t),r=Math.cos(t),e=t>0?1:-1,o=Math.tan(e*t),i=(1+a-r)/2;return n.invert=function(t,n){var h=0,u=0,M=50;do{var s=Math.cos(h),c=Math.sin(h),f=Math.cos(u),v=Math.sin(u),l=1+f,g=l*c-t,d=i+v*r-l*a*s-n,b=.5*l*s,p=-c*v,w=.5*a*l*c,q=r*f+a*s*v,m=p*w-q*b,y=.5*(d*p-g*q)/m,S=(g*w-d*b)/m;h-=y,u-=S}while((Math.abs(y)>ga||Math.abs(S)>ga)&&--M>0);return e*u>-Math.atan2(Math.cos(h),o)-.001?[2*h,u]:null},n}function l(){var t=ba/9,n=t>0?1:-1,a=Math.tan(n*t),r=Sa(v),e=r(t),o=e.stream;return e.parallel=function(e){return arguments.length?(a=Math.tan((n=(t=e*ba/180)>0?1:-1)*t),r(t)):180*(t/ba)},e.stream=function(r){var i=e.rotate(),h=o(r),u=(e.rotate([0,0]),o(r));return e.rotate(i),h.sphere=function(){u.polygonStart(),u.lineStart();for(var r=-180*n;180>n*r;r+=90*n)u.point(r,90*n);for(;n*(r-=t)>=-180;)u.point(r,n*-Math.atan2(Math.cos(r*qa/2),a)*ma);u.lineEnd(),u.polygonEnd()},h},e}function g(t){return t=Math.exp(2*t),(t-1)/(t+1)}function d(t){return.5*(Math.exp(t)-Math.exp(-t))}function b(t){return.5*(Math.exp(t)+Math.exp(-t))}function p(t){return Math.log(t+M(t*t+1))}function w(t){return Math.log(t+M(t*t-1))}function q(t,n){var a=Math.tan(n/2),r=M(1-a*a),e=1+r*Math.cos(t/=2),o=Math.sin(t)*r/e,i=a/e,h=o*o,u=i*i;return[4/3*o*(3+h-3*u),4/3*i*(3+3*h-u)]}function m(t,n){var a=Math.abs(n);return ba/4>a?[t,Math.log(Math.tan(ba/4+n/2))]:[t*Math.cos(a)*(2*Math.SQRT2-1/Math.sin(a)),i(n)*(2*Math.SQRT2*(a-ba/4)-Math.log(Math.tan(a/2)))]}function y(t){function n(t,n){var r=Ra(t,n);if(Math.abs(t)>pa){var e=Math.atan2(r[1],r[0]),o=Math.sqrt(r[0]*r[0]+r[1]*r[1]),i=a*Math.round((e-pa)/a)+pa,u=Math.atan2(Math.sin(e-=i),2-Math.cos(e));e=i+h(ba/o*Math.sin(u))-u,r[0]=o*Math.cos(e),r[1]=o*Math.sin(e)}return r}var a=2*ba/t;return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n);if(r>pa){var e=Math.atan2(n,t),o=a*Math.round((e-pa)/a)+pa,i=e>o?-1:1,h=r*Math.cos(o-e),u=1/Math.tan(i*Math.acos((h-ba)/Math.sqrt(ba*(ba-2*h)+r*r)));e=o+2*Math.atan((u+i*Math.sqrt(u*u-3))/3),t=r*Math.cos(e),n=r*Math.sin(e)}return Ra.invert(t,n)},n}function S(){var t=5,n=Sa(y),a=n(t),r=a.stream,e=.01,o=-Math.cos(e*qa),i=Math.sin(e*qa);return a.lobes=function(a){return arguments.length?n(t=+a):t},a.stream=function(n){var u=a.rotate(),M=r(n),s=(a.rotate([0,0]),r(n));return a.rotate(u),M.sphere=function(){s.polygonStart(),s.lineStart();for(var n=0,a=360/t,r=2*ba/t,u=90-180/t,M=pa;t>n;++n,u-=a,M-=r)s.point(Math.atan2(i*Math.cos(M),o)*ma,h(i*Math.sin(M))*ma),-90>u?(s.point(-90,-180-u-e),s.point(-90,-180-u+e)):(s.point(90,u+e),s.point(90,u-e));s.lineEnd(),s.polygonEnd()},M},a}function Q(t){return function(n){var a,r=t*Math.sin(n),e=30;do n-=a=(n+Math.sin(n)-r)/(1+Math.cos(n));while(Math.abs(a)>ga&&--e>0);return n/2}}function R(t,n,a){function r(a,r){return[t*a*Math.cos(r=e(r)),n*Math.sin(r)]}var e=Q(a);return r.invert=function(r,e){var o=h(e/n);return[r/(t*Math.cos(o)),h((2*o+Math.sin(2*o))/a)]},r}function T(t,n){var a=2.00276,r=Ta(n);return[a*t/(1/Math.cos(n)+1.11072/Math.cos(r)),(n+Math.SQRT2*Math.sin(r))/a]}function x(t){var n=0,a=Sa(t),r=a(n);return r.parallel=function(t){return arguments.length?a(n=t*ba/180):180*(n/ba)},r}function E(t,n){return[t*Math.cos(n),n]}function k(t){function n(n,r){var e=a+t-r,o=e?n*Math.cos(r)/e:e;return[e*Math.sin(o),a-e*Math.cos(o)]}if(!t)return E;var a=1/Math.tan(t);return n.invert=function(n,r){var e=Math.sqrt(n*n+(r=a-r)*r),o=a+t-e;return[e/Math.cos(o)*Math.atan2(n,r),o]},n}function P(t){function n(n,a){for(var r=Math.sin(a),e=Math.cos(a),o=new Array(3),M=0;3>M;++M){var s=t[M];if(o[M]=z(a-s[1],s[3],s[2],e,r,n-s[0]),!o[M][0])return s.point;o[M][1]=F(o[M][1]-s.v[1])}for(var c=u.slice(),M=0;3>M;++M){var f=2==M?0:M+1,v=B(t[M].v[0],o[M][0],o[f][0]);o[M][1]<0&&(v=-v),M?1==M?(v=i-v,c[0]-=o[M][0]*Math.cos(v),c[1]-=o[M][0]*Math.sin(v)):(v=h-v,c[0]+=o[M][0]*Math.cos(v),c[1]+=o[M][0]*Math.sin(v)):(c[0]+=o[M][0]*Math.cos(v),c[1]-=o[M][0]*Math.sin(v))}return c[0]/=3,c[1]/=3,c}t=t.map(function(t){return[t[0],t[1],Math.sin(t[1]),Math.cos(t[1])]});for(var a,r=t[2],e=0;3>e;++e,r=a)a=t[e],r.v=z(a[1]-r[1],r[3],r[2],a[3],a[2],a[0]-r[0]),r.point=[0,0];var o=B(t[0].v[0],t[2].v[0],t[1].v[0]),i=B(t[0].v[0],t[1].v[0],t[2].v[0]),h=ba-o;t[2].point[1]=0,t[0].point[0]=-(t[1].point[0]=.5*t[0].v[0]);var u=[t[2].point[0]=t[0].point[0]+t[2].v[0]*Math.cos(o),2*(t[0].point[1]=t[1].point[1]=t[2].v[0]*Math.sin(o))];return n}function _(){var t=[[0,0],[0,0],[0,0]],n=Sa(P),a=n(t),r=a.rotate;return delete a.rotate,a.points=function(e){if(!arguments.length)return t;t=e;var o=d3.geo.centroid({type:"MultiPoint",coordinates:t}),i=[-o[0],-o[1]];return r.call(a,i),n(t.map(d3.geo.rotation(i)).map(A))},a.points([[-150,55],[-35,55],[-92.5,10]])}function z(t,n,a,r,e,o){var i,M=Math.cos(o);if(Math.abs(t)>1||Math.abs(o)>1)i=u(a*e+n*r*M);else{var s=Math.sin(.5*t),c=Math.sin(.5*o);i=2*h(Math.sqrt(s*s+n*r*c*c))}return Math.abs(i)>ga?[i,Math.atan2(r*Math.sin(o),n*e-a*r*M)]:[0,0]}function B(t,n,a){return u(.5*(t*t+n*n-a*a)/(t*n))}function F(t){return t-2*ba*Math.floor((t+ba)/(2*ba))}function A(t){return[t[0]*qa,t[1]*qa]}function G(t,n){var a=M(1-Math.sin(n));return[2/wa*t*a,wa*(1-a)]}function j(t){function n(t,n){return[t,(t?t/Math.sin(t):1)*(Math.sin(n)*Math.cos(t)-a*Math.cos(n))]}var a=Math.tan(t);return n.invert=a?function(t,n){t&&(n*=Math.sin(t)/t);var r=Math.cos(t);return[t,2*Math.atan2(Math.sqrt(r*r+a*a-n*n)-r,a-n)]}:function(t,n){return[t,h(t?n*Math.tan(t)/t:n)]},n}function C(t,n){var a=Math.sqrt(3);return[a*t*(2*Math.cos(2*n/3)-1)/wa,a*wa*Math.sin(n/3)]}function D(t){function n(t,n){return[t*a,Math.sin(n)/a]}var a=Math.cos(t);return n.invert=function(t,n){return[t/a,h(n*a)]},n}function L(t){function n(t,n){return[t*a,(1+a)*Math.tan(.5*n)]}var a=Math.cos(t);return n.invert=function(t,n){return[t/a,2*Math.atan(n/(1+a))]},n}function O(t,n){var a=Math.sqrt(8/(3*ba));return[a*t*(1-Math.abs(n)/ba),a*n]}function H(t,n){var a=Math.sqrt(4-3*Math.sin(Math.abs(n)));return[2/Math.sqrt(6*ba)*t*a,i(n)*Math.sqrt(2*ba/3)*(2-a)]}function I(t,n){var a=Math.sqrt(ba*(4+ba));return[2/a*t*(1+Math.sqrt(1-4*n*n/(ba*ba))),4/a*n]}function J(t,n){var a=(2+pa)*Math.sin(n);n/=2;for(var r=0,e=1/0;10>r&&Math.abs(e)>ga;r++){var o=Math.cos(n);n-=e=(n+Math.sin(n)*(o+2)-a)/(2*o*(1+o))}return[2/Math.sqrt(ba*(4+ba))*t*(1+Math.cos(n)),2*Math.sqrt(ba/(4+ba))*Math.sin(n)]}function K(t,n){return[t*(1+Math.cos(n))/Math.sqrt(2+ba),2*n/Math.sqrt(2+ba)]}function N(t,n){for(var a=(1+pa)*Math.sin(n),r=0,e=1/0;10>r&&Math.abs(e)>ga;r++)n-=e=(n+Math.sin(n)-a)/(1+Math.cos(n));return a=Math.sqrt(2+ba),[t*(1+Math.cos(n))/a,2*n/a]}function U(t,n){var a=Math.sin(t/=2),r=Math.cos(t),e=Math.sqrt(Math.cos(n)),o=Math.cos(n/=2),i=Math.sin(n)/(o+Math.SQRT2*r*e),h=Math.sqrt(2/(1+i*i)),u=Math.sqrt((Math.SQRT2*o+(r+a)*e)/(Math.SQRT2*o+(r-a)*e));return[ka*(h*(u-1/u)-2*Math.log(u)),ka*(h*i*(u+1/u)-2*Math.atan(i))]}function V(t,n){var a=Math.tan(n/2);return[t*Pa*M(1-a*a),(1+Pa)*a]}function W(t,n){var a=n/2,r=Math.cos(a);return[2*t/wa*Math.cos(n)*r*r,wa*Math.tan(a)]}function X(t,n){function a(n,a){var o=_a(n,a),i=o[0],h=o[1],u=i*i+h*h;if(u>e){var M=Math.sqrt(u),s=Math.atan2(h,i),c=r*Math.round(s/r),f=s-c,v=t*Math.cos(f),l=(t*Math.sin(f)-f*Math.sin(v))/(pa-v),g=Y(f,l),d=(ba-t)/$(g,v,ba);i=M;var b,p=50;do i-=b=(t+$(g,v,i)*d-M)/(g(i)*d);while(Math.abs(b)>ga&&--p>0);h=f*Math.sin(i),pa>i&&(h-=l*(i-pa));var w=Math.sin(c),q=Math.cos(c);o[0]=i*q-h*w,o[1]=i*w+h*q}return o}var r=2*ba/n,e=t*t;return a.invert=function(n,a){var o=n*n+a*a;if(o>e){var i=Math.sqrt(o),h=Math.atan2(a,n),u=r*Math.round(h/r),M=h-u,n=i*Math.cos(M);a=i*Math.sin(M);for(var s=n-pa,c=Math.sin(n),f=a/c,v=pa>n?1/0:0,l=10;;){var g=t*Math.sin(f),d=t*Math.cos(f),b=Math.sin(d),p=pa-d,w=(g-f*b)/p,q=Y(f,w);if(Math.abs(v)<da||!--l)break;f-=v=(f*c-w*s-a)/(c-2*s*(p*(d+f*g*Math.cos(d)-b)-g*(g-f*b))/(p*p))}i=t+$(q,d,n)*(ba-t)/$(q,d,ba),h=u+f,n=i*Math.cos(h),a=i*Math.sin(h)}return _a.invert(n,a)},a}function Y(t,n){return function(a){var r=t*Math.cos(a);return pa>a&&(r-=n),Math.sqrt(1+r*r)}}function Z(){var t=6,n=30*qa,a=Math.cos(n),r=Math.sin(n),e=Sa(X),o=e(n,t),i=o.stream,h=.01,u=-Math.cos(h*qa),M=Math.sin(h*qa);return o.radius=function(o){return arguments.length?(a=Math.cos(n=o*qa),r=Math.sin(n),e(n,t)):n*ma},o.lobes=function(a){return arguments.length?e(n,t=+a):t},o.stream=function(n){var e=o.rotate(),h=i(n),s=(o.rotate([0,0]),i(n));return o.rotate(e),h.sphere=function(){s.polygonStart(),s.lineStart();for(var n=0,e=2*ba/t,o=0;t>n;++n,o-=e)s.point(Math.atan2(M*Math.cos(o),u)*ma,Math.asin(M*Math.sin(o))*ma),s.point(Math.atan2(r*Math.cos(o-e/2),a)*ma,Math.asin(r*Math.sin(o-e/2))*ma);s.lineEnd(),s.polygonEnd()},h},o}function $(t,n,a){for(var r=50,e=(a-n)/r,o=t(n)+t(a),i=1,h=n;r>i;++i)o+=2*t(h+=e);return.5*o*e}function tn(t,n,a,r,e,o,i,h){function u(u,M){if(!M)return[t*u/ba,0];var s=M*M,c=t+s*(n+s*(a+s*r)),f=M*(e-1+s*(o-h+s*i)),v=(c*c+f*f)/(2*f),l=u*Math.asin(c/v)/ba;return[v*Math.sin(l),M*(1+s*h)+v*(1-Math.cos(l))]}return arguments.length<8&&(h=0),u.invert=function(u,s){var c,f,v=ba*u/t,l=s,g=50;do{var d=l*l,b=t+d*(n+d*(a+d*r)),p=l*(e-1+d*(o-h+d*i)),w=b*b+p*p,q=2*p,m=w/q,y=m*m,S=Math.asin(b/m)/ba,Q=v*S;if(xB2=b*b,dxBdφ=(2*n+d*(4*a+6*d*r))*l,dyBdφ=e+d*(3*o+5*d*i),dpdφ=2*(b*dxBdφ+p*(dyBdφ-1)),dqdφ=2*(dyBdφ-1),dmdφ=(dpdφ*q-w*dqdφ)/(q*q),cosα=Math.cos(Q),sinα=Math.sin(Q),mcosα=m*cosα,msinα=m*sinα,dαdφ=v/ba*(1/M(1-xB2/y))*(dxBdφ*m-b*dmdφ)/y,fx=msinα-u,fy=l*(1+d*h)+m-mcosα-s,δxδφ=dmdφ*sinα+mcosα*dαdφ,δxδλ=mcosα*S,δyδφ=1+dmdφ-(dmdφ*cosα-msinα*dαdφ),δyδλ=msinα*S,denominator=δxδφ*δyδλ-δyδφ*δxδλ,!denominator)break;v-=c=(fy*δxδφ-fx*δyδφ)/denominator,l-=f=(fx*δyδλ-fy*δxδλ)/denominator}while((Math.abs(c)>ga||Math.abs(f)>ga)&&--g>0);return[v,l]},u}function nn(t,n){var a=t*t,r=n*n;return[t*(1-.162388*r)*(.87-952426e-9*a*a),n*(1+r/12)]}function an(t){function n(){var t=!1,n=Sa(a),r=n(t);return r.quincuncial=function(a){return arguments.length?n(t=!!a):t},r}function a(n){var a=n?function(n,a){var e=Math.abs(n)<pa,o=t(e?n:n>0?n-ba:n+ba,a),h=(o[0]-o[1])*Math.SQRT1_2,u=(o[0]+o[1])*Math.SQRT1_2;if(e)return[h,u];var M=r*Math.SQRT1_2,s=h>0^u>0?-1:1;return[s*h-i(u)*M,s*u-i(h)*M]}:function(n,a){var e=n>0?-.5:.5,o=t(n+e*ba,a);return o[0]-=e*r,o};return t.invert&&(a.invert=n?function(n,a){var e=(n+a)*Math.SQRT1_2,o=(a-n)*Math.SQRT1_2,i=Math.abs(e)<.5*r&&Math.abs(o)<.5*r;if(!i){var h=r*Math.SQRT1_2,u=e>0^o>0?-1:1,M=-u*(n+(o>0?1:-1)*h),s=-u*(a+(e>0?1:-1)*h);e=(-M-s)*Math.SQRT1_2,o=(M-s)*Math.SQRT1_2}var c=t.invert(e,o);return i||(c[0]+=e>0?ba:-ba),c}:function(n,a){var e=n>0?-.5:.5,o=t.invert(n+e*r,a),i=o[0]-e*ba;return-ba>i?i+=2*ba:i>ba&&(i-=2*ba),o[0]=i,o}),a}var r=t(pa,0)[0]-t(-pa,0)[0];return n.raw=a,n}function rn(t,n){var a=i(t),r=i(n),e=Math.cos(n),o=Math.cos(t)*e,u=Math.sin(t)*e,M=Math.sin(r*n);t=Math.abs(Math.atan2(u,M)),n=h(o),Math.abs(t-pa)>ga&&(t%=pa);var s=en(t>ba/4?pa-t:t,n);return t>ba/4&&(M=s[0],s[0]=-s[1],s[1]=-M),s[0]*=a,s[1]*=-r,s}function en(t,n){if(n===pa)return[0,0];var a=Math.sin(n),r=a*a,e=r*r,o=1+e,i=1+3*e,u=1-e,s=h(1/Math.sqrt(o)),c=u+r*o*s,f=(1-a)/c,v=Math.sqrt(f),l=f*o,g=Math.sqrt(l),d=v*u;if(0===t)return[0,-(d+r*g)];var b=Math.cos(n),p=1/b,w=2*a*b,q=(-3*r+s*i)*w,m=(-c*b-(1-a)*q)/(c*c),y=.5*m/v,S=u*y-2*r*v*w,Q=r*o*m+f*i*w,R=-p*w,T=-p*Q,x=-2*p*S,E=4*t/ba;if(t>.222*ba||ba/4>n&&t>.175*ba){var k=(d+r*M(l*(1+e)-d*d))/(1+e);if(t>ba/4)return[k,k];var P=k,_=.5*k,z=50;k=.5*(_+P);do{var B=Math.sqrt(l-k*k),F=k*(x+R*B)+T*h(k/g)-E;if(!F)break;0>F?_=k:P=k,k=.5*(_+P)}while(Math.abs(P-_)>ga&&--z>0)}else{var A,k=ga,z=25;do{var G=k*k,B=M(l-G),j=x+R*B,F=k*j+T*h(k/g)-E,C=j+(T-R*G)/B;k-=A=B?F/C:0}while(Math.abs(A)>ga&&--z>0)}return[k,-d-r*M(l-k*k)]}function on(t,n){for(var a=0,r=1,e=.5,o=50;;){var i=e*e,h=Math.sqrt(e),u=Math.asin(1/Math.sqrt(1+i)),M=1-i+e*(1+i)*u,s=(1-h)/M,c=Math.sqrt(s),f=s*(1+i),v=c*(1-i),l=f-t*t,g=Math.sqrt(l),d=n+v+e*g;if(Math.abs(r-a)<da||0===--o||0===d)break;d>0?a=e:r=e,e=.5*(a+r)}if(!o)return null;var b=Math.asin(h),p=Math.cos(b),w=1/p,q=2*h*p,m=(-3*e+u*(1+3*i))*q,y=(-M*p-(1-h)*m)/(M*M),S=.5*y/c,Q=(1-i)*S-2*e*c*q,R=-2*w*Q,T=-w*q,x=-w*(e*(1+i)*y+s*(1+3*i)*q);return[ba/4*(t*(R+T*g)+x*Math.asin(t/Math.sqrt(f))),b]}function hn(t,n,a){if(!t){var r=un(n,1-a);return[[0,r[0]/r[1]],[1/r[1],0],[r[2]/r[1],0]]}var e=un(t,a);if(!n)return[[e[0],0],[e[1],0],[e[2],0]];var r=un(n,1-a),o=r[1]*r[1]+a*e[0]*e[0]*r[0]*r[0];return[[e[0]*r[2]/o,e[1]*e[2]*r[0]*r[1]/o],[e[1]*r[1]/o,-e[0]*e[2]*r[0]*r[2]/o],[e[2]*r[1]*r[2]/o,-a*e[0]*e[1]*r[0]/o]]}function un(t,n){var a,r,e,o,i;if(ga>n)return o=Math.sin(t),r=Math.cos(t),a=.25*n*(t-o*r),[o-a*r,r+a*o,1-.5*n*o*o,t-a];if(n>=1-ga)return a=.25*(1-n),r=b(t),o=g(t),e=1/r,i=r*d(t),[o+a*(i-t)/(r*r),e-a*o*e*(i-t),e+a*o*e*(i+t),2*Math.atan(Math.exp(t))-pa+a*(i-t)/r];var u=[1,0,0,0,0,0,0,0,0],s=[Math.sqrt(n),0,0,0,0,0,0,0,0],c=0;for(r=Math.sqrt(1-n),i=1;Math.abs(s[c]/u[c])>ga&&8>c;)a=u[c++],s[c]=.5*(a-r),u[c]=.5*(a+r),r=M(a*r),i*=2;e=i*u[c]*t;do o=s[c]*Math.sin(r=e)/u[c],e=.5*(h(o)+e);while(--c);return[Math.sin(e),o=Math.cos(e),o/Math.cos(e-r),e]}function Mn(t,n,a){var r=Math.abs(t),e=Math.abs(n),o=d(e);if(r){var h=1/Math.sin(r),u=1/(Math.tan(r)*Math.tan(r)),s=-(u+a*o*o*h*h-1+a),c=(a-1)*u,f=.5*(-s+Math.sqrt(s*s-4*c));return[sn(Math.atan(1/Math.sqrt(f)),a)*i(t),sn(Math.atan(M((f/u-1)/a)),1-a)*i(n)]}return[0,sn(Math.atan(o),1-a)*i(n)]}function sn(t,n){if(!n)return t;if(1===n)return Math.log(Math.tan(t/2+ba/4));for(var a=1,r=Math.sqrt(1-n),e=Math.sqrt(n),o=0;Math.abs(e)>ga;o++){if(t%ba){var i=Math.atan(r*Math.tan(t)/a);0>i&&(i+=ba),t+=i+~~(t/ba)*ba}else t+=t;e=(a+r)/2,r=Math.sqrt(a*r),e=((a=e)-r)/2}return t/(Math.pow(2,o)*a)}function cn(t,n){var a=(Math.SQRT2-1)/(Math.SQRT2+1),r=Math.sqrt(1-a*a),e=sn(pa,r*r),o=-1,i=Math.log(Math.tan(ba/4+Math.abs(n)/2)),h=Math.exp(o*i)/Math.sqrt(a),u=fn(h*Math.cos(o*t),h*Math.sin(o*t)),M=Mn(u[0],u[1],r*r);return[-M[1],(n>=0?1:-1)*(.5*e-M[0])]}function fn(t,n){var a=t*t,r=n+1,e=1-a-n*n;return[.5*((t>=0?pa:-pa)-Math.atan2(e,2*t)),-.25*Math.log(e*e+4*a)+.5*Math.log(r*r+a)]}function vn(t,n){var a=n[0]*n[0]+n[1]*n[1];return[(t[0]*n[0]+t[1]*n[1])/a,(t[1]*n[0]-t[0]*n[1])/a]}function ln(t){function n(t,n){var o=e(t,n);t=o[0],n=o[1];var i=Math.sin(n),h=Math.cos(n),M=Math.cos(t),s=u(a*i+r*h*M),c=Math.sin(s),f=Math.abs(c)>ga?s/c:1;return[f*r*Math.sin(t),(Math.abs(t)>pa?f:-f)*(a*h-r*i*M)]}var a=Math.sin(t),r=Math.cos(t),e=gn(t);return e.invert=gn(-t),n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),o=-Math.sin(r),i=Math.cos(r),h=r*i,u=-n*o,s=r*a,c=M(h*h+u*u-s*s),f=Math.atan2(h*s+u*c,u*s-h*c),v=(r>pa?-1:1)*Math.atan2(t*o,r*Math.cos(f)*i+n*Math.sin(f)*o);return e.invert(v,f)},n}function gn(t){var n=Math.sin(t),a=Math.cos(t);return function(t,r){var e=Math.cos(r),o=Math.cos(t)*e,i=Math.sin(t)*e,u=Math.sin(r);return[Math.atan2(i,o*a-u*n),h(u*a+o*n)]}}function dn(){var t=0,n=Sa(ln),a=n(t),r=a.rotate,e=a.stream,o=d3.geo.circle();return a.parallel=function(r){if(!arguments.length)return 180*(t/ba);var e=a.rotate();return n(t=r*ba/180).rotate(e)},a.rotate=function(n){return arguments.length?(r.call(a,[n[0],n[1]-180*(t/ba)]),o.origin([-n[0],-n[1]]),a):(n=r.call(a),n[1]+=180*(t/ba),n)},a.stream=function(t){return t=e(t),t.sphere=function(){t.polygonStart();var n,a=.01,r=o.angle(90-a)().coordinates[0],e=r.length-1,i=-1;for(t.lineStart();++i<e;)t.point((n=r[i])[0],n[1]);for(t.lineEnd(),r=o.angle(90+a)().coordinates[0],e=r.length-1,t.lineStart();--i>=0;)t.point((n=r[i])[0],n[1]);t.lineEnd(),t.polygonEnd()},t},a}function bn(t,n){function a(a,r){var e=Ga(a/n,r);return e[0]*=t,e}return arguments.length<2&&(n=t),1===n?Ga:1/0===n?wn:(a.invert=function(a,r){var e=Ga.invert(a/t,r);return e[0]*=n,e},a)}function pn(){var t=2,n=Sa(bn),a=n(t);return a.coefficient=function(a){return arguments.length?n(t=+a):t},a}function wn(t,n){return[t*Math.cos(n)/Math.cos(n/=2),2*Math.sin(n)]}function qn(t,n){for(var a,r=Math.sin(n)*(0>n?2.43763:2.67595),e=0;20>e&&(n-=a=(n+Math.sin(n)-r)/(1+Math.cos(n)),!(Math.abs(a)<ga));e++);return[.85*t*Math.cos(n*=.5),Math.sin(n)*(0>n?1.93052:1.75859)]}function mn(t){function n(n,s){var c,f=Math.abs(s);if(f>r){var v=Math.min(t-1,Math.max(0,Math.floor((n+ba)/M)));n+=ba*(t-1)/t-v*M,c=d3.geo.collignon.raw(n,f),c[0]=c[0]*e/o-e*(t-1)/(2*t)+v*e/t,c[1]=i+4*(c[1]-h)*u/e,0>s&&(c[1]=-c[1])}else c=a(n,s);return c[0]/=2,c}var a=d3.geo.cylindricalEqualArea.raw(0),r=ja*ba/180,e=2*ba,o=d3.geo.collignon.raw(ba,r)[0]-d3.geo.collignon.raw(-ba,r)[0],i=a(0,r)[1],h=d3.geo.collignon.raw(0,r)[1],u=d3.geo.collignon.raw(0,pa)[1]-h,M=2*ba/t;return n.invert=function(n,r){n*=2;var s=Math.abs(r);if(s>i){var c=Math.min(t-1,Math.max(0,Math.floor((n+ba)/M)));n=(n+ba*(t-1)/t-c*M)*o/e;var f=d3.geo.collignon.raw.invert(n,.25*(s-i)*e/u+h);return f[0]-=ba*(t-1)/t-c*M,0>r&&(f[1]=-f[1]),f}return a.invert(n,r)},n}function yn(){function t(){var t=180/n;return{type:"Polygon",coordinates:[d3.range(-180,180+t/2,t).map(function(t,n){return[t,1&n?90-1e-6:ja]}).concat(d3.range(180,-180-t/2,-t).map(function(t,n){return[t,1&n?-90+1e-6:-ja]}))]}}var n=2,a=Sa(mn),r=a(n),e=r.stream;return r.lobes=function(t){return arguments.length?a(n=+t):n},r.stream=function(n){var a=r.rotate(),o=e(n),i=(r.rotate([0,0]),e(n));return r.rotate(a),o.sphere=function(){d3.geo.stream(t(),i)},o},r}function Sn(t){function n(n,e){var h,u,f=1-Math.sin(e);if(f&&2>f){var v,l=pa-e,g=25;do{var d=Math.sin(l),b=Math.cos(l),p=o+Math.atan2(d,r-b),w=1+c-2*r*b;l-=v=(l-s*o-r*d+w*p-.5*f*a)/(2*r*d*p)}while(Math.abs(v)>da&&--g>0);h=i*Math.sqrt(w),u=n*p/ba}else h=i*(t+f),u=n*o/ba;return[h*Math.sin(u),M-h*Math.cos(u)]}var a,r=1+t,e=Math.sin(1/r),o=h(e),i=2*Math.sqrt(ba/(a=ba+4*o*r)),M=.5*i*(r+Math.sqrt(t*(2+t))),s=t*t,c=r*r;return n.invert=function(t,n){var e=t*t+(n-=M)*n,f=(1+c-e/(i*i))/(2*r),v=u(f),l=Math.sin(v),g=o+Math.atan2(l,r-f);return[h(t/Math.sqrt(e))*ba/g,h(1-2*(v-s*o-r*l+(1+c-2*r*f)*g)/a)]},n}function Qn(){var t=1,n=Sa(Sn),a=n(t);return a.ratio=function(a){return arguments.length?n(t=+a):t},a}function Rn(t,n){return n>-Ca?(t=xa(t,n),t[1]+=Da,t):E(t,n)}function Tn(t,n){return Math.abs(n)>Ca?(t=xa(t,n),t[1]-=n>0?Da:-Da,t):E(t,n)}function xn(t,n){return[3*t/(2*ba)*Math.sqrt(ba*ba/3-n*n),n]}function En(t){function n(n,a){if(Math.abs(Math.abs(a)-pa)<ga)return[0,0>a?-2:2];var r=Math.sin(a),e=Math.pow((1+r)/(1-r),t/2),o=.5*(e+1/e)+Math.cos(n*=t);return[2*Math.sin(n)/o,(e-1/e)/o]}return n.invert=function(n,a){var r=Math.abs(a);if(Math.abs(r-2)<ga)return n?null:[0,i(a)*pa];if(r>2)return null;n/=2,a/=2;var e=n*n,o=a*a,u=2*a/(1+e+o);return u=Math.pow((1+u)/(1-u),1/t),[Math.atan2(2*n,1-e-o)/t,h((u-1)/(u+1))]},n}function kn(){var t=.5,n=Sa(En),a=n(t);return a.spacing=function(a){return arguments.length?n(t=+a):t},a}function Pn(t,n){return[t*(1+Math.sqrt(Math.cos(n)))/2,n/(Math.cos(n/2)*Math.cos(t/6))]}function _n(t,n){var a=t*t,r=n*n;return[t*(.975534+r*(-.119161+a*-.0143059+r*-.0547009)),n*(1.00384+a*(.0802894+r*-.02855+199025e-9*a)+r*(.0998909+r*-.0491032))]}function zn(t,n){return[Math.sin(t)/Math.cos(n),Math.tan(n)*Math.cos(t)]}function Bn(t){function n(n,e){var o=e-t,i=Math.abs(o)<ga?n*a:Math.abs(i=ba/4+e/2)<ga||Math.abs(Math.abs(i)-pa)<ga?0:n*o/Math.log(Math.tan(i)/r);return[i,o]}var a=Math.cos(t),r=Math.tan(ba/4+t/2);return n.invert=function(n,e){var o,i=e+t;return[Math.abs(e)<ga?n/a:Math.abs(o=ba/4+i/2)<ga||Math.abs(Math.abs(o)-pa)<ga?0:n*Math.log(Math.tan(o)/r)/e,i]},n}function Fn(t,n){return[t,1.25*Math.log(Math.tan(ba/4+.4*n))]}function An(t){function n(n,r){for(var e,o=Math.cos(r),i=2/(1+o*Math.cos(n)),h=i*o*Math.sin(n),u=i*Math.sin(r),M=a,s=t[M],c=s[0],f=s[1];--M>=0;)s=t[M],c=s[0]+h*(e=c)-u*f,f=s[1]+h*f+u*e;return c=h*(e=c)-u*f,f=h*f+u*e,[c,f]}var a=t.length-1;return n.invert=function(n,r){var e=20,o=n,i=r;do{for(var u,M=a,s=t[M],c=s[0],f=s[1],v=0,l=0;--M>=0;)s=t[M],v=c+o*(u=v)-i*l,l=f+o*l+i*u,c=s[0]+o*(u=c)-i*f,f=s[1]+o*f+i*u;v=c+o*(u=v)-i*l,l=f+o*l+i*u,c=o*(u=c)-i*f-n,f=o*f+i*u-r;var g,d,b=v*v+l*l;o-=g=(c*v+f*l)/b,i-=d=(f*v-c*l)/b}while(Math.abs(g)+Math.abs(d)>ga*ga&&--e>0);if(e){var p=Math.sqrt(o*o+i*i),w=2*Math.atan(.5*p),q=Math.sin(w);return[Math.atan2(o*q,p*Math.cos(w)),p?h(i*q/p):0]}},n}function Gn(){var t=La.miller,n=Sa(An),a=n(t);return a.coefficients=function(a){return arguments.length?n(t="string"==typeof a?La[a]:a):t},a}function jn(t,n){var a=Math.sqrt(6),r=Math.sqrt(7),e=Math.asin(7*Math.sin(n)/(3*a));return[a*t*(2*Math.cos(2*e/3)-1)/r,9*Math.sin(e/3)/r]}function Cn(t,n){for(var a,r=(1+Math.SQRT1_2)*Math.sin(n),e=n,o=0;25>o&&(e-=a=(Math.sin(e/2)+Math.sin(e)-r)/(.5*Math.cos(e/2)+Math.cos(e)),!(Math.abs(a)<ga));o++);return[t*(1+2*Math.cos(e)/Math.cos(e/2))/(3*Math.SQRT2),2*Math.sqrt(3)*Math.sin(e/2)/Math.sqrt(2+Math.SQRT2)]}function Dn(t,n){for(var a,r=Math.sqrt(6/(4+ba)),e=(1+ba/4)*Math.sin(n),o=n/2,i=0;25>i&&(o-=a=(o/2+Math.sin(o)-e)/(.5+Math.cos(o)),!(Math.abs(a)<ga));i++);return[r*(.5+Math.cos(o))*t/1.5,r*o]}function Ln(t,n){var a=n*n,r=a*a;return[t*(.8707-.131979*a+r*(-.013791+r*(.003971*a-.001529*r))),n*(1.007226+a*(.015085+r*(-.044475+.028874*a-.005916*r)))]}function On(t,n){return[t*(1+Math.cos(n))/2,2*(n-Math.tan(n/2))]}function Hn(t,n){var a=n*n;return[t,n*(Oa+a*a*(Ha+a*(Ia+Ja*a)))]}function In(t,n){if(Math.abs(n)<ga)return[t,0];var a=Math.tan(n),r=t*Math.sin(n);return[Math.sin(r)/a,n+(1-Math.cos(r))/a]}function Jn(t){function n(n,r){var e=a?Math.tan(n*a/2)/a:n/2;if(!r)return[2*e,-t];var o=2*Math.atan(e*Math.sin(r)),i=1/Math.tan(r);return[Math.sin(o)*i,r+(1-Math.cos(o))*i-t]}var a=Math.sin(t);return n.invert=function(n,r){if(Math.abs(r+=t)<ga)return[a?2*Math.atan(a*n/2)/a:n,0];var e,o=n*n+r*r,i=0,M=10;do{var s=Math.tan(i),c=1/Math.cos(i),f=o-2*r*i+i*i;i-=e=(s*f+2*(i-r))/(2+f*c*c+2*(i-r)*s)}while(Math.abs(e)>ga&&--M>0);var v=n*(s=Math.tan(i)),l=Math.tan(Math.abs(r)<Math.abs(i+1/s)?.5*h(v):.5*u(v)+ba/4)/Math.sin(i);return[a?2*Math.atan(a*l)/a:2*l,i]},n}function Kn(t,n){var a,r=Math.min(18,36*Math.abs(n)/ba),e=Math.floor(r),o=r-e,i=(a=Ya[e])[0],h=a[1],u=(a=Ya[++e])[0],M=a[1],s=(a=Ya[Math.min(19,++e)])[0],c=a[1];return[t*(u+o*(s-i)/2+o*o*(s-2*u+i)/2),(n>0?pa:-pa)*(M+o*(c-h)/2+o*o*(c-2*M+h)/2)]}function Nn(t){function n(n,a){var r=Math.cos(a),e=(t-1)/(t-r*Math.cos(n));return[e*r*Math.sin(n),e*Math.sin(a)]}return n.invert=function(n,a){var r=n*n+a*a,e=Math.sqrt(r),o=(t-Math.sqrt(1-r*(t+1)/(t-1)))/((t-1)/e+e/(t-1));return[Math.atan2(n*o,e*Math.sqrt(1-o*o)),e?h(a*o/e):0]},n}function Un(t,n){function a(n,a){var i=r(n,a),h=i[1],u=h*o/(t-1)+e;return[i[0]*e/u,h/u]}var r=Nn(t);if(!n)return r;var e=Math.cos(n),o=Math.sin(n);return a.invert=function(n,a){var i=(t-1)/(t-1-a*o);return r.invert(i*n,i*a*e)},a}function Vn(){var t=1.4,n=0,a=Sa(Un),r=a(t,n);return r.distance=function(r){return arguments.length?a(t=+r,n):t},r.tilt=function(r){return arguments.length?a(t,n=r*ba/180):180*n/ba},r}function Wn(t,n){var a=Math.tan(n/2),r=Math.sin(ba/4*a);return[t*(.74482-.34588*r*r),1.70711*a]}function Xn(t){function n(n,o){var i=u(Math.cos(o)*Math.cos(n-a)),h=u(Math.cos(o)*Math.cos(n-r)),s=0>o?-1:1;return i*=i,h*=h,[(i-h)/(2*t),s*M(4*e*h-(e-i+h)*(e-i+h))/(2*t)]}if(!t)return d3.geo.azimuthalEquidistant.raw;var a=-t/2,r=-a,e=t*t,o=Math.tan(r),i=.5/Math.sin(r);return n.invert=function(t,n){var e,h,M=n*n,s=Math.cos(Math.sqrt(M+(e=t+a)*e)),c=Math.cos(Math.sqrt(M+(e=t+r)*e));return[Math.atan2(h=s-c,e=(s+c)*o),(0>n?-1:1)*u(Math.sqrt(e*e+h*h)*i)]},n}function Yn(){var t=[[0,0],[0,0]],n=Sa(Xn),a=n(0),r=a.rotate;return delete a.rotate,a.points=function(a){if(!arguments.length)return t;t=a;var e=d3.geo.interpolate(a[0],a[1]),o=e(.5),i=d3.geo.rotation([-o[0],-o[1]])(a[0]),u=.5*e.distance,M=-h(Math.sin(i[1]*qa)/Math.sin(u));return i[0]>0&&(M=ba-M),r.call(i,[-o[0],-o[1],-M*ma]),n(2*u)},a}function Zn(t){function n(t,n){var r=d3.geo.gnomonic.raw(t,n);return r[0]*=a,r}var a=Math.cos(t);return n.invert=function(t,n){return d3.geo.gnomonic.raw.invert(t/a,n)},n}function $n(){var t=[[0,0],[0,0]],n=Sa(Zn),a=n(0),r=a.rotate;return delete a.rotate,a.points=function(a){if(!arguments.length)return t;t=a;var e=d3.geo.interpolate(a[0],a[1]),o=e(.5),i=d3.geo.rotation([-o[0],-o[1]])(a[0]),u=.5*e.distance,M=-h(Math.sin(i[1]*qa)/Math.sin(u));return i[0]>0&&(M=ba-M),r.call(i,[-o[0],-o[1],-M*ma]),n(u)},a}function ta(t,n){if(Math.abs(n)<ga)return[t,0];var a=Math.abs(n/pa),r=h(a);if(Math.abs(t)<ga||Math.abs(Math.abs(n)-pa)<ga)return[0,i(n)*ba*Math.tan(r/2)];var e=Math.cos(r),o=Math.abs(ba/t-t/ba)/2,u=o*o,M=e/(a+e-1),s=M*(2/a-1),c=s*s,f=c+u,v=M-c,l=u+M;return[i(t)*ba*(o*v+Math.sqrt(u*v*v-f*(M*M-c)))/f,i(n)*ba*(s*l-o*Math.sqrt((u+1)*f-l*l))/f]}function na(t,n){if(Math.abs(n)<ga)return[t,0];var a=Math.abs(n/pa),r=h(a);if(Math.abs(t)<ga||Math.abs(Math.abs(n)-pa)<ga)return[0,i(n)*ba*Math.tan(r/2)];var e=Math.cos(r),o=Math.abs(ba/t-t/ba)/2,u=o*o,s=e*(Math.sqrt(1+u)-o*e)/(1+u*a*a);return[i(t)*ba*s,i(n)*ba*M(1-s*(2*o+s))]}function aa(t,n){if(Math.abs(n)<ga)return[t,0];var a=n/pa,r=h(a);if(Math.abs(t)<ga||Math.abs(Math.abs(n)-pa)<ga)return[0,ba*Math.tan(r/2)];var e=(ba/t-t/ba)/2,o=a/(1+Math.cos(r));return[ba*(i(t)*M(e*e+1-o*o)-e),ba*o]}function ra(t,n){if(!n)return[t,0];var a=Math.abs(n);if(!t||a===pa)return[0,n];var r=a/pa,e=r*r,o=(8*r-e*(e+2)-5)/(2*e*(r-1)),h=o*o,u=r*o,s=e+h+2*u,c=r+3*o,f=t/pa,v=f+1/f,l=i(Math.abs(t)-pa)*Math.sqrt(v*v-4),g=l*l,d=s*(e+h*g-1)+(1-e)*(e*(c*c+4*h)+12*u*h+4*h*h),b=(l*(s+h-1)+2*M(d))/(4*s+g);return[i(t)*pa*b,i(n)*pa*M(1+l*Math.abs(b)-b*b)]}function ea(t,n){return[t*Math.sqrt(1-3*n*n/(ba*ba)),n]}function oa(t,n){var a=.90631*Math.sin(n),r=Math.sqrt(1-a*a),e=Math.sqrt(2/(1+r*Math.cos(t/=3)));return[2.66723*r*e*Math.sin(t),1.24104*a*e]}function ia(t,n){var a=Math.cos(n),r=Math.cos(t)*a,e=1-r,o=Math.cos(t=Math.atan2(Math.sin(t)*a,-Math.sin(n))),i=Math.sin(t);return a=M(1-r*r),[i*a-o*e,-o*a-i*e]}function ha(t,n){var a=f(t,n);return[(a[0]+t/pa)/2,(a[1]+n)/2]}d3.geo.project=function(t,a){var r=a.stream;if(!r)throw new Error("not yet supported");return(t&&ua.hasOwnProperty(t.type)?ua[t.type]:n)(t,r)};var ua={Feature:t,FeatureCollection:function(n,a){return{type:"FeatureCollection",features:n.features.map(function(n){return t(n,a)})}}},Ma=[],sa=[],ca={point:function(t,n){Ma.push([t,n])},result:function(){var t=Ma.length?Ma.length<2?{type:"Point",coordinates:Ma[0]}:{type:"MultiPoint",coordinates:Ma}:null;return Ma=[],t}},fa={lineStart:a,point:function(t,n){Ma.push([t,n])},lineEnd:function(){Ma.length&&(sa.push(Ma),Ma=[])},result:function(){var t=sa.length?sa.length<2?{type:"LineString",coordinates:sa[0]}:{type:"MultiLineString",coordinates:sa}:null;return sa=[],t}},va={polygonStart:a,lineStart:a,point:function(t,n){Ma.push([t,n])},lineEnd:function(){var t=Ma.length;if(t){do Ma.push(Ma[0].slice());while(++t<4);sa.push(Ma),Ma=[]}},polygonEnd:a,result:function(){if(!sa.length)return null;var t=[],n=[];return sa.forEach(function(a){r(a)?t.push([a]):n.push(a)}),n.forEach(function(n){var a=n[0];t.some(function(t){return e(t[0],a)?(t.push(n),!0):void 0})||t.push([n])}),sa=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},la={Point:ca,MultiPoint:ca,LineString:fa,MultiLineString:fa,Polygon:va,MultiPolygon:va,Sphere:va},ga=1e-6,da=ga*ga,ba=Math.PI,pa=ba/2,wa=Math.sqrt(ba),qa=ba/180,ma=180/ba,ya=d3.geo.projection,Sa=d3.geo.projectionMutator;d3.geo.interrupt=function(t){function n(n,a){for(var r=0>a?-1:1,e=h[+(0>a)],o=0,i=e.length-1;i>o&&n>e[o][2][0];++o);var u=t(n-e[o][1][0],a);return u[0]+=t(e[o][1][0],r*a>r*e[o][0][1]?e[o][0][1]:a)[0],u}function a(){i=h.map(function(n){return n.map(function(n){var a,r=t(n[0][0],n[0][1])[0],e=t(n[2][0],n[2][1])[0],o=t(n[1][0],n[0][1])[1],i=t(n[1][0],n[1][1])[1];return o>i&&(a=o,o=i,i=a),[[r,o],[e,i]]})})}function r(){for(var t=1e-6,n=[],a=0,r=h[0].length;r>a;++a){var o=h[0][a],i=180*o[0][0]/ba,u=180*o[0][1]/ba,M=180*o[1][1]/ba,s=180*o[2][0]/ba,c=180*o[2][1]/ba;n.push(e([[i+t,u+t],[i+t,M-t],[s-t,M-t],[s-t,c+t]],30))}for(var a=h[1].length-1;a>=0;--a){var o=h[1][a],i=180*o[0][0]/ba,u=180*o[0][1]/ba,M=180*o[1][1]/ba,s=180*o[2][0]/ba,c=180*o[2][1]/ba;n.push(e([[s-t,c-t],[s-t,M+t],[i+t,M+t],[i+t,u-t]],30))}return{type:"Polygon",coordinates:[d3.merge(n)]}}function e(t,n){for(var a,r,e,o=-1,i=t.length,h=t[0],u=[];++o<i;){a=t[o],r=(a[0]-h[0])/n,e=(a[1]-h[1])/n;for(var M=0;n>M;++M)u.push([h[0]+M*r,h[1]+M*e]);h=a}return u.push(a),u}function o(t,n){return Math.abs(t[0]-n[0])<ga&&Math.abs(t[1]-n[1])<ga}var i,h=[[[[-ba,0],[0,pa],[ba,0]]],[[[-ba,0],[0,-pa],[ba,0]]]];t.invert&&(n.invert=function(a,r){for(var e=i[+(0>r)],u=h[+(0>r)],M=0,s=e.length;s>M;++M){var c=e[M];if(c[0][0]<=a&&a<c[1][0]&&c[0][1]<=r&&r<c[1][1]){var f=t.invert(a-t(u[M][1][0],0)[0],r);return f[0]+=u[M][1][0],o(n(f[0],f[1]),[a,r])?f:null}}});var u=d3.geo.projection(n),M=u.stream;return u.stream=function(t){var n=u.rotate(),a=M(t),e=(u.rotate([0,0]),M(t));return u.rotate(n),a.sphere=function(){d3.geo.stream(r(),e)},a},u.lobes=function(t){return arguments.length?(h=t.map(function(t){return t.map(function(t){return[[t[0][0]*ba/180,t[0][1]*ba/180],[t[1][0]*ba/180,t[1][1]*ba/180],[t[2][0]*ba/180,t[2][1]*ba/180]]})}),a(),u):h.map(function(t){return t.map(function(t){return[[180*t[0][0]/ba,180*t[0][1]/ba],[180*t[1][0]/ba,180*t[1][1]/ba],[180*t[2][0]/ba,180*t[2][1]/ba]]})})},u},(d3.geo.airy=c).raw=s,f.invert=function(t,n){if(!(t*t+4*n*n>ba*ba+ga)){var a=t,r=n,e=25;do{var o,i=Math.sin(a),h=Math.sin(a/2),M=Math.cos(a/2),s=Math.sin(r),c=Math.cos(r),f=Math.sin(2*r),v=s*s,l=c*c,g=h*h,d=1-l*M*M,b=d?u(c*M)*Math.sqrt(o=1/d):o=0,p=2*b*c*h-t,w=b*s-n,q=o*(l*g+b*c*M*v),m=o*(.5*i*f-2*b*s*h),y=.25*o*(f*h-b*s*l*i),S=o*(v*M+b*g*c),Q=m*y-S*q;if(!Q)break;var R=(w*m-p*S)/Q,T=(p*y-w*q)/Q;a-=R,r-=T}while((Math.abs(R)>ga||Math.abs(T)>ga)&&--e>0);return[a,r]}},(d3.geo.aitoff=function(){return ya(f)}).raw=f,(d3.geo.armadillo=l).raw=v,q.invert=function(t,n){if(t*=3/8,n*=3/8,!t&&Math.abs(n)>1)return null;var a=t*t,r=n*n,e=1+a+r,o=Math.sqrt(.5*(e-Math.sqrt(e*e-4*n*n))),u=h(o)/3,M=o?w(Math.abs(n/o))/3:p(Math.abs(t))/3,s=Math.cos(u),c=b(M),f=c*c-s*s;return[2*i(t)*Math.atan2(d(M)*s,.25-f),2*i(n)*Math.atan2(c*Math.sin(u),.25+f)]},(d3.geo.august=function(){return ya(q)}).raw=q;var Qa=Math.log(1+Math.SQRT2);m.invert=function(t,n){if((r=Math.abs(n))<Qa)return[t,2*Math.atan(Math.exp(n))-pa];var a,r,e=Math.sqrt(8),o=ba/4,h=25;do{var u=Math.cos(o/2),M=Math.tan(o/2);o-=a=(e*(o-ba/4)-Math.log(M)-r)/(e-.5*u*u/M)}while(Math.abs(a)>da&&--h>0);return[t/(Math.cos(o)*(e-1/Math.sin(o))),i(n)*o]},(d3.geo.baker=function(){return ya(m)
}).raw=m;var Ra=d3.geo.azimuthalEquidistant.raw;(d3.geo.berghaus=S).raw=y;var Ta=Q(ba),xa=R(Math.SQRT2/pa,Math.SQRT2,ba);(d3.geo.mollweide=function(){return ya(xa)}).raw=xa,T.invert=function(t,n){var a,r,e=2.00276,o=e*n,i=0>n?-ba/4:ba/4,h=25;do r=o-Math.SQRT2*Math.sin(i),i-=a=(Math.sin(2*i)+2*i-ba*Math.sin(r))/(2*Math.cos(2*i)+2+ba*Math.cos(r)*Math.SQRT2*Math.cos(i));while(Math.abs(a)>ga&&--h>0);return r=o-Math.SQRT2*Math.sin(i),[t*(1/Math.cos(r)+1.11072/Math.cos(i))/e,r]},(d3.geo.boggs=function(){return ya(T)}).raw=T,E.invert=function(t,n){return[t/Math.cos(n),n]},(d3.geo.sinusoidal=function(){return ya(E)}).raw=E,(d3.geo.bonne=function(){return x(k).parallel(45)}).raw=k;var Ea=R(1,4/ba,ba);(d3.geo.bromley=function(){return ya(Ea)}).raw=Ea,(d3.geo.chamberlin=_).raw=P,G.invert=function(t,n){var a=(a=n/wa-1)*a;return[a>0?t*Math.sqrt(ba/a)/2:0,h(1-a)]},(d3.geo.collignon=function(){return ya(G)}).raw=G,(d3.geo.craig=function(){return x(j)}).raw=j,C.invert=function(t,n){var a=Math.sqrt(3),r=3*h(n/(a*wa));return[wa*t/(a*(2*Math.cos(2*r/3)-1)),r]},(d3.geo.craster=function(){return ya(C)}).raw=C,(d3.geo.cylindricalEqualArea=function(){return x(D)}).raw=D,(d3.geo.cylindricalStereographic=function(){return x(L)}).raw=L,O.invert=function(t,n){var a=Math.sqrt(8/(3*ba)),r=n/a;return[t/(a*(1-Math.abs(r)/ba)),r]},(d3.geo.eckert1=function(){return ya(O)}).raw=O,H.invert=function(t,n){var a=2-Math.abs(n)/Math.sqrt(2*ba/3);return[t*Math.sqrt(6*ba)/(2*a),i(n)*h((4-a*a)/3)]},(d3.geo.eckert2=function(){return ya(H)}).raw=H,I.invert=function(t,n){var a=Math.sqrt(ba*(4+ba))/2;return[t*a/(1+M(1-n*n*(4+ba)/(4*ba))),n*a/2]},(d3.geo.eckert3=function(){return ya(I)}).raw=I,J.invert=function(t,n){var a=.5*n*Math.sqrt((4+ba)/ba),r=h(a),e=Math.cos(r);return[t/(2/Math.sqrt(ba*(4+ba))*(1+e)),h((r+a*(e+2))/(2+pa))]},(d3.geo.eckert4=function(){return ya(J)}).raw=J,K.invert=function(t,n){var a=Math.sqrt(2+ba),r=n*a/2;return[a*t/(1+Math.cos(r)),r]},(d3.geo.eckert5=function(){return ya(K)}).raw=K,N.invert=function(t,n){var a=1+pa,r=Math.sqrt(a/2);return[2*t*r/(1+Math.cos(n*=r)),h((n+Math.sin(n))/a)]},(d3.geo.eckert6=function(){return ya(N)}).raw=N,U.invert=function(t,n){var a=d3.geo.august.raw.invert(t/1.2,1.065*n);if(!a)return null;var r=a[0],e=a[1],o=20;t/=ka,n/=ka;do{var i=r/2,h=e/2,u=Math.sin(i),M=Math.cos(i),s=Math.sin(h),c=Math.cos(h),f=Math.cos(e),v=Math.sqrt(f),l=s/(c+Math.SQRT2*M*v),g=l*l,d=Math.sqrt(2/(1+g)),b=Math.SQRT2*c+(M+u)*v,p=Math.SQRT2*c+(M-u)*v,w=b/p,q=Math.sqrt(w),m=q-1/q,y=q+1/q,S=d*m-2*Math.log(q)-t,Q=d*l*y-2*Math.atan(l)-n,R=s&&Math.SQRT1_2*v*u*g/s,T=(Math.SQRT2*M*c+v)/(2*(c+Math.SQRT2*M*v)*(c+Math.SQRT2*M*v)*v),x=-.5*l*d*d*d,E=x*R,k=x*T,P=(P=2*c+Math.SQRT2*v*(M-u))*P*q,_=(Math.SQRT2*M*c*v+f)/P,z=-(Math.SQRT2*u*s)/(v*P),B=m*E-2*_/q+d*(_+_/w),F=m*k-2*z/q+d*(z+z/w),A=l*y*E-2*R/(1+g)+d*y*R+d*l*(_-_/w),G=l*y*k-2*T/(1+g)+d*y*T+d*l*(z-z/w),j=F*A-G*B;if(!j)break;var C=(Q*F-S*G)/j,D=(S*A-Q*B)/j;r-=C,e=Math.max(-pa,Math.min(pa,e-D))}while((Math.abs(C)>ga||Math.abs(D)>ga)&&--o>0);return Math.abs(Math.abs(e)-pa)<ga?[0,e]:o&&[r,e]};var ka=3+2*Math.SQRT2;(d3.geo.eisenlohr=function(){return ya(U)}).raw=U,V.invert=function(t,n){var a=n/(1+Pa);return[t?t/(Pa*M(1-a*a)):0,2*Math.atan(a)]};var Pa=Math.cos(35*qa);(d3.geo.fahey=function(){return ya(V)}).raw=V,W.invert=function(t,n){var a=Math.atan(n/wa),r=Math.cos(a),e=2*a;return[.5*t*wa/(Math.cos(e)*r*r),e]},(d3.geo.foucaut=function(){return ya(W)}).raw=W,d3.geo.gilbert=function(t){function n(n){return t([.5*n[0],h(Math.tan(.5*n[1]*qa))*ma])}var a=d3.geo.equirectangular().scale(ma).translate([0,0]);return t.invert&&(n.invert=function(n){return n=t.invert(n),n[0]*=2,n[1]=2*Math.atan(Math.sin(n[1]*qa))*ma,n}),n.stream=function(n){n=t.stream(n);var r=a.stream({point:function(t,a){n.point(.5*t,h(Math.tan(.5*-a*qa))*ma)},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}});return r.sphere=function(){n.sphere()},r.valid=!1,r},n};var _a=d3.geo.azimuthalEquidistant.raw;(d3.geo.gingery=Z).raw=X;var za=tn(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);(d3.geo.ginzburg4=function(){return ya(za)}).raw=za;var Ba=tn(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);(d3.geo.ginzburg5=function(){return ya(Ba)}).raw=Ba;var Fa=tn(5/6*ba,-.62636,-.0344,0,1.3493,-.05524,0,.045);(d3.geo.ginzburg6=function(){return ya(Fa)}).raw=Fa,nn.invert=function(t,n){var a,r=t,e=n,o=50;do{var i=e*e;e-=a=(e*(1+i/12)-n)/(1+i/4)}while(Math.abs(a)>ga&&--o>0);o=50,t/=1-.162388*i;do{var h=(h=r*r)*h;r-=a=(r*(.87-952426e-9*h)-t)/(.87-.00476213*h)}while(Math.abs(a)>ga&&--o>0);return[r,e]},(d3.geo.ginzburg8=function(){return ya(nn)}).raw=nn;var Aa=tn(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);(d3.geo.ginzburg9=function(){return ya(Aa)}).raw=Aa,rn.invert=function(t,n){var a=i(t),r=i(n),e=-a*t,o=-r*n,u=1>o/e,M=on(u?o:e,u?e:o),s=M[0],c=M[1];u&&(s=-pa-s);var f=Math.cos(c),t=Math.cos(s)*f,n=Math.sin(s)*f,v=Math.sin(c);return[a*(Math.atan2(n,-v)+ba),r*h(t)]},d3.geo.gringorten=an(rn),cn.invert=function(t,n){var a=(Math.SQRT2-1)/(Math.SQRT2+1),r=Math.sqrt(1-a*a),e=sn(pa,r*r),o=-1,i=hn(.5*e-n,-t,r*r),h=vn(i[0],i[1]),u=Math.atan2(h[1],h[0])/o;return[u,2*Math.atan(Math.exp(.5/o*Math.log(a*h[0]*h[0]+a*h[1]*h[1])))-pa]},d3.geo.guyou=an(cn),(d3.geo.hammerRetroazimuthal=dn).raw=ln;var Ga=d3.geo.azimuthalEqualArea.raw;wn.invert=function(t,n){var a=2*h(n/2);return[t*Math.cos(a/2)/Math.cos(a),a]},(d3.geo.hammer=pn).raw=bn,qn.invert=function(t,n){var a=Math.abs(a=n*(0>n?.5179951515653813:.5686373742600607))>1-ga?a>0?pa:-pa:h(a);return[1.1764705882352942*t/Math.cos(a),Math.abs(a=((a+=a)+Math.sin(a))*(0>n?.4102345310814193:.3736990601468637))>1-ga?a>0?pa:-pa:h(a)]},(d3.geo.hatano=function(){return ya(qn)}).raw=qn;var ja=41+48/36+37/3600;(d3.geo.healpix=yn).raw=mn,(d3.geo.hill=Qn).raw=Sn;var Ca=.7109889596207567,Da=.0528035274542;Rn.invert=function(t,n){return n>-Ca?xa.invert(t,n-Da):E.invert(t,n)},(d3.geo.sinuMollweide=function(){return ya(Rn).rotate([-20,-55])}).raw=Rn,Tn.invert=function(t,n){return Math.abs(n)>Ca?xa.invert(t,n+(n>0?Da:-Da)):E.invert(t,n)},(d3.geo.homolosine=function(){return ya(Tn)}).raw=Tn,xn.invert=function(t,n){return[2/3*ba*t/Math.sqrt(ba*ba/3-n*n),n]},(d3.geo.kavrayskiy7=function(){return ya(xn)}).raw=xn,(d3.geo.lagrange=kn).raw=En,Pn.invert=function(t,n){var a=Math.abs(t),r=Math.abs(n),e=ba/Math.SQRT2,o=ga,i=pa;e>r?i*=r/e:o+=6*u(e/r);for(var h=0;25>h;h++){var s=Math.sin(i),c=M(Math.cos(i)),f=Math.sin(i/2),v=Math.cos(i/2),l=Math.sin(o/6),g=Math.cos(o/6),d=.5*o*(1+c)-a,b=i/(v*g)-r,p=c?-.25*o*s/c:0,w=.5*(1+c),q=(1+.5*i*f/v)/(v*g),m=i/v*(l/6)/(g*g),y=p*m-q*w,S=(d*m-b*w)/y,Q=(b*p-d*q)/y;if(i-=S,o-=Q,Math.abs(S)<ga&&Math.abs(Q)<ga)break}return[0>t?-o:o,0>n?-i:i]},(d3.geo.larrivee=function(){return ya(Pn)}).raw=Pn,_n.invert=function(t,n){var a=i(t)*ba,r=n/2,e=50;do{var o=a*a,h=r*r,u=a*r,M=a*(.975534+h*(-.119161+o*-.0143059+h*-.0547009))-t,s=r*(1.00384+o*(.0802894+h*-.02855+199025e-9*o)+h*(.0998909+h*-.0491032))-n,c=.975534-h*(.119161+.0143059*3*o+.0547009*h),f=-u*(.238322+.2188036*h+.0286118*o),v=u*(.1605788+7961e-7*o+-.0571*h),l=1.00384+o*(.0802894+199025e-9*o)+h*(3*(.0998909-.02855*o)-.245516*h),g=f*v-l*c,d=(s*f-M*l)/g,b=(M*v-s*c)/g;a-=d,r-=b}while((Math.abs(d)>ga||Math.abs(b)>ga)&&--e>0);return e&&[a,r]},(d3.geo.laskowski=function(){return ya(_n)}).raw=_n,zn.invert=function(t,n){var a=t*t,r=n*n,e=r+1,o=t?Math.SQRT1_2*Math.sqrt((e-Math.sqrt(a*a+2*a*(r-1)+e*e))/a+1):1/Math.sqrt(e);return[h(t*o),i(n)*u(o)]},(d3.geo.littrow=function(){return ya(zn)}).raw=zn,(d3.geo.loximuthal=function(){return x(Bn).parallel(40)}).raw=Bn,Fn.invert=function(t,n){return[t,2.5*Math.atan(Math.exp(.8*n))-.625*ba]},(d3.geo.miller=function(){return ya(Fn)}).raw=Fn;var La={alaska:[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],gs48:[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],gs50:[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],miller:[[.9245,0],[0,0],[.01943,0]],lee:[[.721316,0],[0,0],[-.00881625,-.00617325]]};(d3.geo.modifiedStereographic=Gn).raw=An,jn.invert=function(t,n){var a=Math.sqrt(6),r=Math.sqrt(7),e=3*h(n*r/9);return[t*r/(a*(2*Math.cos(2*e/3)-1)),h(3*Math.sin(e)*a/7)]},(d3.geo.mtFlatPolarParabolic=function(){return ya(jn)}).raw=jn,Cn.invert=function(t,n){var a=n*Math.sqrt(2+Math.SQRT2)/(2*Math.sqrt(3)),r=2*h(a);return[3*Math.SQRT2*t/(1+2*Math.cos(r)/Math.cos(r/2)),h((a+Math.sin(r))/(1+Math.SQRT1_2))]},(d3.geo.mtFlatPolarQuartic=function(){return ya(Cn)}).raw=Cn,Dn.invert=function(t,n){var a=Math.sqrt(6/(4+ba)),r=n/a;return Math.abs(Math.abs(r)-pa)<ga&&(r=0>r?-pa:pa),[1.5*t/(a*(.5+Math.cos(r))),h((r/2+Math.sin(r))/(1+ba/4))]},(d3.geo.mtFlatPolarSinusoidal=function(){return ya(Dn)}).raw=Dn,Ln.invert=function(t,n){var a,r=n,e=25;do{var o=r*r,i=o*o;r-=a=(r*(1.007226+o*(.015085+i*(-.044475+.028874*o-.005916*i)))-n)/(1.007226+o*(.045255+i*(-.311325+.259866*o-.005916*11*i)))}while(Math.abs(a)>ga&&--e>0);return[t/(.8707+(o=r*r)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),r]},(d3.geo.naturalEarth=function(){return ya(Ln)}).raw=Ln,On.invert=function(t,n){for(var a=n/2,r=0,e=1/0;10>r&&Math.abs(e)>ga;r++){var o=Math.cos(n/2);n-=e=(n-Math.tan(n/2)-a)/(1-.5/(o*o))}return[2*t/(1+Math.cos(n)),n]},(d3.geo.nellHammer=function(){return ya(On)}).raw=On;var Oa=1.0148,Ha=.23185,Ia=-.14499,Ja=.02406,Ka=Oa,Na=5*Ha,Ua=7*Ia,Va=9*Ja,Wa=1.790857183;Hn.invert=function(t,n){n>Wa?n=Wa:-Wa>n&&(n=-Wa);var a,r=n;do{var e=r*r;r-=a=(r*(Oa+e*e*(Ha+e*(Ia+Ja*e)))-n)/(Ka+e*e*(Na+e*(Ua+Va*e)))}while(Math.abs(a)>ga);return[t,r]},(d3.geo.patterson=function(){return ya(Hn)}).raw=Hn;var Xa=an(cn);(d3.geo.peirceQuincuncial=function(){return Xa().quincuncial(!0).rotate([-90,-90,45]).clipAngle(180-1e-6)}).raw=Xa.raw,In.invert=function(t,n){if(Math.abs(n)<ga)return[t,0];var a,r=t*t+n*n,e=.5*n,o=10;do{var M=Math.tan(e),s=1/Math.cos(e),c=r-2*n*e+e*e;e-=a=(M*c+2*(e-n))/(2+c*s*s+2*(e-n)*M)}while(Math.abs(a)>ga&&--o>0);return M=Math.tan(e),[(Math.abs(n)<Math.abs(e+1/M)?h(t*M):i(t)*(u(Math.abs(t*M))+pa))/Math.sin(e),e]},(d3.geo.polyconic=function(){return ya(In)}).raw=In,(d3.geo.rectangularPolyconic=function(){return x(Jn)}).raw=Jn;var Ya=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Ya.forEach(function(t){t[1]*=1.0144}),Kn.invert=function(t,n){var a=n/pa,r=90*a,e=Math.min(18,Math.abs(r/5)),o=Math.max(0,Math.floor(e));do{var i=Ya[o][1],h=Ya[o+1][1],u=Ya[Math.min(19,o+2)][1],M=u-i,s=u-2*h+i,c=2*(Math.abs(a)-h)/M,f=s/M,v=c*(1-f*c*(1-2*f*c));if(v>=0||1===o){r=(n>=0?5:-5)*(v+e);var l,g=50;do e=Math.min(18,Math.abs(r)/5),o=Math.floor(e),v=e-o,i=Ya[o][1],h=Ya[o+1][1],u=Ya[Math.min(19,o+2)][1],r-=(l=(n>=0?pa:-pa)*(h+v*(u-i)/2+v*v*(u-2*h+i)/2)-n)*ma;while(Math.abs(l)>da&&--g>0);break}}while(--o>=0);var d=Ya[o][0],b=Ya[o+1][0],p=Ya[Math.min(19,o+2)][0];return[t/(b+v*(p-d)/2+v*v*(p-2*b+d)/2),r*qa]},(d3.geo.robinson=function(){return ya(Kn)}).raw=Kn,(d3.geo.satellite=Vn).raw=Un,Wn.invert=function(t,n){var a=n/1.70711,r=Math.sin(ba/4*a);return[t/(.74482-.34588*r*r),2*Math.atan(a)]},(d3.geo.times=function(){return ya(Wn)}).raw=Wn,(d3.geo.twoPointEquidistant=Yn).raw=Xn,(d3.geo.twoPointAzimuthal=$n).raw=Zn,ta.invert=function(t,n){if(Math.abs(n)<ga)return[t,0];if(Math.abs(t)<ga)return[0,pa*Math.sin(2*Math.atan(n/ba))];var a=(t/=ba)*t,r=(n/=ba)*n,e=a+r,o=e*e,h=-Math.abs(n)*(1+e),M=h-2*r+a,s=-2*h+1+2*r+o,c=r/s+(2*M*M*M/(s*s*s)-9*h*M/(s*s))/27,f=(h-M*M/(3*s))/s,v=2*Math.sqrt(-f/3),l=u(3*c/(f*v))/3;return[ba*(e-1+Math.sqrt(1+2*(a-r)+o))/(2*t),i(n)*ba*(-v*Math.cos(l+ba/3)-M/(3*s))]},(d3.geo.vanDerGrinten=function(){return ya(ta)}).raw=ta,na.invert=function(t,n){if(!t)return[0,pa*Math.sin(2*Math.atan(n/ba))];var a=Math.abs(t/ba),r=(1-a*a-(n/=ba)*n)/(2*a),e=r*r,o=Math.sqrt(e+1);return[i(t)*ba*(o-r),i(n)*pa*Math.sin(2*Math.atan2(Math.sqrt((1-2*r*a)*(r+o)-a),Math.sqrt(o+r+a)))]},(d3.geo.vanDerGrinten2=function(){return ya(na)}).raw=na,aa.invert=function(t,n){if(!n)return[t,0];var a=n/ba,r=(ba*ba*(1-a*a)-t*t)/(2*ba*t);return[t?ba*(i(t)*Math.sqrt(r*r+1)-r):0,pa*Math.sin(2*Math.atan(a))]},(d3.geo.vanDerGrinten3=function(){return ya(aa)}).raw=aa,ra.invert=function(t,n){if(!t||!n)return[t,n];n/=ba;var a=i(t)*t/pa,r=(a*a-1+4*n*n)/Math.abs(a),e=r*r,o=2*n,h=50;do{var u=o*o,M=(8*o-u*(u+2)-5)/(2*u*(o-1)),s=(3*o-u*o-10)/(2*u*o),c=M*M,f=o*M,v=o+M,l=v*v,g=o+3*M,d=l*(u+c*e-1)+(1-u)*(u*(g*g+4*c)+c*(12*f+4*c)),b=-2*v*(4*f*c+(1-4*u+3*u*u)*(1+s)+c*(-6+14*u-e+(-8+8*u-2*e)*s)+f*(-8+12*u+(-10+10*u-e)*s)),p=Math.sqrt(d),w=r*(l+c-1)+2*p-a*(4*l+e),q=r*(2*M*s+2*v*(1+s))+b/p-8*v*(r*(-1+c+l)+2*p)*(1+s)/(e+4*l);o-=δ=w/q}while(δ>ga&&--h>0);return[i(t)*(Math.sqrt(r*r+4)+r)*ba/4,pa*o]},(d3.geo.vanDerGrinten4=function(){return ya(ra)}).raw=ra;var Za=function(){var t=4*ba+3*Math.sqrt(3),n=2*Math.sqrt(2*ba*Math.sqrt(3)/t);return R(n*Math.sqrt(3)/ba,n,t/6)}();(d3.geo.wagner4=function(){return ya(Za)}).raw=Za,ea.invert=function(t,n){return[t/Math.sqrt(1-3*n*n/(ba*ba)),n]},(d3.geo.wagner6=function(){return ya(ea)}).raw=ea,oa.invert=function(t,n){var a=t/2.66723,r=n/1.24104,e=Math.sqrt(a*a+r*r),o=2*h(e/2);return[3*Math.atan2(t*Math.tan(o),2.66723*e),e&&h(n*Math.sin(o)/(1.24104*.90631*e))]},(d3.geo.wagner7=function(){return ya(oa)}).raw=oa,ia.invert=function(t,n){var a=-.5*(t*t+n*n),r=Math.sqrt(-a*(2+a)),e=n*a+t*r,o=t*a-n*r,i=Math.sqrt(o*o+e*e);return[Math.atan2(r*e,i*(1+a)),i?-h(r*o/i):0]},(d3.geo.wiechel=function(){return ya(ia)}).raw=ia,ha.invert=function(t,n){var a=t,r=n,e=25;do{var o,i=Math.cos(r),h=Math.sin(r),M=Math.sin(2*r),s=h*h,c=i*i,f=Math.sin(a),v=Math.cos(a/2),l=Math.sin(a/2),g=l*l,d=1-c*v*v,b=d?u(i*v)*Math.sqrt(o=1/d):o=0,p=.5*(2*b*i*l+a/pa)-t,w=.5*(b*h+r)-n,q=.5*o*(c*g+b*i*v*s)+.5/pa,m=o*(f*M/4-b*h*l),y=.125*o*(M*l-b*h*c*f),S=.5*o*(s*v+b*g*i)+.5,Q=m*y-S*q,R=(w*m-p*S)/Q,T=(p*y-w*q)/Q;a-=R,r-=T}while((Math.abs(R)>ga||Math.abs(T)>ga)&&--e>0);return[a,r]},(d3.geo.winkel3=function(){return ya(ha)}).raw=ha}();
!function(){var topojson={version:"1.6.19",mesh:function(topology){return object(topology,meshArcs.apply(this,arguments))},meshArcs:meshArcs,merge:function(topology){return object(topology,mergeArcs.apply(this,arguments))},mergeArcs:mergeArcs,feature:featureOrCollection,neighbors:neighbors,presimplify:presimplify};function stitchArcs(topology,arcs){var stitchedArcs={},fragmentByStart={},fragmentByEnd={},fragments=[],emptyIndex=-1;arcs.forEach(function(i,j){var arc=topology.arcs[i<0?~i:i],t;if(arc.length<3&&!arc[1][0]&&!arc[1][1]){t=arcs[++emptyIndex],arcs[emptyIndex]=i,arcs[j]=t}});arcs.forEach(function(i){var e=ends(i),start=e[0],end=e[1],f,g;if(f=fragmentByEnd[start]){delete fragmentByEnd[f.end];f.push(i);f.end=end;if(g=fragmentByStart[end]){delete fragmentByStart[g.start];var fg=g===f?f:f.concat(g);fragmentByStart[fg.start=f.start]=fragmentByEnd[fg.end=g.end]=fg}else{fragmentByStart[f.start]=fragmentByEnd[f.end]=f}}else if(f=fragmentByStart[end]){delete fragmentByStart[f.start];f.unshift(i);f.start=start;if(g=fragmentByEnd[start]){delete fragmentByEnd[g.end];var gf=g===f?f:g.concat(f);fragmentByStart[gf.start=g.start]=fragmentByEnd[gf.end=f.end]=gf}else{fragmentByStart[f.start]=fragmentByEnd[f.end]=f}}else{f=[i];fragmentByStart[f.start=start]=fragmentByEnd[f.end=end]=f}});function ends(i){var arc=topology.arcs[i<0?~i:i],p0=arc[0],p1;if(topology.transform)p1=[0,0],arc.forEach(function(dp){p1[0]+=dp[0],p1[1]+=dp[1]});else p1=arc[arc.length-1];return i<0?[p1,p0]:[p0,p1]}function flush(fragmentByEnd,fragmentByStart){for(var k in fragmentByEnd){var f=fragmentByEnd[k];delete fragmentByStart[f.start];delete f.start;delete f.end;f.forEach(function(i){stitchedArcs[i<0?~i:i]=1});fragments.push(f)}}flush(fragmentByEnd,fragmentByStart);flush(fragmentByStart,fragmentByEnd);arcs.forEach(function(i){if(!stitchedArcs[i<0?~i:i])fragments.push([i])});return fragments}function meshArcs(topology,o,filter){var arcs=[];if(arguments.length>1){var geomsByArc=[],geom;function arc(i){var j=i<0?~i:i;(geomsByArc[j]||(geomsByArc[j]=[])).push({i:i,g:geom})}function line(arcs){arcs.forEach(arc)}function polygon(arcs){arcs.forEach(line)}function geometry(o){if(o.type==="GeometryCollection")o.geometries.forEach(geometry);else if(o.type in geometryType)geom=o,geometryType[o.type](o.arcs)}var geometryType={LineString:line,MultiLineString:polygon,Polygon:polygon,MultiPolygon:function(arcs){arcs.forEach(polygon)}};geometry(o);geomsByArc.forEach(arguments.length<3?function(geoms){arcs.push(geoms[0].i)}:function(geoms){if(filter(geoms[0].g,geoms[geoms.length-1].g))arcs.push(geoms[0].i)})}else{for(var i=0,n=topology.arcs.length;i<n;++i)arcs.push(i)}return{type:"MultiLineString",arcs:stitchArcs(topology,arcs)}}function mergeArcs(topology,objects){var polygonsByArc={},polygons=[],components=[];objects.forEach(function(o){if(o.type==="Polygon")register(o.arcs);else if(o.type==="MultiPolygon")o.arcs.forEach(register)});function register(polygon){polygon.forEach(function(ring){ring.forEach(function(arc){(polygonsByArc[arc=arc<0?~arc:arc]||(polygonsByArc[arc]=[])).push(polygon)})});polygons.push(polygon)}function exterior(ring){return cartesianRingArea(object(topology,{type:"Polygon",arcs:[ring]}).coordinates[0])>0}polygons.forEach(function(polygon){if(!polygon._){var component=[],neighbors=[polygon];polygon._=1;components.push(component);while(polygon=neighbors.pop()){component.push(polygon);polygon.forEach(function(ring){ring.forEach(function(arc){polygonsByArc[arc<0?~arc:arc].forEach(function(polygon){if(!polygon._){polygon._=1;neighbors.push(polygon)}})})})}}});polygons.forEach(function(polygon){delete polygon._});return{type:"MultiPolygon",arcs:components.map(function(polygons){var arcs=[];polygons.forEach(function(polygon){polygon.forEach(function(ring){ring.forEach(function(arc){if(polygonsByArc[arc<0?~arc:arc].length<2){arcs.push(arc)}})})});arcs=stitchArcs(topology,arcs);if((n=arcs.length)>1){var sgn=exterior(polygons[0][0]);for(var i=0,t;i<n;++i){if(sgn===exterior(arcs[i])){t=arcs[0],arcs[0]=arcs[i],arcs[i]=t;break}}}return arcs})}}function featureOrCollection(topology,o){return o.type==="GeometryCollection"?{type:"FeatureCollection",features:o.geometries.map(function(o){return feature(topology,o)})}:feature(topology,o)}function feature(topology,o){var f={type:"Feature",id:o.id,properties:o.properties||{},geometry:object(topology,o)};if(o.id==null)delete f.id;return f}function object(topology,o){var absolute=transformAbsolute(topology.transform),arcs=topology.arcs;function arc(i,points){if(points.length)points.pop();for(var a=arcs[i<0?~i:i],k=0,n=a.length,p;k<n;++k){points.push(p=a[k].slice());absolute(p,k)}if(i<0)reverse(points,n)}function point(p){p=p.slice();absolute(p,0);return p}function line(arcs){var points=[];for(var i=0,n=arcs.length;i<n;++i)arc(arcs[i],points);if(points.length<2)points.push(points[0].slice());return points}function ring(arcs){var points=line(arcs);while(points.length<4)points.push(points[0].slice());return points}function polygon(arcs){return arcs.map(ring)}function geometry(o){var t=o.type;return t==="GeometryCollection"?{type:t,geometries:o.geometries.map(geometry)}:t in geometryType?{type:t,coordinates:geometryType[t](o)}:null}var geometryType={Point:function(o){return point(o.coordinates)},MultiPoint:function(o){return o.coordinates.map(point)},LineString:function(o){return line(o.arcs)},MultiLineString:function(o){return o.arcs.map(line)},Polygon:function(o){return polygon(o.arcs)},MultiPolygon:function(o){return o.arcs.map(polygon)}};return geometry(o)}function reverse(array,n){var t,j=array.length,i=j-n;while(i<--j)t=array[i],array[i++]=array[j],array[j]=t}function bisect(a,x){var lo=0,hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(a[mid]<x)lo=mid+1;else hi=mid}return lo}function neighbors(objects){var indexesByArc={},neighbors=objects.map(function(){return[]});function line(arcs,i){arcs.forEach(function(a){if(a<0)a=~a;var o=indexesByArc[a];if(o)o.push(i);else indexesByArc[a]=[i]})}function polygon(arcs,i){arcs.forEach(function(arc){line(arc,i)})}function geometry(o,i){if(o.type==="GeometryCollection")o.geometries.forEach(function(o){geometry(o,i)});else if(o.type in geometryType)geometryType[o.type](o.arcs,i)}var geometryType={LineString:line,MultiLineString:polygon,Polygon:polygon,MultiPolygon:function(arcs,i){arcs.forEach(function(arc){polygon(arc,i)})}};objects.forEach(geometry);for(var i in indexesByArc){for(var indexes=indexesByArc[i],m=indexes.length,j=0;j<m;++j){for(var k=j+1;k<m;++k){var ij=indexes[j],ik=indexes[k],n;if((n=neighbors[ij])[i=bisect(n,ik)]!==ik)n.splice(i,0,ik);if((n=neighbors[ik])[i=bisect(n,ij)]!==ij)n.splice(i,0,ij)}}}return neighbors}function presimplify(topology,triangleArea){var absolute=transformAbsolute(topology.transform),relative=transformRelative(topology.transform),heap=minAreaHeap();if(!triangleArea)triangleArea=cartesianTriangleArea;topology.arcs.forEach(function(arc){var triangles=[],maxArea=0,triangle;for(var i=0,n=arc.length,p;i<n;++i){p=arc[i];absolute(arc[i]=[p[0],p[1],Infinity],i)}for(var i=1,n=arc.length-1;i<n;++i){triangle=arc.slice(i-1,i+2);triangle[1][2]=triangleArea(triangle);triangles.push(triangle);heap.push(triangle)}for(var i=0,n=triangles.length;i<n;++i){triangle=triangles[i];triangle.previous=triangles[i-1];triangle.next=triangles[i+1]}while(triangle=heap.pop()){var previous=triangle.previous,next=triangle.next;if(triangle[1][2]<maxArea)triangle[1][2]=maxArea;else maxArea=triangle[1][2];if(previous){previous.next=next;previous[2]=triangle[2];update(previous)}if(next){next.previous=previous;next[0]=triangle[0];update(next)}}arc.forEach(relative)});function update(triangle){heap.remove(triangle);triangle[1][2]=triangleArea(triangle);heap.push(triangle)}return topology}function cartesianRingArea(ring){var i=-1,n=ring.length,a,b=ring[n-1],area=0;while(++i<n){a=b;b=ring[i];area+=a[0]*b[1]-a[1]*b[0]}return area*.5}function cartesianTriangleArea(triangle){var a=triangle[0],b=triangle[1],c=triangle[2];return Math.abs((a[0]-c[0])*(b[1]-a[1])-(a[0]-b[0])*(c[1]-a[1]))}function compareArea(a,b){return a[1][2]-b[1][2]}function minAreaHeap(){var heap={},array=[],size=0;heap.push=function(object){up(array[object._=size]=object,size++);return size};heap.pop=function(){if(size<=0)return;var removed=array[0],object;if(--size>0)object=array[size],down(array[object._=0]=object,0);return removed};heap.remove=function(removed){var i=removed._,object;if(array[i]!==removed)return;if(i!==--size)object=array[size],(compareArea(object,removed)<0?up:down)(array[object._=i]=object,i);return i};function up(object,i){while(i>0){var j=(i+1>>1)-1,parent=array[j];if(compareArea(object,parent)>=0)break;array[parent._=i]=parent;array[object._=i=j]=object}}function down(object,i){while(true){var r=i+1<<1,l=r-1,j=i,child=array[j];if(l<size&&compareArea(array[l],child)<0)child=array[j=l];if(r<size&&compareArea(array[r],child)<0)child=array[j=r];if(j===i)break;array[child._=i]=child;array[object._=i=j]=object}}return heap}function transformAbsolute(transform){if(!transform)return noop;var x0,y0,kx=transform.scale[0],ky=transform.scale[1],dx=transform.translate[0],dy=transform.translate[1];return function(point,i){if(!i)x0=y0=0;point[0]=(x0+=point[0])*kx+dx;point[1]=(y0+=point[1])*ky+dy}}function transformRelative(transform){if(!transform)return noop;var x0,y0,kx=transform.scale[0],ky=transform.scale[1],dx=transform.translate[0],dy=transform.translate[1];return function(point,i){if(!i)x0=y0=0;var x1=(point[0]-dx)/kx|0,y1=(point[1]-dy)/ky|0;point[0]=x1-x0;point[1]=y1-y0;x0=x1;y0=y1}}function noop(){}if(typeof define==="function"&&define.amd)define(topojson);else if(typeof module==="object"&&module.exports)module.exports=topojson;else this.topojson=topojson}();
(function(){if(typeof define==="function"&&define.amd)define(["d3"],cloud);else cloud(this.d3);function cloud(d3){d3.layout.cloud=function cloud(){var size=[256,256],text=cloudText,font=cloudFont,fontSize=cloudFontSize,fontStyle=cloudFontNormal,fontWeight=cloudFontNormal,rotate=cloudRotate,padding=cloudPadding,spiral=archimedeanSpiral,words=[],timeInterval=Infinity,event=d3.dispatch("word","end"),timer=null,random=Math.random,cloud={};cloud.start=function(){var board=zeroArray((size[0]>>5)*size[1]),bounds=null,n=words.length,i=-1,tags=[],data=words.map(function(d,i){d.text=text.call(this,d,i);d.font=font.call(this,d,i);d.style=fontStyle.call(this,d,i);d.weight=fontWeight.call(this,d,i);d.rotate=rotate.call(this,d,i);d.size=~~fontSize.call(this,d,i);d.padding=padding.call(this,d,i);return d}).sort(function(a,b){return b.size-a.size});if(timer)clearInterval(timer);timer=setInterval(step,0);step();return cloud;function step(){var start=Date.now();while(Date.now()-start<timeInterval&&++i<n&&timer){var d=data[i];d.x=size[0]*(random()+.5)>>1;d.y=size[1]*(random()+.5)>>1;cloudSprite(d,data,i);if(d.hasText&&place(board,d,bounds)){tags.push(d);event.word(d);if(bounds)cloudBounds(bounds,d);else bounds=[{x:d.x+d.x0,y:d.y+d.y0},{x:d.x+d.x1,y:d.y+d.y1}];d.x-=size[0]>>1;d.y-=size[1]>>1}}if(i>=n){cloud.stop();event.end(tags,bounds)}}};cloud.stop=function(){if(timer){clearInterval(timer);timer=null}return cloud};function place(board,tag,bounds){var perimeter=[{x:0,y:0},{x:size[0],y:size[1]}],startX=tag.x,startY=tag.y,maxDelta=Math.sqrt(size[0]*size[0]+size[1]*size[1]),s=spiral(size),dt=random()<.5?1:-1,t=-dt,dxdy,dx,dy;while(dxdy=s(t+=dt)){dx=~~dxdy[0];dy=~~dxdy[1];if(Math.min(Math.abs(dx),Math.abs(dy))>=maxDelta)break;tag.x=startX+dx;tag.y=startY+dy;if(tag.x+tag.x0<0||tag.y+tag.y0<0||tag.x+tag.x1>size[0]||tag.y+tag.y1>size[1])continue;if(!bounds||!cloudCollide(tag,board,size[0])){if(!bounds||collideRects(tag,bounds)){var sprite=tag.sprite,w=tag.width>>5,sw=size[0]>>5,lx=tag.x-(w<<4),sx=lx&127,msx=32-sx,h=tag.y1-tag.y0,x=(tag.y+tag.y0)*sw+(lx>>5),last;for(var j=0;j<h;j++){last=0;for(var i=0;i<=w;i++){board[x+i]|=last<<msx|(i<w?(last=sprite[j*w+i])>>>sx:0)}x+=sw}delete tag.sprite;return true}}}return false}cloud.timeInterval=function(_){return arguments.length?(timeInterval=_==null?Infinity:_,cloud):timeInterval};cloud.words=function(_){return arguments.length?(words=_,cloud):words};cloud.size=function(_){return arguments.length?(size=[+_[0],+_[1]],cloud):size};cloud.font=function(_){return arguments.length?(font=d3.functor(_),cloud):font};cloud.fontStyle=function(_){return arguments.length?(fontStyle=d3.functor(_),cloud):fontStyle};cloud.fontWeight=function(_){return arguments.length?(fontWeight=d3.functor(_),cloud):fontWeight};cloud.rotate=function(_){return arguments.length?(rotate=d3.functor(_),cloud):rotate};cloud.text=function(_){return arguments.length?(text=d3.functor(_),cloud):text};cloud.spiral=function(_){return arguments.length?(spiral=spirals[_]||_,cloud):spiral};cloud.fontSize=function(_){return arguments.length?(fontSize=d3.functor(_),cloud):fontSize};cloud.padding=function(_){return arguments.length?(padding=d3.functor(_),cloud):padding};cloud.random=function(_){return arguments.length?(random=_,cloud):random};return d3.rebind(cloud,event,"on")};function cloudText(d){return d.text}function cloudFont(){return"serif"}function cloudFontNormal(){return"normal"}function cloudFontSize(d){return Math.sqrt(d.value)}function cloudRotate(){return(~~(Math.random()*6)-3)*30}function cloudPadding(){return 1}function cloudSprite(d,data,di){if(d.sprite)return;c.clearRect(0,0,(cw<<5)/ratio,ch/ratio);var x=0,y=0,maxh=0,n=data.length;--di;while(++di<n){d=data[di];c.save();c.font=d.style+" "+d.weight+" "+~~((d.size+1)/ratio)+"px "+d.font;var w=c.measureText(d.text+"m").width*ratio,h=d.size<<1;if(d.rotate){var sr=Math.sin(d.rotate*cloudRadians),cr=Math.cos(d.rotate*cloudRadians),wcr=w*cr,wsr=w*sr,hcr=h*cr,hsr=h*sr;w=Math.max(Math.abs(wcr+hsr),Math.abs(wcr-hsr))+31>>5<<5;h=~~Math.max(Math.abs(wsr+hcr),Math.abs(wsr-hcr))}else{w=w+31>>5<<5}if(h>maxh)maxh=h;if(x+w>=cw<<5){x=0;y+=maxh;maxh=0}if(y+h>=ch)break;c.translate((x+(w>>1))/ratio,(y+(h>>1))/ratio);if(d.rotate)c.rotate(d.rotate*cloudRadians);c.fillText(d.text,0,0);if(d.padding)c.lineWidth=2*d.padding,c.strokeText(d.text,0,0);c.restore();d.width=w;d.height=h;d.xoff=x;d.yoff=y;d.x1=w>>1;d.y1=h>>1;d.x0=-d.x1;d.y0=-d.y1;d.hasText=true;x+=w}var pixels=c.getImageData(0,0,(cw<<5)/ratio,ch/ratio).data,sprite=[];while(--di>=0){d=data[di];if(!d.hasText)continue;var w=d.width,w32=w>>5,h=d.y1-d.y0;for(var i=0;i<h*w32;i++)sprite[i]=0;x=d.xoff;if(x==null)return;y=d.yoff;var seen=0,seenRow=-1;for(var j=0;j<h;j++){for(var i=0;i<w;i++){var k=w32*j+(i>>5),m=pixels[(y+j)*(cw<<5)+(x+i)<<2]?1<<31-i%32:0;sprite[k]|=m;seen|=m}if(seen)seenRow=j;else{d.y0++;h--;j--;y++}}d.y1=d.y0+seenRow;d.sprite=sprite.slice(0,(d.y1-d.y0)*w32)}}function cloudCollide(tag,board,sw){sw>>=5;var sprite=tag.sprite,w=tag.width>>5,lx=tag.x-(w<<4),sx=lx&127,msx=32-sx,h=tag.y1-tag.y0,x=(tag.y+tag.y0)*sw+(lx>>5),last;for(var j=0;j<h;j++){last=0;for(var i=0;i<=w;i++){if((last<<msx|(i<w?(last=sprite[j*w+i])>>>sx:0))&board[x+i])return true}x+=sw}return false}function cloudBounds(bounds,d){var b0=bounds[0],b1=bounds[1];if(d.x+d.x0<b0.x)b0.x=d.x+d.x0;if(d.y+d.y0<b0.y)b0.y=d.y+d.y0;if(d.x+d.x1>b1.x)b1.x=d.x+d.x1;if(d.y+d.y1>b1.y)b1.y=d.y+d.y1}function collideRects(a,b){return a.x+a.x1>b[0].x&&a.x+a.x0<b[1].x&&a.y+a.y1>b[0].y&&a.y+a.y0<b[1].y}function archimedeanSpiral(size){var e=size[0]/size[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function rectangularSpiral(size){var dy=4,dx=dy*size[0]/size[1],x=0,y=0;return function(t){var sign=t<0?-1:1;switch(Math.sqrt(1+4*sign*t)-sign&3){case 0:x+=dx;break;case 1:y+=dy;break;case 2:x-=dx;break;default:y-=dy;break}return[x,y]}}function zeroArray(n){var a=[],i=-1;while(++i<n)a[i]=0;return a}var cloudRadians=Math.PI/180,cw=1<<11>>5,ch=1<<11,canvas,ratio=1;if(typeof document!=="undefined"){canvas=document.createElement("canvas");canvas.width=1;canvas.height=1;ratio=Math.sqrt(canvas.getContext("2d").getImageData(0,0,1,1).data.length>>2);canvas.width=(cw<<5)/ratio;canvas.height=ch/ratio}else{canvas=new Canvas(cw<<5,ch)}var c=canvas.getContext("2d"),spirals={archimedean:archimedeanSpiral,rectangular:rectangularSpiral};c.fillStyle=c.strokeStyle="red";c.textAlign="center"}})();
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.vg=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports={version:"2.2.6",dataflow:require("vega-dataflow"),parse:require("./src/parse/"),scene:{Bounder:require("./src/scene/Bounder"),Builder:require("./src/scene/Builder"),Encoder:require("./src/scene/Encoder"),GroupBuilder:require("./src/scene/GroupBuilder")},transforms:require("./src/transforms"),schema:require("./src/core/schema"),config:require("./src/core/config"),util:require("datalib"),debug:require("vega-logging").debug}},{"./src/core/config":88,"./src/core/schema":89,"./src/parse/":95,"./src/scene/Bounder":107,"./src/scene/Builder":108,"./src/scene/Encoder":109,"./src/scene/GroupBuilder":110,"./src/transforms":139,datalib:24,"vega-dataflow":39,"vega-logging":45}],2:[function(require,module,exports){},{}],3:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.dsv={})})(this,function(exports){"use strict";var dsv=function(delimiter){var reFormat=new RegExp('["'+delimiter+"\n]"),delimiterCode=delimiter.charCodeAt(0);function parse(text,f){var o;return parseRows(text,function(row,i){if(o)return o(row,i-1);var a=new Function("d","return {"+row.map(function(name,i){return JSON.stringify(name)+": d["+i+"]"}).join(",")+"}");o=f?function(row,i){return f(a(row),i)}:a})}function parseRows(text,f){var EOL={},EOF={},rows=[],N=text.length,I=0,n=0,t,eol;function token(){if(I>=N)return EOF;if(eol)return eol=false,EOL;var j=I;if(text.charCodeAt(j)===34){var i=j;while(i++<N){if(text.charCodeAt(i)===34){if(text.charCodeAt(i+1)!==34)break;++i}}I=i+2;var c=text.charCodeAt(i+1);if(c===13){eol=true;if(text.charCodeAt(i+2)===10)++I}else if(c===10){eol=true}return text.slice(j+1,i).replace(/""/g,'"')}while(I<N){var c=text.charCodeAt(I++),k=1;if(c===10)eol=true;else if(c===13){eol=true;if(text.charCodeAt(I)===10)++I,++k}else if(c!==delimiterCode)continue;return text.slice(j,I-k)}return text.slice(j)}while((t=token())!==EOF){var a=[];while(t!==EOL&&t!==EOF){a.push(t);t=token()}if(f&&(a=f(a,n++))==null)continue;rows.push(a)}return rows}function format(rows){if(Array.isArray(rows[0]))return formatRows(rows);var fieldSet=Object.create(null),fields=[];rows.forEach(function(row){for(var field in row){if(!((field+="")in fieldSet)){fields.push(fieldSet[field]=field)}}});return[fields.map(formatValue).join(delimiter)].concat(rows.map(function(row){return fields.map(function(field){return formatValue(row[field])}).join(delimiter)})).join("\n")}function formatRows(rows){return rows.map(formatRow).join("\n")}function formatRow(row){return row.map(formatValue).join(delimiter)}function formatValue(text){return reFormat.test(text)?'"'+text.replace(/\"/g,'""')+'"':text}return{parse:parse,parseRows:parseRows,format:format,formatRows:formatRows}};exports.csv=dsv(",");exports.tsv=dsv("	");exports.dsv=dsv})},{}],4:[function(require,module,exports){if(typeof Map==="undefined"){Map=function(){this.clear()};Map.prototype={set:function(k,v){this._[k]=v;return this},get:function(k){return this._[k]},has:function(k){return k in this._},"delete":function(k){return k in this._&&delete this._[k]},clear:function(){this._=Object.create(null)},get size(){var n=0;for(var k in this._)++n;return n},forEach:function(c){for(var k in this._)c(this._[k],k,this)}}}else(function(){var m=new Map;if(m.set(0,0)!==m){m=m.set;Map.prototype.set=function(){m.apply(this,arguments);return this}}})();(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.format={})})(this,function(exports){"use strict";var zhCn={decimal:".",thousands:",",grouping:[3],currency:["¥",""]};var ruRu={decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]};var ptBr={decimal:",",thousands:".",grouping:[3],currency:["R$",""]};var plPl={decimal:",",thousands:".",grouping:[3],currency:["","zł"]};var nlNl={decimal:",",thousands:".",grouping:[3],currency:["€ ",""]};var mkMk={decimal:",",thousands:".",grouping:[3],currency:[""," ден."]};var jaJp={decimal:".",thousands:",",grouping:[3],currency:["","円"]};var itIt={decimal:",",thousands:".",grouping:[3],currency:["€",""]};var heIl={decimal:".",thousands:",",grouping:[3],currency:["₪",""]};var frFr={decimal:",",thousands:".",grouping:[3],currency:[""," €"]};var frCa={decimal:",",thousands:" ",grouping:[3],currency:["","$"]};var fiFi={decimal:",",thousands:" ",grouping:[3],currency:[""," €"]};var esEs={decimal:",",thousands:".",grouping:[3],currency:[""," €"]};var enUs={decimal:".",thousands:",",grouping:[3],currency:["$",""]};var enGb={decimal:".",thousands:",",grouping:[3],currency:["£",""]};var enCa={decimal:".",thousands:",",grouping:[3],currency:["$",""]};var deDe={decimal:",",thousands:".",grouping:[3],currency:[""," €"]};var caEs={decimal:",",thousands:".",grouping:[3],currency:[""," €"]};function formatDecimal(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;var i,coefficient=x.slice(0,i);return[coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)]}function exponent(x){return x=formatDecimal(Math.abs(x)),x?x[1]:NaN}var prefixExponent;function formatPrefixAuto(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(exponent/3)))*3)+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimal(x,p+i-1)[0]}function formatRounded(x,p){var d=formatDecimal(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0")}function formatDefault(x,p){x=x.toPrecision(p);out:for(var n=x.length,i=1,i0=-1,i1;i<n;++i){switch(x[i]){case".":i0=i1=i;break;case"0":if(i0===0)i0=i;i1=i;break;case"e":break out;default:if(i0>0)i0=0;break}}return i0>0?x.slice(0,i0)+x.slice(i1+1):x}var formatTypes={"":formatDefault,"%":function(x,p){return(x*100).toFixed(p)},b:function(x){return Math.round(x).toString(2)},c:function(x){return x+""},d:function(x){return Math.round(x).toString(10)},e:function(x,p){return x.toExponential(p)},f:function(x,p){return x.toFixed(p)},g:function(x,p){return x.toPrecision(p)},o:function(x){return Math.round(x).toString(8)},p:function(x,p){return formatRounded(x*100,p)},r:formatRounded,s:formatPrefixAuto,X:function(x){return Math.round(x).toString(16).toUpperCase()},x:function(x){return Math.round(x).toString(16)}};var re=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function formatSpecifier(specifier){return new FormatSpecifier(specifier)}function FormatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match,fill=match[1]||" ",align=match[2]||">",sign=match[3]||"-",symbol=match[4]||"",zero=!!match[5],width=match[6]&&+match[6],comma=!!match[7],precision=match[8]&&+match[8].slice(1),type=match[9]||"";if(type==="n")comma=true,type="g";else if(!formatTypes[type])type="";if(zero||fill==="0"&&align==="=")zero=true,fill="0",align="=";this.fill=fill;this.align=align;this.sign=sign;this.symbol=symbol;this.zero=zero;this.width=width;this.comma=comma;this.precision=precision;this.type=type}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width==null?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision==null?"":"."+Math.max(0,this.precision|0))+this.type};function formatGroup(grouping,thousands){return function(value,width){var i=value.length,t=[],j=0,g=grouping[0],length=0;while(i>0&&g>0){if(length+g+1>width)g=Math.max(1,width-length);t.push(value.substring(i-=g,i+g));if((length+=g+1)>width)break;g=grouping[j=(j+1)%grouping.length]}return t.reverse().join(thousands)}}var prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function identity(x){return x}function locale(locale){var group=locale.grouping&&locale.thousands?formatGroup(locale.grouping,locale.thousands):identity,currency=locale.currency,decimal=locale.decimal;function format(specifier){specifier=formatSpecifier(specifier);var fill=specifier.fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,type=specifier.type;var prefix=symbol==="$"?currency[0]:symbol==="#"&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix=symbol==="$"?currency[1]:/[%p]/.test(type)?"%":"";var formatType=formatTypes[type],maybeSuffix=!type||/[defgprs%]/.test(type);precision=precision==null?type?6:12:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision));return function(value){var valuePrefix=prefix,valueSuffix=suffix;if(type==="c"){valueSuffix=formatType(value)+valueSuffix;value=""}else{value=+value;var valueNegative=(value<0||1/value<0)&&(value*=-1,true);value=formatType(value,precision);valuePrefix=(valueNegative?sign==="("?sign:"-":sign==="-"||sign==="("?"":sign)+valuePrefix;valueSuffix=valueSuffix+(type==="s"?prefixes[8+prefixExponent/3]:"")+(valueNegative&&sign==="("?")":"");if(maybeSuffix){var i=-1,n=value.length,c;while(++i<n){if(c=value.charCodeAt(i),48>c||c>57){valueSuffix=(c===46?decimal+value.slice(i+1):value.slice(i))+valueSuffix;value=value.slice(0,i);break}}}}if(comma&&!zero)value=group(value,Infinity);var length=valuePrefix.length+value.length+valueSuffix.length,padding=length<width?new Array(width-length+1).join(fill):"";if(comma&&zero)value=group(padding+value,padding.length?width-valueSuffix.length:Infinity),padding="";switch(align){case"<":return valuePrefix+value+valueSuffix+padding;case"=":return valuePrefix+padding+value+valueSuffix;case"^":return padding.slice(0,length=padding.length>>1)+valuePrefix+value+valueSuffix+padding.slice(length)}return padding+valuePrefix+value+valueSuffix}}function formatPrefix(specifier,value){var f=format((specifier=formatSpecifier(specifier),specifier.type="f",specifier)),e=Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3,k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix}}return{format:format,formatPrefix:formatPrefix}}function precisionRound(step,max){return Math.max(0,exponent(Math.abs(max))-exponent(Math.abs(step)))+1}function precisionPrefix(step,value){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3-exponent(Math.abs(step)))}function precisionFixed(step){return Math.max(0,-exponent(Math.abs(step)))}var localeDefinitions=(new Map).set("ca-ES",caEs).set("de-DE",deDe).set("en-CA",enCa).set("en-GB",enGb).set("en-US",enUs).set("es-ES",esEs).set("fi-FI",fiFi).set("fr-CA",frCa).set("fr-FR",frFr).set("he-IL",heIl).set("it-IT",itIt).set("ja-JP",jaJp).set("mk-MK",mkMk).set("nl-NL",nlNl).set("pl-PL",plPl).set("pt-BR",ptBr).set("ru-RU",ruRu).set("zh-CN",zhCn);var defaultLocale=locale(enUs);exports.format=defaultLocale.format;exports.formatPrefix=defaultLocale.formatPrefix;function localeFormat(definition){if(typeof definition==="string"){definition=localeDefinitions.get(definition);if(!definition)return null}return locale(definition)}exports.localeFormat=localeFormat;exports.formatSpecifier=formatSpecifier;exports.precisionFixed=precisionFixed;exports.precisionPrefix=precisionPrefix;exports.precisionRound=precisionRound})},{}],5:[function(require,module,exports){if(typeof Map==="undefined"){Map=function(){this.clear()};Map.prototype={set:function(k,v){this._[k]=v;return this},get:function(k){return this._[k]},has:function(k){return k in this._},"delete":function(k){return k in this._&&delete this._[k]},clear:function(){this._=Object.create(null)},get size(){var n=0;for(var k in this._)++n;return n},forEach:function(c){for(var k in this._)c(this._[k],k,this)}}}else(function(){var m=new Map;if(m.set(0,0)!==m){m=m.set;Map.prototype.set=function(){m.apply(this,arguments);return this}}})();(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.timeFormat={})})(this,function(exports){"use strict";var zhCn={dateTime:"%a %b %e %X %Y",date:"%Y/%-m/%-d",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]};var ruRu={dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shortDays:["вс","пн","вт","ср","чт","пт","сб"],months:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"]};var ptBr={dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]};var plPl={dateTime:"%A, %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],shortDays:["Niedz.","Pon.","Wt.","Śr.","Czw.","Pt.","Sob."],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],shortMonths:["Stycz.","Luty","Marz.","Kwie.","Maj","Czerw.","Lipc.","Sierp.","Wrz.","Paźdz.","Listop.","Grudz."]};var nlNl={dateTime:"%a %e %B %Y %T",date:"%d-%m-%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"]};var mkMk={dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["недела","понеделник","вторник","среда","четврток","петок","сабота"],shortDays:["нед","пон","вто","сре","чет","пет","саб"],months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],shortMonths:["јан","фев","мар","апр","мај","јун","јул","авг","сеп","окт","ное","дек"]};var jaJp={dateTime:"%Y %b %e %a %X",date:"%Y/%m/%d",time:"%H:%M:%S",periods:["AM","PM"],days:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],shortDays:["日","月","火","水","木","金","土"],months:["睦月","如月","弥生","卯月","皐月","水無月","文月","葉月","長月","神無月","霜月","師走"],shortMonths:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]};var itIt={dateTime:"%A %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shortDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]};var heIl={dateTime:"%A, %e ב%B %Y %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],shortDays:["א׳","ב׳","ג׳","ד׳","ה׳","ו׳","ש׳"],months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],shortMonths:["ינו׳","פבר׳","מרץ","אפר׳","מאי","יוני","יולי","אוג׳","ספט׳","אוק׳","נוב׳","דצמ׳"]};var frFr={dateTime:"%A, le %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."]};var frCa={dateTime:"%a %e %b %Y %X",date:"%Y-%m-%d",time:"%H:%M:%S",periods:["",""],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim","lun","mar","mer","jeu","ven","sam"],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["jan","fév","mar","avr","mai","jui","jul","aoû","sep","oct","nov","déc"]};var fiFi={dateTime:"%A, %-d. %Bta %Y klo %X",date:"%-d.%-m.%Y",time:"%H:%M:%S",periods:["a.m.","p.m."],days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],shortDays:["Su","Ma","Ti","Ke","To","Pe","La"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortMonths:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]};var esEs={dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"]};var enUs={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"]};var enGb={dateTime:"%a %e %b %X %Y",date:"%d/%m/%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"]};var enCa={dateTime:"%a %b %e %X %Y",date:"%Y-%m-%d",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"]};var deDe={dateTime:"%A, der %e. %B %Y, %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]};var caEs={dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],shortDays:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],months:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],shortMonths:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."]};var t0=new Date;var t1=new Date;function newInterval(floori,offseti,count){function interval(date){return floori(date=new Date(+date)),date}interval.floor=interval;interval.round=function(date){var d0=new Date(+date),d1=new Date(date-1);floori(d0),floori(d1),offseti(d1,1);return date-d0<d1-date?d0:d1};interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),date};interval.offset=function(date,step){return offseti(date=new Date(+date),step==null?1:Math.floor(step)),date};interval.range=function(start,stop,step){var range=[];start=new Date(start-1);stop=new Date(+stop);step=step==null?1:Math.floor(step);if(!(start<stop)||!(step>0))return range;offseti(start,1),floori(start);if(start<stop)range.push(new Date(+start));while(offseti(start,step),floori(start),start<stop)range.push(new Date(+start));return range};interval.filter=function(test){return newInterval(function(date){while(floori(date),!test(date))date.setTime(date-1)},function(date,step){while(--step>=0)while(offseti(date,1),!test(date));})};if(count)interval.count=function(start,end){t0.setTime(+start),t1.setTime(+end);floori(t0),floori(t1);return Math.floor(count(t0,t1))};return interval}var day=newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*6e4)/864e5});function weekday(i){return newInterval(function(date){date.setHours(0,0,0,0);date.setDate(date.getDate()-(date.getDay()+7-i)%7)},function(date,step){date.setDate(date.getDate()+step*7)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*6e4)/6048e5})}var sunday=weekday(0);var monday=weekday(1);var year=newInterval(function(date){date.setHours(0,0,0,0);date.setMonth(0,1)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()});var utcDay=newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5});function utcWeekday(i){return newInterval(function(date){date.setUTCHours(0,0,0,0);date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7)},function(date,step){date.setUTCDate(date.getUTCDate()+step*7)},function(start,end){return(end-start)/6048e5})}var utcSunday=utcWeekday(0);var utcMonday=utcWeekday(1);var utcYear=newInterval(function(date){date.setUTCHours(0,0,0,0);date.setUTCMonth(0,1)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()});function localDate(d){if(0<=d.y&&d.y<100){var date=new Date(-1,d.m,d.d,d.H,d.M,d.S,d.L);date.setFullYear(d.y);return date}return new Date(d.y,d.m,d.d,d.H,d.M,d.S,d.L)}function utcDate(d){if(0<=d.y&&d.y<100){var date=new Date(Date.UTC(-1,d.m,d.d,d.H,d.M,d.S,d.L));date.setUTCFullYear(d.y);return date}return new Date(Date.UTC(d.y,d.m,d.d,d.H,d.M,d.S,d.L))}function newYear(y){return{y:y,m:0,d:1,H:0,M:0,S:0,L:0}}function locale(locale){var locale_dateTime=locale.dateTime,locale_date=locale.date,locale_time=locale.time,locale_periods=locale.periods,locale_weekdays=locale.days,locale_shortWeekdays=locale.shortDays,locale_months=locale.months,locale_shortMonths=locale.shortMonths;var periodLookup=formatLookup(locale_periods),weekdayRe=formatRe(locale_weekdays),weekdayLookup=formatLookup(locale_weekdays),shortWeekdayRe=formatRe(locale_shortWeekdays),shortWeekdayLookup=formatLookup(locale_shortWeekdays),monthRe=formatRe(locale_months),monthLookup=formatLookup(locale_months),shortMonthRe=formatRe(locale_shortMonths),shortMonthLookup=formatLookup(locale_shortMonths);var formats={a:formatShortWeekday,A:formatWeekday,b:formatShortMonth,B:formatMonth,c:null,d:formatDayOfMonth,e:formatDayOfMonth,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:formatPeriod,S:formatSeconds,U:formatWeekNumberSunday,w:formatWeekdayNumber,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent};var utcFormats={a:formatUTCShortWeekday,A:formatUTCWeekday,b:formatUTCShortMonth,B:formatUTCMonth,c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:formatUTCPeriod,S:formatUTCSeconds,U:formatUTCWeekNumberSunday,w:formatUTCWeekdayNumber,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent};var parses={a:parseShortWeekday,A:parseWeekday,b:parseShortMonth,B:parseMonth,c:parseLocaleDateTime,d:parseDayOfMonth,e:parseDayOfMonth,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:parsePeriod,S:parseSeconds,U:parseWeekNumberSunday,w:parseWeekdayNumber,W:parseWeekNumberMonday,x:parseLocaleDate,X:parseLocaleTime,y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};formats.x=newFormat(locale_date,formats);formats.X=newFormat(locale_time,formats);formats.c=newFormat(locale_dateTime,formats);utcFormats.x=newFormat(locale_date,utcFormats);utcFormats.X=newFormat(locale_time,utcFormats);utcFormats.c=newFormat(locale_dateTime,utcFormats);function newFormat(specifier,formats){return function(date){var string=[],i=-1,j=0,n=specifier.length,c,pad,format;while(++i<n){if(specifier.charCodeAt(i)===37){string.push(specifier.slice(j,i));if((pad=pads[c=specifier.charAt(++i)])!=null)c=specifier.charAt(++i);if(format=formats[c])c=format(date,pad==null?c==="e"?" ":"0":pad);string.push(c);j=i+1}}string.push(specifier.slice(j,i));return string.join("")}}function newParse(specifier,newDate){return function(string){var d=newYear(1900),i=parseSpecifier(d,specifier,string,0);if(i!=string.length)return null;if("p"in d)d.H=d.H%12+d.p*12;if("Z"in d){if("w"in d&&("W"in d||"U"in d)){var day=utcDate(newYear(d.y)).getUTCDay();if("W"in d)d.U=d.W,d.w=(d.w+6)%7,--day;d.m=0;d.d=d.w+d.U*7-(day+6)%7}d.H+=d.Z/100|0;d.M+=d.Z%100;return utcDate(d)}if("w"in d&&("W"in d||"U"in d)){var day=newDate(newYear(d.y)).getDay();if("W"in d)d.U=d.W,d.w=(d.w+6)%7,--day;d.m=0;d.d=d.w+d.U*7-(day+6)%7}return newDate(d)}}function parseSpecifier(d,specifier,string,j){var i=0,n=specifier.length,m=string.length,c,parse;while(i<n){if(j>=m)return-1;c=specifier.charCodeAt(i++);if(c===37){c=specifier.charAt(i++);parse=parses[c in pads?specifier.charAt(i++):c];if(!parse||(j=parse(d,string,j))<0)return-1}else if(c!=string.charCodeAt(j++)){return-1}}return j}function parseShortWeekday(d,string,i){var n=shortWeekdayRe.exec(string.slice(i));return n?(d.w=shortWeekdayLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function parseWeekday(d,string,i){var n=weekdayRe.exec(string.slice(i));return n?(d.w=weekdayLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function parseShortMonth(d,string,i){var n=shortMonthRe.exec(string.slice(i));return n?(d.m=shortMonthLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function parseMonth(d,string,i){var n=monthRe.exec(string.slice(i));return n?(d.m=monthLookup.get(n[0].toLowerCase()),i+n[0].length):-1}function parseLocaleDateTime(d,string,i){return parseSpecifier(d,locale_dateTime,string,i)}function parseLocaleDate(d,string,i){return parseSpecifier(d,locale_date,string,i)}function parseLocaleTime(d,string,i){return parseSpecifier(d,locale_time,string,i)}function parsePeriod(d,string,i){var n=periodLookup.get(string.slice(i,i+=2).toLowerCase());return n==null?-1:(d.p=n,i)}function formatShortWeekday(d){return locale_shortWeekdays[d.getDay()]}function formatWeekday(d){return locale_weekdays[d.getDay()]}function formatShortMonth(d){return locale_shortMonths[d.getMonth()]}function formatMonth(d){return locale_months[d.getMonth()]}function formatPeriod(d){return locale_periods[+(d.getHours()>=12)]}function formatUTCShortWeekday(d){return locale_shortWeekdays[d.getUTCDay()]}function formatUTCWeekday(d){return locale_weekdays[d.getUTCDay()]}function formatUTCShortMonth(d){return locale_shortMonths[d.getUTCMonth()]}function formatUTCMonth(d){return locale_months[d.getUTCMonth()]}function formatUTCPeriod(d){return locale_periods[+(d.getUTCHours()>=12)]}return{format:function(specifier){var f=newFormat(specifier+="",formats);f.parse=newParse(specifier,localDate);f.toString=function(){return specifier};return f},utcFormat:function(specifier){var f=newFormat(specifier+="",utcFormats);f.parse=newParse(specifier,utcDate);f.toString=function(){return specifier};return f}}}var pads={"-":"",_:" ",0:"0"};var numberRe=/^\s*\d+/;var percentRe=/^%/;var requoteRe=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;function pad(value,fill,width){var sign=value<0?"-":"",string=(sign?-value:value)+"",length=string.length;return sign+(length<width?new Array(width-length+1).join(fill)+string:string)}function requote(s){return s.replace(requoteRe,"\\$&")}function formatRe(names){return new RegExp("^(?:"+names.map(requote).join("|")+")","i")}function formatLookup(names){var map=new Map,i=-1,n=names.length;while(++i<n)map.set(names[i].toLowerCase(),i);return map}function parseWeekdayNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+1));return n?(d.w=+n[0],i+n[0].length):-1}function parseWeekNumberSunday(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.U=+n[0],i+n[0].length):-1}function parseWeekNumberMonday(d,string,i){var n=numberRe.exec(string.slice(i));return n?(d.W=+n[0],i+n[0].length):-1}function parseFullYear(d,string,i){var n=numberRe.exec(string.slice(i,i+4));return n?(d.y=+n[0],i+n[0].length):-1}function parseYear(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.y=+n[0]+(+n[0]>68?1900:2e3),i+n[0].length):-1}function parseZone(d,string,i){return/^[+-]\d{4}$/.test(string=string.slice(i,i+5))?(d.Z=-string,i+5):-1}function parseMonthNumber(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.m=n[0]-1,i+n[0].length):-1}function parseDayOfMonth(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.d=+n[0],i+n[0].length):-1}function parseDayOfYear(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.m=0,d.d=+n[0],i+n[0].length):-1}function parseHour24(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.H=+n[0],i+n[0].length):-1}function parseMinutes(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.M=+n[0],i+n[0].length):-1}function parseSeconds(d,string,i){var n=numberRe.exec(string.slice(i,i+2));return n?(d.S=+n[0],i+n[0].length):-1}function parseMilliseconds(d,string,i){var n=numberRe.exec(string.slice(i,i+3));return n?(d.L=+n[0],i+n[0].length):-1}function parseLiteralPercent(d,string,i){var n=percentRe.exec(string.slice(i,i+1));return n?i+n[0].length:-1}function formatDayOfMonth(d,p){return pad(d.getDate(),p,2)}function formatHour24(d,p){return pad(d.getHours(),p,2)}function formatHour12(d,p){return pad(d.getHours()%12||12,p,2)}function formatDayOfYear(d,p){return pad(1+day.count(year(d),d),p,3)}function formatMilliseconds(d,p){return pad(d.getMilliseconds(),p,3)}function formatMonthNumber(d,p){return pad(d.getMonth()+1,p,2)
}function formatMinutes(d,p){return pad(d.getMinutes(),p,2)}function formatSeconds(d,p){return pad(d.getSeconds(),p,2)}function formatWeekNumberSunday(d,p){return pad(sunday.count(year(d),d),p,2)}function formatWeekdayNumber(d){return d.getDay()}function formatWeekNumberMonday(d,p){return pad(monday.count(year(d),d),p,2)}function formatYear(d,p){return pad(d.getFullYear()%100,p,2)}function formatFullYear(d,p){return pad(d.getFullYear()%1e4,p,4)}function formatZone(d){var z=d.getTimezoneOffset();return(z>0?"-":(z*=-1,"+"))+pad(z/60|0,"0",2)+pad(z%60,"0",2)}function formatUTCDayOfMonth(d,p){return pad(d.getUTCDate(),p,2)}function formatUTCHour24(d,p){return pad(d.getUTCHours(),p,2)}function formatUTCHour12(d,p){return pad(d.getUTCHours()%12||12,p,2)}function formatUTCDayOfYear(d,p){return pad(1+utcDay.count(utcYear(d),d),p,3)}function formatUTCMilliseconds(d,p){return pad(d.getUTCMilliseconds(),p,3)}function formatUTCMonthNumber(d,p){return pad(d.getUTCMonth()+1,p,2)}function formatUTCMinutes(d,p){return pad(d.getUTCMinutes(),p,2)}function formatUTCSeconds(d,p){return pad(d.getUTCSeconds(),p,2)}function formatUTCWeekNumberSunday(d,p){return pad(utcSunday.count(utcYear(d),d),p,2)}function formatUTCWeekdayNumber(d){return d.getUTCDay()}function formatUTCWeekNumberMonday(d,p){return pad(utcMonday.count(utcYear(d),d),p,2)}function formatUTCYear(d,p){return pad(d.getUTCFullYear()%100,p,2)}function formatUTCFullYear(d,p){return pad(d.getUTCFullYear()%1e4,p,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}var isoSpecifier="%Y-%m-%dT%H:%M:%S.%LZ";function formatIsoNative(date){return date.toISOString()}formatIsoNative.parse=function(string){var date=new Date(string);return isNaN(date)?null:date};formatIsoNative.toString=function(){return isoSpecifier};var formatIso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?formatIsoNative:enUs.utcFormat(isoSpecifier);var isoFormat=formatIso;var localeDefinitions=(new Map).set("ca-ES",caEs).set("de-DE",deDe).set("en-CA",enCa).set("en-GB",enGb).set("en-US",enUs).set("es-ES",esEs).set("fi-FI",fiFi).set("fr-CA",frCa).set("fr-FR",frFr).set("he-IL",heIl).set("it-IT",itIt).set("ja-JP",jaJp).set("mk-MK",mkMk).set("nl-NL",nlNl).set("pl-PL",plPl).set("pt-BR",ptBr).set("ru-RU",ruRu).set("zh-CN",zhCn);var defaultLocale=locale(enUs);exports.format=defaultLocale.format;exports.utcFormat=defaultLocale.utcFormat;function localeFormat(definition){if(typeof definition==="string"){definition=localeDefinitions.get(definition);if(!definition)return null}return locale(definition)}exports.localeFormat=localeFormat;exports.isoFormat=isoFormat})},{}],6:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.time={})})(this,function(exports){"use strict";var t1=new Date;var t0=new Date;function newInterval(floori,offseti,count){function interval(date){return floori(date=new Date(+date)),date}interval.floor=interval;interval.round=function(date){var d0=new Date(+date),d1=new Date(date-1);floori(d0),floori(d1),offseti(d1,1);return date-d0<d1-date?d0:d1};interval.ceil=function(date){return floori(date=new Date(date-1)),offseti(date,1),date};interval.offset=function(date,step){return offseti(date=new Date(+date),step==null?1:Math.floor(step)),date};interval.range=function(start,stop,step){var range=[];start=new Date(start-1);stop=new Date(+stop);step=step==null?1:Math.floor(step);if(!(start<stop)||!(step>0))return range;offseti(start,1),floori(start);if(start<stop)range.push(new Date(+start));while(offseti(start,step),floori(start),start<stop)range.push(new Date(+start));return range};interval.filter=function(test){return newInterval(function(date){while(floori(date),!test(date))date.setTime(date-1)},function(date,step){while(--step>=0)while(offseti(date,1),!test(date));})};if(count)interval.count=function(start,end){t0.setTime(+start),t1.setTime(+end);floori(t0),floori(t1);return Math.floor(count(t0,t1))};return interval}var second=newInterval(function(date){date.setMilliseconds(0)},function(date,step){date.setTime(+date+step*1e3)},function(start,end){return(end-start)/1e3});exports.seconds=second.range;var minute=newInterval(function(date){date.setSeconds(0,0)},function(date,step){date.setTime(+date+step*6e4)},function(start,end){return(end-start)/6e4});exports.minutes=minute.range;var hour=newInterval(function(date){date.setMinutes(0,0,0)},function(date,step){date.setTime(+date+step*36e5)},function(start,end){return(end-start)/36e5});exports.hours=hour.range;var day=newInterval(function(date){date.setHours(0,0,0,0)},function(date,step){date.setDate(date.getDate()+step)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*6e4)/864e5});exports.days=day.range;function weekday(i){return newInterval(function(date){date.setHours(0,0,0,0);date.setDate(date.getDate()-(date.getDay()+7-i)%7)},function(date,step){date.setDate(date.getDate()+step*7)},function(start,end){return(end-start-(end.getTimezoneOffset()-start.getTimezoneOffset())*6e4)/6048e5})}exports.sunday=weekday(0);exports.sundays=exports.sunday.range;exports.monday=weekday(1);exports.mondays=exports.monday.range;exports.tuesday=weekday(2);exports.tuesdays=exports.tuesday.range;exports.wednesday=weekday(3);exports.wednesdays=exports.wednesday.range;exports.thursday=weekday(4);exports.thursdays=exports.thursday.range;exports.friday=weekday(5);exports.fridays=exports.friday.range;exports.saturday=weekday(6);exports.saturdays=exports.saturday.range;var week=exports.sunday;exports.weeks=week.range;var month=newInterval(function(date){date.setHours(0,0,0,0);date.setDate(1)},function(date,step){date.setMonth(date.getMonth()+step)},function(start,end){return end.getMonth()-start.getMonth()+(end.getFullYear()-start.getFullYear())*12});exports.months=month.range;var year=newInterval(function(date){date.setHours(0,0,0,0);date.setMonth(0,1)},function(date,step){date.setFullYear(date.getFullYear()+step)},function(start,end){return end.getFullYear()-start.getFullYear()});exports.years=year.range;var utcSecond=newInterval(function(date){date.setUTCMilliseconds(0)},function(date,step){date.setTime(+date+step*1e3)},function(start,end){return(end-start)/1e3});exports.utcSeconds=utcSecond.range;var utcMinute=newInterval(function(date){date.setUTCSeconds(0,0)},function(date,step){date.setTime(+date+step*6e4)},function(start,end){return(end-start)/6e4});exports.utcMinutes=utcMinute.range;var utcHour=newInterval(function(date){date.setUTCMinutes(0,0,0)},function(date,step){date.setTime(+date+step*36e5)},function(start,end){return(end-start)/36e5});exports.utcHours=utcHour.range;var utcDay=newInterval(function(date){date.setUTCHours(0,0,0,0)},function(date,step){date.setUTCDate(date.getUTCDate()+step)},function(start,end){return(end-start)/864e5});exports.utcDays=utcDay.range;function utcWeekday(i){return newInterval(function(date){date.setUTCHours(0,0,0,0);date.setUTCDate(date.getUTCDate()-(date.getUTCDay()+7-i)%7)},function(date,step){date.setUTCDate(date.getUTCDate()+step*7)},function(start,end){return(end-start)/6048e5})}exports.utcSunday=utcWeekday(0);exports.utcSundays=exports.utcSunday.range;exports.utcMonday=utcWeekday(1);exports.utcMondays=exports.utcMonday.range;exports.utcTuesday=utcWeekday(2);exports.utcTuesdays=exports.utcTuesday.range;exports.utcWednesday=utcWeekday(3);exports.utcWednesdays=exports.utcWednesday.range;exports.utcThursday=utcWeekday(4);exports.utcThursdays=exports.utcThursday.range;exports.utcFriday=utcWeekday(5);exports.utcFridays=exports.utcFriday.range;exports.utcSaturday=utcWeekday(6);exports.utcSaturdays=exports.utcSaturday.range;var utcWeek=exports.utcSunday;exports.utcWeeks=utcWeek.range;var utcMonth=newInterval(function(date){date.setUTCHours(0,0,0,0);date.setUTCDate(1)},function(date,step){date.setUTCMonth(date.getUTCMonth()+step)},function(start,end){return end.getUTCMonth()-start.getUTCMonth()+(end.getUTCFullYear()-start.getUTCFullYear())*12});exports.utcMonths=utcMonth.range;var utcYear=newInterval(function(date){date.setUTCHours(0,0,0,0);date.setUTCMonth(0,1)},function(date,step){date.setUTCFullYear(date.getUTCFullYear()+step)},function(start,end){return end.getUTCFullYear()-start.getUTCFullYear()});exports.utcYears=utcYear.range;exports.interval=newInterval;exports.second=second;exports.minute=minute;exports.hour=hour;exports.day=day;exports.week=week;exports.month=month;exports.year=year;exports.utcSecond=utcSecond;exports.utcMinute=utcMinute;exports.utcHour=utcHour;exports.utcDay=utcDay;exports.utcWeek=utcWeek;exports.utcMonth=utcMonth;exports.utcYear=utcYear})},{}],7:[function(require,module,exports){var util=require("../util"),Measures=require("./measures"),Collector=require("./collector");function Aggregator(){this._cells={};this._aggr=[];this._stream=false}var Flags=Aggregator.Flags={ADD_CELL:1,MOD_CELL:2};var proto=Aggregator.prototype;proto.stream=function(v){if(v==null)return this._stream;this._stream=!!v;this._aggr=[];return this};proto.key=function(key){if(key==null)return this._key;this._key=util.$(key);return this};proto.groupby=function(dims){this._dims=util.array(dims).map(function(d,i){d=util.isString(d)?{name:d,get:util.$(d)}:util.isFunction(d)?{name:util.name(d)||d.name||"_"+i,get:d}:d.name&&util.isFunction(d.get)?d:null;if(d==null)throw"Invalid groupby argument: "+d;return d});return this.clear()};proto.summarize=function(fields){fields=summarize_args(fields);this._count=true;var aggr=this._aggr=[],m,f,i,j,op,as,get;for(i=0;i<fields.length;++i){for(j=0,m=[],f=fields[i];j<f.ops.length;++j){op=f.ops[j];if(op!=="count")this._count=false;as=f.as&&f.as[j]||op+(f.name==="*"?"":"_"+f.name);m.push(Measures[op](as))}get=f.get&&util.$(f.get)||(f.name==="*"?util.identity:util.$(f.name));aggr.push({name:f.name,measures:Measures.create(m,this._stream,get,this._assign)})}return this.clear()};proto.count=function(){return this.summarize({"*":"count"})};proto._assign=function(object,name,value){object[name]=value};function summarize_args(fields){if(util.isArray(fields)){return fields}if(fields==null){return[]}var a=[],name,ops;for(name in fields){ops=util.array(fields[name]);a.push({name:name,ops:ops})}return a}proto.clear=function(){return this._cells={},this};proto._cellkey=function(x){var d=this._dims,n=d.length,i,k=String(d[0].get(x));for(i=1;i<n;++i){k+="|"+d[i].get(x)}return k};proto._cell=function(x){var key=this._dims.length?this._cellkey(x):"";return this._cells[key]||(this._cells[key]=this._newcell(x,key))};proto._newcell=function(x,key){var cell={num:0,tuple:this._newtuple(x,key),flag:Flags.ADD_CELL,aggs:{}};var aggr=this._aggr,i;for(i=0;i<aggr.length;++i){cell.aggs[aggr[i].name]=new aggr[i].measures(cell,cell.tuple)}if(cell.collect){cell.data=new Collector(this._key)}return cell};proto._newtuple=function(x){var dims=this._dims,t={},i,n;for(i=0,n=dims.length;i<n;++i){t[dims[i].name]=dims[i].get(x)}return this._ingest(t)};proto._ingest=util.identity;proto._add=function(x){var cell=this._cell(x),aggr=this._aggr,i;cell.num+=1;if(!this._count){if(cell.collect)cell.data.add(x);for(i=0;i<aggr.length;++i){cell.aggs[aggr[i].name].add(x)}}cell.flag|=Flags.MOD_CELL;if(this._on_add)this._on_add(x,cell)};proto._rem=function(x){var cell=this._cell(x),aggr=this._aggr,i;cell.num-=1;if(!this._count){if(cell.collect)cell.data.rem(x);for(i=0;i<aggr.length;++i){cell.aggs[aggr[i].name].rem(x)}}cell.flag|=Flags.MOD_CELL;if(this._on_rem)this._on_rem(x,cell)};proto._mod=function(curr,prev){var cell0=this._cell(prev),cell1=this._cell(curr),aggr=this._aggr,i;if(cell0!==cell1){cell0.num-=1;cell1.num+=1;if(cell0.collect)cell0.data.rem(prev);if(cell1.collect)cell1.data.add(curr)}else if(cell0.collect&&!util.isObject(curr)){cell0.data.rem(prev);cell0.data.add(curr)}for(i=0;i<aggr.length;++i){cell0.aggs[aggr[i].name].rem(prev);cell1.aggs[aggr[i].name].add(curr)}cell0.flag|=Flags.MOD_CELL;cell1.flag|=Flags.MOD_CELL;if(this._on_mod)this._on_mod(curr,prev,cell0,cell1)};proto.result=function(){var result=[],aggr=this._aggr,cell,i,k;for(k in this._cells){cell=this._cells[k];if(cell.num>0){if(cell.collect){cell.data.values()}for(i=0;i<aggr.length;++i){cell.aggs[aggr[i].name].set()}result.push(cell.tuple)}else{delete this._cells[k]}cell.flag=0}this._rems=false;return result};proto.changes=function(output){var changes=output||{add:[],rem:[],mod:[]},aggr=this._aggr,cell,flag,i,k;for(k in this._cells){cell=this._cells[k];flag=cell.flag;if(cell.collect){cell.data.values()}for(i=0;i<aggr.length;++i){cell.aggs[aggr[i].name].set()}if(cell.num<=0){changes.rem.push(cell.tuple);delete this._cells[k];if(this._on_drop)this._on_drop(cell)}else{if(this._on_keep)this._on_keep(cell);if(flag&Flags.ADD_CELL){changes.add.push(cell.tuple)}else if(flag&Flags.MOD_CELL){changes.mod.push(cell.tuple)}}cell.flag=0}this._rems=false;return changes};proto.execute=function(input){return this.clear().insert(input).result()};proto.insert=function(input){this._consolidate();for(var i=0;i<input.length;++i){this._add(input[i])}return this};proto.remove=function(input){if(!this._stream){throw"Aggregator not configured for streaming removes."+" Call stream(true) prior to calling summarize."}for(var i=0;i<input.length;++i){this._rem(input[i])}this._rems=true;return this};proto._consolidate=function(){if(!this._rems)return;for(var k in this._cells){if(this._cells[k].collect){this._cells[k].data.values()}}this._rems=false};module.exports=Aggregator},{"../util":29,"./collector":8,"./measures":10}],8:[function(require,module,exports){var util=require("../util");var stats=require("../stats");var REM="__dl_rem__";function Collector(key){this._add=[];this._rem=[];this._key=key||null;this._last=null}var proto=Collector.prototype;proto.add=function(v){this._add.push(v)};proto.rem=function(v){this._rem.push(v)};proto.values=function(){this._get=null;if(this._rem.length===0)return this._add;var a=this._add,r=this._rem,k=this._key,x=Array(a.length-r.length),i,j,n,m;if(!util.isObject(r[0])){m=stats.count.map(r);for(i=0,j=0,n=a.length;i<n;++i){if(m[a[i]]>0){m[a[i]]-=1}else{x[j++]=a[i]}}}else if(k){m=util.toMap(r,k);for(i=0,j=0,n=a.length;i<n;++i){if(!m.hasOwnProperty(k(a[i]))){x[j++]=a[i]}}}else{for(i=0,n=r.length;i<n;++i){r[i][REM]=1}for(i=0,j=0,n=a.length;i<n;++i){if(!a[i][REM]){x[j++]=a[i]}}for(i=0,n=r.length;i<n;++i){delete r[i][REM]}}this._rem=[];return this._add=x};proto.extent=function(get){if(this._get!==get||!this._ext){var v=this.values(),i=stats.extent.index(v,get);this._ext=[v[i[0]],v[i[1]]];this._get=get}return this._ext};proto.argmin=function(get){return this.extent(get)[0]};proto.argmax=function(get){return this.extent(get)[1]};proto.min=function(get){var m=this.extent(get)[0];return m?get(m):+Infinity};proto.max=function(get){var m=this.extent(get)[1];return m?get(m):-Infinity};proto.quartile=function(get){if(this._get!==get||!this._q){this._q=stats.quartile(this.values(),get);this._get=get}return this._q};proto.q1=function(get){return this.quartile(get)[0]};proto.q2=function(get){return this.quartile(get)[1]};proto.q3=function(get){return this.quartile(get)[2]};module.exports=Collector},{"../stats":26,"../util":29}],9:[function(require,module,exports){var util=require("../util");var Aggregator=require("./aggregator");module.exports=function(){var args=[].reduce.call(arguments,function(a,x){return a.concat(util.array(x))},[]);return(new Aggregator).groupby(args).summarize({"*":"values"})}},{"../util":29,"./aggregator":7}],10:[function(require,module,exports){var util=require("../util");var types={values:measure({name:"values",init:"cell.collect = true;",set:"cell.data.values()",idx:-1}),count:measure({name:"count",set:"cell.num"}),missing:measure({name:"missing",set:"this.missing"}),valid:measure({name:"valid",set:"this.valid"}),sum:measure({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:measure({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:measure({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:measure({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:measure({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:measure({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:measure({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),median:measure({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:measure({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:measure({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),distinct:measure({name:"distinct",set:"this.distinct(cell.data.values(), this.get)",req:["values"],idx:3}),argmin:measure({name:"argmin",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin = this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:measure({name:"argmax",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax = this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:measure({name:"min",init:"this.min = +Infinity;",add:"if (v < this.min) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:measure({name:"max",init:"this.max = -Infinity;",add:"if (v > this.max) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4}),modeskew:measure({name:"modeskew",set:"this.dev===0 ? 0 : (this.mean - cell.data.q2(this.get)) / Math.sqrt(this.dev/(this.valid-1))",req:["mean","stdev","median"],idx:5})};function measure(base){return function(out){var m=util.extend({init:"",add:"",rem:"",idx:0},base);m.out=out||base.name;return m}}function resolve(agg,stream){function collect(m,a){function helper(r){if(!m[r])collect(m,m[r]=types[r]())}if(a.req)a.req.forEach(helper);if(stream&&a.str)a.str.forEach(helper);return m}var map=agg.reduce(collect,agg.reduce(function(m,a){return m[a.name]=a,m},{}));return util.vals(map).sort(function(a,b){return a.idx-b.idx})}function create(agg,stream,accessor,mutator){var all=resolve(agg,stream),ctr="this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;",add="if (v==null) this.missing++; if (!this.isValid(v)) return; ++this.valid;",rem="if (v==null) this.missing--; if (!this.isValid(v)) return; --this.valid;",set="var t = this.tuple; var cell = this.cell;";all.forEach(function(a){if(a.idx<0){ctr=a.init+ctr;add=a.add+add;rem=a.rem+rem}else{ctr+=a.init;add+=a.add;rem+=a.rem}});agg.slice().sort(function(a,b){return a.idx-b.idx}).forEach(function(a){set+="this.assign(t,'"+a.out+"',"+a.set+");"});set+="return t;";ctr=Function("cell","t",ctr);ctr.prototype.assign=mutator;ctr.prototype.add=Function("t","var v = this.get(t);"+add);ctr.prototype.rem=Function("t","var v = this.get(t);"+rem);ctr.prototype.set=Function(set);ctr.prototype.get=accessor;ctr.prototype.distinct=require("../stats").count.distinct;ctr.prototype.isValid=util.isValid;ctr.fields=agg.map(util.$("out"));return ctr}types.create=create;module.exports=types},{"../stats":26,"../util":29}],11:[function(require,module,exports){var util=require("../util"),time=require("../time"),EPSILON=1e-15;function bins(opt){if(!opt){throw Error("Missing binning options.")}var maxb=opt.maxbins||15,base=opt.base||10,logb=Math.log(base),div=opt.div||[5,2],min=opt.min,max=opt.max,span=max-min,step,level,minstep,precision,v,i,eps;if(opt.step){step=opt.step}else if(opt.steps){step=opt.steps[Math.min(opt.steps.length-1,bisect(opt.steps,span/maxb,0,opt.steps.length))]}else{level=Math.ceil(Math.log(maxb)/logb);minstep=opt.minstep||0;step=Math.max(minstep,Math.pow(base,Math.round(Math.log(span)/logb)-level));do{step*=base}while(Math.ceil(span/step)>maxb);for(i=0;i<div.length;++i){v=step/div[i];if(v>=minstep&&span/v<=maxb)step=v}}v=Math.log(step);precision=v>=0?0:~~(-v/logb)+1;eps=Math.pow(base,-precision-1);min=Math.min(min,Math.floor(min/step+eps)*step);max=Math.ceil(max/step)*step;return{start:min,stop:max,step:step,unit:{precision:precision},value:value,index:index}}function bisect(a,x,lo,hi){while(lo<hi){var mid=lo+hi>>>1;if(util.cmp(a[mid],x)<0){lo=mid+1}else{hi=mid}}return lo}function value(v){return this.step*Math.floor(v/this.step+EPSILON)}function index(v){return Math.floor((v-this.start)/this.step+EPSILON)}function date_value(v){return this.unit.date(value.call(this,v))}function date_index(v){return index.call(this,this.unit.unit(v))}bins.date=function(opt){if(!opt){throw Error("Missing date binning options.")}var units=opt.utc?time.utc:time,dmin=opt.min,dmax=opt.max,maxb=opt.maxbins||20,minb=opt.minbins||4,span=+dmax-+dmin,unit=opt.unit?units[opt.unit]:units.find(span,minb,maxb),spec=bins({min:unit.min!=null?unit.min:unit.unit(dmin),max:unit.max!=null?unit.max:unit.unit(dmax),maxbins:maxb,minstep:unit.minstep,steps:unit.step});spec.unit=unit;spec.index=date_index;if(!opt.raw)spec.value=date_value;return spec};module.exports=bins},{"../time":28,"../util":29}],12:[function(require,module,exports){var bins=require("./bins"),gen=require("../generate"),type=require("../import/type"),util=require("../util"),stats=require("../stats");var qtype={integer:1,number:1,date:1};function $bin(values,f,opt){opt=options(values,f,opt);var b=spec(opt);return!b?opt.accessor||util.identity:util.$func("bin",b.unit.unit?function(x){return b.value(b.unit.unit(x))}:function(x){return b.value(x)})(opt.accessor)}function histogram(values,f,opt){opt=options(values,f,opt);var b=spec(opt);return b?numerical(values,opt.accessor,b):categorical(values,opt.accessor,opt&&opt.sort)}function spec(opt){var t=opt.type,b=null;if(t==null||qtype[t]){if(t==="integer"&&opt.minstep==null)opt.minstep=1;b=t==="date"?bins.date(opt):bins(opt)}return b}function options(){var a=arguments,i=0,values=util.isArray(a[i])?a[i++]:null,f=util.isFunction(a[i])||util.isString(a[i])?util.$(a[i++]):null,opt=util.extend({},a[i]);if(values){opt.type=opt.type||type(values,f);if(qtype[opt.type]){var ext=stats.extent(values,f);opt=util.extend({min:ext[0],max:ext[1]},opt)}}if(f){opt.accessor=f}return opt}function numerical(values,f,b){var h=gen.range(b.start,b.stop+b.step/2,b.step).map(function(v){return{value:b.value(v),count:0}});for(var i=0,v,j;i<values.length;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){j=b.index(v);if(j<0||j>=h.length||!isFinite(j))continue;h[j].count+=1}}h.bins=b;return h}function categorical(values,f,sort){var u=stats.unique(values,f),c=stats.count.map(values,f);return u.map(function(k){return{value:k,count:c[k]}}).sort(util.comparator(sort?"-count":"+value"))}module.exports={$bin:$bin,histogram:histogram}},{"../generate":14,"../import/type":23,"../stats":26,"../util":29,"./bins":11}],13:[function(require,module,exports){var d3_time=require("d3-time"),d3_timeF=require("d3-time-format"),d3_numberF=require("d3-format"),numberF=d3_numberF,timeF=d3_timeF;function numberLocale(l){var f=d3_numberF.localeFormat(l);if(f==null)throw Error("Unrecognized locale: "+l);numberF=f}function timeLocale(l){var f=d3_timeF.localeFormat(l);if(f==null)throw Error("Unrecognized locale: "+l);timeF=f}module.exports={numberLocale:numberLocale,number:function(f){return numberF.format(f)},numberPrefix:function(f,v){return numberF.formatPrefix(f,v)},timeLocale:timeLocale,time:function(f){return timeF.format(f)},utc:function(f){return timeF.utcFormat(f)},locale:function(l){numberLocale(l);timeLocale(l)},auto:{number:numberAutoFormat,time:function(){return timeAutoFormat()},utc:function(){return utcAutoFormat()}}};var e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function intervals(domain,count){if(!domain.length)domain=[0];if(count==null)count=10;var start=domain[0],stop=domain[domain.length-1];if(stop<start){error=stop;stop=start;start=error}var span=stop-start||(count=1,start||stop||1),step=Math.pow(10,Math.floor(Math.log(span/count)/Math.LN10)),error=span/count/step;if(error>=e10)step*=10;else if(error>=e5)step*=5;else if(error>=e2)step*=2;return[Math.ceil(start/step)*step,Math.floor(stop/step)*step+step/2,step]}function numberAutoFormat(domain,count,f){var range=intervals(domain,count);if(f==null){f=",."+d3_numberF.precisionFixed(range[2])+"f"}else{switch(f=d3_numberF.formatSpecifier(f),f.type){case"s":{var value=Math.max(Math.abs(range[0]),Math.abs(range[1]));if(f.precision==null)f.precision=d3_numberF.precisionPrefix(range[2],value);return numberF.formatPrefix(f,value)}case"":case"e":case"g":case"p":case"r":{if(f.precision==null)f.precision=d3_numberF.precisionRound(range[2],Math.max(Math.abs(range[0]),Math.abs(range[1])))-(f.type==="e");break}case"f":case"%":{if(f.precision==null)f.precision=d3_numberF.precisionFixed(range[2])-(f.type==="%")*2;break}}}return numberF.format(f)}function timeAutoFormat(){var f=timeF.format,formatMillisecond=f(".%L"),formatSecond=f(":%S"),formatMinute=f("%I:%M"),formatHour=f("%I %p"),formatDay=f("%a %d"),formatWeek=f("%b %d"),formatMonth=f("%B"),formatYear=f("%Y");return function(date){var d=+date;return(d3_time.second(date)<d?formatMillisecond:d3_time.minute(date)<d?formatSecond:d3_time.hour(date)<d?formatMinute:d3_time.day(date)<d?formatHour:d3_time.month(date)<d?d3_time.week(date)<d?formatDay:formatWeek:d3_time.year(date)<d?formatMonth:formatYear)(date)}}function utcAutoFormat(){var f=timeF.utcFormat,formatMillisecond=f(".%L"),formatSecond=f(":%S"),formatMinute=f("%I:%M"),formatHour=f("%I %p"),formatDay=f("%a %d"),formatWeek=f("%b %d"),formatMonth=f("%B"),formatYear=f("%Y");return function(date){var d=+date;return(d3_time.utcSecond(date)<d?formatMillisecond:d3_time.utcMinute(date)<d?formatSecond:d3_time.utcHour(date)<d?formatMinute:d3_time.utcDay(date)<d?formatHour:d3_time.utcMonth(date)<d?d3_time.utcWeek(date)<d?formatDay:formatWeek:d3_time.utcYear(date)<d?formatMonth:formatYear)(date)}}},{"d3-format":4,"d3-time":6,"d3-time-format":5}],14:[function(require,module,exports){var gen=module.exports={};gen.repeat=function(val,n){var a=Array(n),i;for(i=0;i<n;++i)a[i]=val;return a};gen.zeros=function(n){return gen.repeat(0,n)};gen.range=function(start,stop,step){if(arguments.length<3){step=1;if(arguments.length<2){stop=start;start=0}}if((stop-start)/step==Infinity)throw new Error("Infinite range");var range=[],i=-1,j;if(step<0)while((j=start+step*++i)>stop)range.push(j);else while((j=start+step*++i)<stop)range.push(j);return range};gen.random={};gen.random.uniform=function(min,max){if(max===undefined){max=min===undefined?1:min;min=0}var d=max-min;var f=function(){return min+d*Math.random()};f.samples=function(n){return gen.zeros(n).map(f)};return f};gen.random.integer=function(a,b){if(b===undefined){b=a;a=0}var d=b-a;var f=function(){return a+Math.floor(d*Math.random())};f.samples=function(n){return gen.zeros(n).map(f)};return f};gen.random.normal=function(mean,stdev){mean=mean||0;stdev=stdev||1;var next;var f=function(){var x=0,y=0,rds,c;if(next!==undefined){x=next;next=undefined;return x}do{x=Math.random()*2-1;y=Math.random()*2-1;rds=x*x+y*y}while(rds===0||rds>1);c=Math.sqrt(-2*Math.log(rds)/rds);next=mean+y*c*stdev;return mean+x*c*stdev};f.samples=function(n){return gen.zeros(n).map(f)};return f}},{}],15:[function(require,module,exports){var util=require("../../util");var d3_dsv=require("d3-dsv");function dsv(data,format){if(data){var h=format.header;data=(h?h.join(format.delimiter)+"\n":"")+data}return d3_dsv.dsv(format.delimiter).parse(data)}dsv.delimiter=function(delim){var fmt={delimiter:delim};return function(data,format){return dsv(data,format?util.extend(format,fmt):fmt)}};module.exports=dsv},{"../../util":29,"d3-dsv":3}],16:[function(require,module,exports){var dsv=require("./dsv");module.exports={json:require("./json"),topojson:require("./topojson"),treejson:require("./treejson"),dsv:dsv,csv:dsv.delimiter(","),tsv:dsv.delimiter("	")}},{"./dsv":15,"./json":17,"./topojson":18,"./treejson":19}],17:[function(require,module,exports){var util=require("../../util");module.exports=function(data,format){var d=util.isObject(data)&&!util.isBuffer(data)?data:JSON.parse(data);if(format&&format.property){d=util.accessor(format.property)(d)}return d}},{"../../util":29}],18:[function(require,module,exports){(function(global){var json=require("./json");var reader=function(data,format){var topojson=reader.topojson;if(topojson==null){throw Error("TopoJSON library not loaded.")}var t=json(data,format),obj;if(format&&format.feature){if(obj=t.objects[format.feature]){return topojson.feature(t,obj).features}else{throw Error("Invalid TopoJSON object: "+format.feature)}}else if(format&&format.mesh){if(obj=t.objects[format.mesh]){return[topojson.mesh(t,t.objects[format.mesh])]}else{throw Error("Invalid TopoJSON object: "+format.mesh)}}else{throw Error("Missing TopoJSON feature or mesh parameter.")}};reader.topojson=typeof window!=="undefined"?window["topojson"]:typeof global!=="undefined"?global["topojson"]:null;module.exports=reader}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./json":17}],19:[function(require,module,exports){var json=require("./json");module.exports=function(data,format){data=json(data,format);return toTable(data,format&&format.children)};function toTable(root,childrenField){childrenField=childrenField||"children";var table=[];function visit(node){table.push(node);var children=node[childrenField];if(children){for(var i=0;i<children.length;++i){visit(children[i],node)}}}visit(root,null);return table.root=root,table}},{"./json":17}],20:[function(require,module,exports){var protocol_re=/^([A-Za-z]+:)?\/\//;var fileProtocol="file://";function sanitizeUrl(opt){var url=opt.url;if(!url&&opt.file){return fileProtocol+opt.file}if(opt.baseURL&&!protocol_re.test(url)){if(!startsWith(url,"/")&&opt.baseURL[opt.baseURL.length-1]!=="/"){url="/"+url}url=opt.baseURL+url}if(!load.useXHR&&startsWith(url,"//")){url=(opt.defaultProtocol||"http")+":"+url}if(opt.domainWhiteList){var domain,origin;if(load.useXHR){var a=document.createElement("a");a.href=url;if(a.host===""){a.href=a.href}domain=a.hostname.toLowerCase();origin=window.location.hostname}else{var parts=require("url").parse(url);domain=parts.hostname;origin=null}if(origin!==domain){var whiteListed=opt.domainWhiteList.some(function(d){var idx=domain.length-d.length;return d===domain||idx>1&&domain[idx-1]==="."&&domain.lastIndexOf(d)===idx});if(!whiteListed){throw"URL is not whitelisted: "+url}}}return url}function load(opt,callback){var error=callback||function(e){throw e},url;try{url=load.sanitizeUrl(opt)}catch(err){error(err);return}if(!url){error("Invalid URL: "+opt.url)}else if(load.useXHR){return xhr(url,callback)}else if(startsWith(url,fileProtocol)){return file(url.slice(fileProtocol.length),callback)}else if(url.indexOf("://")<0){return file(url,callback)}else{return http(url,callback)}}function xhrHasResponse(request){var type=request.responseType;return type&&type!=="text"?request.response:request.responseText}function xhr(url,callback){var async=!!callback;var request=new XMLHttpRequest;if(this.XDomainRequest&&!("withCredentials"in request)&&/^(http(s)?:)?\/\//.test(url))request=new XDomainRequest;function respond(){var status=request.status;if(!status&&xhrHasResponse(request)||status>=200&&status<300||status===304){callback(null,request.responseText)}else{callback(request,null)}}if(async){if("onload"in request){request.onload=request.onerror=respond
}else{request.onreadystatechange=function(){if(request.readyState>3)respond()}}}request.open("GET",url,async);request.send();if(!async&&xhrHasResponse(request)){return request.responseText}}function file(filename,callback){var fs=require("fs");if(!callback){return fs.readFileSync(filename,"utf8")}fs.readFile(filename,callback)}function http(url,callback){if(!callback){return require("sync-request")("GET",url).getBody()}var options={url:url,encoding:null,gzip:true};require("request")(options,function(error,response,body){if(!error&&response.statusCode===200){callback(null,body)}else{error=error||"Load failed with response code "+response.statusCode+".";callback(error,null)}})}function startsWith(string,searchString){return string==null?false:string.lastIndexOf(searchString,0)===0}load.sanitizeUrl=sanitizeUrl;load.useXHR=typeof XMLHttpRequest!=="undefined";module.exports=load},{fs:2,request:2,"sync-request":2,url:2}],21:[function(require,module,exports){var util=require("../util");var type=require("./type");var formats=require("./formats");function read(data,format){var type=format&&format.type||"json";data=formats[type](data,format);if(format&&format.parse)parse(data,format.parse);return data}function parse(data,types){var cols,parsers,d,i,j,clen,len=data.length;types=types==="auto"?type.inferAll(data):util.duplicate(types);cols=util.keys(types);parsers=cols.map(function(c){return type.parsers[types[c]]});for(i=0,clen=cols.length;i<len;++i){d=data[i];for(j=0;j<clen;++j){d[cols[j]]=parsers[j](d[cols[j]])}}type.annotation(data,types)}read.formats=formats;module.exports=read},{"../util":29,"./formats":16,"./type":23}],22:[function(require,module,exports){var util=require("../util");var load=require("./load");var read=require("./read");module.exports=util.keys(read.formats).reduce(function(out,type){out[type]=function(opt,format,callback){if(util.isString(opt)){opt={url:opt}}if(arguments.length===2&&util.isFunction(format)){callback=format;format=undefined}format=util.extend({parse:"auto"},format);format.type=type;var data=load(opt,callback?function(error,data){if(error){callback(error,null);return}try{data=read(data,format);callback(null,data)}catch(e){callback(e,null)}}:undefined);if(!callback)return read(data,format)};return out},{})},{"../util":29,"./load":20,"./read":21}],23:[function(require,module,exports){var util=require("../util");var TYPES="__types__";var PARSERS={"boolean":util.boolean,integer:util.number,number:util.number,date:util.date,string:function(x){return x===""?null:x}};var TESTS={"boolean":function(x){return x==="true"||x==="false"||util.isBoolean(x)},integer:function(x){return TESTS.number(x)&&(x=+x)===~~x},number:function(x){return!isNaN(+x)&&!util.isDate(x)},date:function(x){return!isNaN(Date.parse(x))}};function annotation(data,types){if(!types)return data&&data[TYPES]||null;data[TYPES]=types}function type(values,f){f=util.$(f);var v,i,n;if(values[TYPES]){v=f(values[TYPES]);if(util.isString(v))return v}for(i=0,n=values.length;!util.isValid(v)&&i<n;++i){v=f?f(values[i]):values[i]}return util.isDate(v)?"date":util.isNumber(v)?"number":util.isBoolean(v)?"boolean":util.isString(v)?"string":null}function typeAll(data,fields){if(!data.length)return;fields=fields||util.keys(data[0]);return fields.reduce(function(types,f){return types[f]=type(data,f),types},{})}function infer(values,f){f=util.$(f);var i,j,v;var types=["boolean","integer","number","date"];for(i=0;i<values.length;++i){v=f?f(values[i]):values[i];for(j=0;j<types.length;++j){if(util.isValid(v)&&!TESTS[types[j]](v)){types.splice(j,1);j-=1}}if(types.length===0)return"string"}return types[0]}function inferAll(data,fields){fields=fields||util.keys(data[0]);return fields.reduce(function(types,f){types[f]=infer(data,f);return types},{})}type.annotation=annotation;type.all=typeAll;type.infer=infer;type.inferAll=inferAll;type.parsers=PARSERS;module.exports=type},{"../util":29}],24:[function(require,module,exports){var util=require("./util");var dl={version:"1.4.6",load:require("./import/load"),read:require("./import/read"),type:require("./import/type"),Aggregator:require("./aggregate/aggregator"),groupby:require("./aggregate/groupby"),bins:require("./bins/bins"),$bin:require("./bins/histogram").$bin,histogram:require("./bins/histogram").histogram,format:require("./format"),print:require("./print"),template:require("./template"),time:require("./time")};util.extend(dl,util);util.extend(dl,require("./generate"));util.extend(dl,require("./stats"));util.extend(dl,require("./import/readers"));module.exports=dl},{"./aggregate/aggregator":7,"./aggregate/groupby":9,"./bins/bins":11,"./bins/histogram":12,"./format":13,"./generate":14,"./import/load":20,"./import/read":21,"./import/readers":22,"./import/type":23,"./print":25,"./stats":26,"./template":27,"./time":28,"./util":29}],25:[function(require,module,exports){var util=require("./util");var type=require("./import/type");var stats=require("./stats");var template=require("./template");var FMT={date:'|time:"%m/%d/%Y %H:%M:%S"',number:'|number:".4f"',integer:'|number:"d"'};var POS={number:"left",integer:"left"};module.exports.table=function(data,opt){opt=util.extend({separator:" ",minwidth:8,maxwidth:15},opt);var fields=opt.fields||util.keys(data[0]),types=type.all(data);if(opt.start||opt.limit){var a=opt.start||0,b=opt.limit?a+opt.limit:data.length;data=data.slice(a,b)}var lens=fields.map(function(name){var format=FMT[types[name]]||"",t=template("{{"+name+format+"}}"),l=stats.max(data,function(x){return t(x).length});l=Math.max(Math.min(name.length,opt.minwidth),l);return opt.maxwidth>0?Math.min(l,opt.maxwidth):l});var head=fields.map(function(name,i){return util.truncate(util.pad(name,lens[i],"center"),lens[i])}).join(opt.separator);var tmpl=template(fields.map(function(name,i){return"{{"+name+(FMT[types[name]]||"")+("|pad:"+lens[i]+","+(POS[types[name]]||"right"))+("|truncate:"+lens[i])+"}}"}).join(opt.separator));return head+"\n"+data.map(tmpl).join("\n")};module.exports.summary=function(s){s=s?s.__summary__?s:stats.summary(s):this;var str=[],i,n;for(i=0,n=s.length;i<n;++i){str.push("-- "+s[i].field+" --");if(s[i].type==="string"||s[i].distinct<10){str.push(printCategoricalProfile(s[i]))}else{str.push(printQuantitativeProfile(s[i]))}str.push("")}return str.join("\n")};function printQuantitativeProfile(p){return["valid:    "+p.valid,"missing:  "+p.missing,"distinct: "+p.distinct,"min:      "+p.min,"max:      "+p.max,"median:   "+p.median,"mean:     "+p.mean,"stdev:    "+p.stdev,"modeskew: "+p.modeskew].join("\n")}function printCategoricalProfile(p){var list=["valid:    "+p.valid,"missing:  "+p.missing,"distinct: "+p.distinct,"top values: "];var u=p.unique;var top=util.keys(u).sort(function(a,b){return u[b]-u[a]}).slice(0,6).map(function(v){return" '"+v+"' ("+u[v]+")"});return list.concat(top).join("\n")}},{"./import/type":23,"./stats":26,"./template":27,"./util":29}],26:[function(require,module,exports){var util=require("./util");var type=require("./import/type");var gen=require("./generate");var stats={};stats.unique=function(values,f,results){f=util.$(f);results=results||[];var u={},v,i,n;for(i=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];if(v in u)continue;u[v]=1;results.push(v)}return results};stats.count=function(values){return values&&values.length||0};stats.count.valid=function(values,f){f=util.$(f);var v,i,n,valid=0;for(i=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v))valid+=1}return valid};stats.count.missing=function(values,f){f=util.$(f);var v,i,n,count=0;for(i=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];if(v==null)count+=1}return count};stats.count.distinct=function(values,f){f=util.$(f);var u={},v,i,n,count=0;for(i=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];if(v in u)continue;u[v]=1;count+=1}return count};stats.count.map=function(values,f){f=util.$(f);var map={},v,i,n;for(i=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];map[v]=v in map?map[v]+1:1}return map};stats.median=function(values,f){if(f)values=values.map(util.$(f));values=values.filter(util.isValid).sort(util.cmp);return stats.quantile(values,.5)};stats.quartile=function(values,f){if(f)values=values.map(util.$(f));values=values.filter(util.isValid).sort(util.cmp);var q=stats.quantile;return[q(values,.25),q(values,.5),q(values,.75)]};stats.quantile=function(values,f,p){if(p===undefined){p=f;f=util.identity}f=util.$(f);var H=(values.length-1)*p+1,h=Math.floor(H),v=+f(values[h-1]),e=H-h;return e?v+e*(f(values[h])-v):v};stats.sum=function(values,f){f=util.$(f);for(var sum=0,i=0,n=values.length,v;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v))sum+=v}return sum};stats.mean=function(values,f){f=util.$(f);var mean=0,delta,i,n,c,v;for(i=0,c=0,n=values.length;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){delta=v-mean;mean=mean+delta/++c}}return mean};stats.variance=function(values,f){f=util.$(f);if(!util.isArray(values)||values.length<2)return 0;var mean=0,M2=0,delta,i,c,v;for(i=0,c=0;i<values.length;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){delta=v-mean;mean=mean+delta/++c;M2=M2+delta*(v-mean)}}M2=M2/(c-1);return M2};stats.stdev=function(values,f){return Math.sqrt(stats.variance(values,f))};stats.modeskew=function(values,f){var avg=stats.mean(values,f),med=stats.median(values,f),std=stats.stdev(values,f);return std===0?0:(avg-med)/std};stats.min=function(values,f){return stats.extent(values,f)[0]};stats.max=function(values,f){return stats.extent(values,f)[1]};stats.extent=function(values,f){f=util.$(f);var a,b,v,i,n=values.length;for(i=0;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){a=b=v;break}}for(;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){if(v<a)a=v;if(v>b)b=v}}return[a,b]};stats.extent.index=function(values,f){f=util.$(f);var x=-1,y=-1,a,b,v,i,n=values.length;for(i=0;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){a=b=v;x=y=i;break}}for(;i<n;++i){v=f?f(values[i]):values[i];if(util.isValid(v)){if(v<a){a=v;x=i}if(v>b){b=v;y=i}}}return[x,y]};stats.dot=function(values,a,b){var sum=0,i,v;if(!b){if(values.length!==a.length){throw Error("Array lengths must match.")}for(i=0;i<values.length;++i){v=values[i]*a[i];if(v===v)sum+=v}}else{a=util.$(a);b=util.$(b);for(i=0;i<values.length;++i){v=a(values[i])*b(values[i]);if(v===v)sum+=v}}return sum};stats.rank=function(values,f){f=util.$(f)||util.identity;var a=values.map(function(v,i){return{idx:i,val:f(v)}}).sort(util.comparator("val"));var n=values.length,r=Array(n),tie=-1,p={},i,v,mu;for(i=0;i<n;++i){v=a[i].val;if(tie<0&&p===v){tie=i-1}else if(tie>-1&&p!==v){mu=1+(i-1+tie)/2;for(;tie<i;++tie)r[a[tie].idx]=mu;tie=-1}r[a[i].idx]=i+1;p=v}if(tie>-1){mu=1+(n-1+tie)/2;for(;tie<n;++tie)r[a[tie].idx]=mu}return r};stats.cor=function(values,a,b){var fn=b;b=fn?values.map(util.$(b)):a;a=fn?values.map(util.$(a)):values;var dot=stats.dot(a,b),mua=stats.mean(a),mub=stats.mean(b),sda=stats.stdev(a),sdb=stats.stdev(b),n=values.length;return(dot-n*mua*mub)/((n-1)*sda*sdb)};stats.cor.rank=function(values,a,b){var ra=b?stats.rank(values,util.$(a)):stats.rank(values),rb=b?stats.rank(values,util.$(b)):stats.rank(a),n=values.length,i,s,d;for(i=0,s=0;i<n;++i){d=ra[i]-rb[i];s+=d*d}return 1-6*s/(n*(n*n-1))};stats.cor.dist=function(values,a,b){var X=b?values.map(util.$(a)):values,Y=b?values.map(util.$(b)):a;var A=stats.dist.mat(X),B=stats.dist.mat(Y),n=A.length,i,aa,bb,ab;for(i=0,aa=0,bb=0,ab=0;i<n;++i){aa+=A[i]*A[i];bb+=B[i]*B[i];ab+=A[i]*B[i]}return Math.sqrt(ab/Math.sqrt(aa*bb))};stats.dist=function(values,a,b,exp){var f=util.isFunction(b)||util.isString(b),X=values,Y=f?values:a,e=f?exp:b,L2=e===2||e==null,n=values.length,s=0,d,i;if(f){a=util.$(a);b=util.$(b)}for(i=0;i<n;++i){d=f?a(X[i])-b(Y[i]):X[i]-Y[i];s+=L2?d*d:Math.pow(Math.abs(d),e)}return L2?Math.sqrt(s):Math.pow(s,1/e)};stats.dist.mat=function(X){var n=X.length,m=n*n,A=Array(m),R=gen.zeros(n),M=0,v,i,j;for(i=0;i<n;++i){A[i*n+i]=0;for(j=i+1;j<n;++j){A[i*n+j]=v=Math.abs(X[i]-X[j]);A[j*n+i]=v;R[i]+=v;R[j]+=v}}for(i=0;i<n;++i){M+=R[i];R[i]/=n}M/=m;for(i=0;i<n;++i){for(j=i;j<n;++j){A[i*n+j]+=M-R[i]-R[j];A[j*n+i]=A[i*n+j]}}return A};stats.entropy=function(counts,f){f=util.$(f);var i,p,s=0,H=0,n=counts.length;for(i=0;i<n;++i){s+=f?f(counts[i]):counts[i]}if(s===0)return 0;for(i=0;i<n;++i){p=(f?f(counts[i]):counts[i])/s;if(p)H+=p*Math.log(p)}return-H/Math.LN2};stats.mutual=function(values,a,b,counts){var x=counts?values.map(util.$(a)):values,y=counts?values.map(util.$(b)):a,z=counts?values.map(util.$(counts)):b;var px={},py={},n=z.length,s=0,I=0,H=0,p,t,i;for(i=0;i<n;++i){px[x[i]]=0;py[y[i]]=0}for(i=0;i<n;++i){px[x[i]]+=z[i];py[y[i]]+=z[i];s+=z[i]}t=1/(s*Math.LN2);for(i=0;i<n;++i){if(z[i]===0)continue;p=s*z[i]/(px[x[i]]*py[y[i]]);I+=z[i]*t*Math.log(p);H+=z[i]*t*Math.log(z[i]/s)}return[I,1+I/H]};stats.mutual.info=function(values,a,b,counts){return stats.mutual(values,a,b,counts)[0]};stats.mutual.dist=function(values,a,b,counts){return stats.mutual(values,a,b,counts)[1]};stats.profile=function(values,f){var mean=0,valid=0,missing=0,distinct=0,min=null,max=null,M2=0,vals=[],u={},delta,sd,i,v,x;for(i=0;i<values.length;++i){v=f?f(values[i]):values[i];u[v]=v in u?u[v]+1:(distinct+=1,1);if(v==null){++missing}else if(util.isValid(v)){x=typeof v==="string"?v.length:v;if(min===null||x<min)min=x;if(max===null||x>max)max=x;delta=x-mean;mean=mean+delta/++valid;M2=M2+delta*(x-mean);vals.push(x)}}M2=M2/(valid-1);sd=Math.sqrt(M2);vals.sort(util.cmp);return{type:type(values,f),unique:u,count:values.length,valid:valid,missing:missing,distinct:distinct,min:min,max:max,mean:mean,stdev:sd,median:v=stats.quantile(vals,.5),q1:stats.quantile(vals,.25),q3:stats.quantile(vals,.75),modeskew:sd===0?0:(mean-v)/sd}};stats.summary=function(data,fields){fields=fields||util.keys(data[0]);var s=fields.map(function(f){var p=stats.profile(data,util.$(f));return p.field=f,p});return s.__summary__=true,s};module.exports=stats},{"./generate":14,"./import/type":23,"./util":29}],27:[function(require,module,exports){var util=require("./util"),format=require("./format");var context={formats:[],format_map:{},truncate:util.truncate,pad:util.pad};function template(text){var src=source(text,"d");src="var __t; return "+src+";";return new Function("d",src).bind(context)}template.source=source;template.context=context;module.exports=template;template.clearFormatCache=function(){context.formats=[];context.format_map={}};template.property=function(object,property){var src=util.field(property).map(util.str).join("][");return object+"["+src+"]"};function source(text,variable,properties){variable=variable||"obj";var index=0;var src="'";var regex=template_re;text.replace(regex,function(match,interpolate,offset){src+=text.slice(index,offset).replace(template_escaper,template_escapeChar);index=offset+match.length;if(interpolate){src+="'\n+((__t=("+template_var(interpolate,variable,properties)+"))==null?'':__t)+\n'"}return match});return src+"'"}function template_var(text,variable,properties){var filters=text.match(filter_re);var prop=filters.shift().trim();var stringCast=true;function strcall(fn){fn=fn||"";if(stringCast){stringCast=false;src="String("+src+")"+fn}else{src+=fn}return src}function date(){return"(typeof "+src+'==="number"?new Date('+src+"):"+src+")"}function number_format(fmt,key){a=template_format(args[0],key,fmt);stringCast=false;src="this.formats["+a+"]("+src+")"}function time_format(fmt,key){a=template_format(args[0],key,fmt);stringCast=false;src="this.formats["+a+"]("+date()+")"}if(properties)properties[prop]=1;var src=template.property(variable,prop);for(var i=0;i<filters.length;++i){var f=filters[i],args=null,pidx,a,b;if((pidx=f.indexOf(":"))>0){f=f.slice(0,pidx);args=filters[i].slice(pidx+1).match(args_re).map(function(s){return s.trim()})}f=f.trim();switch(f){case"length":strcall(".length");break;case"lower":strcall(".toLowerCase()");break;case"upper":strcall(".toUpperCase()");break;case"lower-locale":strcall(".toLocaleLowerCase()");break;case"upper-locale":strcall(".toLocaleUpperCase()");break;case"trim":strcall(".trim()");break;case"left":a=util.number(args[0]);strcall(".slice(0,"+a+")");break;case"right":a=util.number(args[0]);strcall(".slice(-"+a+")");break;case"mid":a=util.number(args[0]);b=a+util.number(args[1]);strcall(".slice(+"+a+","+b+")");break;case"slice":a=util.number(args[0]);strcall(".slice("+a+(args.length>1?","+util.number(args[1]):"")+")");break;case"truncate":a=util.number(args[0]);b=args[1];b=b!=="left"&&b!=="middle"&&b!=="center"?"right":b;src="this.truncate("+strcall()+","+a+",'"+b+"')";break;case"pad":a=util.number(args[0]);b=args[1];b=b!=="left"&&b!=="middle"&&b!=="center"?"right":b;src="this.pad("+strcall()+","+a+",'"+b+"')";break;case"number":number_format(format.number,"number");break;case"time":time_format(format.time,"time");break;case"time-utc":time_format(format.utc,"time-utc");break;default:throw Error("Unrecognized template filter: "+f)}}return src}var template_re=/\{\{(.+?)\}\}|$/g,filter_re=/(?:"[^"]*"|\'[^\']*\'|[^\|"]+|[^\|\']+)+/g,args_re=/(?:"[^"]*"|\'[^\']*\'|[^,"]+|[^,\']+)+/g;var template_escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var template_escaper=/\\|'|\r|\n|\u2028|\u2029/g;function template_escapeChar(match){return"\\"+template_escapes[match]}function template_format(pattern,key,fmt){if(pattern[0]==="'"&&pattern[pattern.length-1]==="'"||pattern[0]==='"'&&pattern[pattern.length-1]==='"'){pattern=pattern.slice(1,-1)}else{throw Error("Format pattern must be quoted: "+pattern)}key=key+":"+pattern;if(!context.format_map[key]){var f=fmt(pattern);var i=context.formats.length;context.formats.push(f);context.format_map[key]=i}return context.format_map[key]}},{"./format":13,"./util":29}],28:[function(require,module,exports){var d3_time=require("d3-time");var tempDate=new Date,baseDate=new Date(0,0,1).setFullYear(0),utcBaseDate=new Date(Date.UTC(0,0,1)).setUTCFullYear(0);function date(d){return tempDate.setTime(+d),tempDate}function entry(type,date,unit,step,min,max){var e={type:type,date:date,unit:unit};if(step){e.step=step}else{e.minstep=1}if(min!=null)e.min=min;if(max!=null)e.max=max;return e}function create(type,unit,base,step,min,max){return entry(type,function(d){return unit.offset(base,d)},function(d){return unit.count(base,d)},step,min,max)}var locale=[create("second",d3_time.second,baseDate),create("minute",d3_time.minute,baseDate),create("hour",d3_time.hour,baseDate),create("day",d3_time.day,baseDate,[1,7]),create("month",d3_time.month,baseDate,[1,3,6]),create("year",d3_time.year,baseDate),entry("seconds",function(d){return new Date(1970,0,1,0,0,d)},function(d){return date(d).getSeconds()},null,0,59),entry("minutes",function(d){return new Date(1970,0,1,0,d)},function(d){return date(d).getMinutes()},null,0,59),entry("hours",function(d){return new Date(1970,0,1,d)},function(d){return date(d).getHours()},null,0,23),entry("weekdays",function(d){return new Date(1970,0,4+d)},function(d){return date(d).getDay()},[1],0,6),entry("dates",function(d){return new Date(1970,0,d)},function(d){return date(d).getDate()},[1],1,31),entry("months",function(d){return new Date(1970,d%12,1)},function(d){return date(d).getMonth()},[1],0,11)];var utc=[create("second",d3_time.utcSecond,utcBaseDate),create("minute",d3_time.utcMinute,utcBaseDate),create("hour",d3_time.utcHour,utcBaseDate),create("day",d3_time.utcDay,utcBaseDate,[1,7]),create("month",d3_time.utcMonth,utcBaseDate,[1,3,6]),create("year",d3_time.utcYear,utcBaseDate),entry("seconds",function(d){return new Date(Date.UTC(1970,0,1,0,0,d))},function(d){return date(d).getUTCSeconds()},null,0,59),entry("minutes",function(d){return new Date(Date.UTC(1970,0,1,0,d))},function(d){return date(d).getUTCMinutes()},null,0,59),entry("hours",function(d){return new Date(Date.UTC(1970,0,1,d))},function(d){return date(d).getUTCHours()},null,0,23),entry("weekdays",function(d){return new Date(Date.UTC(1970,0,4+d))},function(d){return date(d).getUTCDay()},[1],0,6),entry("dates",function(d){return new Date(Date.UTC(1970,0,d))},function(d){return date(d).getUTCDate()},[1],1,31),entry("months",function(d){return new Date(Date.UTC(1970,d%12,1))},function(d){return date(d).getUTCMonth()},[1],0,11)];var STEPS=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];function find(units,span,minb,maxb){var step=STEPS[0],i,n,bins;for(i=1,n=STEPS.length;i<n;++i){step=STEPS[i];if(span>step[0]){bins=span/step[0];if(bins>maxb){return units[STEPS[i-1][1]]}if(bins>=minb){return units[step[1]]}}}return units[STEPS[n-1][1]]}function toUnitMap(units){var map={},i,n;for(i=0,n=units.length;i<n;++i){map[units[i].type]=units[i]}map.find=function(span,minb,maxb){return find(units,span,minb,maxb)};return map}module.exports=toUnitMap(locale);module.exports.utc=toUnitMap(utc)},{"d3-time":6}],29:[function(require,module,exports){var buffer=require("buffer"),time=require("./time"),utc=time.utc;var u=module.exports={};var FNAME="__name__";u.namedfunc=function(name,f){return f[FNAME]=name,f};u.name=function(f){return f==null?null:f[FNAME]};u.identity=function(x){return x};u.true=u.namedfunc("true",function(){return true});u.false=u.namedfunc("false",function(){return false});u.duplicate=function(obj){return JSON.parse(JSON.stringify(obj))};u.equal=function(a,b){return JSON.stringify(a)===JSON.stringify(b)};u.extend=function(obj){for(var x,name,i=1,len=arguments.length;i<len;++i){x=arguments[i];for(name in x){obj[name]=x[name]}}return obj};u.length=function(x){return x!=null&&x.length!=null?x.length:null};u.keys=function(x){var keys=[],k;for(k in x)keys.push(k);return keys};u.vals=function(x){var vals=[],k;for(k in x)vals.push(x[k]);return vals};u.toMap=function(list,f){return(f=u.$(f))?list.reduce(function(obj,x){return obj[f(x)]=1,obj},{}):list.reduce(function(obj,x){return obj[x]=1,obj},{})};u.keystr=function(values){var n=values.length;if(!n)return"";for(var s=String(values[0]),i=1;i<n;++i){s+="|"+String(values[i])}return s};var toString=Object.prototype.toString;u.isObject=function(obj){return obj===Object(obj)};u.isFunction=function(obj){return toString.call(obj)==="[object Function]"};u.isString=function(obj){return typeof value==="string"||toString.call(obj)==="[object String]"};u.isArray=Array.isArray||function(obj){return toString.call(obj)==="[object Array]"};u.isNumber=function(obj){return typeof obj==="number"||toString.call(obj)==="[object Number]"};u.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)=="[object Boolean]"};u.isDate=function(obj){return toString.call(obj)==="[object Date]"};u.isValid=function(obj){return obj!=null&&obj===obj};u.isBuffer=buffer.Buffer&&buffer.Buffer.isBuffer||u.false;u.number=function(s){return s==null||s===""?null:+s};u.boolean=function(s){return s==null||s===""?null:s==="false"?false:!!s};u.date=function(s){return s==null||s===""?null:Date.parse(s)};u.array=function(x){return x!=null?u.isArray(x)?x:[x]:[]};u.str=function(x){return u.isArray(x)?"["+x.map(u.str)+"]":u.isObject(x)?JSON.stringify(x):u.isString(x)?"'"+util_escape_str(x)+"'":x};var escape_str_re=/(^|[^\\])'/g;function util_escape_str(x){return x.replace(escape_str_re,"$1\\'")}var field_re=/\[(.*?)\]|[^.\[]+/g;u.field=function(f){return String(f).match(field_re).map(function(d){return d[0]!=="["?d:d[1]!=="'"&&d[1]!=='"'?d.slice(1,-1):d.slice(2,-2).replace(/\\(["'])/g,"$1")})};u.accessor=function(f){var s;return f==null||u.isFunction(f)?f:u.namedfunc(f,(s=u.field(f)).length>1?function(x){return s.reduce(function(x,f){return x[f]},x)}:function(x){return x[f]})};u.$=u.accessor;u.mutator=function(f){var s;return u.isString(f)&&(s=u.field(f)).length>1?function(x,v){for(var i=0;i<s.length-1;++i)x=x[s[i]];x[s[i]]=v}:function(x,v){x[f]=v}};u.$func=function(name,op){return function(f){f=u.$(f)||u.identity;var n=name+(u.name(f)?"_"+u.name(f):"");return u.namedfunc(n,function(d){return op(f(d))})}};u.$valid=u.$func("valid",u.isValid);u.$length=u.$func("length",u.length);u.$in=function(f,values){f=u.$(f);var map=u.isArray(values)?u.toMap(values):values;return function(d){return!!map[f(d)]}};u.$year=u.$func("year",time.year.unit);u.$month=u.$func("month",time.months.unit);u.$date=u.$func("date",time.dates.unit);u.$day=u.$func("day",time.weekdays.unit);u.$hour=u.$func("hour",time.hours.unit);u.$minute=u.$func("minute",time.minutes.unit);u.$second=u.$func("second",time.seconds.unit);u.$utcYear=u.$func("utcYear",utc.year.unit);u.$utcMonth=u.$func("utcMonth",utc.months.unit);u.$utcDate=u.$func("utcDate",utc.dates.unit);u.$utcDay=u.$func("utcDay",utc.weekdays.unit);u.$utcHour=u.$func("utcHour",utc.hours.unit);u.$utcMinute=u.$func("utcMinute",utc.minutes.unit);u.$utcSecond=u.$func("utcSecond",utc.seconds.unit);u.comparator=function(sort){var sign=[];if(sort===undefined)sort=[];sort=u.array(sort).map(function(f){var s=1;if(f[0]==="-"){s=-1;f=f.slice(1)}else if(f[0]==="+"){s=+1;f=f.slice(1)}sign.push(s);return u.accessor(f)});return function(a,b){var i,n,f,x,y;for(i=0,n=sort.length;i<n;++i){f=sort[i];x=f(a);y=f(b);if(x<y)return-1*sign[i];if(x>y)return sign[i]}return 0}};u.cmp=function(a,b){if(a<b){return-1}else if(a>b){return 1}else if(a>=b){return 0}else if(a===null){return-1}else if(b===null){return 1}return NaN};u.numcmp=function(a,b){return a-b};u.stablesort=function(array,sortBy,keyFn){var indices=array.reduce(function(idx,v,i){return idx[keyFn(v)]=i,idx},{});array.sort(function(a,b){var sa=sortBy(a),sb=sortBy(b);return sa<sb?-1:sa>sb?1:indices[keyFn(a)]-indices[keyFn(b)]});return array};u.pad=function(s,length,pos,padchar){padchar=padchar||" ";var d=length-s.length;if(d<=0)return s;switch(pos){case"left":return strrep(d,padchar)+s;case"middle":case"center":return strrep(Math.floor(d/2),padchar)+s+strrep(Math.ceil(d/2),padchar);default:return s+strrep(d,padchar)}};function strrep(n,str){var s="",i;for(i=0;i<n;++i)s+=str;return s}u.truncate=function(s,length,pos,word,ellipsis){var len=s.length;if(len<=length)return s;ellipsis=ellipsis!==undefined?String(ellipsis):"…";var l=Math.max(0,length-ellipsis.length);switch(pos){case"left":return ellipsis+(word?truncateOnWord(s,l,1):s.slice(len-l));case"middle":case"center":var l1=Math.ceil(l/2),l2=Math.floor(l/2);return(word?truncateOnWord(s,l1):s.slice(0,l1))+ellipsis+(word?truncateOnWord(s,l2,1):s.slice(len-l2));default:return(word?truncateOnWord(s,l):s.slice(0,l))+ellipsis}};function truncateOnWord(s,len,rev){var cnt=0,tok=s.split(truncate_word_re);if(rev){s=(tok=tok.reverse()).filter(function(w){cnt+=w.length;return cnt<=len}).reverse()}else{s=tok.filter(function(w){cnt+=w.length;return cnt<=len})}return s.length?s.join("").trim():tok[0].slice(0,len)}var truncate_word_re=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/},{"./time":28,buffer:2}],30:[function(require,module,exports){var DEPS=require("./Dependencies").ALL;function create(cs,reflow){var out={};copy(cs,out);out.add=[];out.mod=[];out.rem=[];out.reflow=reflow;return out}function copy(a,b){b.stamp=a?a.stamp:0;b.sort=a?a.sort:null;b.facet=a?a.facet:null;b.trans=a?a.trans:null;b.dirty=a?a.dirty:[];b.request=a?a.request:null;for(var d,i=0,n=DEPS.length;i<n;++i){b[d=DEPS[i]]=a?a[d]:{}}}module.exports={create:create,copy:copy}},{"./Dependencies":33}],31:[function(require,module,exports){var log=require("vega-logging"),Tuple=require("./Tuple"),Base=require("./Node").prototype;function Collector(graph){Base.init.call(this,graph);this._data=[];this.router(true).collector(true)}var prototype=Collector.prototype=Object.create(Base);prototype.constructor=Collector;prototype.data=function(){return this._data};prototype.evaluate=function(input){log.debug(input,["collecting"]);if(input.rem.length){this._data=Tuple.idFilter(this._data,input.rem)}if(input.add.length){this._data=this._data.length?this._data.concat(input.add):input.add}if(input.sort){this._data.sort(input.sort)}if(input.reflow){input.mod=input.mod.concat(Tuple.idFilter(this._data,input.add,input.mod,input.rem));input.reflow=false}return input};module.exports=Collector},{"./Node":36,"./Tuple":38,"vega-logging":45}],32:[function(require,module,exports){var log=require("vega-logging"),ChangeSet=require("./ChangeSet"),Collector=require("./Collector"),Tuple=require("./Tuple"),Node=require("./Node");function DataSource(graph,name,facet){this._graph=graph;this._name=name;this._data=[];this._source=null;this._facet=facet;this._input=ChangeSet.create();this._output=null;this._inputNode=null;this._outputNode=null;this._pipeline=null;this._collector=null;this._mutates=false}var prototype=DataSource.prototype;prototype.name=function(name){if(!arguments.length)return this._name;return this._name=name,this};prototype.source=function(src){if(!arguments.length)return this._source;return this._source=this._graph.data(src)};prototype.insert=function(tuples){this._input.add=this._input.add.concat(tuples.map(Tuple.ingest));return this};prototype.remove=function(where){var remove=this._data.filter(where);this._input.rem=this._input.rem.concat(remove);return this};prototype.update=function(where,field,func){var mod=this._input.mod,ids=Tuple.idMap(mod);this._input.fields[field]=1;this._data.filter(where).forEach(function(x){var prev=x[field],next=func(x);if(prev!==next){Tuple.set(x,field,next);if(ids[x._id]!==1){mod.push(x);ids[x._id]=1}}});return this};prototype.values=function(data){if(!arguments.length)return this._collector.data();this._input.rem=this._data.slice();if(data){this.insert(data)}return this};prototype.mutates=function(m){if(!arguments.length)return this._mutates;this._mutates=this._mutates||m;return this};prototype.last=function(){return this._output};prototype.fire=function(input){if(input)this._input=input;this._graph.propagate(this._input,this._pipeline[0]);return this};prototype.pipeline=function(pipeline){if(!arguments.length)return this._pipeline;var graph=this._graph,status;pipeline.unshift(this._inputNode=DataSourceInput(this));status=graph.preprocess(pipeline);if(status.router){pipeline.push(status.collector=new Collector(graph))}pipeline.push(this._outputNode=DataSourceOutput(this));this._collector=status.collector;this._mutates=!!status.mutates;graph.connect(this._pipeline=pipeline);return this};prototype.synchronize=function(){this._graph.synchronize(this._pipeline);return this};prototype.listener=function(){return DataSourceListener(this).addListener(this._inputNode)};prototype.addListener=function(l){if(l instanceof DataSource){this._collector.addListener(l.listener())}else{this._outputNode.addListener(l)}return this};prototype.removeListener=function(l){this._outputNode.removeListener(l)};prototype.listeners=function(ds){return(ds?this._collector:this._outputNode).listeners()};function DataSourceInput(ds){var input=new Node(ds._graph).router(true).collector(true);input.data=function(){return ds._data};input.evaluate=function(input){log.debug(input,["input",ds._name]);var delta=ds._input,out=ChangeSet.create(input),f;for(f in delta.fields){out.fields[f]=1}if(delta.rem.length){ds._data=Tuple.idFilter(ds._data,delta.rem)}if(delta.add.length){ds._data=ds._data.concat(delta.add)}if(input.reflow){delta.mod=delta.mod.concat(Tuple.idFilter(ds._data,delta.add,delta.mod,delta.rem))}ds._input=ChangeSet.create();out.add=delta.add;out.mod=delta.mod;out.rem=delta.rem;out.facet=ds._facet;return out};return input}function DataSourceOutput(ds){var output=new Node(ds._graph).router(true).reflows(true).collector(true);output.data=function(){return ds._collector?ds._collector.data():ds._data};output.evaluate=function(input){log.debug(input,["output",ds._name]);var out=ChangeSet.create(input,true);if(ds._facet){ds._facet.values=ds.values();input.facet=null}ds._output=input;out.data[ds._name]=1;return out};return output}function DataSourceListener(ds){var l=new Node(ds._graph).router(true);l.evaluate=function(input){if(ds.mutates()){var map=ds._srcMap||(ds._srcMap={}),output=ChangeSet.create(input);
output.add=input.add.map(function(t){return map[t._id]=Tuple.derive(t)});output.mod=input.mod.map(function(t){return Tuple.rederive(t,map[t._id])});output.rem=input.rem.map(function(t){var o=map[t._id];return map[t._id]=null,o});return ds._input=output}else{return ds._input=input}};return l}module.exports=DataSource},{"./ChangeSet":30,"./Collector":31,"./Node":36,"./Tuple":38,"vega-logging":45}],33:[function(require,module,exports){var deps=module.exports={ALL:["data","fields","scales","signals"]};deps.ALL.forEach(function(k){deps[k.toUpperCase()]=k})},{}],34:[function(require,module,exports){var dl=require("datalib"),Heap=require("./Heap"),ChangeSet=require("./ChangeSet"),DataSource=require("./DataSource"),Collector=require("./Collector"),Tuple=require("./Tuple"),Signal=require("./Signal"),Deps=require("./Dependencies");function Graph(){}var prototype=Graph.prototype;prototype.init=function(){this._stamp=0;this._rank=0;this._data={};this._signals={};this.doNotPropagate={}};prototype.rank=function(){return++this._rank};prototype.values=function(type,names,hash){var data=type===Deps.SIGNALS?this._signals:this._data,n=names!==undefined?names:dl.keys(data),vals,i;if(Array.isArray(n)){vals=hash||{};for(i=0;i<n.length;++i){vals[n[i]]=data[n[i]].values()}return vals}else{return data[n].values()}};prototype.dataValues=function(names){return this.values(Deps.DATA,names)};prototype.signalValues=function(names){return this.values(Deps.SIGNALS,names)};prototype.data=function(name,pipeline,facet){var db=this._data;if(!arguments.length){var all=[],key;for(key in db){all.push(db[key])}return all}else if(arguments.length===1){return db[name]}else{return db[name]=new DataSource(this,name,facet).pipeline(pipeline)}};prototype.signal=function(name,init){if(arguments.length===1){var m=this;return Array.isArray(name)?name.map(function(n){return m._signals[n]}):this._signals[name]}else{return this._signals[name]=new Signal(this,name,init)}};prototype.signalRef=function(ref){if(!Array.isArray(ref)){ref=dl.field(ref)}var value=this.signal(ref[0]).value();if(ref.length>1){for(var i=1,n=ref.length;i<n;++i){value=value[ref[i]]}}return value};prototype.propagate=function(pulse,node,stamp){var pulses={},listeners,next,nplse,tpls,ntpls,i,len;var pq=new Heap(function(a,b){return a._qrank-b._qrank});if(pulse.stamp)throw Error("Pulse already has a non-zero stamp.");pulse.stamp=stamp||++this._stamp;pulses[node._id]=pulse;pq.push(node.qrank(true));while(pq.size()>0){node=pq.peek();pulse=pulses[node._id];if(node.rank()!==node.qrank()){pq.replace(node.qrank(true))}else{pq.pop();pulses[node._id]=null;listeners=node._listeners;pulse=this.evaluate(pulse,node);if(pulse!==this.doNotPropagate){if(!pulse.reflow&&node.reflows()){pulse=ChangeSet.create(pulse,true)}for(i=0,len=listeners.length;i<len;++i){next=listeners[i];if((nplse=pulses[next._id])!==undefined){if(nplse===null)throw Error("Already propagated to node.");if(nplse===pulse)continue;tpls=pulse.add.length||pulse.mod.length||pulse.rem.length;ntpls=nplse.add.length||nplse.mod.length||nplse.rem.length;if(tpls&&ntpls)throw Error("Multiple changeset pulses to same node");pulses[next._id]=tpls?pulse:nplse;pulses[next._id].reflow=pulse.reflow||nplse.reflow}else{pq.push(next.qrank(true));pulses[next._id]=pulse}}}}}};prototype.preprocess=function(branch){var graph=this,mutates=0,node,router,collector,collects;for(var i=0;i<branch.length;++i){node=branch[i];if(node.batch()&&!node._collector){if(router||!collector){node=new Collector(graph);branch.splice(i,0,node);router=false}else{node._collector=collector}}if(collects=node.collector())collector=node;router=router||node.router()&&!collects;mutates=mutates||node.mutates();if(node.produces()){branch.splice(i+1,0,new Collector(graph));router=false}}return{router:router,collector:collector,mutates:mutates}};prototype.connect=function(branch){var collector,node,data,signals,i,n,j,m;for(i=0,n=branch.length;i<n;++i){node=branch[i];if(node.collector())collector=node;data=node.dependency(Deps.DATA);for(j=0,m=data.length;j<m;++j){this.data(data[j]).addListener(collector)}signals=node.dependency(Deps.SIGNALS);for(j=0,m=signals.length;j<m;++j){this.signal(signals[j]).addListener(collector)}if(i>0)branch[i-1].addListener(node)}return branch};prototype.disconnect=function(branch){var collector,node,data,signals,i,n,j,m;for(i=0,n=branch.length;i<n;++i){node=branch[i];if(node.collector())collector=node;data=node.dependency(Deps.DATA);for(j=0,m=data.length;j<m;++j){this.data(data[j]).removeListener(collector)}signals=node.dependency(Deps.SIGNALS);for(j=0,m=signals.length;j<m;++j){this.signal(signals[j]).removeListener(collector)}node.disconnect()}return branch};prototype.synchronize=function(branch){var ids={},node,data,i,n,j,m,d,id;for(i=0,n=branch.length;i<n;++i){node=branch[i];if(!node.collector())continue;for(j=0,data=node.data(),m=data.length;j<m;++j){id=(d=data[j])._id;if(ids[id])continue;Tuple.prev_update(d);ids[id]=1}}return this};prototype.reevaluate=function(pulse,node){var reflowed=pulse.reflow&&node.last()>=pulse.stamp,run=node.router()||pulse.add.length||pulse.rem.length;return run||!reflowed||node.reevaluate(pulse)};prototype.evaluate=function(pulse,node){if(!this.reevaluate(pulse,node))return pulse;pulse=node.evaluate(pulse);node.last(pulse.stamp);return pulse};module.exports=Graph},{"./ChangeSet":30,"./Collector":31,"./DataSource":32,"./Dependencies":33,"./Heap":35,"./Signal":37,"./Tuple":38,datalib:24}],35:[function(require,module,exports){function Heap(comparator){this.cmp=comparator;this.nodes=[]}var prototype=Heap.prototype;prototype.size=function(){return this.nodes.length};prototype.clear=function(){return this.nodes=[],this};prototype.peek=function(){return this.nodes[0]};prototype.push=function(x){var array=this.nodes;array.push(x);return _siftdown(array,0,array.length-1,this.cmp)};prototype.pop=function(){var array=this.nodes,last=array.pop(),item;if(array.length){item=array[0];array[0]=last;_siftup(array,0,this.cmp)}else{item=last}return item};prototype.replace=function(item){var array=this.nodes,retval=array[0];array[0]=item;_siftup(array,0,this.cmp);return retval};prototype.pushpop=function(item){var array=this.nodes,ref=array[0];if(array.length&&this.cmp(ref,item)<0){array[0]=item;item=ref;_siftup(array,0,this.cmp)}return item};function _siftdown(array,start,idx,cmp){var item,parent,pidx;item=array[idx];while(idx>start){pidx=idx-1>>1;parent=array[pidx];if(cmp(item,parent)<0){array[idx]=parent;idx=pidx;continue}break}return array[idx]=item}function _siftup(array,idx,cmp){var start=idx,end=array.length,item=array[idx],cidx=2*idx+1,ridx;while(cidx<end){ridx=cidx+1;if(ridx<end&&cmp(array[cidx],array[ridx])>=0){cidx=ridx}array[idx]=array[cidx];idx=cidx;cidx=2*idx+1}array[idx]=item;return _siftdown(array,start,idx,cmp)}module.exports=Heap},{}],36:[function(require,module,exports){var DEPS=require("./Dependencies").ALL,nodeID=0;function Node(graph){if(graph)this.init(graph)}var Flags=Node.Flags={Router:1,Collector:2,Produces:4,Mutates:8,Reflows:16,Batch:32};var prototype=Node.prototype;prototype.init=function(graph){this._id=++nodeID;this._graph=graph;this._rank=graph.rank();this._qrank=null;this._stamp=0;this._listeners=[];this._listeners._ids={};this._deps={};for(var i=0,n=DEPS.length;i<n;++i){this._deps[DEPS[i]]=[]}this._flags=0;return this};prototype.rank=function(){return this._rank};prototype.qrank=function(){if(!arguments.length)return this._qrank;return this._qrank=this._rank,this};prototype.last=function(stamp){if(!arguments.length)return this._stamp;return this._stamp=stamp,this};prototype._setf=function(v,b){if(b){this._flags|=v}else{this._flags&=~v}return this};prototype.router=function(state){if(!arguments.length)return this._flags&Flags.Router;return this._setf(Flags.Router,state)};prototype.collector=function(state){if(!arguments.length)return this._flags&Flags.Collector;return this._setf(Flags.Collector,state)};prototype.produces=function(state){if(!arguments.length)return this._flags&Flags.Produces;return this._setf(Flags.Produces,state)};prototype.mutates=function(state){if(!arguments.length)return this._flags&Flags.Mutates;return this._setf(Flags.Mutates,state)};prototype.reflows=function(state){if(!arguments.length)return this._flags&Flags.Reflows;return this._setf(Flags.Reflows,state)};prototype.batch=function(state){if(!arguments.length)return this._flags&Flags.Batch;return this._setf(Flags.Batch,state)};prototype.dependency=function(type,deps){var d=this._deps[type],n=d._names||(d._names={});if(arguments.length===1){return d}if(deps===null){d.splice(0,d.length);d._names={}}else if(!Array.isArray(deps)){if(n[deps])return this;d.push(deps);n[deps]=1}else{for(var i=0,len=deps.length,dep;i<len;++i){dep=deps[i];if(n[dep])continue;d.push(dep);n[dep]=1}}return this};prototype.listeners=function(){return this._listeners};prototype.addListener=function(l){if(!(l instanceof Node)){throw Error("Listener is not a Node")}if(this._listeners._ids[l._id])return this;this._listeners.push(l);this._listeners._ids[l._id]=1;if(this._rank>l._rank){var q=[l],g=this._graph,cur;while(q.length){cur=q.shift();cur._rank=g.rank();q.unshift.apply(q,cur.listeners())}}return this};prototype.removeListener=function(l){if(!this._listeners._ids[l._id])return false;var idx=this._listeners.indexOf(l),b=idx>=0;if(b){this._listeners.splice(idx,1);this._listeners._ids[l._id]=null}return b};prototype.disconnect=function(){this._listeners=[];this._listeners._ids={}};prototype.evaluate=function(pulse){return pulse};prototype.reevaluate=function(pulse){var prop,dep,i,n,j,m;for(i=0,n=DEPS.length;i<n;++i){prop=DEPS[i];dep=this._deps[prop];for(j=0,m=dep.length;j<m;++j){if(pulse[prop][dep[j]])return true}}return false};Node.reset=function(){nodeID=0};module.exports=Node},{"./Dependencies":33}],37:[function(require,module,exports){var ChangeSet=require("./ChangeSet"),Node=require("./Node"),Base=Node.prototype;function Signal(graph,name,initialValue){Base.init.call(this,graph);this._name=name;this._value=initialValue;this._verbose=false;this._handlers=[];return this}var prototype=Signal.prototype=Object.create(Base);prototype.constructor=Signal;prototype.name=function(){return this._name};prototype.value=function(val){if(!arguments.length)return this._value;return this._value=val,this};prototype.values=prototype.value;prototype.verbose=function(v){if(!arguments.length)return this._verbose;return this._verbose=!!v,this};prototype.evaluate=function(input){return input.signals[this._name]?input:this._graph.doNotPropagate};prototype.fire=function(cs){if(!cs)cs=ChangeSet.create(null,true);cs.signals[this._name]=1;this._graph.propagate(cs,this)};prototype.on=function(handler){var signal=this,node=new Node(this._graph);node.evaluate=function(input){handler(signal.name(),signal.value());return input};this._handlers.push({handler:handler,node:node});return this.addListener(node)};prototype.off=function(handler){var h=this._handlers,i,x;for(i=h.length;--i>=0;){if(!handler||h[i].handler===handler){x=h.splice(i,1)[0];this.removeListener(x.node)}}return this};module.exports=Signal},{"./ChangeSet":30,"./Node":36}],38:[function(require,module,exports){var tupleID=0;function ingest(datum){datum=datum===Object(datum)?datum:{data:datum};datum._id=++tupleID;if(datum._prev)datum._prev=null;return datum}function idMap(a,ids){ids=ids||{};for(var i=0,n=a.length;i<n;++i){ids[a[i]._id]=1}return ids}function copy(t,c){c=c||{};for(var k in t){if(k!=="_prev"&&k!=="_id")c[k]=t[k]}return c}module.exports={ingest:ingest,idMap:idMap,derive:function(d){return ingest(copy(d))},rederive:function(d,t){return copy(d,t)},set:function(t,k,v){return t[k]===v?0:(t[k]=v,1)},prev:function(t){return t._prev||t},prev_init:function(t){if(!t._prev){t._prev={_id:t._id}}},prev_update:function(t){var p=t._prev,k,v;if(p)for(k in t){if(k!=="_prev"&&k!=="_id"){p[k]=(v=t[k])instanceof Object&&v._prev?v._prev:v}}},reset:function(){tupleID=0},idFilter:function(data){var ids={};for(var i=arguments.length;--i>0;){idMap(arguments[i],ids)}return data.filter(function(x){return!ids[x._id]})}}},{}],39:[function(require,module,exports){module.exports={ChangeSet:require("./ChangeSet"),Collector:require("./Collector"),DataSource:require("./DataSource"),Dependencies:require("./Dependencies"),Graph:require("./Graph"),Node:require("./Node"),Signal:require("./Signal"),Tuple:require("./Tuple"),debug:require("vega-logging").debug}},{"./ChangeSet":30,"./Collector":31,"./DataSource":32,"./Dependencies":33,"./Graph":34,"./Node":36,"./Signal":37,"./Tuple":38,"vega-logging":45}],40:[function(require,module,exports){function toMap(list){var map={},i,n;for(i=0,n=list.length;i<n;++i)map[list[i]]=1;return map}function keys(object){var list=[],k;for(k in object)list.push(k);return list}module.exports=function(opt){opt=opt||{};var constants=opt.constants||require("./constants"),functions=(opt.functions||require("./functions"))(codegen),idWhiteList=opt.idWhiteList?toMap(opt.idWhiteList):null,idBlackList=opt.idBlackList?toMap(opt.idBlackList):null,memberDepth=0,FIELD_VAR=opt.fieldVar||"datum",GLOBAL_VAR=opt.globalVar||"signals",globals={},fields={};function codegen_wrap(ast){var retval={code:codegen(ast),globals:keys(globals),fields:keys(fields)};globals={};fields={};return retval}function lookupGlobal(id){return GLOBAL_VAR+'["'+id+'"]'}function codegen(ast){if(typeof ast==="string")return ast;var generator=CODEGEN_TYPES[ast.type];if(generator==null){throw new Error("Unsupported type: "+ast.type)}return generator(ast)}var CODEGEN_TYPES={Literal:function(n){return n.raw},Identifier:function(n){var id=n.name;if(memberDepth>0){return id}if(constants.hasOwnProperty(id)){return constants[id]}if(idWhiteList){if(idWhiteList.hasOwnProperty(id)){return id}else{globals[id]=1;return lookupGlobal(id)}}if(idBlackList&&idBlackList.hasOwnProperty(id)){throw new Error("Illegal identifier: "+id)}return id},Program:function(n){return n.body.map(codegen).join("\n")},MemberExpression:function(n){var d=!n.computed;var o=codegen(n.object);if(d)memberDepth+=1;var p=codegen(n.property);if(o===FIELD_VAR){fields[p]=1}if(d)memberDepth-=1;return o+(d?"."+p:"["+p+"]")},CallExpression:function(n){if(n.callee.type!=="Identifier"){throw new Error("Illegal callee type: "+n.callee.type)}var callee=n.callee.name;var args=n.arguments;var fn=functions.hasOwnProperty(callee)&&functions[callee];if(!fn)throw new Error("Unrecognized function: "+callee);return fn instanceof Function?fn(args):fn+"("+args.map(codegen).join(",")+")"},ArrayExpression:function(n){return"["+n.elements.map(codegen).join(",")+"]"},BinaryExpression:function(n){return"("+codegen(n.left)+n.operator+codegen(n.right)+")"},UnaryExpression:function(n){return"("+n.operator+codegen(n.argument)+")"},ConditionalExpression:function(n){return"("+codegen(n.test)+"?"+codegen(n.consequent)+":"+codegen(n.alternate)+")"},LogicalExpression:function(n){return"("+codegen(n.left)+n.operator+codegen(n.right)+")"},ObjectExpression:function(n){return"{"+n.properties.map(codegen).join(",")+"}"},Property:function(n){memberDepth+=1;var k=codegen(n.key);memberDepth-=1;return k+":"+codegen(n.value)},ExpressionStatement:function(n){return codegen(n.expression)}};codegen_wrap.functions=functions;codegen_wrap.constants=constants;return codegen_wrap}},{"./constants":41,"./functions":42}],41:[function(require,module,exports){module.exports={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2"}},{}],42:[function(require,module,exports){module.exports=function(codegen){function fncall(name,args,cast,type){var obj=codegen(args[0]);if(cast){obj=cast+"("+obj+")";if(cast.lastIndexOf("new ",0)===0)obj="("+obj+")"}return obj+"."+name+(type<0?"":type===0?"()":"("+args.slice(1).map(codegen).join(",")+")")}function fn(name,cast,type){return function(args){return fncall(name,args,cast,type)}}var DATE="new Date",STRING="String",REGEXP="RegExp";return{isNaN:"isNaN",isFinite:"isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(args){if(args.length<3)throw new Error("Missing arguments to clamp function.");if(args.length>3)throw new Error("Too many arguments to clamp function.");var a=args.map(codegen);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",datetime:DATE,date:fn("getDate",DATE,0),day:fn("getDay",DATE,0),year:fn("getFullYear",DATE,0),month:fn("getMonth",DATE,0),hours:fn("getHours",DATE,0),minutes:fn("getMinutes",DATE,0),seconds:fn("getSeconds",DATE,0),milliseconds:fn("getMilliseconds",DATE,0),time:fn("getTime",DATE,0),timezoneoffset:fn("getTimezoneOffset",DATE,0),utcdate:fn("getUTCDate",DATE,0),utcday:fn("getUTCDay",DATE,0),utcyear:fn("getUTCFullYear",DATE,0),utcmonth:fn("getUTCMonth",DATE,0),utchours:fn("getUTCHours",DATE,0),utcminutes:fn("getUTCMinutes",DATE,0),utcseconds:fn("getUTCSeconds",DATE,0),utcmilliseconds:fn("getUTCMilliseconds",DATE,0),length:fn("length",null,-1),indexof:fn("indexOf",null),lastindexof:fn("lastIndexOf",null),parseFloat:"parseFloat",parseInt:"parseInt",upper:fn("toUpperCase",STRING,0),lower:fn("toLowerCase",STRING,0),slice:fn("slice",STRING),substring:fn("substring",STRING),regexp:REGEXP,test:fn("test",REGEXP),"if":function(args){if(args.length<3)throw new Error("Missing arguments to if function.");if(args.length>3)throw new Error("Too many arguments to if function.");var a=args.map(codegen);return a[0]+"?"+a[1]+":"+a[2]}}}},{}],43:[function(require,module,exports){var parser=require("./parser"),codegen=require("./codegen");var expr=module.exports={parse:function(input,opt){return parser.parse("("+input+")",opt)},code:function(opt){return codegen(opt)},compiler:function(args,opt){args=args.slice();var generator=codegen(opt),len=args.length,compile=function(str){var value=generator(expr.parse(str));args[len]='"use strict"; return ('+value.code+");";value.fn=Function.apply(null,args);return value};compile.codegen=generator;return compile},functions:require("./functions"),constants:require("./constants")}},{"./codegen":40,"./constants":41,"./functions":42,"./parser":44}],44:[function(require,module,exports){module.exports=function(){"use strict";var Token,TokenName,Syntax,PropertyKind,Messages,Regex,source,strict,index,lineNumber,lineStart,length,lookahead,state,extra;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9};TokenName={};TokenName[Token.BooleanLiteral]="Boolean";TokenName[Token.EOF]="<end>";TokenName[Token.Identifier]="Identifier";TokenName[Token.Keyword]="Keyword";TokenName[Token.NullLiteral]="Null";TokenName[Token.NumericLiteral]="Numeric";TokenName[Token.Punctuator]="Punctuator";TokenName[Token.StringLiteral]="String";TokenName[Token.RegularExpression]="RegularExpression";Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",UnaryExpression:"UnaryExpression"};PropertyKind={Data:1,Get:2,Set:4};Messages={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"};Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function assert(condition,message){if(!condition){throw new Error("ASSERT: "+message)}}function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return"0123456789abcdefABCDEF".indexOf(ch)>=0}function isOctalDigit(ch){return"01234567".indexOf(ch)>=0}function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(ch)>=0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function isFutureReservedWord(id){switch(id){case"class":case"enum":case"export":case"extends":case"import":case"super":return true;default:return false}}function isStrictModeReservedWord(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return true;default:return false}}function isKeyword(id){if(strict&&isStrictModeReservedWord(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try"||id==="let";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function skipComment(){var ch,start;start=index===0;while(index<length){ch=source.charCodeAt(index);if(isWhiteSpace(ch)){++index}else if(isLineTerminator(ch)){++index;if(ch===13&&source.charCodeAt(index)===10){++index}++lineNumber;lineStart=index;start=true}else{break}}}function scanHexEscape(prefix){var i,len,ch,code=0;len=prefix==="u"?4:2;for(i=0;i<len;++i){if(index<length&&isHexDigit(source[index])){ch=source[index++];code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}else{return""}}return String.fromCharCode(code)}function scanUnicodeCodePointEscape(){var ch,code,cu1,cu2;ch=source[index];code=0;if(ch==="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}while(index<length){ch=source[index++];if(!isHexDigit(ch)){break}code=code*16+"0123456789abcdef".indexOf(ch.toLowerCase())}if(code>1114111||ch!=="}"){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(code<=65535){return String.fromCharCode(code)}cu1=(code-65536>>10)+55296;cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function getEscapedIdentifier(){var ch,id;ch=source.charCodeAt(index++);id=String.fromCharCode(ch);if(ch===92){if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierStart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id=ch}while(index<length){ch=source.charCodeAt(index);if(!isIdentifierPart(ch)){break}++index;id+=String.fromCharCode(ch);if(ch===92){id=id.substr(0,id.length-1);if(source.charCodeAt(index)!==117){throwError({},Messages.UnexpectedToken,"ILLEGAL")}++index;ch=scanHexEscape("u");if(!ch||ch==="\\"||!isIdentifierPart(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}id+=ch}}return id}function getIdentifier(){var start,ch;start=index++;while(index<length){ch=source.charCodeAt(index);if(ch===92){index=start;return getEscapedIdentifier()}if(isIdentifierPart(ch)){++index}else{break}}return source.slice(start,index)}function scanIdentifier(){var start,id,type;start=index;id=source.charCodeAt(index)===92?getEscapedIdentifier():getIdentifier();if(id.length===1){type=Token.Identifier}else if(isKeyword(id)){type=Token.Keyword}else if(id==="null"){type=Token.NullLiteral}else if(id==="true"||id==="false"){type=Token.BooleanLiteral}else{type=Token.Identifier}return{type:type,value:id,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}function scanPunctuator(){var start=index,code=source.charCodeAt(index),code2,ch1=source[index],ch2,ch3,ch4;switch(code){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:++index;if(extra.tokenize){if(code===40){extra.openParenToken=extra.tokens.length}else if(code===123){extra.openCurlyToken=extra.tokens.length}}return{type:Token.Punctuator,value:String.fromCharCode(code),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};default:code2=source.charCodeAt(index+1);if(code2===61){switch(code){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:index+=2;return{type:Token.Punctuator,value:String.fromCharCode(code)+String.fromCharCode(code2),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index};case 33:case 61:index+=2;if(source.charCodeAt(index)===61){++index}return{type:Token.Punctuator,value:source.slice(start,index),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}}}ch4=source.substr(index,4);if(ch4===">>>="){index+=4;return{type:Token.Punctuator,value:ch4,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}ch3=ch4.substr(0,3);if(ch3===">>>"||ch3==="<<="||ch3===">>="){index+=3;return{type:Token.Punctuator,value:ch3,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}ch2=ch3.substr(0,2);if(ch1===ch2[1]&&"+-<>&|".indexOf(ch1)>=0||ch2==="=>"){index+=2;return{type:Token.Punctuator,value:ch2,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}if("<>=!+-*%&|^/".indexOf(ch1)>=0){++index;return{type:Token.Punctuator,value:ch1,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}throwError({},Messages.UnexpectedToken,"ILLEGAL")}function scanHexLiteral(start){var number="";while(index<length){if(!isHexDigit(source[index])){break}number+=source[index++]}if(number.length===0){throwError({},Messages.UnexpectedToken,"ILLEGAL")}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt("0x"+number,16),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}function scanOctalLiteral(start){var number="0"+source[index++];while(index<length){if(!isOctalDigit(source[index])){break}number+=source[index++]}if(isIdentifierStart(source.charCodeAt(index))||isDecimalDigit(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseInt(number,8),octal:true,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}function scanNumericLiteral(){var number,start,ch;ch=source[index];assert(isDecimalDigit(ch.charCodeAt(0))||ch===".","Numeric literal must start with a decimal digit or a decimal point");start=index;number="";if(ch!=="."){number=source[index++];ch=source[index];if(number==="0"){if(ch==="x"||ch==="X"){++index;return scanHexLiteral(start)}if(isOctalDigit(ch)){return scanOctalLiteral(start)}if(ch&&isDecimalDigit(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="."){number+=source[index++];while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="e"||ch==="E"){number+=source[index++];ch=source[index];if(ch==="+"||ch==="-"){number+=source[index++]}if(isDecimalDigit(source.charCodeAt(index))){while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}}else{throwError({},Messages.UnexpectedToken,"ILLEGAL")}}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseFloat(number),lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}function scanStringLiteral(){var str="",quote,start,ch,code,unescaped,restore,octal=false,startLineNumber,startLineStart;
startLineNumber=lineNumber;startLineStart=lineStart;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote="";break}else if(ch==="\\"){ch=source[index++];if(!ch||!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"u":case"x":if(source[index]==="{"){++index;str+=scanUnicodeCodePointEscape()}else{restore=index;unescaped=scanHexEscape(ch);if(unescaped){str+=unescaped}else{index=restore;str+=ch}}break;case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+="	";break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+="";break;default:if(isOctalDigit(ch)){code="01234567".indexOf(ch);if(code!==0){octal=true}if(index<length&&isOctalDigit(source[index])){octal=true;code=code*8+"01234567".indexOf(source[index++]);if("0123".indexOf(ch)>=0&&index<length&&isOctalDigit(source[index])){code=code*8+"01234567".indexOf(source[index++])}}str+=String.fromCharCode(code)}else{str+=ch}break}}else{++lineNumber;if(ch==="\r"&&source[index]==="\n"){++index}lineStart=index}}else if(isLineTerminator(ch.charCodeAt(0))){break}else{str+=ch}}if(quote!==""){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.StringLiteral,value:str,octal:octal,startLineNumber:startLineNumber,startLineStart:startLineStart,lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}function testRegExp(pattern,flags){var tmp=pattern,value;if(flags.indexOf("u")>=0){tmp=tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g,function($0,$1){if(parseInt($1,16)<=1114111){return"x"}throwError({},Messages.InvalidRegExp)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{value=new RegExp(tmp)}catch(e){throwError({},Messages.InvalidRegExp)}try{return new RegExp(pattern,flags)}catch(exception){return null}}function scanRegExpBody(){var ch,str,classMarker,terminated,body;ch=source[index];assert(ch==="/","Regular expression literal must start with a slash");str=source[index++];classMarker=false;terminated=false;while(index<length){ch=source[index++];str+=ch;if(ch==="\\"){ch=source[index++];if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}str+=ch}else if(isLineTerminator(ch.charCodeAt(0))){throwError({},Messages.UnterminatedRegExp)}else if(classMarker){if(ch==="]"){classMarker=false}}else{if(ch==="/"){terminated=true;break}else if(ch==="["){classMarker=true}}}if(!terminated){throwError({},Messages.UnterminatedRegExp)}body=str.substr(1,str.length-2);return{value:body,literal:str}}function scanRegExpFlags(){var ch,str,flags,restore;str="";flags="";while(index<length){ch=source[index];if(!isIdentifierPart(ch.charCodeAt(0))){break}++index;if(ch==="\\"&&index<length){ch=source[index];if(ch==="u"){++index;restore=index;ch=scanHexEscape("u");if(ch){flags+=ch;for(str+="\\u";restore<index;++restore){str+=source[restore]}}else{index=restore;flags+="u";str+="\\u"}throwErrorTolerant({},Messages.UnexpectedToken,"ILLEGAL")}else{str+="\\";throwErrorTolerant({},Messages.UnexpectedToken,"ILLEGAL")}}else{flags+=ch;str+=ch}}return{value:flags,literal:str}}function scanRegExp(){var start,body,flags,value;lookahead=null;skipComment();start=index;body=scanRegExpBody();flags=scanRegExpFlags();value=testRegExp(body.value,flags.value);if(extra.tokenize){return{type:Token.RegularExpression,value:value,regex:{pattern:body.value,flags:flags.value},lineNumber:lineNumber,lineStart:lineStart,start:start,end:index}}return{literal:body.literal+flags.literal,value:value,regex:{pattern:body.value,flags:flags.value},start:start,end:index}}function collectRegex(){var pos,loc,regex,token;skipComment();pos=index;loc={start:{line:lineNumber,column:index-lineStart}};regex=scanRegExp();loc.end={line:lineNumber,column:index-lineStart};if(!extra.tokenize){if(extra.tokens.length>0){token=extra.tokens[extra.tokens.length-1];if(token.range[0]===pos&&token.type==="Punctuator"){if(token.value==="/"||token.value==="/="){extra.tokens.pop()}}}extra.tokens.push({type:"RegularExpression",value:regex.literal,regex:regex.regex,range:[pos,index],loc:loc})}return regex}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral}function advanceSlash(){var prevToken,checkToken;prevToken=extra.tokens[extra.tokens.length-1];if(!prevToken){return collectRegex()}if(prevToken.type==="Punctuator"){if(prevToken.value==="]"){return scanPunctuator()}if(prevToken.value===")"){checkToken=extra.tokens[extra.openParenToken-1];if(checkToken&&checkToken.type==="Keyword"&&(checkToken.value==="if"||checkToken.value==="while"||checkToken.value==="for"||checkToken.value==="with")){return collectRegex()}return scanPunctuator()}if(prevToken.value==="}"){if(extra.tokens[extra.openCurlyToken-3]&&extra.tokens[extra.openCurlyToken-3].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-4];if(!checkToken){return scanPunctuator()}}else if(extra.tokens[extra.openCurlyToken-4]&&extra.tokens[extra.openCurlyToken-4].type==="Keyword"){checkToken=extra.tokens[extra.openCurlyToken-5];if(!checkToken){return collectRegex()}}else{return scanPunctuator()}return scanPunctuator()}return collectRegex()}if(prevToken.type==="Keyword"&&prevToken.value!=="this"){return collectRegex()}return scanPunctuator()}function advance(){var ch;skipComment();if(index>=length){return{type:Token.EOF,lineNumber:lineNumber,lineStart:lineStart,start:index,end:index}}ch=source.charCodeAt(index);if(isIdentifierStart(ch)){return scanIdentifier()}if(ch===40||ch===41||ch===59){return scanPunctuator()}if(ch===39||ch===34){return scanStringLiteral()}if(ch===46){if(isDecimalDigit(source.charCodeAt(index+1))){return scanNumericLiteral()}return scanPunctuator()}if(isDecimalDigit(ch)){return scanNumericLiteral()}if(extra.tokenize&&ch===47){return advanceSlash()}return scanPunctuator()}function collectToken(){var loc,token,value,entry;skipComment();loc={start:{line:lineNumber,column:index-lineStart}};token=advance();loc.end={line:lineNumber,column:index-lineStart};if(token.type!==Token.EOF){value=source.slice(token.start,token.end);entry={type:TokenName[token.type],value:value,range:[token.start,token.end],loc:loc};if(token.regex){entry.regex={pattern:token.regex.pattern,flags:token.regex.flags}}extra.tokens.push(entry)}return token}function lex(){var token;token=lookahead;index=token.end;lineNumber=token.lineNumber;lineStart=token.lineStart;lookahead=typeof extra.tokens!=="undefined"?collectToken():advance();index=token.end;lineNumber=token.lineNumber;lineStart=token.lineStart;return token}function peek(){var pos,line,start;pos=index;line=lineNumber;start=lineStart;lookahead=typeof extra.tokens!=="undefined"?collectToken():advance();index=pos;lineNumber=line;lineStart=start}function Position(){this.line=lineNumber;this.column=index-lineStart}function SourceLocation(){this.start=new Position;this.end=null}function WrappingSourceLocation(startToken){if(startToken.type===Token.StringLiteral){this.start={line:startToken.startLineNumber,column:startToken.start-startToken.startLineStart}}else{this.start={line:startToken.lineNumber,column:startToken.start-startToken.lineStart}}this.end=null}function Node(){index=lookahead.start;if(lookahead.type===Token.StringLiteral){lineNumber=lookahead.startLineNumber;lineStart=lookahead.startLineStart}else{lineNumber=lookahead.lineNumber;lineStart=lookahead.lineStart}if(extra.range){this.range=[index,0]}if(extra.loc){this.loc=new SourceLocation}}function WrappingNode(startToken){if(extra.range){this.range=[startToken.start,0]}if(extra.loc){this.loc=new WrappingSourceLocation(startToken)}}WrappingNode.prototype=Node.prototype={finish:function(){if(extra.range){this.range[1]=index}if(extra.loc){this.loc.end=new Position;if(extra.source){this.loc.source=extra.source}}},finishArrayExpression:function(elements){this.type=Syntax.ArrayExpression;this.elements=elements;this.finish();return this},finishAssignmentExpression:function(operator,left,right){this.type=Syntax.AssignmentExpression;this.operator=operator;this.left=left;this.right=right;this.finish();return this},finishBinaryExpression:function(operator,left,right){this.type=operator==="||"||operator==="&&"?Syntax.LogicalExpression:Syntax.BinaryExpression;this.operator=operator;this.left=left;this.right=right;this.finish();return this},finishCallExpression:function(callee,args){this.type=Syntax.CallExpression;this.callee=callee;this.arguments=args;this.finish();return this},finishConditionalExpression:function(test,consequent,alternate){this.type=Syntax.ConditionalExpression;this.test=test;this.consequent=consequent;this.alternate=alternate;this.finish();return this},finishExpressionStatement:function(expression){this.type=Syntax.ExpressionStatement;this.expression=expression;this.finish();return this},finishIdentifier:function(name){this.type=Syntax.Identifier;this.name=name;this.finish();return this},finishLiteral:function(token){this.type=Syntax.Literal;this.value=token.value;this.raw=source.slice(token.start,token.end);if(token.regex){if(this.raw=="//"){this.raw="/(?:)/"}this.regex=token.regex}this.finish();return this},finishMemberExpression:function(accessor,object,property){this.type=Syntax.MemberExpression;this.computed=accessor==="[";this.object=object;this.property=property;this.finish();return this},finishObjectExpression:function(properties){this.type=Syntax.ObjectExpression;this.properties=properties;this.finish();return this},finishProgram:function(body){this.type=Syntax.Program;this.body=body;this.finish();return this},finishProperty:function(kind,key,value){this.type=Syntax.Property;this.key=key;this.value=value;this.kind=kind;this.finish();return this},finishUnaryExpression:function(operator,argument){this.type=Syntax.UnaryExpression;this.operator=operator;this.argument=argument;this.prefix=true;this.finish();return this}};function peekLineTerminator(){var pos,line,start,found;pos=index;line=lineNumber;start=lineStart;skipComment();found=lineNumber!==line;index=pos;lineNumber=line;lineStart=start;return found}function throwError(token,messageFormat){var error,args=Array.prototype.slice.call(arguments,2),msg=messageFormat.replace(/%(\d)/g,function(whole,index){assert(index<args.length,"Message reference must be in range");return args[index]});if(typeof token.lineNumber==="number"){error=new Error("Line "+token.lineNumber+": "+msg);error.index=token.start;error.lineNumber=token.lineNumber;error.column=token.start-lineStart+1}else{error=new Error("Line "+lineNumber+": "+msg);error.index=index;error.lineNumber=lineNumber;error.column=index-lineStart+1}error.description=msg;throw error}function throwErrorTolerant(){try{throwError.apply(null,arguments)}catch(e){if(extra.errors){extra.errors.push(e)}else{throw e}}}function throwUnexpected(token){if(token.type===Token.EOF){throwError(token,Messages.UnexpectedEOS)}if(token.type===Token.NumericLiteral){throwError(token,Messages.UnexpectedNumber)}if(token.type===Token.StringLiteral){throwError(token,Messages.UnexpectedString)}if(token.type===Token.Identifier){throwError(token,Messages.UnexpectedIdentifier)}if(token.type===Token.Keyword){if(isFutureReservedWord(token.value)){throwError(token,Messages.UnexpectedReserved)}else if(strict&&isStrictModeReservedWord(token.value)){throwErrorTolerant(token,Messages.StrictReservedWord);return}throwError(token,Messages.UnexpectedToken,token.value)}throwError(token,Messages.UnexpectedToken,token.value)}function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpected(token)}}function expectTolerant(value){if(extra.errors){var token=lookahead;if(token.type!==Token.Punctuator&&token.value!==value){throwErrorTolerant(token,Messages.UnexpectedToken,token.value)}else{lex()}}else{expect(value)}}function match(value){return lookahead.type===Token.Punctuator&&lookahead.value===value}function matchKeyword(keyword){return lookahead.type===Token.Keyword&&lookahead.value===keyword}function consumeSemicolon(){var line;if(source.charCodeAt(index)===59||match(";")){lex();return}line=lineNumber;skipComment();if(lineNumber!==line){return}if(lookahead.type!==Token.EOF&&!match("}")){throwUnexpected(lookahead)}}function parseArrayInitialiser(){var elements=[],node=new Node;expect("[");while(!match("]")){if(match(",")){lex();elements.push(null)}else{elements.push(parseAssignmentExpression());if(!match("]")){expect(",")}}}lex();return node.finishArrayExpression(elements)}function parseObjectPropertyKey(){var token,node=new Node;token=lex();if(token.type===Token.StringLiteral||token.type===Token.NumericLiteral){if(strict&&token.octal){throwErrorTolerant(token,Messages.StrictOctalLiteral)}return node.finishLiteral(token)}return node.finishIdentifier(token.value)}function parseObjectProperty(){var token,key,id,value,node=new Node;token=lookahead;if(token.type===Token.Identifier){id=parseObjectPropertyKey();expect(":");value=parseAssignmentExpression();return node.finishProperty("init",id,value)}if(token.type===Token.EOF||token.type===Token.Punctuator){throwUnexpected(token)}else{key=parseObjectPropertyKey();expect(":");value=parseAssignmentExpression();return node.finishProperty("init",key,value)}}function parseObjectInitialiser(){var properties=[],property,name,key,kind,map={},toString=String,node=new Node;expect("{");while(!match("}")){property=parseObjectProperty();if(property.key.type===Syntax.Identifier){name=property.key.name}else{name=toString(property.key.value)}kind=property.kind==="init"?PropertyKind.Data:property.kind==="get"?PropertyKind.Get:PropertyKind.Set;key="$"+name;if(Object.prototype.hasOwnProperty.call(map,key)){if(map[key]===PropertyKind.Data){if(strict&&kind===PropertyKind.Data){throwErrorTolerant({},Messages.StrictDuplicateProperty)}else if(kind!==PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}}else{if(kind===PropertyKind.Data){throwErrorTolerant({},Messages.AccessorDataProperty)}else if(map[key]&kind){throwErrorTolerant({},Messages.AccessorGetSet)}}map[key]|=kind}else{map[key]=kind}properties.push(property);if(!match("}")){expectTolerant(",")}}expect("}");return node.finishObjectExpression(properties)}function parseGroupExpression(){var expr;expect("(");++state.parenthesisCount;expr=parseExpression();expect(")");return expr}var legalKeywords={"if":1,"this":1};function parsePrimaryExpression(){var type,token,expr,node;if(match("(")){return parseGroupExpression()}if(match("[")){return parseArrayInitialiser()}if(match("{")){return parseObjectInitialiser()}type=lookahead.type;node=new Node;if(type===Token.Identifier||legalKeywords[lookahead.value]){expr=node.finishIdentifier(lex().value)}else if(type===Token.StringLiteral||type===Token.NumericLiteral){if(strict&&lookahead.octal){throwErrorTolerant(lookahead,Messages.StrictOctalLiteral)}expr=node.finishLiteral(lex())}else if(type===Token.Keyword){throw new Error("Disabled.")}else if(type===Token.BooleanLiteral){token=lex();token.value=token.value==="true";expr=node.finishLiteral(token)}else if(type===Token.NullLiteral){token=lex();token.value=null;expr=node.finishLiteral(token)}else if(match("/")||match("/=")){if(typeof extra.tokens!=="undefined"){expr=node.finishLiteral(collectRegex())}else{expr=node.finishLiteral(scanRegExp())}peek()}else{throwUnexpected(lex())}return expr}function parseArguments(){var args=[];expect("(");if(!match(")")){while(index<length){args.push(parseAssignmentExpression());if(match(")")){break}expectTolerant(",")}}expect(")");return args}function parseNonComputedProperty(){var token,node=new Node;token=lex();if(!isIdentifierName(token)){throwUnexpected(token)}return node.finishIdentifier(token.value)}function parseNonComputedMember(){expect(".");return parseNonComputedProperty()}function parseComputedMember(){var expr;expect("[");expr=parseExpression();expect("]");return expr}function parseLeftHandSideExpressionAllowCall(){var expr,args,property,startToken,previousAllowIn=state.allowIn;startToken=lookahead;state.allowIn=true;expr=parsePrimaryExpression();for(;;){if(match(".")){property=parseNonComputedMember();expr=new WrappingNode(startToken).finishMemberExpression(".",expr,property)}else if(match("(")){args=parseArguments();expr=new WrappingNode(startToken).finishCallExpression(expr,args)}else if(match("[")){property=parseComputedMember();expr=new WrappingNode(startToken).finishMemberExpression("[",expr,property)}else{break}}state.allowIn=previousAllowIn;return expr}function parsePostfixExpression(){var expr=parseLeftHandSideExpressionAllowCall();if(lookahead.type===Token.Punctuator){if((match("++")||match("--"))&&!peekLineTerminator()){throw new Error("Disabled.")}}return expr}function parseUnaryExpression(){var token,expr,startToken;if(lookahead.type!==Token.Punctuator&&lookahead.type!==Token.Keyword){expr=parsePostfixExpression()}else if(match("++")||match("--")){throw new Error("Disabled.")}else if(match("+")||match("-")||match("~")||match("!")){startToken=lookahead;token=lex();expr=parseUnaryExpression();expr=new WrappingNode(startToken).finishUnaryExpression(token.value,expr)}else if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof")){throw new Error("Disabled.")}else{expr=parsePostfixExpression()}return expr}function binaryPrecedence(token,allowIn){var prec=0;if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return 0}switch(token.value){case"||":prec=1;break;case"&&":prec=2;break;case"|":prec=3;break;case"^":prec=4;break;case"&":prec=5;break;case"==":case"!=":case"===":case"!==":prec=6;break;case"<":case">":case"<=":case">=":case"instanceof":prec=7;break;case"in":prec=allowIn?7:0;break;case"<<":case">>":case">>>":prec=8;break;case"+":case"-":prec=9;break;case"*":case"/":case"%":prec=11;break;default:break}return prec}function parseBinaryExpression(){var marker,markers,expr,token,prec,stack,right,operator,left,i;marker=lookahead;left=parseUnaryExpression();token=lookahead;prec=binaryPrecedence(token,state.allowIn);if(prec===0){return left}token.prec=prec;lex();markers=[marker,lookahead];right=parseUnaryExpression();stack=[left,token,right];while((prec=binaryPrecedence(lookahead,state.allowIn))>0){while(stack.length>2&&prec<=stack[stack.length-2].prec){right=stack.pop();operator=stack.pop().value;left=stack.pop();markers.pop();expr=new WrappingNode(markers[markers.length-1]).finishBinaryExpression(operator,left,right);stack.push(expr)}token=lex();token.prec=prec;stack.push(token);markers.push(lookahead);expr=parseUnaryExpression();stack.push(expr)}i=stack.length-1;expr=stack[i];markers.pop();while(i>1){expr=new WrappingNode(markers.pop()).finishBinaryExpression(stack[i-1].value,stack[i-2],expr);i-=2}return expr}function parseConditionalExpression(){var expr,previousAllowIn,consequent,alternate,startToken;startToken=lookahead;expr=parseBinaryExpression();if(match("?")){lex();previousAllowIn=state.allowIn;state.allowIn=true;consequent=parseAssignmentExpression();state.allowIn=previousAllowIn;expect(":");alternate=parseAssignmentExpression();expr=new WrappingNode(startToken).finishConditionalExpression(expr,consequent,alternate)}return expr}function parseAssignmentExpression(){var oldParenthesisCount,token,expr,startToken;oldParenthesisCount=state.parenthesisCount;startToken=lookahead;token=lookahead;expr=parseConditionalExpression();return expr}function parseExpression(){var expr=parseAssignmentExpression();if(match(",")){throw new Error("Disabled.")}return expr}function parseExpressionStatement(node){var expr=parseExpression();consumeSemicolon();return node.finishExpressionStatement(expr)}function parseStatement(){var type=lookahead.type,expr,node;if(type===Token.EOF){throwUnexpected(lookahead)}if(type===Token.Punctuator&&lookahead.value==="{"){throw new Error("Disabled.")}node=new Node;if(type===Token.Punctuator){switch(lookahead.value){case";":throw new Error("Disabled.");case"(":return parseExpressionStatement(node);default:break}}else if(type===Token.Keyword){throw new Error("Disabled.")}expr=parseExpression();consumeSemicolon();return node.finishExpressionStatement(expr)}function parseSourceElement(){if(lookahead.type===Token.Keyword){switch(lookahead.value){case"const":case"let":throw new Error("Disabled.");case"function":throw new Error("Disabled.");default:return parseStatement()}}if(lookahead.type!==Token.EOF){return parseStatement()}}function parseSourceElements(){var sourceElement,sourceElements=[],token,directive,firstRestricted;while(index<length){token=lookahead;if(token.type!==Token.StringLiteral){break}sourceElement=parseSourceElement();sourceElements.push(sourceElement);if(sourceElement.expression.type!==Syntax.Literal){break}directive=source.slice(token.start+1,token.end-1);if(directive==="use strict"){strict=true;if(firstRestricted){throwErrorTolerant(firstRestricted,Messages.StrictOctalLiteral)}}else{if(!firstRestricted&&token.octal){firstRestricted=token}}}while(index<length){sourceElement=parseSourceElement();if(typeof sourceElement==="undefined"){break}sourceElements.push(sourceElement)}return sourceElements}function parseProgram(){var body,node;skipComment();peek();node=new Node;strict=true;body=parseSourceElements();return node.finishProgram(body)}function filterTokenLocation(){var i,entry,token,tokens=[];for(i=0;i<extra.tokens.length;++i){entry=extra.tokens[i];token={type:entry.type,value:entry.value};if(entry.regex){token.regex={pattern:entry.regex.pattern,flags:entry.regex.flags}}if(extra.range){token.range=entry.range}if(extra.loc){token.loc=entry.loc}tokens.push(token)}extra.tokens=tokens}function tokenize(code,options){var toString,tokens;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowIn:true,labelSet:{},inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};extra={};options=options||{};options.tokens=true;extra.tokens=[];extra.tokenize=true;extra.openParenToken=-1;extra.openCurlyToken=-1;extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}try{peek();if(lookahead.type===Token.EOF){return extra.tokens}lex();while(lookahead.type!==Token.EOF){try{lex()}catch(lexError){if(extra.errors){extra.errors.push(lexError);break}else{throw lexError}}}filterTokenLocation();tokens=extra.tokens;if(typeof extra.errors!=="undefined"){tokens.errors=extra.errors}}catch(e){throw e}finally{extra={}}return tokens}function parse(code,options){var program,toString;toString=String;if(typeof code!=="string"&&!(code instanceof String)){code=toString(code)}source=code;index=0;lineNumber=source.length>0?1:0;lineStart=0;length=source.length;lookahead=null;state={allowIn:true,labelSet:{},parenthesisCount:0,inFunctionBody:false,inIteration:false,inSwitch:false,lastCommentStart:-1};extra={};if(typeof options!=="undefined"){extra.range=typeof options.range==="boolean"&&options.range;extra.loc=typeof options.loc==="boolean"&&options.loc;if(extra.loc&&options.source!==null&&options.source!==undefined){extra.source=toString(options.source)}if(typeof options.tokens==="boolean"&&options.tokens){extra.tokens=[]}if(typeof options.tolerant==="boolean"&&options.tolerant){extra.errors=[]}}try{program=parseProgram();if(typeof extra.tokens!=="undefined"){filterTokenLocation();program.tokens=extra.tokens}if(typeof extra.errors!=="undefined"){program.errors=extra.errors}}catch(e){throw e}finally{extra={}}return program}return{tokenize:tokenize,parse:parse}}()},{}],45:[function(require,module,exports){var ts=Date.now();function write(msg){msg="[Vega Log] "+msg;console.log(msg)}function error(msg){msg="[Vega Err] "+msg;console.error(msg)}function debug(input,args){if(!debug.enable)return;var log=Function.prototype.bind.call(console.log,console);var state={prevTime:Date.now()-ts,stamp:input.stamp};if(input.add){state.add=input.add.length;state.mod=input.mod.length;state.rem=input.rem.length;state.reflow=!!input.reflow}log.apply(console,(args.push(JSON.stringify(state)),args));ts=Date.now()}module.exports={log:write,error:error,debug:(debug.enable=false,debug)}},{}],46:[function(require,module,exports){module.exports={path:require("./path"),render:require("./render"),Item:require("./util/Item"),bound:require("./util/bound"),Bounds:require("./util/Bounds"),Gradient:require("./util/Gradient"),toJSON:require("./util/scene").toJSON,fromJSON:require("./util/scene").fromJSON}},{"./path":48,"./render":68,"./util/Bounds":74,"./util/Gradient":76,"./util/Item":78,"./util/bound":79,"./util/scene":82}],47:[function(require,module,exports){var segmentCache={},bezierCache={},join=[].join;function segments(x,y,rx,ry,large,sweep,rotateX,ox,oy){var key=join.call(arguments);if(segmentCache[key]){return segmentCache[key]}var th=rotateX*(Math.PI/180);var sin_th=Math.sin(th);var cos_th=Math.cos(th);rx=Math.abs(rx);ry=Math.abs(ry);var px=cos_th*(ox-x)*.5+sin_th*(oy-y)*.5;var py=cos_th*(oy-y)*.5-sin_th*(ox-x)*.5;var pl=px*px/(rx*rx)+py*py/(ry*ry);if(pl>1){pl=Math.sqrt(pl);rx*=pl;ry*=pl}var a00=cos_th/rx;var a01=sin_th/rx;var a10=-sin_th/ry;var a11=cos_th/ry;var x0=a00*ox+a01*oy;var y0=a10*ox+a11*oy;var x1=a00*x+a01*y;var y1=a10*x+a11*y;var d=(x1-x0)*(x1-x0)+(y1-y0)*(y1-y0);var sfactor_sq=1/d-.25;if(sfactor_sq<0)sfactor_sq=0;var sfactor=Math.sqrt(sfactor_sq);if(sweep==large)sfactor=-sfactor;var xc=.5*(x0+x1)-sfactor*(y1-y0);var yc=.5*(y0+y1)+sfactor*(x1-x0);var th0=Math.atan2(y0-yc,x0-xc);var th1=Math.atan2(y1-yc,x1-xc);var th_arc=th1-th0;if(th_arc<0&&sweep===1){th_arc+=2*Math.PI}else if(th_arc>0&&sweep===0){th_arc-=2*Math.PI}var segs=Math.ceil(Math.abs(th_arc/(Math.PI*.5+.001)));var result=[];for(var i=0;i<segs;++i){var th2=th0+i*th_arc/segs;var th3=th0+(i+1)*th_arc/segs;result[i]=[xc,yc,th2,th3,rx,ry,sin_th,cos_th]}return segmentCache[key]=result}function bezier(params){var key=join.call(params);if(bezierCache[key]){return bezierCache[key]}var cx=params[0],cy=params[1],th0=params[2],th1=params[3],rx=params[4],ry=params[5],sin_th=params[6],cos_th=params[7];var a00=cos_th*rx;var a01=-sin_th*ry;var a10=sin_th*rx;var a11=cos_th*ry;var cos_th0=Math.cos(th0);var sin_th0=Math.sin(th0);var cos_th1=Math.cos(th1);var sin_th1=Math.sin(th1);var th_half=.5*(th1-th0);var sin_th_h2=Math.sin(th_half*.5);var t=8/3*sin_th_h2*sin_th_h2/Math.sin(th_half);var x1=cx+cos_th0-t*sin_th0;var y1=cy+sin_th0+t*cos_th0;var x3=cx+cos_th1;var y3=cy+sin_th1;var x2=x3+t*sin_th1;var y2=y3-t*cos_th1;return bezierCache[key]=[a00*x1+a01*y1,a10*x1+a11*y1,a00*x2+a01*y2,a10*x2+a11*y2,a00*x3+a01*y3,a10*x3+a11*y3]}module.exports={segments:segments,bezier:bezier,cache:{segments:segmentCache,bezier:bezierCache}}},{}],48:[function(require,module,exports){module.exports={parse:require("./parse"),render:require("./render")}},{"./parse":49,"./render":50}],49:[function(require,module,exports){var cmdlen={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},regexp=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\d)([-+])/g,/\s|,|###/];module.exports=function(pathstr){var result=[],path,curr,chunks,parsed,param,cmd,len,i,j,n,m;path=pathstr.slice().replace(regexp[0],"###$1").split(regexp[1]).slice(1);for(i=0,n=path.length;i<n;++i){curr=path[i];chunks=curr.slice(1).trim().replace(regexp[2],"$1###$2").split(regexp[3]);cmd=curr.charAt(0);parsed=[cmd];for(j=0,m=chunks.length;j<m;++j){if((param=+chunks[j])===param){parsed.push(param)}}len=cmdlen[cmd.toLowerCase()];if(parsed.length-1>len){for(j=1,m=parsed.length;j<m;j+=len){result.push([cmd].concat(parsed.slice(j,j+len)))}}else{result.push(parsed)}}return result}},{}],50:[function(require,module,exports){var arc=require("./arc");module.exports=function(g,path,l,t){var current,previous=null,x=0,y=0,controlX=0,controlY=0,tempX,tempY,tempControlX,tempControlY;if(l==null)l=0;if(t==null)t=0;g.beginPath();for(var i=0,len=path.length;i<len;++i){current=path[i];switch(current[0]){case"l":x+=current[1];y+=current[2];g.lineTo(x+l,y+t);break;case"L":x=current[1];y=current[2];g.lineTo(x+l,y+t);break;case"h":x+=current[1];g.lineTo(x+l,y+t);break;case"H":x=current[1];g.lineTo(x+l,y+t);break;case"v":y+=current[1];g.lineTo(x+l,y+t);break;case"V":y=current[1];g.lineTo(x+l,y+t);break;case"m":x+=current[1];y+=current[2];g.moveTo(x+l,y+t);break;case"M":x=current[1];y=current[2];g.moveTo(x+l,y+t);break;case"c":tempX=x+current[5];tempY=y+current[6];controlX=x+current[3];controlY=y+current[4];g.bezierCurveTo(x+current[1]+l,y+current[2]+t,controlX+l,controlY+t,tempX+l,tempY+t);x=tempX;y=tempY;break;case"C":x=current[5];y=current[6];controlX=current[3];controlY=current[4];g.bezierCurveTo(current[1]+l,current[2]+t,controlX+l,controlY+t,x+l,y+t);break;case"s":tempX=x+current[3];tempY=y+current[4];controlX=2*x-controlX;controlY=2*y-controlY;g.bezierCurveTo(controlX+l,controlY+t,x+current[1]+l,y+current[2]+t,tempX+l,tempY+t);controlX=x+current[1];controlY=y+current[2];x=tempX;y=tempY;break;case"S":tempX=current[3];tempY=current[4];controlX=2*x-controlX;controlY=2*y-controlY;g.bezierCurveTo(controlX+l,controlY+t,current[1]+l,current[2]+t,tempX+l,tempY+t);x=tempX;y=tempY;controlX=current[1];controlY=current[2];break;case"q":tempX=x+current[3];tempY=y+current[4];controlX=x+current[1];controlY=y+current[2];g.quadraticCurveTo(controlX+l,controlY+t,tempX+l,tempY+t);x=tempX;y=tempY;break;case"Q":tempX=current[3];tempY=current[4];g.quadraticCurveTo(current[1]+l,current[2]+t,tempX+l,tempY+t);x=tempX;y=tempY;controlX=current[1];controlY=current[2];break;case"t":tempX=x+current[1];tempY=y+current[2];if(previous[0].match(/[QqTt]/)===null){controlX=x;controlY=y}else if(previous[0]==="t"){controlX=2*x-tempControlX;controlY=2*y-tempControlY}else if(previous[0]==="q"){controlX=2*x-controlX;controlY=2*y-controlY}tempControlX=controlX;tempControlY=controlY;g.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];controlX=2*x-controlX;controlY=2*y-controlY;g.quadraticCurveTo(controlX+l,controlY+t,tempX+l,tempY+t);x=tempX;y=tempY;break;case"a":drawArc(g,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":drawArc(g,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":g.closePath();break}previous=current}};function drawArc(g,x,y,coords){var seg=arc.segments(coords[5],coords[6],coords[0],coords[1],coords[3],coords[4],coords[2],x,y);for(var i=0;i<seg.length;++i){var bez=arc.bezier(seg[i]);g.bezierCurveTo.apply(g,bez)}}},{"./arc":47}],51:[function(require,module,exports){function Handler(){this._active=null;this._handlers={}}var prototype=Handler.prototype;prototype.initialize=function(el,pad,obj){this._el=el;this._obj=obj||null;return this.padding(pad)};prototype.element=function(){return this._el};prototype.padding=function(pad){this._padding=pad||{top:0,left:0,bottom:0,right:0};return this};prototype.scene=function(scene){if(!arguments.length)return this._scene;this._scene=scene;return this};prototype.on=function(){};prototype.off=function(){};prototype.handlers=function(){var h=this._handlers,a=[],k;for(k in h){a.push.apply(a,h[k])}return a};prototype.eventName=function(name){var i=name.indexOf(".");return i<0?name:name.slice(0,i)};module.exports=Handler},{}],52:[function(require,module,exports){function Renderer(){this._el=null;this._bgcolor=null}var prototype=Renderer.prototype;prototype.initialize=function(el,width,height,padding){this._el=el;return this.resize(width,height,padding)};prototype.element=function(){return this._el};prototype.scene=function(){return this._el&&this._el.firstChild};prototype.background=function(bgcolor){if(arguments.length===0)return this._bgcolor;this._bgcolor=bgcolor;return this};prototype.resize=function(width,height,padding){this._width=width;this._height=height;
this._padding=padding||{top:0,left:0,bottom:0,right:0};return this};prototype.render=function(){return this};module.exports=Renderer},{}],53:[function(require,module,exports){var DOM=require("../../util/dom"),Handler=require("../Handler"),marks=require("./marks");function CanvasHandler(){Handler.call(this);this._down=null;this._touch=null;this._first=true}var base=Handler.prototype;var prototype=CanvasHandler.prototype=Object.create(base);prototype.constructor=CanvasHandler;prototype.initialize=function(el,pad,obj){var canvas=this._canvas=DOM.find(el,"canvas"),that=this;this.events.forEach(function(type){canvas.addEventListener(type,function(evt){if(prototype[type]){prototype[type].call(that,evt)}else{that.fire(type,evt)}})});return base.initialize.call(this,el,pad,obj)};prototype.canvas=function(){return this._canvas};prototype.context=function(){return this._canvas.getContext("2d")};prototype.events=["keydown","keypress","keyup","mousedown","mouseup","mousemove","mouseout","mouseover","click","dblclick","wheel","mousewheel","touchstart","touchmove","touchend"];prototype.DOMMouseScroll=function(evt){this.fire("mousewheel",evt)};prototype.mousemove=function(evt){var a=this._active,p=this.pickEvent(evt);if(p===a){this.fire("mousemove",evt)}else{this.fire("mouseout",evt);this._active=p;this.fire("mouseover",evt);this.fire("mousemove",evt)}};prototype.mouseout=function(evt){this.fire("mouseout",evt);this._active=null};prototype.mousedown=function(evt){this._down=this._active;this.fire("mousedown",evt)};prototype.click=function(evt){if(this._down===this._active){this.fire("click",evt);this._down=null}};prototype.touchstart=function(evt){this._touch=this.pickEvent(evt.changedTouches[0]);if(this._first){this._active=this._touch;this._first=false}this.fire("touchstart",evt,true)};prototype.touchmove=function(evt){this.fire("touchmove",evt,true)};prototype.touchend=function(evt){this.fire("touchend",evt,true);this._touch=null};prototype.fire=function(type,evt,touch){var a=touch?this._touch:this._active,h=this._handlers[type],i,len;if(h){evt.vegaType=type;for(i=0,len=h.length;i<len;++i){h[i].handler.call(this._obj,evt,a)}}};prototype.on=function(type,handler){var name=this.eventName(type),h=this._handlers;(h[name]||(h[name]=[])).push({type:type,handler:handler});return this};prototype.off=function(type,handler){var name=this.eventName(type),h=this._handlers[name],i;if(!h)return;for(i=h.length;--i>=0;){if(h[i].type!==type)continue;if(!handler||h[i].handler===handler)h.splice(i,1)}return this};prototype.pickEvent=function(evt){var rect=this._canvas.getBoundingClientRect(),pad=this._padding,x,y;return this.pick(this._scene,x=evt.clientX-rect.left,y=evt.clientY-rect.top,x-pad.left,y-pad.top)};prototype.pick=function(scene,x,y,gx,gy){var g=this.context(),mark=marks[scene.marktype];return mark.pick.call(this,g,scene,x,y,gx,gy)};module.exports=CanvasHandler},{"../../util/dom":81,"../Handler":51,"./marks":60}],54:[function(require,module,exports){var DOM=require("../../util/dom"),Bounds=require("../../util/Bounds"),ImageLoader=require("../../util/ImageLoader"),Canvas=require("../../util/canvas"),Renderer=require("../Renderer"),marks=require("./marks");function CanvasRenderer(loadConfig){Renderer.call(this);this._loader=new ImageLoader(loadConfig)}CanvasRenderer.RETINA=true;var base=Renderer.prototype;var prototype=CanvasRenderer.prototype=Object.create(base);prototype.constructor=CanvasRenderer;prototype.initialize=function(el,width,height,padding){this._canvas=Canvas.instance(width,height);if(el){DOM.clear(el,0).appendChild(this._canvas);this._canvas.setAttribute("class","marks")}return base.initialize.call(this,el,width,height,padding)};prototype.resize=function(width,height,padding){base.resize.call(this,width,height,padding);Canvas.resize(this._canvas,this._width,this._height,this._padding,CanvasRenderer.RETINA);return this};prototype.canvas=function(){return this._canvas};prototype.context=function(){return this._canvas?this._canvas.getContext("2d"):null};prototype.pendingImages=function(){return this._loader.pending()};function clipToBounds(g,items){if(!items)return null;var b=new Bounds,i,n,item,mark,group;for(i=0,n=items.length;i<n;++i){item=items[i];mark=item.mark;group=mark.group;item=marks[mark.marktype].nested?mark:item;b.union(translate(item.bounds,group));if(item["bounds:prev"]){b.union(translate(item["bounds:prev"],group))}}b.round();g.beginPath();g.rect(b.x1,b.y1,b.width(),b.height());g.clip();return b}function translate(bounds,group){if(group==null)return bounds;var b=bounds.clone();for(;group!=null;group=group.mark.group){b.translate(group.x||0,group.y||0)}return b}prototype.render=function(scene,items){var g=this.context(),p=this._padding,w=this._width+p.left+p.right,h=this._height+p.top+p.bottom,b;this._scene=scene;g.save();b=clipToBounds(g,items);this.clear(-p.left,-p.top,w,h);this.draw(g,scene,b);g.restore();this._scene=null;return this};prototype.draw=function(ctx,scene,bounds){var mark=marks[scene.marktype];mark.draw.call(this,ctx,scene,bounds)};prototype.clear=function(x,y,w,h){var g=this.context();g.clearRect(x,y,w,h);if(this._bgcolor!=null){g.fillStyle=this._bgcolor;g.fillRect(x,y,w,h)}};prototype.loadImage=function(uri){var renderer=this,scene=this._scene;return this._loader.loadImage(uri,function(){renderer.renderAsync(scene)})};prototype.renderAsync=function(scene){var renderer=this;if(renderer._async_id){clearTimeout(renderer._async_id)}renderer._async_id=setTimeout(function(){renderer.render(scene);delete renderer._async_id},10)};module.exports=CanvasRenderer},{"../../util/Bounds":74,"../../util/ImageLoader":77,"../../util/canvas":80,"../../util/dom":81,"../Renderer":52,"./marks":60}],55:[function(require,module,exports){module.exports={Handler:require("./CanvasHandler"),Renderer:require("./CanvasRenderer")}},{"./CanvasHandler":53,"./CanvasRenderer":54}],56:[function(require,module,exports){var util=require("./util");var halfpi=Math.PI/2;function path(g,o){var x=o.x||0,y=o.y||0,ir=o.innerRadius||0,or=o.outerRadius||0,sa=(o.startAngle||0)-halfpi,ea=(o.endAngle||0)-halfpi;g.beginPath();if(ir===0)g.moveTo(x,y);else g.arc(x,y,ir,sa,ea,0);g.arc(x,y,or,ea,sa,1);g.closePath()}module.exports={draw:util.drawAll(path),pick:util.pickPath(path)}},{"./util":67}],57:[function(require,module,exports){var util=require("./util"),parse=require("../../../path/parse"),render=require("../../../path/render"),areaPath=require("../../../util/svg").path.area;function path(g,items){var o=items[0],p=o.pathCache||(o.pathCache=parse(areaPath(items)));render(g,p)}function pick(g,scene,x,y,gx,gy){var items=scene.items,b=scene.bounds;if(!items||!items.length||b&&!b.contains(gx,gy)){return null}if(g.pixelratio!=null&&g.pixelratio!==1){x*=g.pixelratio;y*=g.pixelratio}return hit(g,items,x,y)?items[0]:null}var hit=util.testPath(path);module.exports={draw:util.drawOne(path),pick:pick,nested:true}},{"../../../path/parse":49,"../../../path/render":50,"../../../util/svg":83,"./util":67}],58:[function(require,module,exports){var util=require("./util"),rect=require("./rect");function draw(g,scene,bounds){if(!scene.items||!scene.items.length)return;var groups=scene.items,renderer=this,group,items,axes,legends,gx,gy,i,n,j,m;rect.draw.call(renderer,g,scene,bounds);for(i=0,n=groups.length;i<n;++i){group=groups[i];axes=group.axisItems||[];items=group.items||[];legends=group.legendItems||[];gx=group.x||0;gy=group.y||0;g.save();g.translate(gx,gy);if(group.clip){g.beginPath();g.rect(0,0,group.width||0,group.height||0);g.clip()}if(bounds)bounds.translate(-gx,-gy);for(j=0,m=axes.length;j<m;++j){if(axes[j].layer==="back"){renderer.draw(g,axes[j],bounds)}}for(j=0,m=items.length;j<m;++j){renderer.draw(g,items[j],bounds)}for(j=0,m=axes.length;j<m;++j){if(axes[j].layer!=="back"){renderer.draw(g,axes[j],bounds)}}for(j=0,m=legends.length;j<m;++j){renderer.draw(g,legends[j],bounds)}if(bounds)bounds.translate(gx,gy);g.restore()}}function hit(g,o){return o.fill||o.stroke}function pick(g,scene,x,y,gx,gy){if(scene.bounds&&!scene.bounds.contains(gx,gy)){return null}var items=scene.items||[],subscene,group,hits,dx,dy,i,j;for(i=items.length;--i>=0;){group=items[i];dx=group.x||0;dy=group.y||0;g.save();g.translate(dx,dy);for(j=group.items.length;--j>=0;){subscene=group.items[j];if(subscene.interactive===false)continue;hits=this.pick(subscene,x,y,gx-dx,gy-dy);if(hits){g.restore();return hits}}g.restore()}return scene.interactive!==false?pickSelf(g,scene,x,y,gx,gy):null}var pickSelf=util.pick(hit);module.exports={draw:draw,pick:pick}},{"./rect":63,"./util":67}],59:[function(require,module,exports){var util=require("./util");function draw(g,scene,bounds){if(!scene.items||!scene.items.length)return;var renderer=this,items=scene.items,o;for(var i=0,len=items.length;i<len;++i){o=items[i];if(bounds&&!bounds.intersects(o.bounds))continue;if(!(o.image&&o.image.url===o.url)){o.image=renderer.loadImage(o.url);o.image.url=o.url}var x=o.x||0,y=o.y||0,w=o.width||o.image&&o.image.width||0,h=o.height||o.image&&o.image.height||0,opac;x=x-(o.align==="center"?w/2:o.align==="right"?w:0);y=y-(o.baseline==="middle"?h/2:o.baseline==="bottom"?h:0);if(o.image.loaded){g.globalAlpha=(opac=o.opacity)!=null?opac:1;g.drawImage(o.image,x,y,w,h)}}}module.exports={draw:draw,pick:util.pick()}},{"./util":67}],60:[function(require,module,exports){module.exports={arc:require("./arc"),area:require("./area"),group:require("./group"),image:require("./image"),line:require("./line"),path:require("./path"),rect:require("./rect"),rule:require("./rule"),symbol:require("./symbol"),text:require("./text")}},{"./arc":56,"./area":57,"./group":58,"./image":59,"./line":61,"./path":62,"./rect":63,"./rule":64,"./symbol":65,"./text":66}],61:[function(require,module,exports){var util=require("./util"),parse=require("../../../path/parse"),render=require("../../../path/render"),linePath=require("../../../util/svg").path.line;function path(g,items){var o=items[0],p=o.pathCache||(o.pathCache=parse(linePath(items)));render(g,p)}function pick(g,scene,x,y,gx,gy){var items=scene.items,b=scene.bounds;if(!items||!items.length||b&&!b.contains(gx,gy)){return null}if(g.pixelratio!=null&&g.pixelratio!==1){x*=g.pixelratio;y*=g.pixelratio}return hit(g,items,x,y)?items[0]:null}var hit=util.testPath(path,false);module.exports={draw:util.drawOne(path),pick:pick,nested:true}},{"../../../path/parse":49,"../../../path/render":50,"../../../util/svg":83,"./util":67}],62:[function(require,module,exports){var util=require("./util"),parse=require("../../../path/parse"),render=require("../../../path/render");function path(g,o){if(o.path==null)return true;var p=o.pathCache||(o.pathCache=parse(o.path));render(g,p,o.x,o.y)}module.exports={draw:util.drawAll(path),pick:util.pickPath(path)}},{"../../../path/parse":49,"../../../path/render":50,"./util":67}],63:[function(require,module,exports){var util=require("./util");function draw(g,scene,bounds){if(!scene.items||!scene.items.length)return;var items=scene.items,o,opac,x,y,w,h;for(var i=0,len=items.length;i<len;++i){o=items[i];if(bounds&&!bounds.intersects(o.bounds))continue;opac=o.opacity==null?1:o.opacity;if(opac===0)continue;x=o.x||0;y=o.y||0;w=o.width||0;h=o.height||0;if(o.fill&&util.fill(g,o,opac)){g.fillRect(x,y,w,h)}if(o.stroke&&util.stroke(g,o,opac)){g.strokeRect(x,y,w,h)}}}module.exports={draw:draw,pick:util.pick()}},{"./util":67}],64:[function(require,module,exports){var util=require("./util");function draw(g,scene,bounds){if(!scene.items||!scene.items.length)return;var items=scene.items,o,opac,x1,y1,x2,y2;for(var i=0,len=items.length;i<len;++i){o=items[i];if(bounds&&!bounds.intersects(o.bounds))continue;opac=o.opacity==null?1:o.opacity;if(opac===0)continue;x1=o.x||0;y1=o.y||0;x2=o.x2!=null?o.x2:x1;y2=o.y2!=null?o.y2:y1;if(o.stroke&&util.stroke(g,o,opac)){g.beginPath();g.moveTo(x1,y1);g.lineTo(x2,y2);g.stroke()}}}function stroke(g,o){var x1=o.x||0,y1=o.y||0,x2=o.x2!=null?o.x2:x1,y2=o.y2!=null?o.y2:y1,lw=o.strokeWidth,lc=o.strokeCap;g.lineWidth=lw!=null?lw:1;g.lineCap=lc!=null?lc:"butt";g.beginPath();g.moveTo(x1,y1);g.lineTo(x2,y2)}function hit(g,o,x,y){if(!g.isPointInStroke)return false;stroke(g,o);return g.isPointInStroke(x,y)}module.exports={draw:draw,pick:util.pick(hit)}},{"./util":67}],65:[function(require,module,exports){var util=require("./util");var sqrt3=Math.sqrt(3),tan30=Math.tan(30*Math.PI/180);function path(g,o){var size=o.size!=null?o.size:100,x=o.x,y=o.y,r,t,rx,ry;g.beginPath();if(o.shape==null||o.shape==="circle"){r=Math.sqrt(size/Math.PI);g.arc(x,y,r,0,2*Math.PI,0);g.closePath();return}switch(o.shape){case"cross":r=Math.sqrt(size/5)/2;t=3*r;g.moveTo(x-t,y-r);g.lineTo(x-r,y-r);g.lineTo(x-r,y-t);g.lineTo(x+r,y-t);g.lineTo(x+r,y-r);g.lineTo(x+t,y-r);g.lineTo(x+t,y+r);g.lineTo(x+r,y+r);g.lineTo(x+r,y+t);g.lineTo(x-r,y+t);g.lineTo(x-r,y+r);g.lineTo(x-t,y+r);break;case"diamond":ry=Math.sqrt(size/(2*tan30));rx=ry*tan30;g.moveTo(x,y-ry);g.lineTo(x+rx,y);g.lineTo(x,y+ry);g.lineTo(x-rx,y);break;case"square":t=Math.sqrt(size);r=t/2;g.rect(x-r,y-r,t,t);break;case"triangle-down":rx=Math.sqrt(size/sqrt3);ry=rx*sqrt3/2;g.moveTo(x,y+ry);g.lineTo(x+rx,y-ry);g.lineTo(x-rx,y-ry);break;case"triangle-up":rx=Math.sqrt(size/sqrt3);ry=rx*sqrt3/2;g.moveTo(x,y-ry);g.lineTo(x+rx,y+ry);g.lineTo(x-rx,y+ry)}g.closePath()}module.exports={draw:util.drawAll(path),pick:util.pickPath(path)}},{"./util":67}],66:[function(require,module,exports){var Bounds=require("../../../util/Bounds"),textBounds=require("../../../util/bound").text,text=require("../../../util/text"),util=require("./util"),tempBounds=new Bounds;function draw(g,scene,bounds){if(!scene.items||!scene.items.length)return;var items=scene.items,o,opac,x,y,r,t,str;for(var i=0,len=items.length;i<len;++i){o=items[i];if(bounds&&!bounds.intersects(o.bounds))continue;str=text.value(o.text);if(!str)continue;opac=o.opacity==null?1:o.opacity;if(opac===0)continue;g.font=text.font(o);g.textAlign=o.align||"left";x=o.x||0;y=o.y||0;if(r=o.radius){t=(o.theta||0)-Math.PI/2;x+=r*Math.cos(t);y+=r*Math.sin(t)}if(o.angle){g.save();g.translate(x,y);g.rotate(o.angle*Math.PI/180);x=y=0}x+=o.dx||0;y+=(o.dy||0)+text.offset(o);if(o.fill&&util.fill(g,o,opac)){g.fillText(str,x,y)}if(o.stroke&&util.stroke(g,o,opac)){g.strokeText(str,x,y)}if(o.angle)g.restore()}}function hit(g,o,x,y,gx,gy){if(o.fontSize<=0)return false;if(!o.angle)return true;var b=textBounds(o,tempBounds,true),a=-o.angle*Math.PI/180,cos=Math.cos(a),sin=Math.sin(a),ox=o.x,oy=o.y,px=cos*gx-sin*gy+(ox-ox*cos+oy*sin),py=sin*gx+cos*gy+(oy-ox*sin-oy*cos);return b.contains(px,py)}module.exports={draw:draw,pick:util.pick(hit)}},{"../../../util/Bounds":74,"../../../util/bound":79,"../../../util/text":84,"./util":67}],67:[function(require,module,exports){function drawPathOne(path,g,o,items){if(path(g,items))return;var opac=o.opacity==null?1:o.opacity;if(opac===0)return;if(o.fill&&fill(g,o,opac)){g.fill()}if(o.stroke&&stroke(g,o,opac)){g.stroke()}}function drawPathAll(path,g,scene,bounds){var i,len,item;for(i=0,len=scene.items.length;i<len;++i){item=scene.items[i];if(!bounds||bounds.intersects(item.bounds)){drawPathOne(path,g,item,item)}}}function drawAll(pathFunc){return function(g,scene,bounds){drawPathAll(pathFunc,g,scene,bounds)}}function drawOne(pathFunc){return function(g,scene,bounds){if(!scene.items.length)return;if(!bounds||bounds.intersects(scene.bounds)){drawPathOne(pathFunc,g,scene.items[0],scene.items)}}}var trueFunc=function(){return true};function pick(test){if(!test)test=trueFunc;return function(g,scene,x,y,gx,gy){if(!scene.items.length)return null;var o,b,i;if(g.pixelratio!=null&&g.pixelratio!==1){x*=g.pixelratio;y*=g.pixelratio}for(i=scene.items.length;--i>=0;){o=scene.items[i];b=o.bounds;if(b&&!b.contains(gx,gy)||!b)continue;if(test(g,o,x,y,gx,gy))return o}return null}}function testPath(path,filled){return function(g,o,x,y){var item=Array.isArray(o)?o[0]:o,fill=filled==null?item.fill:filled,stroke=item.stroke&&g.isPointInStroke,lw,lc;if(stroke){lw=item.strokeWidth;lc=item.strokeCap;g.lineWidth=lw!=null?lw:1;g.lineCap=lc!=null?lc:"butt"}return path(g,o)?false:fill&&g.isPointInPath(x,y)||stroke&&g.isPointInStroke(x,y)}}function pickPath(path){return pick(testPath(path))}function fill(g,o,opacity){opacity*=o.fillOpacity==null?1:o.fillOpacity;if(opacity>0){g.globalAlpha=opacity;g.fillStyle=color(g,o,o.fill);return true}else{return false}}function stroke(g,o,opacity){var lw=(lw=o.strokeWidth)!=null?lw:1,lc;if(lw<=0)return false;opacity*=o.strokeOpacity==null?1:o.strokeOpacity;if(opacity>0){g.globalAlpha=opacity;g.strokeStyle=color(g,o,o.stroke);g.lineWidth=lw;g.lineCap=(lc=o.strokeCap)!=null?lc:"butt";g.vgLineDash(o.strokeDash||null);g.vgLineDashOffset(o.strokeDashOffset||0);return true}else{return false}}function color(g,o,value){return value.id?gradient(g,value,o.bounds):value}function gradient(g,p,b){var w=b.width(),h=b.height(),x1=b.x1+p.x1*w,y1=b.y1+p.y1*h,x2=b.x1+p.x2*w,y2=b.y1+p.y2*h,grad=g.createLinearGradient(x1,y1,x2,y2),stop=p.stops,i,n;for(i=0,n=stop.length;i<n;++i){grad.addColorStop(stop[i].offset,stop[i].color)}return grad}module.exports={drawOne:drawOne,drawAll:drawAll,pick:pick,pickPath:pickPath,testPath:testPath,stroke:stroke,fill:fill,color:color,gradient:gradient}},{}],68:[function(require,module,exports){module.exports={canvas:require("./canvas"),svg:require("./svg")}},{"./canvas":55,"./svg":72}],69:[function(require,module,exports){var DOM=require("../../util/dom"),Handler=require("../Handler");function SVGHandler(){Handler.call(this)}var base=Handler.prototype;var prototype=SVGHandler.prototype=Object.create(base);prototype.constructor=SVGHandler;prototype.initialize=function(el,pad,obj){this._svg=DOM.find(el,"svg");return base.initialize.call(this,el,pad,obj)};prototype.svg=function(){return this._svg};prototype.listener=function(handler){var that=this;return function(evt){var target=evt.target,item=target.__data__;evt.vegaType=evt.type;item=Array.isArray(item)?item[0]:item;handler.call(that._obj,evt,item)}};prototype.on=function(type,handler){var name=this.eventName(type),svg=this._svg,h=this._handlers,x={type:type,handler:handler,listener:this.listener(handler)};(h[name]||(h[name]=[])).push(x);svg.addEventListener(name,x.listener);return this};prototype.off=function(type,handler){var name=this.eventName(type),svg=this._svg,h=this._handlers[name],i;if(!h)return;for(i=h.length;--i>=0;){if(h[i].type===type&&!handler||h[i].handler===handler){svg.removeEventListener(name,h[i].listener);h.splice(i,1)}}return this};module.exports=SVGHandler},{"../../util/dom":81,"../Handler":51}],70:[function(require,module,exports){var ImageLoader=require("../../util/ImageLoader"),Renderer=require("../Renderer"),text=require("../../util/text"),DOM=require("../../util/dom"),SVG=require("../../util/svg"),ns=SVG.metadata.xmlns,marks=require("./marks");function SVGRenderer(loadConfig){Renderer.call(this);this._loader=new ImageLoader(loadConfig);this._dirtyID=0}var base=Renderer.prototype;var prototype=SVGRenderer.prototype=Object.create(base);prototype.constructor=SVGRenderer;prototype.initialize=function(el,width,height,padding){if(el){this._svg=DOM.child(el,0,"svg",ns,"marks");DOM.clear(el,1);this._root=DOM.child(this._svg,0,"g",ns);DOM.clear(this._svg,1)}this._defs={clip_id:1,gradient:{},clipping:{}};this.background(this._bgcolor);return base.initialize.call(this,el,width,height,padding)};prototype.background=function(bgcolor){if(arguments.length&&this._svg){this._svg.style.setProperty("background-color",bgcolor)}return base.background.apply(this,arguments)};prototype.resize=function(width,height,padding){base.resize.call(this,width,height,padding);if(this._svg){var w=this._width,h=this._height,p=this._padding;this._svg.setAttribute("width",w+p.left+p.right);this._svg.setAttribute("height",h+p.top+p.bottom);this._root.setAttribute("transform","translate("+p.left+","+p.top+")")}return this};prototype.svg=function(){if(!this._svg)return null;var attr={"class":"marks",width:this._width+this._padding.left+this._padding.right,height:this._height+this._padding.top+this._padding.bottom};for(var key in SVG.metadata){attr[key]=SVG.metadata[key]}return DOM.openTag("svg",attr)+this._svg.innerHTML+DOM.closeTag("svg")};prototype.imageURL=function(url){return this._loader.imageURL(url)};prototype.render=function(scene,items){if(this._dirtyCheck(items)){if(this._dirtyAll)this._resetDefs();this.draw(this._root,scene,-1);DOM.clear(this._root,1)}this.updateDefs();return this};prototype.draw=function(el,scene,index){this.drawMark(el,scene,index,marks[scene.marktype])};prototype.updateDefs=function(){var svg=this._svg,defs=this._defs,el=defs.el,index=0,id;for(id in defs.gradient){if(!el)el=defs.el=DOM.child(svg,0,"defs",ns);updateGradient(el,defs.gradient[id],index++)}for(id in defs.clipping){if(!el)el=defs.el=DOM.child(svg,0,"defs",ns);updateClipping(el,defs.clipping[id],index++)}if(el){if(index===0){svg.removeChild(el);defs.el=null}else{DOM.clear(el,index)}}};function updateGradient(el,grad,index){var i,n,stop;el=DOM.child(el,index,"linearGradient",ns);el.setAttribute("id",grad.id);el.setAttribute("x1",grad.x1);el.setAttribute("x2",grad.x2);el.setAttribute("y1",grad.y1);el.setAttribute("y2",grad.y2);for(i=0,n=grad.stops.length;i<n;++i){stop=DOM.child(el,i,"stop",ns);stop.setAttribute("offset",grad.stops[i].offset);stop.setAttribute("stop-color",grad.stops[i].color)}DOM.clear(el,i)}function updateClipping(el,clip,index){var rect;el=DOM.child(el,index,"clipPath",ns);el.setAttribute("id",clip.id);rect=DOM.child(el,0,"rect",ns);rect.setAttribute("x",0);rect.setAttribute("y",0);rect.setAttribute("width",clip.width);rect.setAttribute("height",clip.height)}prototype._resetDefs=function(){var def=this._defs;def.clip_id=1;def.gradient={};def.clipping={}};prototype.isDirty=function(item){return this._dirtyAll||item.dirty===this._dirtyID};prototype._dirtyCheck=function(items){this._dirtyAll=true;if(!items)return true;var id=++this._dirtyID,item,mark,type,mdef,i,n,o;for(i=0,n=items.length;i<n;++i){item=items[i];mark=item.mark;if(mark.marktype!==type){type=mark.marktype;mdef=marks[type]}if(item.status==="exit"){if(item._svg){if(mdef.nest&&item.mark.items.length){this._update(mdef,item._svg,item.mark.items[0]);o=item.mark.items[0];o._svg=item._svg;o._update=id}else{DOM.remove(item._svg)}item._svg=null}continue}item=mdef.nest?mark.items[0]:item;if(item._update===id){continue}else if(item._svg){this._update(mdef,item._svg,item)}else{this._dirtyAll=false;dirtyParents(item,id)}item._update=id}return!this._dirtyAll};function dirtyParents(item,id){for(;item&&item.dirty!==id;item=item.mark.group){item.dirty=id;if(item.mark&&item.mark.dirty!==id){item.mark.dirty=id}else return}}prototype.drawMark=function(el,scene,index,mdef){if(!this.isDirty(scene))return;var items=mdef.nest?scene.items&&scene.items.length?[scene.items[0]]:[]:scene.items||[],events=scene.interactive===false?"none":null,isGroup=mdef.tag==="g",className=DOM.cssClass(scene),p,i,n,c,d,insert;p=DOM.child(el,index+1,"g",ns,className);p.setAttribute("class",className);scene._svg=p;if(!isGroup&&events){p.style.setProperty("pointer-events",events)}for(i=0,n=items.length;i<n;++i){if(this.isDirty(d=items[i])){insert=!(this._dirtyAll||d._svg);c=insert?bind(p,mdef,d,i,true):p.childNodes[i]||bind(p,mdef,d,i);this._update(mdef,c,d);if(isGroup){if(insert)this._dirtyAll=true;this._recurse(c,d);if(insert)this._dirtyAll=false}}}DOM.clear(p,i);return p};prototype._recurse=function(el,group){var items=group.items||[],legends=group.legendItems||[],axes=group.axisItems||[],idx=0,j,m;for(j=0,m=axes.length;j<m;++j){if(axes[j].layer==="back"){this.drawMark(el,axes[j],idx++,marks.group)}}for(j=0,m=items.length;j<m;++j){this.draw(el,items[j],idx++)}for(j=0,m=axes.length;j<m;++j){if(axes[j].layer!=="back"){this.drawMark(el,axes[j],idx++,marks.group)}}for(j=0,m=legends.length;j<m;++j){this.drawMark(el,legends[j],idx++,marks.group)}DOM.clear(el,1+idx)};function bind(el,mdef,item,index,insert){var node=DOM.child(el,index,mdef.tag,ns,null,insert);node.__data__=item;node.__values__={fill:"default"};if(mdef.tag==="g"){var bg=DOM.child(node,0,"rect",ns,"background");bg.__data__=item}return item._svg=node}var href=typeof window!=="undefined"?window.location.href:"",element=null,values=null;var mark_extras={group:function(mdef,el,item){element=el.childNodes[0];values=el.__values__;mdef.background(emit,item,this);var value=item.mark.interactive===false?"none":null;if(value!==values.events){element.style.setProperty("pointer-events",value);values.events=value}},text:function(mdef,el,item){var str=text.value(item.text);if(str!==values.text){el.textContent=str;values.text=str}str=text.font(item);if(str!==values.font){el.style.setProperty("font",str);values.font=str}}};prototype._update=function(mdef,el,item){element=el;values=el.__values__;mdef.attr(emit,item,this);var extra=mark_extras[mdef.type];if(extra)extra(mdef,el,item);this.style(element,item)};function emit(name,value,ns){if(value===values[name])return;if(value!=null){if(ns){element.setAttributeNS(ns,name,value)}else{element.setAttribute(name,value)}}else{if(ns){element.removeAttributeNS(ns,name)}else{element.removeAttribute(name)}}values[name]=value}prototype.style=function(el,o){if(o==null)return;var i,n,prop,name,value;for(i=0,n=SVG.styleProperties.length;i<n;++i){prop=SVG.styleProperties[i];value=o[prop];if(value===values[prop])continue;name=SVG.styles[prop];if(value==null){if(name==="fill"){el.style.setProperty(name,"none")}else{el.style.removeProperty(name)}}else{if(value.id){this._defs.gradient[value.id]=value;value="url("+href+"#"+value.id+")"}el.style.setProperty(name,value+"")}values[prop]=value}};module.exports=SVGRenderer},{"../../util/ImageLoader":77,"../../util/dom":81,"../../util/svg":83,"../../util/text":84,"../Renderer":52,"./marks":73}],71:[function(require,module,exports){var Renderer=require("../Renderer"),ImageLoader=require("../../util/ImageLoader"),SVG=require("../../util/svg"),text=require("../../util/text"),DOM=require("../../util/dom"),openTag=DOM.openTag,closeTag=DOM.closeTag,MARKS=require("./marks");function SVGStringRenderer(loadConfig){Renderer.call(this);this._loader=new ImageLoader(loadConfig);this._text={head:"",root:"",foot:"",defs:"",body:""};this._defs={clip_id:1,gradient:{},clipping:{}}}var base=Renderer.prototype;var prototype=SVGStringRenderer.prototype=Object.create(base);prototype.constructor=SVGStringRenderer;prototype.resize=function(width,height,padding){base.resize.call(this,width,height,padding);var p=this._padding,t=this._text;var attr={"class":"marks",width:this._width+p.left+p.right,height:this._height+p.top+p.bottom};for(var key in SVG.metadata){attr[key]=SVG.metadata[key]}t.head=openTag("svg",attr);t.root=openTag("g",{transform:"translate("+p.left+","+p.top+")"});t.foot=closeTag("g")+closeTag("svg");return this};prototype.svg=function(){var t=this._text;return t.head+t.defs+t.root+t.body+t.foot};prototype.render=function(scene){this._text.body=this.mark(scene);this._text.defs=this.buildDefs();return this};prototype.reset=function(){this._defs.clip_id=0;return this};prototype.buildDefs=function(){var all=this._defs,defs="",i,id,def,stops;for(id in all.gradient){def=all.gradient[id];stops=def.stops;defs+=openTag("linearGradient",{id:id,x1:def.x1,x2:def.x2,y1:def.y1,y2:def.y2});for(i=0;i<stops.length;++i){defs+=openTag("stop",{offset:stops[i].offset,"stop-color":stops[i].color})+closeTag("stop")}defs+=closeTag("linearGradient")}for(id in all.clipping){def=all.clipping[id];defs+=openTag("clipPath",{id:id});defs+=openTag("rect",{x:0,y:0,width:def.width,height:def.height})+closeTag("rect");defs+=closeTag("clipPath")}return defs.length>0?openTag("defs")+defs+closeTag("defs"):""};prototype.imageURL=function(url){return this._loader.imageURL(url)};var object;function emit(name,value,ns,prefixed){object[prefixed||name]=value}prototype.attributes=function(attr,item){object={};attr(emit,item,this);return object};prototype.mark=function(scene){var mdef=MARKS[scene.marktype],tag=mdef.tag,attr=mdef.attr,nest=mdef.nest||false,data=nest?scene.items&&scene.items.length?[scene.items[0]]:[]:scene.items||[],defs=this._defs,str="",style,i,item;if(tag!=="g"&&scene.interactive===false){style='style="pointer-events: none;"'}str+=openTag("g",{"class":DOM.cssClass(scene)},style);for(i=0;i<data.length;++i){item=data[i];style=tag!=="g"?styles(item,scene,tag,defs):null;str+=openTag(tag,this.attributes(attr,item),style);if(tag==="text"){str+=escape_text(text.value(item.text))}else if(tag==="g"){str+=openTag("rect",this.attributes(mdef.background,item),styles(item,scene,"bgrect",defs))+closeTag("rect");str+=this.markGroup(item)}str+=closeTag(tag)}return str+closeTag("g")};prototype.markGroup=function(scene){var str="",axes=scene.axisItems||[],items=scene.items||[],legends=scene.legendItems||[],j,m;for(j=0,m=axes.length;j<m;++j){if(axes[j].layer==="back"){str+=this.mark(axes[j])}}for(j=0,m=items.length;j<m;++j){str+=this.mark(items[j])}for(j=0,m=axes.length;j<m;++j){if(axes[j].layer!=="back"){str+=this.mark(axes[j])}}for(j=0,m=legends.length;j<m;++j){str+=this.mark(legends[j])}return str};function styles(o,mark,tag,defs){if(o==null)return"";var i,n,prop,name,value,s="";if(tag==="bgrect"&&mark.interactive===false){s+="pointer-events: none;"}if(tag==="text"){s+="font: "+text.font(o)+";"}for(i=0,n=SVG.styleProperties.length;i<n;++i){prop=SVG.styleProperties[i];name=SVG.styles[prop];value=o[prop];if(value==null){if(name==="fill"){s+=(s.length?" ":"")+"fill: none;"}}else{if(value.id){defs.gradient[value.id]=value;value="url(#"+value.id+")"}s+=(s.length?" ":"")+name+": "+value+";"}}return s?'style="'+s+'"':null}function escape_text(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}module.exports=SVGStringRenderer},{"../../util/ImageLoader":77,"../../util/dom":81,"../../util/svg":83,"../../util/text":84,"../Renderer":52,"./marks":73}],72:[function(require,module,exports){module.exports={Handler:require("./SVGHandler"),Renderer:require("./SVGRenderer"),string:{Renderer:require("./SVGStringRenderer")}}},{"./SVGHandler":69,"./SVGRenderer":70,"./SVGStringRenderer":71}],73:[function(require,module,exports){var text=require("../../util/text"),SVG=require("../../util/svg"),textAlign=SVG.textAlign,path=SVG.path;function translateItem(o){return translate(o.x||0,o.y||0)}function translate(x,y){return"translate("+x+","+y+")"}module.exports={arc:{tag:"path",type:"arc",attr:function(emit,o){emit("transform",translateItem(o));emit("d",path.arc(o))}},area:{tag:"path",type:"area",nest:true,attr:function(emit,o){var items=o.mark.items;if(items.length)emit("d",path.area(items))}},group:{tag:"g",type:"group",attr:function(emit,o,renderer){var id=null,defs,c;emit("transform",translateItem(o));if(o.clip){defs=renderer._defs;id=o.clip_id||(o.clip_id="clip"+defs.clip_id++);c=defs.clipping[id]||(defs.clipping[id]={id:id});c.width=o.width||0;c.height=o.height||0}emit("clip-path",id?"url(#"+id+")":null)},background:function(emit,o){emit("class","background");emit("width",o.width||0);emit("height",o.height||0)}},image:{tag:"image",type:"image",attr:function(emit,o,renderer){var x=o.x||0,y=o.y||0,w=o.width||0,h=o.height||0,url=renderer.imageURL(o.url);x=x-(o.align==="center"?w/2:o.align==="right"?w:0);y=y-(o.baseline==="middle"?h/2:o.baseline==="bottom"?h:0);emit("href",url,"http://www.w3.org/1999/xlink","xlink:href");emit("transform",translate(x,y));emit("width",w);emit("height",h)}},line:{tag:"path",type:"line",nest:true,attr:function(emit,o){var items=o.mark.items;if(items.length)emit("d",path.line(items))}},path:{tag:"path",type:"path",attr:function(emit,o){emit("transform",translateItem(o));emit("d",o.path)}},rect:{tag:"rect",type:"rect",nest:false,attr:function(emit,o){emit("transform",translateItem(o));emit("width",o.width||0);emit("height",o.height||0)}},rule:{tag:"line",type:"rule",attr:function(emit,o){emit("transform",translateItem(o));emit("x2",o.x2!=null?o.x2-(o.x||0):0);emit("y2",o.y2!=null?o.y2-(o.y||0):0)}},symbol:{tag:"path",type:"symbol",attr:function(emit,o){emit("transform",translateItem(o));
emit("d",path.symbol(o))}},text:{tag:"text",type:"text",nest:false,attr:function(emit,o){var dx=o.dx||0,dy=(o.dy||0)+text.offset(o),x=o.x||0,y=o.y||0,a=o.angle||0,r=o.radius||0,t;if(r){t=(o.theta||0)-Math.PI/2;x+=r*Math.cos(t);y+=r*Math.sin(t)}emit("text-anchor",textAlign[o.align]||"start");if(a){t=translate(x,y)+" rotate("+a+")";if(dx||dy)t+=" "+translate(dx,dy)}else{t=translate(x+dx,y+dy)}emit("transform",t)}}}},{"../../util/svg":83,"../../util/text":84}],74:[function(require,module,exports){function Bounds(b){this.clear();if(b)this.union(b)}var prototype=Bounds.prototype;prototype.clone=function(){return new Bounds(this)};prototype.clear=function(){this.x1=+Number.MAX_VALUE;this.y1=+Number.MAX_VALUE;this.x2=-Number.MAX_VALUE;this.y2=-Number.MAX_VALUE;return this};prototype.set=function(x1,y1,x2,y2){this.x1=x1;this.y1=y1;this.x2=x2;this.y2=y2;return this};prototype.add=function(x,y){if(x<this.x1)this.x1=x;if(y<this.y1)this.y1=y;if(x>this.x2)this.x2=x;if(y>this.y2)this.y2=y;return this};prototype.expand=function(d){this.x1-=d;this.y1-=d;this.x2+=d;this.y2+=d;return this};prototype.round=function(){this.x1=Math.floor(this.x1);this.y1=Math.floor(this.y1);this.x2=Math.ceil(this.x2);this.y2=Math.ceil(this.y2);return this};prototype.translate=function(dx,dy){this.x1+=dx;this.x2+=dx;this.y1+=dy;this.y2+=dy;return this};prototype.rotate=function(angle,x,y){var cos=Math.cos(angle),sin=Math.sin(angle),cx=x-x*cos+y*sin,cy=y-x*sin-y*cos,x1=this.x1,x2=this.x2,y1=this.y1,y2=this.y2;return this.clear().add(cos*x1-sin*y1+cx,sin*x1+cos*y1+cy).add(cos*x1-sin*y2+cx,sin*x1+cos*y2+cy).add(cos*x2-sin*y1+cx,sin*x2+cos*y1+cy).add(cos*x2-sin*y2+cx,sin*x2+cos*y2+cy)};prototype.union=function(b){if(b.x1<this.x1)this.x1=b.x1;if(b.y1<this.y1)this.y1=b.y1;if(b.x2>this.x2)this.x2=b.x2;if(b.y2>this.y2)this.y2=b.y2;return this};prototype.encloses=function(b){return b&&(this.x1<=b.x1&&this.x2>=b.x2&&this.y1<=b.y1&&this.y2>=b.y2)};prototype.intersects=function(b){return b&&!(this.x2<b.x1||this.x1>b.x2||this.y2<b.y1||this.y1>b.y2)};prototype.contains=function(x,y){return!(x<this.x1||x>this.x2||y<this.y1||y>this.y2)};prototype.width=function(){return this.x2-this.x1};prototype.height=function(){return this.y2-this.y1};module.exports=Bounds},{}],75:[function(require,module,exports){module.exports=function(b){function noop(){}function add(x,y){b.add(x,y)}return{bounds:function(_){if(!arguments.length)return b;return b=_,this},beginPath:noop,closePath:noop,moveTo:add,lineTo:add,quadraticCurveTo:function(x1,y1,x2,y2){b.add(x1,y1);b.add(x2,y2)},bezierCurveTo:function(x1,y1,x2,y2,x3,y3){b.add(x1,y1);b.add(x2,y2);b.add(x3,y3)}}}},{}],76:[function(require,module,exports){var gradient_id=0;function Gradient(type){this.id="gradient_"+gradient_id++;this.type=type||"linear";this.stops=[];this.x1=0;this.x2=1;this.y1=0;this.y2=0}var prototype=Gradient.prototype;prototype.stop=function(offset,color){this.stops.push({offset:offset,color:color});return this};module.exports=Gradient},{}],77:[function(require,module,exports){(function(global){var load=require("datalib/src/import/load");function ImageLoader(loadConfig){this._pending=0;this._config=loadConfig||ImageLoader.Config}ImageLoader.Config=null;var prototype=ImageLoader.prototype;prototype.pending=function(){return this._pending};prototype.params=function(uri){var p={url:uri},k;for(k in this._config){p[k]=this._config[k]}return p};prototype.imageURL=function(uri){return load.sanitizeUrl(this.params(uri))};function browser(uri,callback){var url=load.sanitizeUrl(this.params(uri));if(!url){if(callback)callback(uri,null);return null}var loader=this,image=new Image;loader._pending+=1;image.onload=function(){loader._pending-=1;image.loaded=true;if(callback)callback(null,image)};image.src=url;return image}function server(uri,callback){var loader=this,image=new(typeof window!=="undefined"?window["canvas"]:typeof global!=="undefined"?global["canvas"]:null).Image;loader._pending+=1;load(this.params(uri),function(err,data){loader._pending-=1;if(err){if(callback)callback(err,null);return null}image.src=data;image.loaded=true;if(callback)callback(null,image)});return image}prototype.loadImage=function(uri,callback){return load.useXHR?browser.call(this,uri,callback):server.call(this,uri,callback)};module.exports=ImageLoader}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"datalib/src/import/load":20}],78:[function(require,module,exports){function Item(mark){this.mark=mark}var prototype=Item.prototype;prototype.hasPropertySet=function(name){var props=this.mark.def.properties;return props&&props[name]!=null};prototype.cousin=function(offset,index){if(offset===0)return this;offset=offset||-1;var mark=this.mark,group=mark.group,iidx=index==null?mark.items.indexOf(this):index,midx=group.items.indexOf(mark)+offset;return group.items[midx].items[iidx]};prototype.sibling=function(offset){if(offset===0)return this;offset=offset||-1;var mark=this.mark,iidx=mark.items.indexOf(this)+offset;return mark.items[iidx]};prototype.remove=function(){var item=this,list=item.mark.items,i=list.indexOf(item);if(i>=0){if(i===list.length-1){list.pop()}else{list.splice(i,1)}}return item};prototype.touch=function(){if(this.pathCache)this.pathCache=null};module.exports=Item},{}],79:[function(require,module,exports){var BoundsContext=require("./BoundsContext"),Bounds=require("./Bounds"),canvas=require("./canvas"),svg=require("./svg"),text=require("./text"),paths=require("../path"),parse=paths.parse,drawPath=paths.render,areaPath=svg.path.area,linePath=svg.path.line,halfpi=Math.PI/2,sqrt3=Math.sqrt(3),tan30=Math.tan(30*Math.PI/180),g2D=null,bc=BoundsContext();function context(){return g2D||(g2D=canvas.instance(1,1).getContext("2d"))}function strokeBounds(o,bounds){if(o.stroke&&o.opacity!==0&&o.stokeOpacity!==0){bounds.expand(o.strokeWidth!=null?o.strokeWidth:1)}return bounds}function pathBounds(o,path,bounds,x,y){if(path==null){bounds.set(0,0,0,0)}else{drawPath(bc.bounds(bounds),path,x,y);strokeBounds(o,bounds)}return bounds}function path(o,bounds){var p=o.path?o.pathCache||(o.pathCache=parse(o.path)):null;return pathBounds(o,p,bounds,o.x,o.y)}function area(mark,bounds){if(mark.items.length===0)return bounds;var items=mark.items,item=items[0],p=item.pathCache||(item.pathCache=parse(areaPath(items)));return pathBounds(item,p,bounds)}function line(mark,bounds){if(mark.items.length===0)return bounds;var items=mark.items,item=items[0],p=item.pathCache||(item.pathCache=parse(linePath(items)));return pathBounds(item,p,bounds)}function rect(o,bounds){var x,y;return strokeBounds(o,bounds.set(x=o.x||0,y=o.y||0,x+o.width||0,y+o.height||0))}function image(o,bounds){var x=o.x||0,y=o.y||0,w=o.width||0,h=o.height||0;x=x-(o.align==="center"?w/2:o.align==="right"?w:0);y=y-(o.baseline==="middle"?h/2:o.baseline==="bottom"?h:0);return bounds.set(x,y,x+w,y+h)}function rule(o,bounds){var x1,y1;return strokeBounds(o,bounds.set(x1=o.x||0,y1=o.y||0,o.x2!=null?o.x2:x1,o.y2!=null?o.y2:y1))}function arc(o,bounds){var cx=o.x||0,cy=o.y||0,ir=o.innerRadius||0,or=o.outerRadius||0,sa=(o.startAngle||0)-halfpi,ea=(o.endAngle||0)-halfpi,xmin=Infinity,xmax=-Infinity,ymin=Infinity,ymax=-Infinity,a,i,n,x,y,ix,iy,ox,oy;var angles=[sa,ea],s=sa-sa%halfpi;for(i=0;i<4&&s<ea;++i,s+=halfpi){angles.push(s)}for(i=0,n=angles.length;i<n;++i){a=angles[i];x=Math.cos(a);ix=ir*x;ox=or*x;y=Math.sin(a);iy=ir*y;oy=or*y;xmin=Math.min(xmin,ix,ox);xmax=Math.max(xmax,ix,ox);ymin=Math.min(ymin,iy,oy);ymax=Math.max(ymax,iy,oy)}return strokeBounds(o,bounds.set(cx+xmin,cy+ymin,cx+xmax,cy+ymax))}function symbol(o,bounds){var size=o.size!=null?o.size:100,x=o.x||0,y=o.y||0,r,t,rx,ry;switch(o.shape){case"cross":t=3*Math.sqrt(size/5)/2;bounds.set(x-t,y-t,x+t,y+t);break;case"diamond":ry=Math.sqrt(size/(2*tan30));rx=ry*tan30;bounds.set(x-rx,y-ry,x+rx,y+ry);break;case"square":t=Math.sqrt(size);r=t/2;bounds.set(x-r,y-r,x+r,y+r);break;case"triangle-down":rx=Math.sqrt(size/sqrt3);ry=rx*sqrt3/2;bounds.set(x-rx,y-ry,x+rx,y+ry);break;case"triangle-up":rx=Math.sqrt(size/sqrt3);ry=rx*sqrt3/2;bounds.set(x-rx,y-ry,x+rx,y+ry);break;default:r=Math.sqrt(size/Math.PI);bounds.set(x-r,y-r,x+r,y+r)}return strokeBounds(o,bounds)}function textMark(o,bounds,noRotate){var g=context(),h=text.size(o),a=o.align,r=o.radius||0,x=o.x||0,y=o.y||0,dx=o.dx||0,dy=(o.dy||0)+text.offset(o)-Math.round(.8*h),w,t;if(r){t=(o.theta||0)-Math.PI/2;x+=r*Math.cos(t);y+=r*Math.sin(t)}g.font=text.font(o);w=g.measureText(text.value(o.text)).width;if(a==="center"){dx-=w/2}else if(a==="right"){dx-=w}else{}bounds.set(dx+=x,dy+=y,dx+w,dy+h);if(o.angle&&!noRotate){bounds.rotate(o.angle*Math.PI/180,x,y)}return bounds.expand(noRotate?0:1)}function group(g,bounds,includeLegends){var axes=g.axisItems||[],items=g.items||[],legends=g.legendItems||[],j,m;for(j=0,m=axes.length;j<m;++j){bounds.union(axes[j].bounds)}for(j=0,m=items.length;j<m;++j){bounds.union(items[j].bounds)}if(includeLegends){for(j=0,m=legends.length;j<m;++j){bounds.union(legends[j].bounds)}}if(g.width||g.height){strokeBounds(g,bounds.add(0,0).add(g.width||0,g.height||0))}return bounds.translate(g.x||0,g.y||0)}var methods={group:group,symbol:symbol,image:image,rect:rect,rule:rule,arc:arc,text:textMark,path:path,area:area,line:line};methods.area.nest=true;methods.line.nest=true;function itemBounds(item,func,opt){var type=item.mark.marktype;func=func||methods[type];if(func.nest)item=item.mark;var curr=item.bounds,prev=item["bounds:prev"]||(item["bounds:prev"]=new Bounds);if(curr){prev.clear().union(curr);curr.clear()}else{item.bounds=new Bounds}func(item,item.bounds,opt);if(!curr)prev.clear().union(item.bounds);return item.bounds}var DUMMY_ITEM={mark:null};function markBounds(mark,bounds,opt){var type=mark.marktype,func=methods[type],items=mark.items,hasi=items&&items.length,i,n,o,b;if(func.nest){o=hasi?items[0]:(DUMMY_ITEM.mark=mark,DUMMY_ITEM);b=itemBounds(o,func,opt);bounds=bounds&&bounds.union(b)||b;return bounds}bounds=bounds||mark.bounds&&mark.bounds.clear()||new Bounds;if(hasi){for(i=0,n=items.length;i<n;++i){bounds.union(itemBounds(items[i],func,opt))}}return mark.bounds=bounds}module.exports={mark:markBounds,item:itemBounds,text:textMark,group:group}},{"../path":48,"./Bounds":74,"./BoundsContext":75,"./canvas":80,"./svg":83,"./text":84}],80:[function(require,module,exports){(function(global){function instance(w,h){w=w||1;h=h||1;var canvas;if(typeof document!=="undefined"&&document.createElement){canvas=document.createElement("canvas");canvas.width=w;canvas.height=h}else{var Canvas=typeof window!=="undefined"?window["canvas"]:typeof global!=="undefined"?global["canvas"]:null;if(!Canvas.prototype)return null;canvas=new Canvas(w,h)}return lineDash(canvas)}function resize(canvas,w,h,p,retina){var g=this._ctx=canvas.getContext("2d"),s=1;canvas.width=w+p.left+p.right;canvas.height=h+p.top+p.bottom;if(retina&&typeof HTMLElement!=="undefined"&&canvas instanceof HTMLElement){g.pixelratio=s=pixelRatio(canvas)||1}g.setTransform(s,0,0,s,s*p.left,s*p.top);return canvas}function pixelRatio(canvas){var g=canvas.getContext("2d");var devicePixelRatio=window&&window.devicePixelRatio||1,backingStoreRatio=g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||g.backingStorePixelRatio||1,ratio=devicePixelRatio/backingStoreRatio;if(devicePixelRatio!==backingStoreRatio){var w=canvas.width,h=canvas.height;canvas.width=w*ratio;canvas.height=h*ratio;canvas.style.width=w+"px";canvas.style.height=h+"px"}return ratio}function lineDash(canvas){var g=canvas.getContext("2d");if(g.vgLineDash)return;var NOOP=function(){},NODASH=[];if(g.setLineDash){g.vgLineDash=function(dash){this.setLineDash(dash||NODASH)};g.vgLineDashOffset=function(off){this.lineDashOffset=off}}else if(g.webkitLineDash!==undefined){g.vgLineDash=function(dash){this.webkitLineDash=dash||NODASH};g.vgLineDashOffset=function(off){this.webkitLineDashOffset=off}}else if(g.mozDash!==undefined){g.vgLineDash=function(dash){this.mozDash=dash};g.vgLineDashOffset=NOOP}else{g.vgLineDash=NOOP;g.vgLineDashOffset=NOOP}return canvas}module.exports={instance:instance,resize:resize,lineDash:lineDash}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],81:[function(require,module,exports){function create(doc,tag,ns){return ns?doc.createElementNS(ns,tag):doc.createElement(tag)}function remove(el){if(!el)return;var p=el.parentNode;if(p){p.removeChild(el);if(!p.childNodes||!p.childNodes.length)remove(p)}}module.exports={find:function(el,tag){tag=tag.toLowerCase();for(var i=0,n=el.childNodes.length;i<n;++i){if(el.childNodes[i].tagName.toLowerCase()===tag){return el.childNodes[i]}}},child:function(el,index,tag,ns,className,insert){var a,b;a=b=el.childNodes[index];if(!a||insert||a.tagName.toLowerCase()!==tag.toLowerCase()||className&&a.getAttribute("class")!=className){a=create(el.ownerDocument,tag,ns);el.insertBefore(a,b);if(className)a.setAttribute("class",className)}return a},clear:function(el,index){var curr=el.childNodes.length;while(curr>index){el.removeChild(el.childNodes[--curr])}return el},remove:remove,cssClass:function(mark){return"mark-"+mark.marktype+(mark.name?" "+mark.name:"")},openTag:function(tag,attr,raw){var s="<"+tag,key,val;if(attr){for(key in attr){val=attr[key];if(val!=null){s+=" "+key+'="'+val+'"'}}}if(raw)s+=" "+raw;return s+">"},closeTag:function(tag){return"</"+tag+">"}}},{}],82:[function(require,module,exports){var bound=require("../util/bound");var sets=["items","axisItems","legendItems"];var keys=["marktype","name","interactive","clip","items","axisItems","legendItems","layer","x","y","width","height","align","baseline","fill","fillOpacity","opacity","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","startAngle","endAngle","innerRadius","outerRadius","interpolate","tension","orient","url","path","x2","y2","size","shape","text","angle","theta","radius","dx","dy","font","fontSize","fontWeight","fontStyle","fontVariant"];function toJSON(scene,indent){return JSON.stringify(scene,keys,indent)}function fromJSON(json){var scene=typeof json==="string"?JSON.parse(json):json;return initialize(scene)}function initialize(scene){var type=scene.marktype,i,n,s,m,items;for(s=0,m=sets.length;s<m;++s){if(items=scene[sets[s]]){for(i=0,n=items.length;i<n;++i){items[i][type?"mark":"group"]=scene;if(!type||type==="group"){initialize(items[i])}}}}if(type)bound.mark(scene);return scene}module.exports={toJSON:toJSON,fromJSON:fromJSON}},{"../util/bound":79}],83:[function(require,module,exports){(function(global){var d3_svg=(typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null).svg;function x(o){return o.x||0}function y(o){return o.y||0}function xw(o){return(o.x||0)+(o.width||0)}function yh(o){return(o.y||0)+(o.height||0)}function size(o){return o.size==null?100:o.size}function shape(o){return o.shape||"circle"}var areav=d3_svg.area().x(x).y1(y).y0(yh),areah=d3_svg.area().y(y).x1(x).x0(xw),line=d3_svg.line().x(x).y(y);module.exports={metadata:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},path:{arc:d3_svg.arc(),symbol:d3_svg.symbol().type(shape).size(size),area:function(items){var o=items[0];return(o.orient==="horizontal"?areah:areav).interpolate(o.interpolate||"linear").tension(o.tension||.7)(items)},line:function(items){var o=items[0];return line.interpolate(o.interpolate||"linear").tension(o.tension||.7)(items)}},textAlign:{left:"start",center:"middle",right:"end"},textBaseline:{top:"before-edge",bottom:"after-edge",middle:"central"},styles:{fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeWidth:"stroke-width",strokeOpacity:"stroke-opacity",strokeCap:"stroke-linecap",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",opacity:"opacity"},styleProperties:["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","strokeCap","strokeDash","strokeDashOffset","opacity"]}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],84:[function(require,module,exports){function size(item){return item.fontSize!=null?item.fontSize:11}module.exports={size:size,value:function(s){return s!=null?String(s):""},font:function(item,quote){var font=item.font;if(quote&&font){font=String(font).replace(/\"/g,"'")}return""+(item.fontStyle?item.fontStyle+" ":"")+(item.fontVariant?item.fontVariant+" ":"")+(item.fontWeight?item.fontWeight+" ":"")+size(item)+"px "+(font||"sans-serif")},offset:function(item){var baseline=item.baseline,h=size(item);return Math.round(baseline==="top"?.93*h:baseline==="middle"?.3*h:baseline==="bottom"?-.21*h:0)}}},{}],85:[function(require,module,exports){var sg=require("vega-scenegraph").render,canvas=sg.canvas,svg=sg.svg.string,View=require("./View");function HeadlessView(width,height,model){View.call(null,width,height,model);this._type="canvas";this._renderers={canvas:canvas,svg:svg}}var prototype=HeadlessView.prototype=new View;prototype.renderer=function(type){if(type)this._type=type;return View.prototype.renderer.apply(this,arguments)};prototype.canvas=function(){return this._type==="canvas"?this._renderer.canvas():null};prototype.canvasAsync=function(callback){var r=this._renderer,view=this;function wait(){if(r.pendingImages()===0){view.render();callback(view.canvas())}else{setTimeout(wait,10)}}if(this._type!=="canvas")return null;if(r.pendingImages()>0){wait()}else{callback(this.canvas())}};prototype.svg=function(){return this._type==="svg"?this._renderer.svg():null};prototype.initialize=function(){var w=this._width,h=this._height,bg=this._bgcolor,pad=this._padding,config=this.model().config();if(this._viewport){w=this._viewport[0]-(pad?pad.left+pad.right:0);h=this._viewport[1]-(pad?pad.top+pad.bottom:0)}this._renderer=(this._renderer||new this._io.Renderer(config.load)).initialize(null,w,h,pad).background(bg);return this};module.exports=HeadlessView},{"./View":87,"vega-scenegraph":46}],86:[function(require,module,exports){var dl=require("datalib"),df=require("vega-dataflow"),ChangeSet=df.ChangeSet,Base=df.Graph.prototype,Node=df.Node,GroupBuilder=require("../scene/GroupBuilder"),visit=require("../scene/visit"),config=require("./config");function Model(cfg){this._defs={};this._predicates={};this._scene=null;this._node=null;this._builder=null;this._reset={axes:false,legends:false};this.config(cfg);Base.init.call(this)}var prototype=Model.prototype=Object.create(Base);prototype.constructor=Model;prototype.defs=function(defs){if(!arguments.length)return this._defs;this._defs=defs;return this};prototype.config=function(cfg){if(!arguments.length)return this._config;this._config=Object.create(config);for(var name in cfg){var x=cfg[name],y=this._config[name];if(dl.isObject(x)&&dl.isObject(y)){dl.extend(y,x)}else{this._config[name]=x}}return this};prototype.width=function(width){if(this._defs)this._defs.width=width;if(this._defs&&this._defs.marks)this._defs.marks.width=width;if(this._scene){this._scene.items[0].width=width;this._scene.items[0]._dirty=true}this._reset.axes=true;return this};prototype.height=function(height){if(this._defs)this._defs.height=height;if(this._defs&&this._defs.marks)this._defs.marks.height=height;if(this._scene){this._scene.items[0].height=height;this._scene.items[0]._dirty=true}this._reset.axes=true;return this};prototype.node=function(){return this._node||(this._node=new Node(this))};prototype.data=function(){var data=Base.data.apply(this,arguments);if(arguments.length>1){this.node().addListener(data.pipeline()[0])}return data};function predicates(name){var m=this,pred={};if(!dl.isArray(name))return this._predicates[name];name.forEach(function(n){pred[n]=m._predicates[n]});return pred}prototype.predicate=function(name,predicate){if(arguments.length===1)return predicates.call(this,name);return this._predicates[name]=predicate};prototype.predicates=function(){return this._predicates};prototype.scene=function(renderer){if(!arguments.length)return this._scene;if(this._builder)this.node().removeListener(this._builder.disconnect());this._builder=new GroupBuilder(this,this._defs.marks,this._scene={});this.node().addListener(this._builder.connect());var p=this._builder.pipeline();p[p.length-1].addListener(renderer);return this};prototype.reset=function(){if(this._scene&&this._reset.axes){visit(this._scene,function(item){if(item.axes)item.axes.forEach(function(axis){axis.reset()})});this._reset.axes=false}if(this._scene&&this._reset.legends){visit(this._scene,function(item){if(item.legends)item.legends.forEach(function(l){l.reset()})});this._reset.legends=false}return this};prototype.addListener=function(l){this.node().addListener(l)};prototype.removeListener=function(l){this.node().removeListener(l)};prototype.fire=function(cs){if(!cs)cs=ChangeSet.create();this.propagate(cs,this.node())};module.exports=Model},{"../scene/GroupBuilder":110,"../scene/visit":115,"./config":88,datalib:24,"vega-dataflow":39}],87:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),df=require("vega-dataflow"),sg=require("vega-scenegraph").render,log=require("vega-logging"),Deps=df.Dependencies,parseStreams=require("../parse/streams"),Encoder=require("../scene/Encoder"),Transition=require("../scene/Transition");function View(el,width,height){this._el=null;this._model=null;this._width=this.__width=width||500;this._height=this.__height=height||300;this._bgcolor=null;this._autopad=1;this._padding={top:0,left:0,bottom:0,right:0};this._viewport=null;this._renderer=null;this._handler=null;this._streamer=null;this._changeset=null;this._repaint=true;this._renderers=sg;this._io=null;this._api={}}var prototype=View.prototype;prototype.model=function(model){if(!arguments.length)return this._model;if(this._model!==model){this._model=model;this._streamer=new df.Node(model);this._streamer._rank=-1;this._changeset=df.ChangeSet.create();if(this._handler)this._handler.model(model)}return this};function streaming(src){var view=this,ds=this._model.data(src),name=ds.name(),listener=ds.pipeline()[0],streamer=this._streamer,api={};if(this._api[src])return this._api[src];api.insert=function(vals){ds.insert(dl.duplicate(vals));streamer.addListener(listener);view._changeset.data[name]=1;return api};api.update=function(){streamer.addListener(listener);view._changeset.data[name]=1;return ds.update.apply(ds,arguments),api};api.remove=function(){streamer.addListener(listener);view._changeset.data[name]=1;return ds.remove.apply(ds,arguments),api};api.values=function(){return ds.values()};return this._api[src]=api}prototype.data=function(data){var v=this;if(!arguments.length)return v._model.values();else if(dl.isString(data))return streaming.call(v,data);else if(dl.isObject(data)){dl.keys(data).forEach(function(k){var api=streaming.call(v,k);data[k](api)})}return this};prototype.signal=function(name,value){var m=this._model,cs=this._changeset,streamer=this._streamer,setter=name;if(!arguments.length){return m.values(Deps.SIGNALS)}else if(arguments.length==1&&dl.isString(name)){return m.values(Deps.SIGNALS,name)}if(arguments.length==2){setter={};setter[name]=value}dl.keys(setter).forEach(function(k){streamer.addListener(m.signal(k).value(setter[k]));cs.signals[k]=1;cs.reflow=true});return this};prototype.width=function(width){if(!arguments.length)return this.__width;if(this.__width!==width){this._width=this.__width=width;this.model().width(width);this.initialize();if(this._strict)this._autopad=1}return this};prototype.height=function(height){if(!arguments.length)return this.__height;if(this.__height!==height){this._height=this.__height=height;this.model().height(height);this.initialize();if(this._strict)this._autopad=1}return this};prototype.background=function(bgcolor){if(!arguments.length)return this._bgcolor;if(this._bgcolor!==bgcolor){this._bgcolor=bgcolor;this.initialize()}return this};prototype.padding=function(pad){if(!arguments.length)return this._padding;if(this._padding!==pad){if(dl.isString(pad)){this._autopad=1;this._padding={top:0,left:0,bottom:0,right:0};this._strict=pad==="strict"}else{this._autopad=0;this._padding=pad;this._strict=false}if(this._renderer)this._renderer.resize(this._width,this._height,pad);if(this._handler)this._handler.padding(pad)}return this._repaint=true,this};prototype.autopad=function(opt){if(this._autopad<1)return this;else this._autopad=0;var b=this.model().scene().bounds,pad=this._padding,config=this.model().config(),inset=config.autopadInset,l=b.x1<0?Math.ceil(-b.x1)+inset:0,t=b.y1<0?Math.ceil(-b.y1)+inset:0,r=b.x2>this._width?Math.ceil(+b.x2-this._width)+inset:0;b=b.y2>this._height?Math.ceil(+b.y2-this._height)+inset:0;pad={left:l,top:t,right:r,bottom:b};if(this._strict){this._autopad=0;this._padding=pad;this._width=Math.max(0,this.__width-(l+r));this._height=Math.max(0,this.__height-(t+b));this._model.width(this._width).height(this._height).reset();this.initialize().update({props:"enter"}).update({props:"update"})}else{this.padding(pad).update(opt)}return this};prototype.viewport=function(size){if(!arguments.length)return this._viewport;if(this._viewport!==size){this._viewport=size;this.initialize()}return this};prototype.renderer=function(type){if(!arguments.length)return this._renderer;if(this._renderers[type])type=this._renderers[type];else if(dl.isString(type))throw new Error("Unknown renderer: "+type);else if(!type)throw new Error("No renderer specified");if(this._io!==type){this._io=type;this._renderer=null;this.initialize();if(this._build)this.render()}return this};prototype.initialize=function(el){var v=this,prevHandler,w=v._width,h=v._height,pad=v._padding,bg=v._bgcolor,config=this.model().config();if(!arguments.length||el===null){el=this._el?this._el.parentNode:null;if(!el)return this}d3.select(el).select("div.vega").remove();this._el=el=d3.select(el).append("div").attr("class","vega").style("position","relative").node();if(v._viewport){d3.select(el).style("width",(v._viewport[0]||w)+"px").style("height",(v._viewport[1]||h)+"px").style("overflow","auto")}sg.canvas.Renderer.RETINA=config.render.retina;v._renderer=(v._renderer||new this._io.Renderer(config.load)).initialize(el,w,h,pad).background(bg);prevHandler=v._handler;v._handler=(new this._io.Handler).initialize(el,pad,v);if(prevHandler){prevHandler.handlers().forEach(function(h){v._handler.on(h.type,h.handler)})}else{v._detach=parseStreams(this)}return this._repaint=true,this};prototype.destroy=function(){if(this._detach)this._detach()};function build(){var v=this;v._renderNode=new df.Node(v._model).router(true);v._renderNode.evaluate=function(input){log.debug(input,["rendering"]);var s=v._model.scene(),h=v._handler;if(h&&h.scene)h.scene(s);if(input.trans){input.trans.start(function(items){v._renderer.render(s,items)})}else if(v._repaint){v._renderer.render(s);v._repaint=false}else if(input.dirty.length){v._renderer.render(s,input.dirty)}if(input.dirty.length){input.dirty.forEach(function(i){i._dirty=false});s.items[0]._dirty=false}for(var d in input.data){v._model.data(d).synchronize()}return input};return v._model.scene(v._renderNode),true}prototype.update=function(opt){opt=opt||{};var v=this,trans=opt.duration?new Transition(opt.duration,opt.ease):null;var cs=v._changeset;if(trans)cs.trans=trans;if(opt.props!==undefined){if(dl.keys(cs.data).length>0){throw Error("New data values are not reflected in the visualization."+" Please call view.update() before updating a specified property set.")}cs.reflow=true;cs.request=opt.props}var built=v._build;v._build=v._build||build.call(this);if(opt.items&&built){Encoder.update(this._model,opt.trans,opt.props,opt.items,cs.dirty);v._renderNode.evaluate(cs)}else if(v._streamer.listeners().length&&built){v._model.propagate(cs,v._streamer);v._streamer.disconnect()}else{v._model.fire(cs)}v._changeset=df.ChangeSet.create();return v.autopad(opt)};prototype.toImageURL=function(type){var v=this,Renderer;switch(type||"png"){case"canvas":case"png":Renderer=sg.canvas.Renderer;break;case"svg":Renderer=sg.svg.string.Renderer;break;default:throw Error("Unrecognized renderer type: "+type)}var retina=sg.canvas.Renderer.RETINA;sg.canvas.Renderer.RETINA=false;var ren=new Renderer(v._model.config.load).initialize(null,v._width,v._height,v._padding).render(v._model.scene());sg.canvas.Renderer.RETINA=retina;if(type==="svg"){var blob=new Blob([ren.svg()],{type:"image/svg+xml"});return window.URL.createObjectURL(blob)}else{return ren.canvas().toDataURL("image/png")}};prototype.render=function(items){this._renderer.render(this._model.scene(),items);return this};prototype.on=function(){this._handler.on.apply(this._handler,arguments);return this};prototype.onSignal=function(name,handler){this._model.signal(name).on(handler);return this};prototype.off=function(){this._handler.off.apply(this._handler,arguments);return this};prototype.offSignal=function(name,handler){this._model.signal(name).off(handler);return this};View.factory=function(model){var HeadlessView=require("./HeadlessView");return function(opt){opt=opt||{};var defs=model.defs();var v=(opt.el?new View:new HeadlessView).model(model).renderer(opt.renderer||"canvas").width(defs.width).height(defs.height).background(defs.background).padding(defs.padding).viewport(defs.viewport).initialize(opt.el);if(opt.data)v.data(opt.data);if(opt.hover!==false&&opt.el){v.on("mouseover",function(evt,item){if(item&&item.hasPropertySet("hover")){this.update({props:"hover",items:item})}}).on("mouseout",function(evt,item){if(item&&item.hasPropertySet("hover")){this.update({props:"update",items:item})}})}return v}};module.exports=View}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../parse/streams":105,"../scene/Encoder":109,"../scene/Transition":112,"./HeadlessView":85,datalib:24,"vega-dataflow":39,"vega-logging":45,"vega-scenegraph":46}],88:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,config={};config.load={baseURL:"",domainWhiteList:false};config.autopadInset=5;config.scale={time:d3.time.scale,utc:d3.time.scale.utc};config.render={retina:true};config.axis={orient:"bottom",ticks:10,padding:3,axisColor:"#000",gridColor:"#000",gridOpacity:.15,tickColor:"#000",tickLabelColor:"#000",axisWidth:1,tickWidth:1,tickSize:6,tickLabelFontSize:11,tickLabelFont:"sans-serif",titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold",titleOffset:35};config.legend={orient:"right",offset:20,padding:3,gradientStrokeColor:"#888",gradientStrokeWidth:1,gradientHeight:16,gradientWidth:100,labelColor:"#000",labelFontSize:10,labelFont:"sans-serif",labelAlign:"left",labelBaseline:"middle",labelOffset:8,symbolShape:"circle",symbolSize:50,symbolColor:"#888",symbolStrokeWidth:1,titleColor:"#000",titleFont:"sans-serif",titleFontSize:11,titleFontWeight:"bold"};config.color={rgb:[128,128,128],lab:[50,0,0],hcl:[0,0,50],hsl:[0,0,.5]};config.range={category10:d3.scale.category10().range(),category20:d3.scale.category20().range(),category20b:d3.scale.category20b().range(),category20c:d3.scale.category20c().range(),shapes:["circle","cross","diamond","square","triangle-down","triangle-up"]};module.exports=config}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],89:[function(require,module,exports){var dl=require("datalib"),parse=require("../parse"),Scale=require("../scene/Scale"),config=require("./config");function compile(module,opt,schema){var s=module.schema;if(!s)return;if(s.refs)dl.extend(schema.refs,s.refs);if(s.defs)dl.extend(schema.defs,s.defs)}module.exports=function(opt){var schema=null;opt=opt||{};if(opt.url){schema=dl.json(dl.extend({url:opt.url},config.load))}else{schema={$schema:"http://json-schema.org/draft-04/schema#",title:"Vega Visualization Specification Language",defs:{},refs:{},$ref:"#/defs/spec"};
dl.keys(parse).forEach(function(k){compile(parse[k],opt,schema)});compile(Scale,opt,schema)}if(opt.properties)dl.keys(opt.properties).forEach(function(k){schema.defs.propset.properties[k]={$ref:"#/refs/"+opt.properties[k]+"Value"}});if(opt.propertySets)dl.keys(opt.propertySets).forEach(function(k){schema.defs.mark.properties.properties.properties[k]={$ref:"#/defs/propset"}});return schema}},{"../parse":95,"../scene/Scale":111,"./config":88,datalib:24}],90:[function(require,module,exports){var dl=require("datalib"),axs=require("../scene/axis");var ORIENT={x:"bottom",y:"left",top:"top",bottom:"bottom",left:"left",right:"right"};function parseAxes(model,spec,axes,group){var config=model.config();(spec||[]).forEach(function(def,index){axes[index]=axes[index]||axs(model);parseAxis(config,def,index,axes[index],group)})}function parseAxis(config,def,index,axis,group){if(def.scale!==undefined){axis.scale(group.scale(def.scale))}axis.orient(def.orient||ORIENT[def.type]);axis.offset(def.offset||0);axis.layer(def.layer||"front");axis.grid(def.grid||false);axis.title(def.title||null);axis.titleOffset(def.titleOffset!=null?def.titleOffset:config.axis.titleOffset);axis.tickValues(def.values||null);axis.tickFormat(def.format||null);axis.tickFormatType(def.formatType||null);axis.tickSubdivide(def.subdivide||0);axis.tickPadding(def.tickPadding||config.axis.padding);var size=[];if(def.tickSize!==undefined){for(var i=0;i<3;++i)size.push(def.tickSize)}else{var ts=config.axis.tickSize;size=[ts,ts,ts]}if(def.tickSizeMajor!=null)size[0]=def.tickSizeMajor;if(def.tickSizeMinor!=null)size[1]=def.tickSizeMinor;if(def.tickSizeEnd!=null)size[2]=def.tickSizeEnd;if(size.length){axis.tickSize.apply(axis,size)}axis.tickCount(def.ticks||config.axis.ticks);var p=def.properties;if(p&&p.ticks){axis.majorTickProperties(p.majorTicks?dl.extend({},p.ticks,p.majorTicks):p.ticks);axis.minorTickProperties(p.minorTicks?dl.extend({},p.ticks,p.minorTicks):p.ticks)}else{axis.majorTickProperties(p&&p.majorTicks||{});axis.minorTickProperties(p&&p.minorTicks||{})}axis.tickLabelProperties(p&&p.labels||{});axis.titleProperties(p&&p.title||{});axis.gridLineProperties(p&&p.grid||{});axis.domainProperties(p&&p.axis||{})}module.exports=parseAxes},{"../scene/axis":113,datalib:24}],91:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null;function parseBg(bg){if(bg==null)return null;return d3.rgb(bg)+""}module.exports=parseBg}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],92:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),parseTransforms=require("./transforms"),parseModify=require("./modify");function parseData(model,spec,callback){var config=model.config(),count=0;function loaded(d){return function(error,data){if(error){log.error("LOADING FAILED: "+d.url+" "+error)}else{model.data(d.name).values(dl.read(data,d.format))}if(--count===0)callback()}}(spec||[]).forEach(function(d){if(d.url){count+=1;dl.load(dl.extend({url:d.url},config.load),loaded(d))}parseData.datasource(model,d)});if(count===0)setTimeout(callback,1);return spec}parseData.datasource=function(model,d){var transform=(d.transform||[]).map(function(t){return parseTransforms(model,t)}),mod=(d.modify||[]).map(function(m){return parseModify(model,m,d)}),ds=model.data(d.name,mod.concat(transform));if(d.values){ds.values(dl.read(d.values,d.format))}else if(d.source){ds.source(d.source).addListener(ds);model.removeListener(ds.pipeline()[0])}return ds};module.exports=parseData},{"./modify":99,"./transforms":106,datalib:24,"vega-logging":45}],93:[function(require,module,exports){module.exports=function(){function peg$subclass(child,parent){function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor}function SyntaxError(message,expected,found,offset,line,column){this.message=message;this.expected=expected;this.found=found;this.offset=offset;this.line=line;this.column=column;this.name="SyntaxError"}peg$subclass(SyntaxError,Error);function parse(input){var options=arguments.length>1?arguments[1]:{},peg$FAILED={},peg$startRuleFunctions={start:peg$parsestart},peg$startRuleFunction=peg$parsestart,peg$c0=peg$FAILED,peg$c1=",",peg$c2={type:"literal",value:",",description:'","'},peg$c3=function(o,m){return[o].concat(m)},peg$c4=function(o){return[o]},peg$c5="[",peg$c6={type:"literal",value:"[",description:'"["'},peg$c7="]",peg$c8={type:"literal",value:"]",description:'"]"'},peg$c9=">",peg$c10={type:"literal",value:">",description:'">"'},peg$c11=function(f1,f2,o){return{start:f1,end:f2,middle:o}},peg$c12=[],peg$c13=function(s,f){return s.filters=f,s},peg$c14=function(s){return s},peg$c15="(",peg$c16={type:"literal",value:"(",description:'"("'},peg$c17=")",peg$c18={type:"literal",value:")",description:'")"'},peg$c19=function(m){return{stream:m}},peg$c20="@",peg$c21={type:"literal",value:"@",description:'"@"'},peg$c22=":",peg$c23={type:"literal",value:":",description:'":"'},peg$c24=function(n,e){return{event:e,name:n}},peg$c25=function(m,e){return{event:e,mark:m}},peg$c26=function(t,e){return{event:e,target:t}},peg$c27=function(e){return{event:e}},peg$c28=function(s){return{signal:s}},peg$c29="rect",peg$c30={type:"literal",value:"rect",description:'"rect"'},peg$c31="symbol",peg$c32={type:"literal",value:"symbol",description:'"symbol"'},peg$c33="path",peg$c34={type:"literal",value:"path",description:'"path"'},peg$c35="arc",peg$c36={type:"literal",value:"arc",description:'"arc"'},peg$c37="area",peg$c38={type:"literal",value:"area",description:'"area"'},peg$c39="line",peg$c40={type:"literal",value:"line",description:'"line"'},peg$c41="rule",peg$c42={type:"literal",value:"rule",description:'"rule"'},peg$c43="image",peg$c44={type:"literal",value:"image",description:'"image"'},peg$c45="text",peg$c46={type:"literal",value:"text",description:'"text"'},peg$c47="group",peg$c48={type:"literal",value:"group",description:'"group"'},peg$c49="mousedown",peg$c50={type:"literal",value:"mousedown",description:'"mousedown"'},peg$c51="mouseup",peg$c52={type:"literal",value:"mouseup",description:'"mouseup"'},peg$c53="click",peg$c54={type:"literal",value:"click",description:'"click"'},peg$c55="dblclick",peg$c56={type:"literal",value:"dblclick",description:'"dblclick"'},peg$c57="wheel",peg$c58={type:"literal",value:"wheel",description:'"wheel"'},peg$c59="keydown",peg$c60={type:"literal",value:"keydown",description:'"keydown"'},peg$c61="keypress",peg$c62={type:"literal",value:"keypress",description:'"keypress"'},peg$c63="keyup",peg$c64={type:"literal",value:"keyup",description:'"keyup"'},peg$c65="mousewheel",peg$c66={type:"literal",value:"mousewheel",description:'"mousewheel"'},peg$c67="mousemove",peg$c68={type:"literal",value:"mousemove",description:'"mousemove"'},peg$c69="mouseout",peg$c70={type:"literal",value:"mouseout",description:'"mouseout"'},peg$c71="mouseover",peg$c72={type:"literal",value:"mouseover",description:'"mouseover"'},peg$c73="mouseenter",peg$c74={type:"literal",value:"mouseenter",description:'"mouseenter"'},peg$c75="touchstart",peg$c76={type:"literal",value:"touchstart",description:'"touchstart"'},peg$c77="touchmove",peg$c78={type:"literal",value:"touchmove",description:'"touchmove"'},peg$c79="touchend",peg$c80={type:"literal",value:"touchend",description:'"touchend"'},peg$c81=function(e){return e},peg$c82=/^[a-zA-Z0-9_\-]/,peg$c83={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},peg$c84=function(n){return n.join("")},peg$c85=/^[a-zA-Z0-9\-_  #.>+~[\]=|\^$*]/,peg$c86={type:"class",value:"[a-zA-Z0-9\\-_  #.>+~[\\]=|\\^$*]",description:"[a-zA-Z0-9\\-_  #.>+~[\\]=|\\^$*]"},peg$c87=function(c){return c.join("")},peg$c88=/^['"a-zA-Z0-9_().><=! \t-&|~]/,peg$c89={type:"class",value:"['\"a-zA-Z0-9_().><=! \\t-&|~]",description:"['\"a-zA-Z0-9_().><=! \\t-&|~]"},peg$c90=function(v){return v.join("")},peg$c91=/^[ \t\r\n]/,peg$c92={type:"class",value:"[ \\t\\r\\n]",description:"[ \\t\\r\\n]"},peg$currPos=0,peg$reportedPos=0,peg$cachedPos=0,peg$cachedPosDetails={line:1,column:1,seenCR:false},peg$maxFailPos=0,peg$maxFailExpected=[],peg$silentFails=0,peg$result;if("startRule"in options){if(!(options.startRule in peg$startRuleFunctions)){throw new Error("Can't start parsing from rule \""+options.startRule+'".')}peg$startRuleFunction=peg$startRuleFunctions[options.startRule]}function text(){return input.substring(peg$reportedPos,peg$currPos)}function offset(){return peg$reportedPos}function line(){return peg$computePosDetails(peg$reportedPos).line}function column(){return peg$computePosDetails(peg$reportedPos).column}function expected(description){throw peg$buildException(null,[{type:"other",description:description}],peg$reportedPos)}function error(message){throw peg$buildException(message,null,peg$reportedPos)}function peg$computePosDetails(pos){function advance(details,startPos,endPos){var p,ch;for(p=startPos;p<endPos;p++){ch=input.charAt(p);if(ch==="\n"){if(!details.seenCR){details.line++}details.column=1;details.seenCR=false}else if(ch==="\r"||ch==="\u2028"||ch==="\u2029"){details.line++;details.column=1;details.seenCR=true}else{details.column++;details.seenCR=false}}}if(peg$cachedPos!==pos){if(peg$cachedPos>pos){peg$cachedPos=0;peg$cachedPosDetails={line:1,column:1,seenCR:false}}advance(peg$cachedPosDetails,peg$cachedPos,pos);peg$cachedPos=pos}return peg$cachedPosDetails}function peg$fail(expected){if(peg$currPos<peg$maxFailPos){return}if(peg$currPos>peg$maxFailPos){peg$maxFailPos=peg$currPos;peg$maxFailExpected=[]}peg$maxFailExpected.push(expected)}function peg$buildException(message,expected,pos){function cleanupExpected(expected){var i=1;expected.sort(function(a,b){if(a.description<b.description){return-1}else if(a.description>b.description){return 1}else{return 0}});while(i<expected.length){if(expected[i-1]===expected[i]){expected.splice(i,1)}else{i++}}}function buildMessage(expected,found){function stringEscape(s){function hex(ch){return ch.charCodeAt(0).toString(16).toUpperCase()}return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ch){return"\\x0"+hex(ch)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ch){return"\\x"+hex(ch)}).replace(/[\u0180-\u0FFF]/g,function(ch){return"\\u0"+hex(ch)}).replace(/[\u1080-\uFFFF]/g,function(ch){return"\\u"+hex(ch)})}var expectedDescs=new Array(expected.length),expectedDesc,foundDesc,i;for(i=0;i<expected.length;i++){expectedDescs[i]=expected[i].description}expectedDesc=expected.length>1?expectedDescs.slice(0,-1).join(", ")+" or "+expectedDescs[expected.length-1]:expectedDescs[0];foundDesc=found?'"'+stringEscape(found)+'"':"end of input";return"Expected "+expectedDesc+" but "+foundDesc+" found."}var posDetails=peg$computePosDetails(pos),found=pos<input.length?input.charAt(pos):null;if(expected!==null){cleanupExpected(expected)}return new SyntaxError(message!==null?message:buildMessage(expected,found),expected,found,pos,posDetails.line,posDetails.column)}function peg$parsestart(){var s0;s0=peg$parsemerged();return s0}function peg$parsemerged(){var s0,s1,s2,s3,s4,s5;s0=peg$currPos;s1=peg$parseordered();if(s1!==peg$FAILED){s2=peg$parsesep();if(s2!==peg$FAILED){if(input.charCodeAt(peg$currPos)===44){s3=peg$c1;peg$currPos++}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c2)}}if(s3!==peg$FAILED){s4=peg$parsesep();if(s4!==peg$FAILED){s5=peg$parsemerged();if(s5!==peg$FAILED){peg$reportedPos=s0;s1=peg$c3(s1,s5);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parseordered();if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c4(s1)}s0=s1}return s0}function peg$parseordered(){var s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===91){s1=peg$c5;peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c6)}}if(s1!==peg$FAILED){s2=peg$parsesep();if(s2!==peg$FAILED){s3=peg$parsefiltered();if(s3!==peg$FAILED){s4=peg$parsesep();if(s4!==peg$FAILED){if(input.charCodeAt(peg$currPos)===44){s5=peg$c1;peg$currPos++}else{s5=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c2)}}if(s5!==peg$FAILED){s6=peg$parsesep();if(s6!==peg$FAILED){s7=peg$parsefiltered();if(s7!==peg$FAILED){s8=peg$parsesep();if(s8!==peg$FAILED){if(input.charCodeAt(peg$currPos)===93){s9=peg$c7;peg$currPos++}else{s9=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c8)}}if(s9!==peg$FAILED){s10=peg$parsesep();if(s10!==peg$FAILED){if(input.charCodeAt(peg$currPos)===62){s11=peg$c9;peg$currPos++}else{s11=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c10)}}if(s11!==peg$FAILED){s12=peg$parsesep();if(s12!==peg$FAILED){s13=peg$parseordered();if(s13!==peg$FAILED){peg$reportedPos=s0;s1=peg$c11(s3,s7,s13);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$parsefiltered()}return s0}function peg$parsefiltered(){var s0,s1,s2,s3;s0=peg$currPos;s1=peg$parsestream();if(s1!==peg$FAILED){s2=[];s3=peg$parsefilter();if(s3!==peg$FAILED){while(s3!==peg$FAILED){s2.push(s3);s3=peg$parsefilter()}}else{s2=peg$c0}if(s2!==peg$FAILED){peg$reportedPos=s0;s1=peg$c13(s1,s2);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsestream();if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c14(s1)}s0=s1}return s0}function peg$parsestream(){var s0,s1,s2,s3,s4;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===40){s1=peg$c15;peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c16)}}if(s1!==peg$FAILED){s2=peg$parsemerged();if(s2!==peg$FAILED){if(input.charCodeAt(peg$currPos)===41){s3=peg$c17;peg$currPos++}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c18)}}if(s3!==peg$FAILED){peg$reportedPos=s0;s1=peg$c19(s2);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;if(input.charCodeAt(peg$currPos)===64){s1=peg$c20;peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c21)}}if(s1!==peg$FAILED){s2=peg$parsename();if(s2!==peg$FAILED){if(input.charCodeAt(peg$currPos)===58){s3=peg$c22;peg$currPos++}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c23)}}if(s3!==peg$FAILED){s4=peg$parseeventType();if(s4!==peg$FAILED){peg$reportedPos=s0;s1=peg$c24(s2,s4);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsemarkType();if(s1!==peg$FAILED){if(input.charCodeAt(peg$currPos)===58){s2=peg$c22;peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c23)}}if(s2!==peg$FAILED){s3=peg$parseeventType();if(s3!==peg$FAILED){peg$reportedPos=s0;s1=peg$c25(s1,s3);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsecss();if(s1!==peg$FAILED){if(input.charCodeAt(peg$currPos)===58){s2=peg$c22;peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c23)}}if(s2!==peg$FAILED){s3=peg$parseeventType();if(s3!==peg$FAILED){peg$reportedPos=s0;s1=peg$c26(s1,s3);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parseeventType();if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c27(s1)}s0=s1;if(s0===peg$FAILED){s0=peg$currPos;s1=peg$parsename();if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c28(s1)}s0=s1}}}}}return s0}function peg$parsemarkType(){var s0;if(input.substr(peg$currPos,4)===peg$c29){s0=peg$c29;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c30)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,6)===peg$c31){s0=peg$c31;peg$currPos+=6}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c32)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,4)===peg$c33){s0=peg$c33;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c34)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,3)===peg$c35){s0=peg$c35;peg$currPos+=3}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c36)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,4)===peg$c37){s0=peg$c37;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c38)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,4)===peg$c39){s0=peg$c39;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c40)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,4)===peg$c41){s0=peg$c41;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c42)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,5)===peg$c43){s0=peg$c43;peg$currPos+=5}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c44)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,4)===peg$c45){s0=peg$c45;peg$currPos+=4}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c46)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,5)===peg$c47){s0=peg$c47;peg$currPos+=5}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c48)}}}}}}}}}}}return s0}function peg$parseeventType(){var s0;if(input.substr(peg$currPos,9)===peg$c49){s0=peg$c49;peg$currPos+=9}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c50)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,7)===peg$c51){s0=peg$c51;peg$currPos+=7}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c52)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,5)===peg$c53){s0=peg$c53;peg$currPos+=5}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c54)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,8)===peg$c55){s0=peg$c55;peg$currPos+=8}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c56)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,5)===peg$c57){s0=peg$c57;peg$currPos+=5}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c58)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,7)===peg$c59){s0=peg$c59;peg$currPos+=7}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c60)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,8)===peg$c61){s0=peg$c61;peg$currPos+=8}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c62)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,5)===peg$c63){s0=peg$c63;peg$currPos+=5}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c64)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,10)===peg$c65){s0=peg$c65;peg$currPos+=10}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c66)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,9)===peg$c67){s0=peg$c67;peg$currPos+=9}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c68)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,8)===peg$c69){s0=peg$c69;peg$currPos+=8}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c70)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,9)===peg$c71){s0=peg$c71;peg$currPos+=9}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c72)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,10)===peg$c73){s0=peg$c73;peg$currPos+=10}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c74)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,10)===peg$c75){s0=peg$c75;peg$currPos+=10}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c76)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,9)===peg$c77){s0=peg$c77;peg$currPos+=9}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c78)}}if(s0===peg$FAILED){if(input.substr(peg$currPos,8)===peg$c79){s0=peg$c79;peg$currPos+=8}else{s0=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c80)}}}}}}}}}}}}}}}}}return s0}function peg$parsefilter(){var s0,s1,s2,s3;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===91){s1=peg$c5;peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c6)}}if(s1!==peg$FAILED){s2=peg$parseexpr();if(s2!==peg$FAILED){if(input.charCodeAt(peg$currPos)===93){s3=peg$c7;peg$currPos++}else{s3=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c8)}}if(s3!==peg$FAILED){peg$reportedPos=s0;s1=peg$c81(s2);s0=s1}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}return s0}function peg$parsename(){var s0,s1,s2;s0=peg$currPos;s1=[];if(peg$c82.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c83)}}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);if(peg$c82.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c83)}}}}else{s1=peg$c0}if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c84(s1)}s0=s1;return s0}function peg$parsecss(){var s0,s1,s2;s0=peg$currPos;s1=[];if(peg$c85.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c86)}}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);if(peg$c85.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c86)}}}}else{s1=peg$c0}if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c87(s1)}s0=s1;return s0}function peg$parseexpr(){var s0,s1,s2;s0=peg$currPos;s1=[];if(peg$c88.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c89)}}if(s2!==peg$FAILED){while(s2!==peg$FAILED){s1.push(s2);if(peg$c88.test(input.charAt(peg$currPos))){s2=input.charAt(peg$currPos);peg$currPos++}else{s2=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c89)}}}}else{s1=peg$c0}if(s1!==peg$FAILED){peg$reportedPos=s0;s1=peg$c90(s1)}s0=s1;return s0}function peg$parsesep(){var s0,s1;s0=[];if(peg$c91.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c92)}}while(s1!==peg$FAILED){s0.push(s1);if(peg$c91.test(input.charAt(peg$currPos))){s1=input.charAt(peg$currPos);peg$currPos++}else{s1=peg$FAILED;if(peg$silentFails===0){peg$fail(peg$c92)}}}return s0}peg$result=peg$startRuleFunction();if(peg$result!==peg$FAILED&&peg$currPos===input.length){return peg$result}else{if(peg$result!==peg$FAILED&&peg$currPos<input.length){peg$fail({type:"end",description:"end of input"})}throw peg$buildException(null,peg$maxFailExpected,peg$maxFailPos)}}return{SyntaxError:SyntaxError,parse:parse}}()},{}],94:[function(require,module,exports){var expr=require("vega-expression"),args=["datum","event","signals"];module.exports=expr.compiler(args,{idWhiteList:args,fieldVar:args[0],globalVar:args[2],functions:function(codegen){var fn=expr.functions(codegen);fn.eventItem=function(){return"event.vg.item"};fn.eventGroup="event.vg.getGroup";fn.eventX="event.vg.getX";fn.eventY="event.vg.getY";fn.open="window.open";return fn}})},{"vega-expression":43}],95:[function(require,module,exports){module.exports={axes:require("./axes"),background:require("./background"),data:require("./data"),events:require("./events"),expr:require("./expr"),legends:require("./legends"),mark:require("./mark"),marks:require("./marks"),modify:require("./modify"),padding:require("./padding"),predicates:require("./predicates"),properties:require("./properties"),signals:require("./signals"),spec:require("./spec"),streams:require("./streams"),transforms:require("./transforms")}},{"./axes":90,"./background":91,"./data":92,"./events":93,"./expr":94,"./legends":96,"./mark":97,"./marks":98,"./modify":99,"./padding":100,"./predicates":101,"./properties":102,"./signals":103,"./spec":104,"./streams":105,"./transforms":106}],96:[function(require,module,exports){var lgnd=require("../scene/legend");function parseLegends(model,spec,legends,group){(spec||[]).forEach(function(def,index){legends[index]=legends[index]||lgnd(model);parseLegend(def,index,legends[index],group)})}function parseLegend(def,index,legend,group){legend.size(def.size?group.scale(def.size):null);legend.shape(def.shape?group.scale(def.shape):null);legend.fill(def.fill?group.scale(def.fill):null);legend.stroke(def.stroke?group.scale(def.stroke):null);if(def.orient)legend.orient(def.orient);if(def.offset!=null)legend.offset(def.offset);legend.title(def.title||null);legend.values(def.values||null);legend.format(def.format!==undefined?def.format:null);var p=def.properties;legend.titleProperties(p&&p.title||{});legend.labelProperties(p&&p.labels||{});legend.legendProperties(p&&p.legend||{});legend.symbolProperties(p&&p.symbols||{});legend.gradientProperties(p&&p.gradient||{})}module.exports=parseLegends},{"../scene/legend":114}],97:[function(require,module,exports){var dl=require("datalib"),parseProperties=require("./properties");function parseMark(model,mark){var props=mark.properties,group=mark.marks;dl.keys(props).forEach(function(k){props[k]=parseProperties(model,mark.type,props[k])});if(mark.delay){mark.delay=parseProperties(model,mark.type,{delay:mark.delay})}if(group){mark.marks=group.map(function(g){return parseMark(model,g)})}return mark}module.exports=parseMark},{"./properties":102,datalib:24}],98:[function(require,module,exports){var parseMark=require("./mark");function parseRootMark(model,spec,width,height){return{type:"group",width:width,height:height,scales:spec.scales||[],axes:spec.axes||[],legends:spec.legends||[],marks:(spec.marks||[]).map(function(m){return parseMark(model,m)})}}module.exports=parseRootMark},{"./mark":97}],99:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),df=require("vega-dataflow"),Node=df.Node,Tuple=df.Tuple,Deps=df.Dependencies;var Types={INSERT:"insert",REMOVE:"remove",TOGGLE:"toggle",CLEAR:"clear"};var EMPTY=[];var filter=function(field,value,src,dest){for(var i=src.length-1;i>=0;--i){if(src[i][field]==value)dest.push.apply(dest,src.splice(i,1))}};function parseModify(model,def,ds){var signal=def.signal?dl.field(def.signal):null,signalName=signal?signal[0]:null,predicate=def.predicate?model.predicate(def.predicate.name||def.predicate):null,reeval=predicate===null,node=new Node(model).router(def.type===Types.CLEAR);node.evaluate=function(input){if(predicate!==null){var db=model.values(Deps.DATA,predicate.data||EMPTY),sg=model.values(Deps.SIGNALS,predicate.signals||EMPTY);reeval=predicate.call(predicate,{},db,sg,model._predicates)}log.debug(input,[def.type+"ing",reeval]);if(!reeval)return input;var datum={},value=signal?model.signalRef(def.signal):null,d=model.data(ds.name),t=null;datum[def.field]=value;if(def.type===Types.INSERT){t=Tuple.ingest(datum);input.add.push(t);d._data.push(t)}else if(def.type===Types.REMOVE){filter(def.field,value,input.add,input.rem);filter(def.field,value,input.mod,input.rem);d._data=d._data.filter(function(x){return x[def.field]!==value})}else if(def.type===Types.TOGGLE){var add=[],rem=[];filter(def.field,value,input.rem,add);filter(def.field,value,input.add,rem);filter(def.field,value,input.mod,rem);if(!(add.length||rem.length))add.push(Tuple.ingest(datum));input.add.push.apply(input.add,add);d._data.push.apply(d._data,add);input.rem.push.apply(input.rem,rem);d._data=d._data.filter(function(x){return rem.indexOf(x)===-1})}else if(def.type===Types.CLEAR){input.rem.push.apply(input.rem,input.add);input.rem.push.apply(input.rem,input.mod);input.add=[];input.mod=[];d._data=[]}input.fields[def.field]=1;return input};if(signalName)node.dependency(Deps.SIGNALS,signalName);if(predicate){node.dependency(Deps.DATA,predicate.data);node.dependency(Deps.SIGNALS,predicate.signals)}return node}module.exports=parseModify},{datalib:24,"vega-dataflow":39,"vega-logging":45}],100:[function(require,module,exports){var dl=require("datalib");function parsePadding(pad){if(pad==null)return"auto";else if(dl.isString(pad))return pad==="strict"?"strict":"auto";else if(dl.isObject(pad))return pad;var p=dl.isNumber(pad)?pad:20;return{top:p,left:p,right:p,bottom:p}}module.exports=parsePadding},{datalib:24}],101:[function(require,module,exports){var dl=require("datalib");var types={"=":parseComparator,"==":parseComparator,"!=":parseComparator,">":parseComparator,">=":parseComparator,"<":parseComparator,"<=":parseComparator,and:parseLogical,"&&":parseLogical,or:parseLogical,"||":parseLogical,"in":parseIn};var nullScale=function(){return 0};nullScale.invert=nullScale;function parsePredicates(model,spec){(spec||[]).forEach(function(s){var parse=types[s.type](model,s);var pred=Function("args","db","signals","predicates",parse.code);pred.root=function(){return model.scene().items[0]};pred.nullScale=nullScale;pred.isFunction=dl.isFunction;pred.signals=parse.signals;pred.data=parse.data;model.predicate(s.name,pred)});return spec}function parseSignal(signal,signals){var s=dl.field(signal),code="signals["+s.map(dl.str).join("][")+"]";signals[s[0]]=1;return code}function parseOperands(model,operands){var decl=[],defs=[],signals={},db={};function setSignal(s){signals[s]=1}function setData(d){db[d]=1}dl.array(operands).forEach(function(o,i){var name="o"+i,def="";if(o.value!==undefined){def=dl.str(o.value)}else if(o.arg){def="args["+dl.str(o.arg)+"]"}else if(o.signal){def=parseSignal(o.signal,signals)}else if(o.predicate){var ref=o.predicate,predName=ref&&(ref.name||ref),pred=model.predicate(predName),p="predicates["+dl.str(predName)+"]";pred.signals.forEach(setSignal);pred.data.forEach(setData);if(dl.isObject(ref)){dl.keys(ref).forEach(function(k){if(k==="name")return;var i=ref[k];def+="args["+dl.str(k)+"] = ";if(i.signal){def+=parseSignal(i.signal,signals)}else if(i.arg){def+="args["+dl.str(i.arg)+"]"}def+=", "})}def+=p+".call("+p+", args, db, signals, predicates)"}decl.push(name);defs.push(name+"=("+def+")")});return{code:"var "+decl.join(", ")+";\n"+defs.join(";\n")+";\n",signals:dl.keys(signals),data:dl.keys(db)}}function parseComparator(model,spec){var ops=parseOperands(model,spec.operands);if(spec.type==="=")spec.type="==";ops.code+="o0 = o0 instanceof Date ? o0.getTime() : o0;\n"+"o1 = o1 instanceof Date ? o1.getTime() : o1;\n";return{code:ops.code+"return "+["o0","o1"].join(spec.type)+";",signals:ops.signals,data:ops.data}}function parseLogical(model,spec){var ops=parseOperands(model,spec.operands),o=[],i=0,len=spec.operands.length;while(o.push("o"+i++)<len);if(spec.type==="and")spec.type="&&";else if(spec.type==="or")spec.type="||";return{code:ops.code+"return "+o.join(spec.type)+";",signals:ops.signals,data:ops.data}}function parseIn(model,spec){var o=[spec.item],code="";if(spec.range)o.push.apply(o,spec.range);if(spec.scale){code=parseScale(spec.scale,o)}var ops=parseOperands(model,o);code=ops.code+code+"\n  var ordSet = null;\n";if(spec.data){var field=dl.field(spec.field).map(dl.str);code+="var where = function(d) { return d["+field.join("][")+"] == o0 };\n";code+="return db["+dl.str(spec.data)+"].filter(where).length > 0;"}else if(spec.range){if(spec.scale){code+="if (scale.length == 2) {\n"+"  ordSet = scale(o1, o2);\n"+"} else {\n"+"  o1 = scale(o1);\no2 = scale(o2);\n"+"}"}code+="return ordSet !== null ? ordSet.indexOf(o0) !== -1 :\n"+"  o1 < o2 ? o1 <= o0 && o0 <= o2 : o2 <= o0 && o0 <= o1;"}return{code:code,signals:ops.signals,data:ops.data.concat(spec.data?[spec.data]:[])}}function parseScale(spec,ops){var code="var scale = ",idx=ops.length;if(dl.isString(spec)){ops.push({value:spec});code+="this.root().scale(o"+idx+")"}else if(spec.arg){ops.push(spec);code+="o"+idx}else if(spec.name){ops.push(dl.isString(spec.name)?{value:spec.name}:spec.name);code+="(this.isFunction(o"+idx+") ? o"+idx+" : ";if(spec.scope){ops.push(spec.scope);code+="((o"+(idx+1)+".scale || this.root().scale)(o"+idx+") || this.nullScale)"}else{code+="this.root().scale(o"+idx+")"
}code+=")"}if(spec.invert===true){code+=".invert"}return code+";\n"}module.exports=parsePredicates},{datalib:24}],102:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),log=require("vega-logging"),Tuple=require("vega-dataflow").Tuple;var DEPS=["signals","scales","data","fields"];function properties(model,mark,spec){var config=model.config(),code="",names=dl.keys(spec),i,len,name,ref,vars={},deps={signals:{},scales:{},data:{},fields:{},nested:[],_nRefs:{},reflow:false};code+="var o = trans ? {} : item, d=0, set=this.tpl.set, tmpl=signals||{}, t;\n"+"tmpl.datum  = item.datum;\n"+"tmpl.group  = group;\n"+"tmpl.parent = group.datum;\n";function handleDep(p){if(ref[p]==null)return;var k=dl.array(ref[p]),i,n;for(i=0,n=k.length;i<n;++i){deps[p][k[i]]=1}}function handleNestedRefs(r){var k=(r.parent?"parent_":"group_")+r.level;deps._nRefs[k]=r}for(i=0,len=names.length;i<len;++i){ref=spec[name=names[i]];code+=i>0?"\n  ":"  ";if(ref.rule){ref=rule(model,name,ref.rule);code+="\n  "+ref.code}else{ref=valueRef(config,name,ref);code+="d += set(o, "+dl.str(name)+", "+ref.val+");"}vars[name]=true;DEPS.forEach(handleDep);deps.reflow=deps.reflow||ref.reflow;if(ref.nested.length)ref.nested.forEach(handleNestedRefs)}dl.keys(deps._nRefs).forEach(function(k){deps.nested.push(deps._nRefs[k])});deps.nested.sort(function(a,b){a=a.level;b=b.level;return a<b?-1:a>b?1:a>=b?0:NaN});if(vars.x2){if(vars.x){code+="\n  if (o.x > o.x2) { "+"\n    t = o.x;"+"\n    d += set(o, 'x', o.x2);"+"\n    d += set(o, 'x2', t); "+"\n  };";code+="\n  d += set(o, 'width', (o.x2 - o.x));"}else if(vars.width){code+="\n  d += set(o, 'x', (o.x2 - o.width));"}else{code+="\n  d += set(o, 'x', o.x2);"}}if(vars.xc){if(vars.width){code+="\n  d += set(o, 'x', (o.xc - o.width/2));"}else{code+="\n  d += set(o, 'x', o.xc);"}}if(vars.y2){if(vars.y){code+="\n  if (o.y > o.y2) { "+"\n    t = o.y;"+"\n    d += set(o, 'y', o.y2);"+"\n    d += set(o, 'y2', t);"+"\n  };";code+="\n  d += set(o, 'height', (o.y2 - o.y));"}else if(vars.height){code+="\n  d += set(o, 'y', (o.y2 - o.height));"}else{code+="\n  d += set(o, 'y', o.y2);"}}if(vars.yc){if(vars.height){code+="\n  d += set(o, 'y', (o.yc - o.height/2));"}else{code+="\n  d += set(o, 'y', o.yc);"}}if(hasPath(mark,vars))code+="\n  d += (item.touch(), 1);";code+="\n  if (trans) trans.interpolate(item, o);";code+="\n  return d > 0;";try{var encoder=Function("item","group","trans","db","signals","predicates",code);encoder.tpl=Tuple;encoder.util=dl;encoder.d3=d3;dl.extend(encoder,dl.template.context);return{encode:encoder,signals:dl.keys(deps.signals),scales:dl.keys(deps.scales),data:dl.keys(deps.data),fields:dl.keys(deps.fields),nested:deps.nested,reflow:deps.reflow}}catch(e){log.error(e);log.log(code)}}function dependencies(a,b){if(!dl.isObject(a)){a={reflow:false,nested:[]};DEPS.forEach(function(d){a[d]=[]})}if(dl.isObject(b)){a.reflow=a.reflow||b.reflow;a.nested.push.apply(a.nested,b.nested);DEPS.forEach(function(d){a[d].push.apply(a[d],b[d])})}return a}function hasPath(mark,vars){return vars.path||(mark==="area"||mark==="line")&&(vars.x||vars.x2||vars.width||vars.y||vars.y2||vars.height||vars.tension||vars.interpolate)}function rule(model,name,rules){var config=model.config(),deps=dependencies(),inputs=[],code="";(rules||[]).forEach(function(r,i){var def=r.predicate,predName=def&&(def.name||def),pred=model.predicate(predName),p="predicates["+dl.str(predName)+"]",input=[],args=name+"_arg"+i,ref;if(dl.isObject(def)){dl.keys(def).forEach(function(k){if(k==="name")return;var ref=valueRef(config,i,def[k]);input.push(dl.str(k)+": "+ref.val);dependencies(deps,ref)})}ref=valueRef(config,name,r);dependencies(deps,ref);if(predName){deps.signals.push.apply(deps.signals,pred.signals);deps.data.push.apply(deps.data,pred.data);inputs.push(args+" = {\n    "+input.join(",\n    ")+"\n  }");code+="if ("+p+".call("+p+","+args+", db, signals, predicates)) {"+"\n    d += set(o, "+dl.str(name)+", "+ref.val+");";code+=rules[i+1]?"\n  } else ":"  }"}else{code+="{"+"\n    d += set(o, "+dl.str(name)+", "+ref.val+");"+"\n  }\n"}});code="var "+inputs.join(",\n      ")+";\n  "+code;return deps.code=code,deps}function valueRef(config,name,ref){if(ref==null)return null;if(name==="fill"||name==="stroke"){if(ref.c){return colorRef(config,"hcl",ref.h,ref.c,ref.l)}else if(ref.h||ref.s){return colorRef(config,"hsl",ref.h,ref.s,ref.l)}else if(ref.l||ref.a){return colorRef(config,"lab",ref.l,ref.a,ref.b)}else if(ref.r||ref.g||ref.b){return colorRef(config,"rgb",ref.r,ref.g,ref.b)}}var val=null,scale=null,deps=dependencies(),sgRef=null,fRef=null,sRef=null,tmpl={};if(ref.template!==undefined){val=dl.template.source(ref.template,"tmpl",tmpl);dl.keys(tmpl).forEach(function(k){var f=dl.field(k),a=f.shift();if(a==="parent"||a==="group"){deps.nested.push({parent:a==="parent",group:a==="group",level:1})}else if(a==="datum"){deps.fields.push(f[0])}else{deps.signals.push(a)}})}if(ref.value!==undefined){val=dl.str(ref.value)}if(ref.signal!==undefined){sgRef=dl.field(ref.signal);val="signals["+sgRef.map(dl.str).join("][")+"]";deps.signals.push(sgRef.shift())}if(ref.field!==undefined){ref.field=dl.isString(ref.field)?{datum:ref.field}:ref.field;fRef=fieldRef(ref.field);val=fRef.val;dependencies(deps,fRef)}if(ref.scale!==undefined){sRef=scaleRef(ref.scale);scale=sRef.val;dependencies(deps,sRef);deps.scales.push(ref.scale.name||ref.scale);if(val!==null||ref.band||ref.mult||ref.offset){val=scale+(ref.band?".rangeBand()":"("+(val!==null?val:"item.datum.data")+")")}else{val=scale}}val="("+(ref.mult?dl.number(ref.mult)+" * ":"")+val+")"+(ref.offset?" + "+dl.number(ref.offset):"");return deps.val=val,deps}function colorRef(config,type,x,y,z){var xx=x?valueRef(config,"",x):config.color[type][0],yy=y?valueRef(config,"",y):config.color[type][1],zz=z?valueRef(config,"",z):config.color[type][2],deps=dependencies();[xx,yy,zz].forEach(function(v){if(dl.isArray)return;dependencies(deps,v)});var val="(this.d3."+type+"("+[xx.val,yy.val,zz.val].join(",")+') + "")';return deps.val=val,deps}function fieldRef(ref){if(dl.isString(ref)){return{val:dl.field(ref).map(dl.str).join("][")}}var l=ref.level||1,nested=(ref.group||ref.parent)&&l,scope=nested?Array(l).join("group.mark."):"",r=fieldRef(ref.datum||ref.group||ref.parent||ref.signal),val=r.val,deps=dependencies(null,r);if(ref.datum){val="item.datum["+val+"]";deps.fields.push(ref.datum)}else if(ref.group){val=scope+"group["+val+"]";deps.nested.push({level:l,group:true})}else if(ref.parent){val=scope+"group.datum["+val+"]";deps.nested.push({level:l,parent:true})}else if(ref.signal){val="signals["+val+"]";deps.signals.push(dl.field(ref.signal)[0]);deps.reflow=true}return deps.val=val,deps}function scaleRef(ref){var scale=null,fr=null,deps=dependencies();if(dl.isString(ref)){scale=dl.str(ref)}else if(ref.name){scale=dl.isString(ref.name)?dl.str(ref.name):(fr=fieldRef(ref.name)).val}else{scale=(fr=fieldRef(ref)).val}scale="(item.mark._scaleRefs["+scale+"] = 1, group.scale("+scale+"))";if(ref.invert)scale+=".invert";if(fr)fr.nested.forEach(function(g){g.scale=true});return fr?(fr.val=scale,fr):(deps.val=scale,deps)}module.exports=properties}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{datalib:24,"vega-dataflow":39,"vega-logging":45}],103:[function(require,module,exports){var dl=require("datalib"),SIGNALS=require("vega-dataflow").Dependencies.SIGNALS,expr=require("./expr");var RESERVED=["datum","event","signals"].concat(dl.keys(expr.codegen.functions));function parseSignals(model,spec){(spec||[]).forEach(function(s){if(RESERVED.indexOf(s.name)!==-1){throw Error('Signal name "'+s.name+'" is a '+"reserved keyword ("+RESERVED.join(", ")+").")}var signal=model.signal(s.name,s.init).verbose(s.verbose);if(s.init&&s.init.expr){s.init.expr=expr(s.init.expr);signal.value(exprVal(model,s.init))}if(s.expr){s.expr=expr(s.expr);signal.evaluate=function(input){var val=exprVal(model,s);if(val!==signal.value()||signal.verbose()){signal.value(val);input.signals[s.name]=1;return input}return model.doNotPropagate};signal.dependency(SIGNALS,s.expr.globals);s.expr.globals.forEach(function(dep){model.signal(dep).addListener(signal)})}});return spec}function exprVal(model,spec){var e=spec.expr,val=e.fn(null,null,model.values(SIGNALS,e.globals));return spec.scale?parseSignals.scale(model,spec,val):val}parseSignals.scale=function scale(model,spec,value,datum,evt){var def=spec.scale,name=def.name||def.signal||def,scope=def.scope,e;if(scope){if(scope.signal){scope=model.signalRef(scope.signal)}else if(dl.isString(scope)){e=def._expr=def._expr||expr(scope);scope=e.fn(datum,evt,model.values(SIGNALS,e.globals))}}if(!scope||!scope.scale){scope=scope&&scope.mark?scope.mark.group:model.scene().items[0]}var s=scope.scale(name);return!s?value:def.invert?s.invert(value):s(value)};module.exports=parseSignals},{"./expr":94,datalib:24,"vega-dataflow":39}],104:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),Model=require("../core/Model"),View=require("../core/View");function parseSpec(spec,callback){var vf=arguments[arguments.length-1],viewFactory=arguments.length>2&&dl.isFunction(vf)?vf:View.factory,config=arguments[2]!==viewFactory?arguments[2]:{},model=new Model(config);function parse(spec){spec=dl.duplicate(spec);var parsers=require("./"),width=spec.width||500,height=spec.height||500,viewport=spec.viewport||null;model.defs({width:width,height:height,viewport:viewport,background:parsers.background(spec.background),padding:parsers.padding(spec.padding),signals:parsers.signals(model,spec.signals),predicates:parsers.predicates(model,spec.predicates),marks:parsers.marks(model,spec,width,height),data:parsers.data(model,spec.data,function(){callback(viewFactory(model))})})}if(dl.isObject(spec)){parse(spec)}else if(dl.isString(spec)){var opts=dl.extend({url:spec},model.config().load);dl.load(opts,function(err,data){if(err){log.error("LOADING SPECIFICATION FAILED: "+err.statusText)}else{try{parse(JSON.parse(data))}catch(e){log.error("INVALID SPECIFICATION: Must be a valid JSON object. "+e)}}})}else{log.error("INVALID SPECIFICATION: Must be a valid JSON object or URL.")}}module.exports=parseSpec},{"../core/Model":86,"../core/View":87,"./":95,datalib:24,"vega-logging":45}],105:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),df=require("vega-dataflow"),SIGNALS=df.Dependencies.SIGNALS,parseSignals=require("./signals"),selector=require("./events"),expr=require("./expr");var GATEKEEPER="_vgGATEKEEPER";var vgEvent={getGroup:function(name){return name?this.name[name]:this.group},getXY:function(item){var p={x:this.x,y:this.y};if(typeof item==="string"){item=this.name[item]}for(;item;item=item.mark&&item.mark.group){p.x-=item.x||0;p.y-=item.y||0}return p},getX:function(item){return this.getXY(item).x},getY:function(item){return this.getXY(item).y}};function parseStreams(view){var model=view.model(),spec=model.defs().signals,registry={handlers:{},nodes:{}},internal=dl.duplicate(registry),external=dl.duplicate(registry);(spec||[]).forEach(function(sig){var signal=model.signal(sig.name);if(sig.expr)return;(sig.streams||[]).forEach(function(stream){var sel=selector.parse(stream.type),exp=expr(stream.expr);mergedStream(signal,sel,exp,stream)})});dl.keys(internal.handlers).forEach(function(type){view.on(type,function(evt,item){evt.preventDefault();extendEvent(evt,item);fire(internal,type,item&&item.datum||{},evt)})});dl.keys(external.handlers).forEach(function(type){if(typeof window==="undefined")return;var h=external.handlers[type],t=type.split(":"),elt=t[0]==="window"?[window]:window.document.querySelectorAll(t[0]);function handler(evt){extendEvent(evt);fire(external,type,d3.select(this).datum(),evt)}for(var i=0;i<elt.length;++i){elt[i].addEventListener(t[1],handler)}h.elements=elt;h.listener=handler});external.detach=function(){dl.keys(external.handlers).forEach(function(type){var h=external.handlers[type],t=type.split(":"),elt=h.elements||[];for(var i=0;i<elt.length;++i){elt[i].removeEventListener(t[1],h.listener)}})};return external.detach;function extendEvent(evt,item){var mouse=d3.mouse((d3.event=evt,view.renderer().scene())),pad=view.padding(),names={},mark,group,i;if(item){mark=item.mark;group=mark.marktype==="group"?item:mark.group;for(i=item;i!=null;i=i.mark.group){if(i.mark.def.name){names[i.mark.def.name]=i}}}names.root=view.model().scene().items[0];evt.vg=Object.create(vgEvent);evt.vg.group=group;evt.vg.item=item||{};evt.vg.name=names;evt.vg.x=mouse[0]-pad.left;evt.vg.y=mouse[1]-pad.top}function fire(registry,type,datum,evt){var handlers=registry.handlers[type],node=registry.nodes[type],cs=df.ChangeSet.create(null,true),filtered=false,val,i,n,h;function invoke(f){return!f.fn(datum,evt,model.values(SIGNALS,f.globals))}for(i=0,n=handlers.length;i<n;++i){h=handlers[i];filtered=h.filters.some(invoke);if(filtered)continue;val=h.exp.fn(datum,evt,model.values(SIGNALS,h.exp.globals));if(h.spec.scale){val=parseSignals.scale(model,h.spec,val,datum,evt)}if(val!==h.signal.value()||h.signal.verbose()){h.signal.value(val);cs.signals[h.signal.name()]=1}}model.propagate(cs,node)}function mergedStream(sig,selector,exp,spec){selector.forEach(function(s){if(s.event)domEvent(sig,s,exp,spec);else if(s.signal)signal(sig,s,exp,spec);else if(s.start)orderedStream(sig,s,exp,spec);else if(s.stream)mergedStream(sig,s.stream,exp,spec)})}function domEvent(sig,selector,exp,spec){var evt=selector.event,name=selector.name,mark=selector.mark,target=selector.target,filters=selector.filters||[],registry=target?external:internal,type=target?target+":"+evt:evt,node=registry.nodes[type]||(registry.nodes[type]=new df.Node(model)),handlers=registry.handlers[type]||(registry.handlers[type]=[]);if(name){filters.push('!!event.vg.name["'+name+'"]')}else if(mark){filters.push("event.vg.item.mark && event.vg.item.mark.marktype==="+dl.str(mark))}handlers.push({signal:sig,exp:exp,spec:spec,filters:filters.map(function(f){return expr(f)})});node.addListener(sig)}function signal(sig,selector,exp,spec){var n=new df.Node(model);n.evaluate=function(input){if(!input.signals[selector.signal])return model.doNotPropagate;var val=exp.fn(null,null,model.values(SIGNALS,exp.globals));if(spec.scale){val=parseSignals.scale(model,spec,val)}if(val!==sig.value()||sig.verbose()){sig.value(val);input.signals[sig.name()]=1;input.reflow=true}return input};n.dependency(df.Dependencies.SIGNALS,selector.signal);n.addListener(sig);model.signal(selector.signal).addListener(n)}function orderedStream(sig,selector,exp,spec){var name=sig.name(),gk=name+GATEKEEPER,trueFn=expr("true"),falseFn=expr("false"),middle=selector.middle,filters=middle.filters||(middle.filters=[]),gatekeeper=model.signal(gk)||model.signal(gk,false);mergedStream(gatekeeper,[selector.start],trueFn,{});mergedStream(gatekeeper,[selector.end],falseFn,{});filters.push(gatekeeper.name());mergedStream(sig,[selector.middle],exp,spec)}}module.exports=parseStreams}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./events":93,"./expr":94,"./signals":103,datalib:24,"vega-dataflow":39}],106:[function(require,module,exports){var dl=require("datalib"),transforms=require("../transforms/index");function parseTransforms(model,def){var tx=new transforms[def.type](model);if(def.output)tx.output(def.output);dl.keys(def).forEach(function(k){if(k==="type"||k==="output")return;tx.param(k,def[k])});return tx}module.exports=parseTransforms},{"../transforms/index":139,datalib:24}],107:[function(require,module,exports){var dl=require("datalib"),df=require("vega-dataflow"),Node=df.Node,log=require("vega-logging"),bound=require("vega-scenegraph").bound,Encoder=require("./Encoder");function Bounder(graph,mark){this._mark=mark;return Node.prototype.init.call(this,graph).router(true).reflows(true).mutates(true)}var proto=Bounder.prototype=new Node;proto.evaluate=function(input){log.debug(input,["bounds",this._mark.marktype]);var type=this._mark.marktype,isGrp=type==="group",items=this._mark.items,hasLegends=dl.array(this._mark.def.legends).length>0,i,ilen,j,jlen,group,legend;if(input.add.length||input.rem.length||!items.length||input.mod.length===items.length||type==="area"||type==="line"){bound.mark(this._mark,null,isGrp&&!hasLegends)}else{input.mod.forEach(function(item){bound.item(item)})}if(isGrp&&hasLegends){for(i=0,ilen=items.length;i<ilen;++i){group=items[i];group._legendPositions=null;for(j=0,jlen=group.legendItems.length;j<jlen;++j){legend=group.legendItems[j];Encoder.update(this._graph,input.trans,"vg_legendPosition",legend.items,input.dirty);bound.mark(legend,null,false)}}bound.mark(this._mark,null,true)}return df.ChangeSet.create(input,true)};module.exports=Bounder},{"./Encoder":109,datalib:24,"vega-dataflow":39,"vega-logging":45,"vega-scenegraph":46}],108:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),Item=require("vega-scenegraph").Item,df=require("vega-dataflow"),Node=df.Node,Deps=df.Dependencies,Tuple=df.Tuple,ChangeSet=df.ChangeSet,Sentinel={},Encoder=require("./Encoder"),Bounder=require("./Bounder"),parseData=require("../parse/data");function Builder(){return arguments.length?this.init.apply(this,arguments):this}var Status=Builder.STATUS={ENTER:"enter",UPDATE:"update",EXIT:"exit"};var CONNECTED=1,DISCONNECTED=2;var proto=Builder.prototype=new Node;proto.init=function(graph,def,mark,parent,parent_id,inheritFrom){Node.prototype.init.call(this,graph).router(true).collector(true);this._def=def;this._mark=mark;this._from=(def.from?def.from.data:null)||inheritFrom;this._ds=dl.isString(this._from)?graph.data(this._from):null;this._map={};this._status=null;mark.def=def;mark.marktype=def.type;mark.interactive=def.interactive!==false;mark.items=[];if(dl.isValid(def.name))mark.name=def.name;this._parent=parent;this._parent_id=parent_id;if(def.from&&(def.from.mark||def.from.transform||def.from.modify)){inlineDs.call(this)}this._isSuper=this._def.type!=="group";this._encoder=new Encoder(this._graph,this._mark,this);this._bounder=new Bounder(this._graph,this._mark);this._output=null;if(this._ds){this._encoder.dependency(Deps.DATA,this._from)}this.dependency(Deps.DATA,this._encoder.dependency(Deps.DATA));this.dependency(Deps.SCALES,this._encoder.dependency(Deps.SCALES));this.dependency(Deps.SIGNALS,this._encoder.dependency(Deps.SIGNALS));return this};function inlineDs(){var from=this._def.from,geom=from.mark,src,name,spec,sibling,output,input;if(geom){name=["vg",this._parent_id,geom].join("_");spec={name:name,transform:from.transform,modify:from.modify}}else{src=this._graph.data(this._from);name=["vg",this._from,this._def.type,src.listeners(true).length].join("_");spec={name:name,source:this._from,transform:from.transform,modify:from.modify}}this._from=name;this._ds=parseData.datasource(this._graph,spec);var node;if(geom){sibling=this.sibling(geom);node=new Node(this._graph).addListener(this._ds.listener());node.evaluate=function(){return sibling._output};if(sibling._isSuper){sibling.addListener(node)}else{sibling._bounder.addListener(node)}}else{output=this._ds.source().last();input=ChangeSet.create(output);input.add=output.add;input.mod=output.mod;input.rem=output.rem;input.stamp=null;this._graph.propagate(input,this._ds.listener(),output.stamp)}}proto.ds=function(){return this._ds};proto.parent=function(){return this._parent};proto.encoder=function(){return this._encoder};proto.pipeline=function(){return[this]};proto.connect=function(){var builder=this;this._graph.connect(this.pipeline());this._encoder._scales.forEach(function(s){if(!(s=builder._parent.scale(s)))return;s.addListener(builder)});if(this._parent){if(this._isSuper)this.addListener(this._parent._collector);else this._bounder.addListener(this._parent._collector)}return this._status=CONNECTED,this};proto.disconnect=function(){var builder=this;if(!this._listeners.length)return this;function disconnectScales(scales){for(var i=0,len=scales.length,s;i<len;++i){if(!(s=builder._parent.scale(scales[i])))continue;s.removeListener(builder)}}Node.prototype.disconnect.call(this);this._graph.disconnect(this.pipeline());disconnectScales(this._encoder._scales);disconnectScales(dl.keys(this._mark._scaleRefs));return this._status=DISCONNECTED,this};proto.sibling=function(name){return this._parent.child(name,this._parent_id)};proto.evaluate=function(input){log.debug(input,["building",this._from||this._def.from,this._def.type]);var self=this,def=this._mark.def,props=def.properties||{},update=props.update||{},output,fullUpdate,fcs,data,name;if(this._ds){output=ChangeSet.create(input);data=output.data[name=this._ds.name()];delete output.data[name];fullUpdate=this._encoder.reevaluate(output);output.data[name]=data;if(fullUpdate)output.mod=this._mark.items.slice();fcs=this._ds.last();if(!fcs)throw Error("Builder evaluated before backing DataSource.");if(fcs.stamp>this._stamp){output=join.call(this,fcs,this._ds.values(),true,fullUpdate)}}else{data=dl.isFunction(this._def.from)?this._def.from():[Sentinel];output=join.call(this,input,data)}this._output=output=this._graph.evaluate(output,this._encoder);if(update.nested&&update.nested.length&&this._status===CONNECTED){dl.keys(this._mark._scaleRefs).forEach(function(s){var scale=self._parent.scale(s);if(!scale)return;scale.addListener(self);self.dependency(Deps.SCALES,s);self._encoder.dependency(Deps.SCALES,s)})}if(this._isSuper){output.mod=output.mod.filter(function(x){return x._dirty});output=this._graph.evaluate(output,this._bounder)}return output};function newItem(){var item=Tuple.ingest(new Item(this._mark));if(this._def.width)Tuple.set(item,"width",this._def.width);if(this._def.height)Tuple.set(item,"height",this._def.height);return item}function join(input,data,ds,fullUpdate){var output=ChangeSet.create(input),keyf=keyFunction(this._def.key||(ds?"_id":null)),prev=this._mark.items||[],rem=ds?input.rem:prev,mod=Tuple.idMap(!ds||fullUpdate?data:input.mod),next=[],i,key,len,item,datum,enter,diff;for(i=0,len=rem.length;i<len;++i){item=rem[i]===prev[i]?prev[i]:keyf?this._map[keyf(rem[i])]:rem[i];item.status=Status.EXIT}for(i=0,len=data.length;i<len;++i){datum=data[i];item=keyf?this._map[key=keyf(datum)]:prev[i];enter=item?false:(item=newItem.call(this),true);item.status=enter?Status.ENTER:Status.UPDATE;diff=!enter&&item.datum!==datum;item.datum=datum;if(keyf){Tuple.set(item,"key",key);this._map[key]=item}if(enter){output.add.push(item)}else if(diff||mod[datum._id]){output.mod.push(item)}next.push(item)}for(i=0,len=rem.length;i<len;++i){item=rem[i]===prev[i]?prev[i]:keyf?this._map[key=keyf(rem[i])]:rem[i];if(item.status===Status.EXIT){item._dirty=true;input.dirty.push(item);next.push(item);output.rem.push(item);if(keyf)this._map[key]=null}}return this._mark.items=next,output}function keyFunction(key){if(key==null)return null;var f=dl.array(key).map(dl.accessor);return function(d){for(var s="",i=0,n=f.length;i<n;++i){if(i>0)s+="|";s+=String(f[i](d))}return s}}module.exports=Builder},{"../parse/data":92,"./Bounder":107,"./Encoder":109,datalib:24,"vega-dataflow":39,"vega-logging":45,"vega-scenegraph":46}],109:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),df=require("vega-dataflow"),Node=df.Node,Deps=df.Dependencies,bound=require("vega-scenegraph").bound;var EMPTY={};function Encoder(graph,mark,builder){var props=mark.def.properties||{},enter=props.enter,update=props.update,exit=props.exit;Node.prototype.init.call(this,graph);this._mark=mark;this._builder=builder;var s=this._scales=[];if(enter)s.push.apply(s,enter.scales);if(update){this.dependency(Deps.DATA,update.data);this.dependency(Deps.SIGNALS,update.signals);this.dependency(Deps.FIELDS,update.fields);this.dependency(Deps.SCALES,update.scales);s.push.apply(s,update.scales)}if(exit)s.push.apply(s,exit.scales);return this.mutates(true)}var proto=Encoder.prototype=new Node;proto.evaluate=function(input){log.debug(input,["encoding",this._mark.def.type]);var graph=this._graph,props=this._mark.def.properties||{},items=this._mark.items,enter=props.enter,update=props.update,exit=props.exit,dirty=input.dirty,preds=graph.predicates(),req=input.request,group=this._mark.group,guide=group&&(group.mark.axis||group.mark.legend),db=EMPTY,sg=EMPTY,i,len,item,prop;if(req&&!guide){if((prop=props[req])&&input.mod.length){db=prop.data?graph.values(Deps.DATA,prop.data):null;sg=prop.signals?graph.values(Deps.SIGNALS,prop.signals):null;for(i=0,len=input.mod.length;i<len;++i){item=input.mod[i];encode.call(this,prop,item,input.trans,db,sg,preds,dirty)}}return input}db=values(Deps.DATA,graph,input,props);sg=values(Deps.SIGNALS,graph,input,props);for(i=0,len=input.rem.length;i<len;++i){item=input.rem[i];if(exit)encode.call(this,exit,item,input.trans,db,sg,preds,dirty);if(input.trans&&!exit)input.trans.interpolate(item,EMPTY);else if(!input.trans)items.pop()}var update_status=require("./Builder").STATUS.UPDATE;for(i=0,len=input.add.length;i<len;++i){item=input.add[i];if(enter)encode.call(this,enter,item,input.trans,db,sg,preds,dirty);if(update)encode.call(this,update,item,input.trans,db,sg,preds,dirty);item.status=update_status}if(update){for(i=0,len=input.mod.length;i<len;++i){item=input.mod[i];encode.call(this,update,item,input.trans,db,sg,preds,dirty)}}return input};function values(type,graph,input,props){var p,x,o,add=input.add.length;if((p=props.enter)&&(x=p[type]).length&&add){o=graph.values(type,x,o=o||{})}if((p=props.exit)&&(x=p[type]).length&&input.rem.length){o=graph.values(type,x,o=o||{})}if((p=props.update)&&(x=p[type]).length&&(add||input.mod.length)){o=graph.values(type,x,o=o||{})}return o||EMPTY}function encode(prop,item,trans,db,sg,preds,dirty){var enc=prop.encode,wasDirty=item._dirty,isDirty=enc.call(enc,item,item.mark.group||item,trans,db,sg,preds);item._dirty=isDirty||wasDirty;if(isDirty&&!wasDirty)dirty.push(item)}proto.reevaluate=function(pulse){var def=this._mark.def,props=def.properties||{},reeval=dl.isFunction(def.from)||def.orient||pulse.request||Node.prototype.reevaluate.call(this,pulse);return reeval||(props.update?nestedRefs.call(this):false)};function nestedRefs(){var refs=this._mark.def.properties.update.nested,parent=this._builder,level=0,i=0,len=refs.length,ref,ds,stamp;for(;i<len;++i){ref=refs[i];if(ref.scale)continue;for(;level<ref.level;++level){parent=parent.parent();ds=parent.ds()}stamp=(ref.group?parent.encoder():ds.last())._stamp;if(stamp>this._stamp)return true}return false}Encoder.update=function(graph,trans,request,items,dirty){items=dl.array(items);var preds=graph.predicates(),db=graph.values(Deps.DATA),sg=graph.values(Deps.SIGNALS),i,len,item,props,prop;for(i=0,len=items.length;i<len;++i){item=items[i];props=item.mark.def.properties;prop=props&&props[request];if(prop){encode.call(null,prop,item,trans,db,sg,preds,dirty);bound.item(item)}}};module.exports=Encoder},{"./Builder":108,datalib:24,"vega-dataflow":39,"vega-logging":45,"vega-scenegraph":46}],110:[function(require,module,exports){var dl=require("datalib"),df=require("vega-dataflow"),Node=df.Node,Deps=df.Dependencies,Collector=df.Collector,log=require("vega-logging"),Builder=require("./Builder"),Scale=require("./Scale"),parseAxes=require("../parse/axes"),parseLegends=require("../parse/legends");function GroupBuilder(){this._children={};this._scaler=null;this._recursor=null;this._scales={};this.scale=scale.bind(this);return arguments.length?this.init.apply(this,arguments):this}var Types=GroupBuilder.TYPES={GROUP:"group",MARK:"mark",AXIS:"axis",LEGEND:"legend"};var proto=GroupBuilder.prototype=new Builder;proto.init=function(graph,def){var builder=this,name;this._scaler=new Node(graph);(def.scales||[]).forEach(function(s){s=builder.scale(name=s.name,new Scale(graph,s,builder));builder.scale(name+":prev",s);builder._scaler.addListener(s)});this._recursor=new Node(graph);this._recursor.evaluate=recurse.bind(this);var scales=(def.axes||[]).reduce(function(acc,x){return acc[x.scale]=1,acc},{});scales=(def.legends||[]).reduce(function(acc,x){return acc[x.size||x.shape||x.fill||x.stroke],acc},scales);this._recursor.dependency(Deps.SCALES,dl.keys(scales));this._collector=new Collector(graph);return Builder.prototype.init.apply(this,arguments)};proto.evaluate=function(){var output=Builder.prototype.evaluate.apply(this,arguments),builder=this;output.add.forEach(function(group){buildGroup.call(builder,output,group)});return output};proto.pipeline=function(){return[this,this._scaler,this._recursor,this._collector,this._bounder]};proto.disconnect=function(){var builder=this;dl.keys(builder._children).forEach(function(group_id){builder._children[group_id].forEach(function(c){builder._recursor.removeListener(c.builder);c.builder.disconnect()})});builder._children={};return Builder.prototype.disconnect.call(this)};proto.child=function(name,group_id){var children=this._children[group_id],i=0,len=children.length,child;for(;i<len;++i){child=children[i];if(child.type==Types.MARK&&child.builder._def.name==name)break}return child.builder};function recurse(input){var builder=this,hasMarks=dl.array(this._def.marks).length>0,hasAxes=dl.array(this._def.axes).length>0,hasLegends=dl.array(this._def.legends).length>0,i,j,c,len,group,pipeline,def,inline=false;for(i=0,len=input.add.length;i<len;++i){group=input.add[i];if(hasMarks)buildMarks.call(this,input,group);if(hasAxes)buildAxes.call(this,input,group);if(hasLegends)buildLegends.call(this,input,group)}for(i=input.add.length-1;i>=0;--i){group=input.add[i];for(j=this._children[group._id].length-1;j>=0;--j){c=this._children[group._id][j];c.builder.connect();pipeline=c.builder.pipeline();def=c.builder._def;inline=def.type!==Types.GROUP;inline=inline&&this._graph.data(c.from)!==undefined;inline=inline&&pipeline[pipeline.length-1].listeners().length===1;inline=inline&&(def.from&&!def.from.mark);c.inline=inline;if(inline)this._graph.evaluate(input,c.builder);else this._recursor.addListener(c.builder)}}function removeTemp(c){if(c.type==Types.MARK&&!c.inline&&builder._graph.data(c.from)!==undefined){builder._recursor.removeListener(c.builder)}}function updateAxis(a){var scale=a.scale();if(!input.scales[scale.scaleName])return;a.reset().def()}function updateLegend(l){var scale=l.size()||l.shape()||l.fill()||l.stroke();if(!input.scales[scale.scaleName])return;l.reset().def()}for(i=0,len=input.mod.length;i<len;++i){group=input.mod[i];if(hasMarks)builder._children[group._id].forEach(removeTemp);if(hasAxes)group.axes.forEach(updateAxis);if(hasLegends)group.legends.forEach(updateLegend)}function disconnectChildren(c){builder._recursor.removeListener(c.builder);c.builder.disconnect()}for(i=0,len=input.rem.length;i<len;++i){group=input.rem[i];builder._children[group._id].forEach(disconnectChildren);delete builder._children[group._id]}return input}function scale(name,x){var group=this,s=null;if(arguments.length===2)return group._scales[name]=x,x;while(s==null){s=group._scales[name];group=group.mark?group.mark.group:group._parent;if(!group)break}return s}function buildGroup(input,group){log.debug(input,["building group",group._id]);group._scales=group._scales||{};group.scale=scale.bind(group);group.items=group.items||[];this._children[group._id]=this._children[group._id]||[];group.axes=group.axes||[];group.axisItems=group.axisItems||[];group.legends=group.legends||[];group.legendItems=group.legendItems||[]}function buildMarks(input,group){log.debug(input,["building children marks #"+group._id]);var marks=this._def.marks,mark,from,inherit,i,len,b;for(i=0,len=marks.length;i<len;++i){mark=marks[i];from=mark.from||{};inherit=group.datum._facetID;group.items[i]={group:group,_scaleRefs:{}};b=mark.type===Types.GROUP?new GroupBuilder:new Builder;b.init(this._graph,mark,group.items[i],this,group._id,inherit);
this._children[group._id].push({builder:b,from:from.data||(from.mark?"vg_"+group._id+"_"+from.mark:inherit),type:Types.MARK})}}function buildAxes(input,group){var axes=group.axes,axisItems=group.axisItems,builder=this;parseAxes(this._graph,this._def.axes,axes,group);axes.forEach(function(a,i){var scale=builder._def.axes[i].scale,def=a.def(),b=null;axisItems[i]={group:group,axis:true,layer:def.layer};b=def.type===Types.GROUP?new GroupBuilder:new Builder;b.init(builder._graph,def,axisItems[i],builder).dependency(Deps.SCALES,scale);builder._children[group._id].push({builder:b,type:Types.AXIS,scale:scale})})}function buildLegends(input,group){var legends=group.legends,legendItems=group.legendItems,builder=this;parseLegends(this._graph,this._def.legends,legends,group);legends.forEach(function(l,i){var scale=l.size()||l.shape()||l.fill()||l.stroke(),def=l.def(),b=null;legendItems[i]={group:group,legend:true};b=def.type===Types.GROUP?new GroupBuilder:new Builder;b.init(builder._graph,def,legendItems[i],builder).dependency(Deps.SCALES,scale);builder._children[group._id].push({builder:b,type:Types.LEGEND,scale:scale})})}module.exports=GroupBuilder},{"../parse/axes":90,"../parse/legends":96,"./Builder":108,"./Scale":111,datalib:24,"vega-dataflow":39,"vega-logging":45}],111:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),df=require("vega-dataflow"),log=require("vega-logging"),Node=df.Node,Deps=df.Dependencies,Aggregate=require("../transforms/Aggregate");var Properties={width:1,height:1};var Types={LINEAR:"linear",ORDINAL:"ordinal",LOG:"log",POWER:"pow",SQRT:"sqrt",TIME:"time",TIME_UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold"};var DataRef={DOMAIN:"domain",RANGE:"range",COUNT:"count",GROUPBY:"groupby",MIN:"min",MAX:"max",VALUE:"value",ASC:"asc",DESC:"desc"};function Scale(graph,def,parent){this._def=def;this._parent=parent;this._updated=false;return Node.prototype.init.call(this,graph).reflows(true)}var proto=Scale.prototype=new Node;proto.evaluate=function(input){var self=this,fn=function(group){scale.call(self,group)};this._updated=false;input.add.forEach(fn);input.mod.forEach(fn);if(this._updated){input.scales[this._def.name]=1;log.debug(input,["scale",this._def.name])}return df.ChangeSet.create(input,true)};proto.dependency=function(type,deps){if(arguments.length==2){var method=type===Deps.DATA?"data":"signal";deps=dl.array(deps);for(var i=0,len=deps.length;i<len;++i){this._graph[method](deps[i]).addListener(this._parent)}}return Node.prototype.dependency.call(this,type,deps)};function scale(group){var name=this._def.name,prev=name+":prev",s=instance.call(this,group.scale(name)),m=s.type===Types.ORDINAL?ordinal:quantitative,rng=range.call(this,group);m.call(this,s,rng,group);group.scale(name,s);group.scale(prev,group.scale(prev)||s);return s}function instance(scale){var config=this._graph.config(),type=this._def.type||Types.LINEAR;if(!scale||type!==scale.type){var ctor=config.scale[type]||d3.scale[type];if(!ctor)throw Error("Unrecognized scale type: "+type);(scale=ctor()).type=scale.type||type;scale.scaleName=this._def.name;scale._prev={}}return scale}function ordinal(scale,rng,group){var def=this._def,prev=scale._prev,dataDrivenRange=false,pad=signal.call(this,def.padding)||0,outer=def.outerPadding==null?pad:signal.call(this,def.outerPadding),points=def.points&&signal.call(this,def.points),round=signal.call(this,def.round)||def.round==null,domain,str;if(dl.isObject(def.range)&&!dl.isArray(def.range)){dataDrivenRange=true;rng=dataRef.call(this,DataRef.RANGE,def.range,scale,group)}domain=dataRef.call(this,DataRef.DOMAIN,def.domain,scale,group);if(domain&&!dl.equal(prev.domain,domain)){scale.domain(domain);prev.domain=domain;this._updated=true}if(dl.equal(prev.range,rng))return;if(def.bandWidth){var bw=signal.call(this,def.bandWidth),len=domain.length,space=def.points?pad*bw:pad*bw*(len-1)+2*outer,start;if(rng[0]>rng[1]){start=rng[1]||0;rng=[start+(bw*len+space),start]}else{start=rng[0]||0;rng=[start,start+(bw*len+space)]}}str=typeof rng[0]==="string";if(str||rng.length>2||rng.length===1||dataDrivenRange){scale.range(rng)}else if(points&&round){scale.rangeRoundPoints(rng,pad)}else if(points){scale.rangePoints(rng,pad)}else if(round){scale.rangeRoundBands(rng,pad,outer)}else{scale.rangeBands(rng,pad,outer)}if(!scale.invert){scale.invert=function(x,y){if(arguments.length===1){return scale.domain()[d3.bisect(scale.range(),x)-1]}else if(arguments.length===2){if(!dl.isNumber(x)||!dl.isNumber(y)){throw Error("Extents to ordinal invert are not numbers ("+x+", "+y+").")}var points=[],rng=scale.range(),i=0,len=rng.length,r;for(;i<len;++i){r=rng[i];if(x<y?x<=r&&r<=y:y<=r&&r<=x){points.push(r)}}return points.map(function(p){return scale.invert(p)})}}}prev.range=rng;this._updated=true}function quantitative(scale,rng,group){var def=this._def,prev=scale._prev,round=signal.call(this,def.round),exponent=signal.call(this,def.exponent),clamp=signal.call(this,def.clamp),nice=signal.call(this,def.nice),domain,interval;domain=def.type===Types.QUANTILE?dataRef.call(this,DataRef.DOMAIN,def.domain,scale,group):domainMinMax.call(this,scale,group);if(domain&&!dl.equal(prev.domain,domain)){scale.domain(domain);prev.domain=domain;this._updated=true}if(signal.call(this,def.range)==="height")rng=rng.reverse();if(dl.equal(prev.range,rng))return;scale[round&&scale.rangeRound?"rangeRound":"range"](rng);prev.range=rng;this._updated=true;if(this._stamp>0)return;if(exponent&&def.type===Types.POWER)scale.exponent(exponent);if(clamp)scale.clamp(true);if(nice){if(def.type===Types.TIME){interval=d3.time[nice];if(!interval)log.error("Unrecognized interval: "+interval);scale.nice(interval)}else{scale.nice()}}}function isUniques(scale){return scale.type===Types.ORDINAL||scale.type===Types.QUANTILE}function getRefs(def){return def.fields||dl.array(def)}function inherits(refs){return refs.some(function(r){if(!r.data)return true;return r.data&&dl.array(r.field).some(function(f){return f.parent})})}function getFields(ref,group){return dl.array(ref.field).map(function(f){return f.parent?dl.accessor(f.parent)(group.datum):f})}function aggrType(def,scale){var refs=getRefs(def);if(refs.length==1&&dl.array(refs[0].field).length==1){return Aggregate.TYPES.TUPLE}if(!isUniques(scale))return Aggregate.TYPES.VALUE;if(!dl.isObject(def.sort))return Aggregate.TYPES.VALUE;return Aggregate.TYPES.MULTI}function getCache(which,def,scale,group){var refs=getRefs(def),inherit=inherits(refs),atype=aggrType(def,scale),uniques=isUniques(scale),sort=def.sort,ck="_"+which,fields=getFields(refs[0],group);if(scale[ck]||this[ck])return scale[ck]||this[ck];var cache=new Aggregate(this._graph).type(atype),groupby,summarize;if(inherit){scale[ck]=cache}else{this[ck]=cache}if(uniques){if(atype===Aggregate.TYPES.VALUE){groupby=[{name:DataRef.GROUPBY,get:dl.identity}];summarize={"*":DataRef.COUNT}}else if(atype===Aggregate.TYPES.TUPLE){groupby=[{name:DataRef.GROUPBY,get:dl.$(fields[0])}];summarize=dl.isObject(sort)?[{field:DataRef.VALUE,get:dl.$(sort.field),ops:[sort.op]}]:{"*":DataRef.COUNT}}else{groupby=DataRef.GROUPBY;summarize=[{field:DataRef.VALUE,ops:[sort.op]}]}}else{groupby=[];summarize=[{field:DataRef.VALUE,get:atype==Aggregate.TYPES.TUPLE?dl.$(fields[0]):dl.identity,ops:[DataRef.MIN,DataRef.MAX],as:[DataRef.MIN,DataRef.MAX]}]}cache.param("groupby",groupby).param("summarize",summarize);return cache._lastUpdate=-1,cache}function dataRef(which,def,scale,group){if(def==null){return[]}if(dl.isArray(def))return def.map(signal.bind(this));var self=this,graph=this._graph,refs=getRefs(def),inherit=inherits(refs),atype=aggrType(def,scale),cache=getCache.apply(this,arguments),sort=def.sort,uniques=isUniques(scale),i,rlen,j,flen,ref,fields,field,data,from,so,cmp;function addDep(s){self.dependency(Deps.SIGNALS,s)}if(inherit||!inherit&&cache._lastUpdate<this._stamp){for(i=0,rlen=refs.length;i<rlen;++i){ref=refs[i];from=ref.data||group.datum._facetID;data=graph.data(from).last();if(data.stamp<=this._stamp)continue;fields=getFields(ref,group);for(j=0,flen=fields.length;j<flen;++j){field=fields[j];if(atype===Aggregate.TYPES.VALUE){cache.accessors(null,field)}else if(atype===Aggregate.TYPES.MULTI){cache.accessors(field,ref.sort||sort.field)}cache.evaluate(data)}this.dependency(Deps.DATA,from);cache.dependency(Deps.SIGNALS).forEach(addDep)}cache._lastUpdate=this._stamp;data=cache.aggr().result();if(uniques){if(dl.isObject(sort)){cmp=(so=sort.order)&&so.signal?graph.signalRef(so.signal):so;cmp=(cmp==DataRef.DESC?"-":"+")+sort.op+"_"+DataRef.VALUE;cmp=dl.comparator(cmp)}else if(sort===true){cmp=dl.comparator(DataRef.GROUPBY)}if(cmp)data=data.sort(cmp);cache._values=data.map(function(d){return d[DataRef.GROUPBY]})}else{data=data[0];cache._values=!dl.isValid(data)?[]:[data[DataRef.MIN],data[DataRef.MAX]]}}return cache._values}function signal(v){if(!v||!v.signal)return v;var s=v.signal,ref;this.dependency(Deps.SIGNALS,(ref=dl.field(s))[0]);return this._graph.signalRef(ref)}function domainMinMax(scale,group){var def=this._def,domain=[null,null],s,z;if(def.domain!==undefined){domain=!dl.isObject(def.domain)?domain:dataRef.call(this,DataRef.DOMAIN,def.domain,scale,group)}z=domain.length-1;if(def.domainMin!==undefined){if(dl.isObject(def.domainMin)){if(def.domainMin.signal){domain[0]=dl.isValid(s=signal.call(this,def.domainMin))?s:domain[0]}else{domain[0]=dataRef.call(this,DataRef.DOMAIN+DataRef.MIN,def.domainMin,scale,group)[0]}}else{domain[0]=def.domainMin}}if(def.domainMax!==undefined){if(dl.isObject(def.domainMax)){if(def.domainMax.signal){domain[z]=dl.isValid(s=signal.call(this,def.domainMax))?s:domain[z]}else{domain[z]=dataRef.call(this,DataRef.DOMAIN+DataRef.MAX,def.domainMax,scale,group)[1]}}else{domain[z]=def.domainMax}}if(def.type!==Types.LOG&&def.type!==Types.TIME&&(def.zero||def.zero===undefined)){domain[0]=Math.min(0,domain[0]);domain[z]=Math.max(0,domain[z])}return domain}function range(group){var def=this._def,config=this._graph.config(),rangeVal=signal.call(this,def.range),rng=[null,null];if(rangeVal!==undefined){if(typeof rangeVal==="string"){if(Properties[rangeVal]){rng=[0,group[rangeVal]]}else if(config.range[rangeVal]){rng=config.range[rangeVal]}else{log.error("Unrecogized range: "+rangeVal);return rng}}else if(dl.isArray(rangeVal)){rng=dl.duplicate(rangeVal).map(signal.bind(this))}else if(dl.isObject(rangeVal)){return null}else{rng=[0,rangeVal]}}if(def.rangeMin!==undefined){rng[0]=def.rangeMin.signal?signal.call(this,def.rangeMin):def.rangeMin}if(def.rangeMax!==undefined){rng[rng.length-1]=def.rangeMax.signal?signal.call(this,def.rangeMax):def.rangeMax}if(def.reverse!==undefined){var rev=signal.call(this,def.reverse);if(dl.isObject(rev)){rev=dl.accessor(rev.field)(group.datum)}if(rev)rng=rng.reverse()}return rng}module.exports=Scale}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../transforms/Aggregate":116,datalib:24,"vega-dataflow":39,"vega-logging":45}],112:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,bound=require("vega-scenegraph").bound,Tuple=require("vega-dataflow").Tuple,Status=require("./Builder").STATUS;function Transition(duration,ease){this.duration=duration||500;this.ease=ease&&d3.ease(ease)||d3.ease("cubic-in-out");this.updates={next:null}}var prototype=Transition.prototype;var skip={text:1,url:1};prototype.interpolate=function(item,values){var key,curr,next,interp,list=null;for(key in values){curr=item[key];next=values[key];if(curr!==next){if(skip[key]||curr===undefined){Tuple.set(item,key,next)}else if(typeof curr==="number"&&!isFinite(curr)){Tuple.set(item,key,next)}else{interp=d3.interpolate(curr,next);interp.property=key;(list||(list=[])).push(interp)}}}if(list===null&&item.status===Status.EXIT){list=[]}if(list!=null){list.item=item;list.ease=item.mark.ease||this.ease;list.next=this.updates.next;this.updates.next=list}return this};prototype.start=function(callback){var t=this,prev=t.updates,curr=prev.next;for(;curr!=null;prev=curr,curr=prev.next){if(curr.item.status===Status.EXIT){curr.item.status=Status.UPDATE;curr.remove=true}}t.callback=callback;d3.timer(function(elapsed){return step.call(t,elapsed)})};function step(elapsed){var list=this.updates,prev=list,curr=prev.next,duration=this.duration,item,delay,f,e,i,n,stop=true;for(;curr!=null;prev=curr,curr=prev.next){item=curr.item;delay=item.delay||0;f=(elapsed-delay)/duration;if(f<0){stop=false;continue}if(f>1)f=1;e=curr.ease(f);for(i=0,n=curr.length;i<n;++i){item[curr[i].property]=curr[i](e)}item.touch();bound.item(item);if(f===1){if(curr.remove){item.status=Status.EXIT;item.remove()}prev.next=curr.next;curr=prev}else{stop=false}}this.callback();return stop}module.exports=Transition}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Builder":108,"vega-dataflow":39,"vega-scenegraph":46}],113:[function(require,module,exports){var dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,parseMark=require("../parse/mark");var TIME="time",UTC="utc",STRING="string",ORDINAL="ordinal",NUMBER="number";function axs(model){var scale,config=model.config(),orient=config.axis.orient,offset=0,titleOffset=config.axis.titleOffset,axisDef={},layer="front",grid=false,title=null,tickMajorSize=config.axis.tickSize,tickMinorSize=config.axis.tickSize,tickEndSize=config.axis.tickSize,tickPadding=config.axis.padding,tickValues=null,tickFormatString=null,tickFormatType=null,tickSubdivide=0,tickCount=config.axis.ticks,gridLineStyle={},tickLabelStyle={},majorTickStyle={},minorTickStyle={},titleStyle={},domainStyle={},m={gridLines:{},majorTicks:{},minorTicks:{},tickLabels:{},domain:{},title:{}};var axis={};function reset(){axisDef.type=null}function ingest(d){return{data:d}}function getTickFormat(){var formatType=tickFormatType||inferFormatType();return getFormatter(formatType,tickFormatString)}function inferFormatType(){switch(scale.type){case TIME:return TIME;case UTC:return UTC;case ORDINAL:return STRING;default:return NUMBER}}function logFilter(domain,count,f){if(count==null)return f;var base=scale.base(),k=Math.min(base,scale.ticks().length/count),v=domain[0]>0?(e=1e-12,Math.ceil):(e=-1e-12,Math.floor),e;function log(x){return(domain[0]<0?-Math.log(x>0?0:-x):Math.log(x<0?0:x))/Math.log(base)}function pow(x){return domain[0]<0?-Math.pow(base,-x):Math.pow(base,x)}return function(d){return pow(v(log(d)+e))/d>=k?f(d):""}}function getFormatter(formatType,str){var fmt=dl.format,log=scale.type==="log",domain,f;switch(formatType){case NUMBER:domain=scale.domain();f=fmt.auto.number(domain,tickCount,str||(log?".1r":null));return log?logFilter(domain,tickCount,f):f;case TIME:return(str?fmt:fmt.auto).time(str);case UTC:return(str?fmt:fmt.auto).utc(str);default:return String}}function getTicks(format){var major=tickValues||(scale.ticks?scale.ticks(tickCount):scale.domain()),minor=axisSubdivide(scale,major,tickSubdivide).map(ingest);major=major.map(function(d){return d=ingest(d),d.label=format(d.data),d});return[major,minor]}axis.def=function(){if(!axisDef.type)axis_def(scale);var ticks=getTicks(getTickFormat());var tdata=title?[title].map(ingest):[];axisDef.marks[0].from=function(){return grid?ticks[0]:[]};axisDef.marks[1].from=function(){return ticks[0]};axisDef.marks[2].from=function(){return ticks[1]};axisDef.marks[3].from=axisDef.marks[1].from;axisDef.marks[4].from=function(){return[1]};axisDef.marks[5].from=function(){return tdata};axisDef.offset=offset;axisDef.orient=orient;axisDef.layer=layer;return axisDef};function axis_def(scale){var newScale,oldScale,range;if(scale.type===ORDINAL){newScale={scale:scale.scaleName,offset:.5+scale.rangeBand()/2};oldScale=newScale}else{newScale={scale:scale.scaleName,offset:.5};oldScale={scale:scale.scaleName+":prev",offset:.5}}range=axisScaleRange(scale);dl.extend(m.gridLines,axisTicks(config));dl.extend(m.majorTicks,axisTicks(config));dl.extend(m.minorTicks,axisTicks(config));dl.extend(m.tickLabels,axisTickLabels(config));dl.extend(m.domain,axisDomain(config));dl.extend(m.title,axisTitle(config));m.gridLines.properties.enter.stroke={value:config.axis.gridColor};m.gridLines.properties.enter.strokeOpacity={value:config.axis.gridOpacity};axisTicksExtend(orient,m.gridLines,oldScale,newScale,Infinity);axisTicksExtend(orient,m.majorTicks,oldScale,newScale,tickMajorSize);axisTicksExtend(orient,m.minorTicks,oldScale,newScale,tickMinorSize);axisLabelExtend(orient,m.tickLabels,oldScale,newScale,tickMajorSize,tickPadding);axisDomainExtend(orient,m.domain,range,tickEndSize);axisTitleExtend(orient,m.title,range,titleOffset);dl.extend(m.gridLines.properties.update,gridLineStyle);dl.extend(m.majorTicks.properties.update,majorTickStyle);dl.extend(m.minorTicks.properties.update,minorTickStyle);dl.extend(m.tickLabels.properties.update,tickLabelStyle);dl.extend(m.domain.properties.update,domainStyle);dl.extend(m.title.properties.update,titleStyle);var marks=[m.gridLines,m.majorTicks,m.minorTicks,m.tickLabels,m.domain,m.title];dl.extend(axisDef,{type:"group",interactive:false,properties:{enter:{encode:axisUpdate,scales:[scale.scaleName],signals:[],data:[]},update:{encode:axisUpdate,scales:[scale.scaleName],signals:[],data:[]}}});axisDef.marks=marks.map(function(m){return parseMark(model,m)})}axis.scale=function(x){if(!arguments.length)return scale;if(scale!==x){scale=x;reset()}return axis};axis.orient=function(x){if(!arguments.length)return orient;if(orient!==x){orient=x in axisOrients?x+"":config.axis.orient;reset()}return axis};axis.title=function(x){if(!arguments.length)return title;if(title!==x){title=x;reset()}return axis};axis.tickCount=function(x){if(!arguments.length)return tickCount;tickCount=x;return axis};axis.tickValues=function(x){if(!arguments.length)return tickValues;tickValues=x;return axis};axis.tickFormat=function(x){if(!arguments.length)return tickFormatString;if(tickFormatString!==x){tickFormatString=x;reset()}return axis};axis.tickFormatType=function(x){if(!arguments.length)return tickFormatType;if(tickFormatType!==x){tickFormatType=x;reset()}return axis};axis.tickSize=function(x,y){if(!arguments.length)return tickMajorSize;var n=arguments.length-1,major=+x,minor=n>1?+y:tickMajorSize,end=n>0?+arguments[n]:tickMajorSize;if(tickMajorSize!==major||tickMinorSize!==minor||tickEndSize!==end){reset()}tickMajorSize=major;tickMinorSize=minor;tickEndSize=end;return axis};axis.tickSubdivide=function(x){if(!arguments.length)return tickSubdivide;tickSubdivide=+x;return axis};axis.offset=function(x){if(!arguments.length)return offset;offset=dl.isObject(x)?x:+x;return axis};axis.tickPadding=function(x){if(!arguments.length)return tickPadding;if(tickPadding!==+x){tickPadding=+x;reset()}return axis};axis.titleOffset=function(x){if(!arguments.length)return titleOffset;if(titleOffset!==+x){titleOffset=+x;reset()}return axis};axis.layer=function(x){if(!arguments.length)return layer;if(layer!==x){layer=x;reset()}return axis};axis.grid=function(x){if(!arguments.length)return grid;if(grid!==x){grid=x;reset()}return axis};axis.gridLineProperties=function(x){if(!arguments.length)return gridLineStyle;if(gridLineStyle!==x){gridLineStyle=x}return axis};axis.majorTickProperties=function(x){if(!arguments.length)return majorTickStyle;if(majorTickStyle!==x){majorTickStyle=x}return axis};axis.minorTickProperties=function(x){if(!arguments.length)return minorTickStyle;if(minorTickStyle!==x){minorTickStyle=x}return axis};axis.tickLabelProperties=function(x){if(!arguments.length)return tickLabelStyle;if(tickLabelStyle!==x){tickLabelStyle=x}return axis};axis.titleProperties=function(x){if(!arguments.length)return titleStyle;if(titleStyle!==x){titleStyle=x}return axis};axis.domainProperties=function(x){if(!arguments.length)return domainStyle;if(domainStyle!==x){domainStyle=x}return axis};axis.reset=function(){reset();return axis};return axis}var axisOrients={top:1,right:1,bottom:1,left:1};function axisSubdivide(scale,ticks,m){var subticks=[];if(m&&ticks.length>1){var extent=axisScaleExtent(scale.domain()),i=-1,n=ticks.length,d=(ticks[1]-ticks[0])/++m,j,v;while(++i<n){for(j=m;--j>0;){if((v=+ticks[i]-j*d)>=extent[0]){subticks.push(v)}}}for(--i,j=0;++j<m&&(v=+ticks[i]+j*d)<extent[1];){subticks.push(v)}}return subticks}function axisScaleExtent(domain){var start=domain[0],stop=domain[domain.length-1];return start<stop?[start,stop]:[stop,start]}function axisScaleRange(scale){return scale.rangeExtent?scale.rangeExtent():axisScaleExtent(scale.range())}var axisAlign={bottom:"center",top:"center",left:"right",right:"left"};var axisBaseline={bottom:"top",top:"bottom",left:"middle",right:"middle"};function axisLabelExtend(orient,labels,oldScale,newScale,size,pad){size=Math.max(size,0)+pad;if(orient==="left"||orient==="top"){size*=-1}if(orient==="top"||orient==="bottom"){dl.extend(labels.properties.enter,{x:oldScale,y:{value:size}});dl.extend(labels.properties.update,{x:newScale,y:{value:size},align:{value:"center"},baseline:{value:axisBaseline[orient]}})}else{dl.extend(labels.properties.enter,{x:{value:size},y:oldScale});dl.extend(labels.properties.update,{x:{value:size},y:newScale,align:{value:axisAlign[orient]},baseline:{value:"middle"}})}}function axisTicksExtend(orient,ticks,oldScale,newScale,size){var sign=orient==="left"||orient==="top"?-1:1;if(size===Infinity){size=orient==="top"||orient==="bottom"?{field:{group:"height",level:2},mult:-sign}:{field:{group:"width",level:2},mult:-sign}}else{size={value:sign*size}}if(orient==="top"||orient==="bottom"){dl.extend(ticks.properties.enter,{x:oldScale,y:{value:0},y2:size});dl.extend(ticks.properties.update,{x:newScale,y:{value:0},y2:size});dl.extend(ticks.properties.exit,{x:newScale})}else{dl.extend(ticks.properties.enter,{x:{value:0},x2:size,y:oldScale});dl.extend(ticks.properties.update,{x:{value:0},x2:size,y:newScale});dl.extend(ticks.properties.exit,{y:newScale})}}function axisTitleExtend(orient,title,range,offset){var mid=~~((range[0]+range[1])/2),sign=orient==="top"||orient==="left"?-1:1;if(orient==="bottom"||orient==="top"){dl.extend(title.properties.update,{x:{value:mid},y:{value:sign*offset},angle:{value:0}})}else{dl.extend(title.properties.update,{x:{value:sign*offset},y:{value:mid},angle:{value:orient==="left"?-90:90}})}}function axisDomainExtend(orient,domain,range,size){var path;if(orient==="top"||orient==="left"){size=-1*size}if(orient==="bottom"||orient==="top"){path="M"+range[0]+","+size+"V0H"+range[1]+"V"+size}else{path="M"+size+","+range[0]+"H0V"+range[1]+"H"+size}domain.properties.update.path={value:path}}function axisUpdate(item,group,trans){var o=trans?{}:item,offset=item.mark.def.offset,orient=item.mark.def.orient,width=group.width,height=group.height;if(dl.isArray(offset)){var ofx=offset[0],ofy=offset[1];switch(orient){case"left":{Tuple.set(o,"x",-ofx);Tuple.set(o,"y",ofy);break}case"right":{Tuple.set(o,"x",width+ofx);Tuple.set(o,"y",ofy);break}case"bottom":{Tuple.set(o,"x",ofx);Tuple.set(o,"y",height+ofy);break}case"top":{Tuple.set(o,"x",ofx);Tuple.set(o,"y",-ofy);break}default:{Tuple.set(o,"x",ofx);Tuple.set(o,"y",ofy)}}}else{if(dl.isObject(offset)){offset=-group.scale(offset.scale)(offset.value)}switch(orient){case"left":{Tuple.set(o,"x",-offset);Tuple.set(o,"y",0);break}case"right":{Tuple.set(o,"x",width+offset);Tuple.set(o,"y",0);break}case"bottom":{Tuple.set(o,"x",0);Tuple.set(o,"y",height+offset);break}case"top":{Tuple.set(o,"x",0);Tuple.set(o,"y",-offset);break}default:{Tuple.set(o,"x",0);Tuple.set(o,"y",0)}}}if(trans)trans.interpolate(item,o);return true}function axisTicks(config){return{type:"rule",interactive:false,key:"data",properties:{enter:{stroke:{value:config.axis.tickColor},strokeWidth:{value:config.axis.tickWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function axisTickLabels(config){return{type:"text",interactive:true,key:"data",properties:{enter:{fill:{value:config.axis.tickLabelColor},font:{value:config.axis.tickLabelFont},fontSize:{value:config.axis.tickLabelFontSize},opacity:{value:1e-6},text:{field:"label"}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function axisTitle(config){return{type:"text",interactive:true,properties:{enter:{font:{value:config.axis.titleFont},fontSize:{value:config.axis.titleFontSize},fontWeight:{value:config.axis.titleFontWeight},fill:{value:config.axis.titleColor},align:{value:"center"},baseline:{value:"middle"},text:{field:"data"}},update:{}}}}function axisDomain(config){return{type:"path",interactive:false,properties:{enter:{x:{value:.5},y:{value:.5},stroke:{value:config.axis.axisColor},strokeWidth:{value:config.axis.axisWidth}},update:{}}}}module.exports=axs},{"../parse/mark":97,datalib:24,"vega-dataflow":39}],114:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),Gradient=require("vega-scenegraph").Gradient,parseProperties=require("../parse/properties"),parseMark=require("../parse/mark");function lgnd(model){var size=null,shape=null,fill=null,stroke=null,spacing=null,values=null,format=null,formatString=null,config=model.config(),title,orient="right",offset=config.legend.offset,padding=config.legend.padding,tickArguments=[5],legendStyle={},symbolStyle={},gradientStyle={},titleStyle={},labelStyle={},m={titles:{},symbols:{},labels:{},gradient:{}};var legend={},legendDef={};function reset(){legendDef.type=null}function ingest(d,i){return{data:d,index:i}}legend.def=function(){var scale=size||shape||fill||stroke;format=!formatString?null:scale.type==="time"?dl.format.time(formatString):dl.format.number(formatString);if(!legendDef.type){legendDef=(scale===fill||scale===stroke)&&!discrete(scale.type)?quantDef(scale):ordinalDef(scale)}legendDef.orient=orient;legendDef.offset=offset;legendDef.padding=padding;return legendDef};function discrete(type){return type==="ordinal"||type==="quantize"||type==="quantile"||type==="threshold"}function ordinalDef(scale){var def=o_legend_def(size,shape,fill,stroke);var data=(values==null?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():values).map(ingest);var fmt=format==null?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):String:format;var fs,range,offset,pad=5,domain=d3.range(data.length);if(size){range=data.map(function(x){return Math.sqrt(size(x.data))});offset=d3.max(range);range=range.reduce(function(a,b,i,z){if(i>0)a[i]=a[i-1]+z[i-1]/2+pad;return a[i]+=b/2,a},[0]).map(Math.round)}else{offset=Math.round(Math.sqrt(config.legend.symbolSize));range=spacing||(fs=labelStyle.fontSize)&&fs.value+pad||config.legend.labelFontSize+pad;range=domain.map(function(d,i){return Math.round(offset/2+i*range)})}var sz=padding,ts;if(title){ts=titleStyle.fontSize;sz+=5+(ts&&ts.value||config.legend.titleFontSize)}for(var i=0,n=range.length;i<n;++i)range[i]+=sz;var scaleSpec={name:"legend",type:"ordinal",points:true,domain:domain,range:range};var tdata=(title?[title]:[]).map(ingest);data.forEach(function(d){d.label=fmt(d.data);d.offset=offset});def.scales=[scaleSpec];def.marks[0].from=function(){return tdata};def.marks[1].from=function(){return data};def.marks[2].from=def.marks[1].from;return def}function o_legend_def(size,shape,fill,stroke){var titles=dl.extend(m.titles,vg_legendTitle(config)),symbols=dl.extend(m.symbols,vg_legendSymbols(config)),labels=dl.extend(m.labels,vg_vLegendLabels(config));vg_legendSymbolExtend(symbols,size,shape,fill,stroke);dl.extend(titles.properties.update,titleStyle);dl.extend(symbols.properties.update,symbolStyle);dl.extend(labels.properties.update,labelStyle);titles.properties.enter.x.value+=padding;titles.properties.enter.y.value+=padding;labels.properties.enter.x.offset+=padding+1;symbols.properties.enter.x.offset=padding+1;labels.properties.update.x.offset+=padding+1;symbols.properties.update.x.offset=padding+1;dl.extend(legendDef,{type:"group",interactive:false,properties:{enter:parseProperties(model,"group",legendStyle),vg_legendPosition:{encode:vg_legendPosition,signals:[],scales:[],data:[],fields:[]}}});legendDef.marks=[titles,symbols,labels].map(function(m){return parseMark(model,m)});return legendDef}function quantDef(scale){var def=q_legend_def(scale),dom=scale.domain(),data=(values==null?scale.ticks?scale.ticks.apply(scale,tickArguments):scale.domain():values).map(ingest),width=gradientStyle.width&&gradientStyle.width.value||config.legend.gradientWidth,fmt=format==null?scale.tickFormat?scale.tickFormat.apply(scale,tickArguments):String:format;var layoutSpec={name:"legend",type:scale.type,round:true,zero:false,domain:[dom[0],dom[dom.length-1]],range:[padding,width+padding]};if(scale.type==="pow")layoutSpec.exponent=scale.exponent();var tdata=(title?[title]:[]).map(ingest);data.forEach(function(d,i){d.label=fmt(d.data);d.align=i==data.length-1?"right":i===0?"left":"center"});def.scales=[layoutSpec];def.marks[0].from=function(){return tdata};def.marks[1].from=function(){return[1]};def.marks[2].from=function(){return data};return def}function q_legend_def(scale){var titles=dl.extend(m.titles,vg_legendTitle(config)),gradient=dl.extend(m.gradient,vg_legendGradient(config)),labels=dl.extend(m.labels,vg_hLegendLabels(config)),grad=new Gradient;var dom=scale.domain(),min=dom[0],max=dom[dom.length-1],f=scale.copy().domain([min,max]).range([0,1]);var stops=scale.type!=="linear"&&scale.ticks?scale.ticks.call(scale,15):dom;if(min!==stops[0])stops.unshift(min);if(max!==stops[stops.length-1])stops.push(max);for(var i=0,n=stops.length;i<n;++i){grad.stop(f(stops[i]),scale(stops[i]))}gradient.properties.enter.fill={value:grad};dl.extend(titles.properties.update,titleStyle);dl.extend(gradient.properties.update,gradientStyle);dl.extend(labels.properties.update,labelStyle);var gp=gradient.properties,gh=gradientStyle.height,hh=gh&&gh.value||gp.enter.height.value;labels.properties.enter.y.value=hh;labels.properties.update.y.value=hh;if(title){var tp=titles.properties,fs=titleStyle.fontSize,sz=4+(fs&&fs.value||tp.enter.fontSize.value);gradient.properties.enter.y.value+=sz;labels.properties.enter.y.value+=sz;gradient.properties.update.y.value+=sz;labels.properties.update.y.value+=sz}titles.properties.enter.x.value+=padding;titles.properties.enter.y.value+=padding;gradient.properties.enter.x.value+=padding;gradient.properties.enter.y.value+=padding;labels.properties.enter.y.value+=padding;gradient.properties.update.x.value+=padding;gradient.properties.update.y.value+=padding;labels.properties.update.y.value+=padding;dl.extend(legendDef,{type:"group",interactive:false,properties:{enter:parseProperties(model,"group",legendStyle),vg_legendPosition:{encode:vg_legendPosition,signals:[],scales:[],data:[],fields:[]}}});legendDef.marks=[titles,gradient,labels].map(function(m){return parseMark(model,m)});return legendDef}legend.size=function(x){if(!arguments.length)return size;if(size!==x){size=x;reset()}return legend};legend.shape=function(x){if(!arguments.length)return shape;if(shape!==x){shape=x;reset()}return legend};legend.fill=function(x){if(!arguments.length)return fill;if(fill!==x){fill=x;reset()}return legend};legend.stroke=function(x){if(!arguments.length)return stroke;if(stroke!==x){stroke=x;reset()}return legend};legend.title=function(x){if(!arguments.length)return title;if(title!==x){title=x;reset()}return legend};legend.format=function(x){if(!arguments.length)return formatString;if(formatString!==x){formatString=x;reset()}return legend};legend.spacing=function(x){if(!arguments.length)return spacing;if(spacing!==+x){spacing=+x;reset()}return legend};legend.orient=function(x){if(!arguments.length)return orient;orient=x in vg_legendOrients?x+"":config.legend.orient;return legend};legend.offset=function(x){if(!arguments.length)return offset;offset=+x;return legend};legend.values=function(x){if(!arguments.length)return values;
values=x;return legend};legend.legendProperties=function(x){if(!arguments.length)return legendStyle;legendStyle=x;return legend};legend.symbolProperties=function(x){if(!arguments.length)return symbolStyle;symbolStyle=x;return legend};legend.gradientProperties=function(x){if(!arguments.length)return gradientStyle;gradientStyle=x;return legend};legend.labelProperties=function(x){if(!arguments.length)return labelStyle;labelStyle=x;return legend};legend.titleProperties=function(x){if(!arguments.length)return titleStyle;titleStyle=x;return legend};legend.reset=function(){reset();return legend};return legend}var vg_legendOrients={right:1,left:1};function vg_legendPosition(item,group,trans,db,signals,predicates){var o=trans?{}:item,gx,offset=item.mark.def.offset,orient=item.mark.def.orient,pad=item.mark.def.padding*2,lw=~~item.bounds.width()+(item.width?0:pad),lh=~~item.bounds.height()+(item.height?0:pad),pos=group._legendPositions||(group._legendPositions={right:.5,left:.5});o.x=.5;o.width=lw;o.y=pos[orient];pos[orient]+=o.height=lh;if(!trans&&group.bounds){group.bounds.delta=group.bounds.x2-group.width}switch(orient){case"left":{gx=group.bounds?group.bounds.x1:0;o.x+=gx-offset-lw;break}case"right":{gx=group.width+(group.bounds&&trans?group.bounds.delta:0);o.x+=gx+offset;break}}if(trans)trans.interpolate(item,o);var enc=item.mark.def.properties.enter.encode;enc.call(enc,item,group,trans,db,signals,predicates);return true}function vg_legendSymbolExtend(mark,size,shape,fill,stroke){var e=mark.properties.enter,u=mark.properties.update;if(size)e.size=u.size={scale:size.scaleName,field:"data"};if(shape)e.shape=u.shape={scale:shape.scaleName,field:"data"};if(fill)e.fill=u.fill={scale:fill.scaleName,field:"data"};if(stroke)e.stroke=u.stroke={scale:stroke.scaleName,field:"data"}}function vg_legendTitle(config){var cfg=config.legend;return{type:"text",interactive:false,key:"data",properties:{enter:{x:{value:0},y:{value:0},fill:{value:cfg.titleColor},font:{value:cfg.titleFont},fontSize:{value:cfg.titleFontSize},fontWeight:{value:cfg.titleFontWeight},baseline:{value:"top"},text:{field:"data"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1}}}}}function vg_legendSymbols(config){var cfg=config.legend;return{type:"symbol",interactive:false,key:"data",properties:{enter:{x:{field:"offset",mult:.5},y:{scale:"legend",field:"index"},shape:{value:cfg.symbolShape},size:{value:cfg.symbolSize},stroke:{value:cfg.symbolColor},strokeWidth:{value:cfg.symbolStrokeWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{field:"offset",mult:.5},y:{scale:"legend",field:"index"},opacity:{value:1}}}}}function vg_vLegendLabels(config){var cfg=config.legend;return{type:"text",interactive:false,key:"data",properties:{enter:{x:{field:"offset",offset:5},y:{scale:"legend",field:"index"},fill:{value:cfg.labelColor},font:{value:cfg.labelFont},fontSize:{value:cfg.labelFontSize},align:{value:cfg.labelAlign},baseline:{value:cfg.labelBaseline},text:{field:"label"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{opacity:{value:1},x:{field:"offset",offset:5},y:{scale:"legend",field:"index"}}}}}function vg_legendGradient(config){var cfg=config.legend;return{type:"rect",interactive:false,properties:{enter:{x:{value:0},y:{value:0},width:{value:cfg.gradientWidth},height:{value:cfg.gradientHeight},stroke:{value:cfg.gradientStrokeColor},strokeWidth:{value:cfg.gradientStrokeWidth},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{value:0},y:{value:0},opacity:{value:1}}}}}function vg_hLegendLabels(config){var cfg=config.legend;return{type:"text",interactive:false,key:"data",properties:{enter:{x:{scale:"legend",field:"data"},y:{value:20},dy:{value:2},fill:{value:cfg.labelColor},font:{value:cfg.labelFont},fontSize:{value:cfg.labelFontSize},align:{field:"align"},baseline:{value:"top"},text:{field:"label"},opacity:{value:1e-6}},exit:{opacity:{value:1e-6}},update:{x:{scale:"legend",field:"data"},y:{value:20},opacity:{value:1}}}}}module.exports=lgnd}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../parse/mark":97,"../parse/properties":102,datalib:24,"vega-scenegraph":46}],115:[function(require,module,exports){module.exports=function visit(node,func){var i,n,s,m,items;if(func(node))return true;var sets=["items","axisItems","legendItems"];for(s=0,m=sets.length;s<m;++s){if(items=node[sets[s]]){for(i=0,n=items.length;i<n;++i){if(visit(items[i],func))return true}}}}},{}],116:[function(require,module,exports){var dl=require("datalib"),df=require("vega-dataflow"),log=require("vega-logging"),ChangeSet=df.ChangeSet,Tuple=df.Tuple,Deps=df.Dependencies,Transform=require("./Transform"),Facetor=require("./Facetor");function Aggregate(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{groupby:{type:"array<field>"},summarize:{type:"custom",set:function(summarize){var signalDeps={},tx=this._transform,i,len,f,fields,name,ops;if(!dl.isArray(fields=summarize)){fields=[];for(name in summarize){ops=dl.array(summarize[name]);fields.push({field:name,ops:ops})}}function sg(x){if(x.signal)signalDeps[x.signal]=1}for(i=0,len=fields.length;i<len;++i){f=fields[i];if(f.field.signal){signalDeps[f.field.signal]=1}dl.array(f.ops).forEach(sg);dl.array(f.as).forEach(sg)}tx._fields=fields;tx._aggr=null;tx.dependency(Deps.SIGNALS,dl.keys(signalDeps));return tx}}});this._aggr=null;this._input=null;this._args=null;this._fields=[];this._out=[];this._type=TYPES.TUPLE;this._acc={groupby:dl.true,value:dl.true};return this.router(true).produces(true)}var prototype=Aggregate.prototype=Object.create(Transform.prototype);prototype.constructor=Aggregate;var TYPES=Aggregate.TYPES={VALUE:1,TUPLE:2,MULTI:3};Aggregate.VALID_OPS=["values","count","valid","missing","distinct","sum","mean","average","variance","variancep","stdev","stdevp","median","q1","q3","modeskew","min","max","argmin","argmax"];prototype.type=function(type){return this._type=type,this};prototype.accessors=function(groupby,value){var acc=this._acc;acc.groupby=dl.$(groupby)||dl.true;acc.value=dl.$(value)||dl.true};prototype.aggr=function(){if(this._aggr)return this._aggr;var g=this._graph,hasGetter=false,args=[],groupby=this.param("groupby").field,value=function(x){return x.signal?g.signalRef(x.signal):x};var fields=this._fields.map(function(f){var field={name:value(f.field),as:dl.array(f.as),ops:dl.array(value(f.ops)).map(value),get:f.get};hasGetter=hasGetter||field.get!=null;args.push(field.name);return field});groupby.forEach(function(g){if(g.get)hasGetter=true;args.push(g.name||g)});this._args=hasGetter||!fields.length?null:args;if(!fields.length)fields={"*":"values"};var aggr=this._aggr=(new Facetor).groupby(groupby).stream(true).summarize(fields);this._out=getFields(aggr);if(this._type!==TYPES.VALUE){aggr.key("_id")}return aggr};function getFields(aggr){var f=[],i,n,j,m,dims,vals,meas;dims=aggr._dims;for(i=0,n=dims.length;i<n;++i){f.push(dims[i].name)}vals=aggr._aggr;for(i=0,n=vals.length;i<n;++i){meas=vals[i].measures.fields;for(j=0,m=meas.length;j<m;++j){f.push(meas[j])}}return f}prototype.transform=function(input,reset){log.debug(input,["aggregate"]);this._input=input;var output=ChangeSet.create(input),aggr=this.aggr(),out=this._out,args=this._args,reeval=true,p=Tuple.prev,add,rem,mod,i;if(reset){output.rem.push.apply(output.rem,aggr.result());aggr.clear();this._aggr=null;aggr=this.aggr()}if(this._type===TYPES.TUPLE){add=function(x){aggr._add(x);Tuple.prev_init(x)};rem=function(x){aggr._rem(p(x))};mod=function(x){aggr._mod(x,p(x))}}else{var gby=this._acc.groupby,val=this._acc.value,get=this._type===TYPES.VALUE?val:function(x){return{_id:x._id,groupby:gby(x),value:val(x)}};add=function(x){aggr._add(get(x));Tuple.prev_init(x)};rem=function(x){aggr._rem(get(p(x)))};mod=function(x){aggr._mod(get(x),get(p(x)))}}input.add.forEach(add);if(reset){input.mod.forEach(add)}else{input.rem.forEach(rem);if(args)for(i=0,reeval=false;i<args.length;++i){if(input.fields[args[i]]){reeval=true;break}}if(reeval)input.mod.forEach(mod)}for(i=0;i<out.length;++i){output.fields[out[i]]=1}return aggr.changes(output)};module.exports=Aggregate},{"./Facetor":122,"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],117:[function(require,module,exports){var Base=require("./Transform").prototype;function BatchTransform(){this._collector=null}var prototype=BatchTransform.prototype=Object.create(Base);prototype.constructor=BatchTransform;prototype.init=function(graph){Base.init.call(this,graph);return this.batch(true)};prototype.transform=function(input){return this.batchTransform(input,this._collector.data())};prototype.batchTransform=function(){};module.exports=BatchTransform},{"./Transform":135}],118:[function(require,module,exports){var bins=require("datalib").bins,Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform");function Bin(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{field:{type:"field"},min:{type:"value"},max:{type:"value"},base:{type:"value","default":10},maxbins:{type:"value","default":20},step:{type:"value"},steps:{type:"value"},minstep:{type:"value"},div:{type:"array<value>","default":[5,2]}});this._output={bin:"bin"};return this.mutates(true)}var prototype=Bin.prototype=Object.create(Transform.prototype);prototype.constructor=Bin;prototype.transform=function(input){log.debug(input,["binning"]);var output=this._output.bin,step=this.param("step"),steps=this.param("steps"),minstep=this.param("minstep"),get=this.param("field").accessor,opt={min:this.param("min"),max:this.param("max"),base:this.param("base"),maxbins:this.param("maxbins"),div:this.param("div")};if(step)opt.step=step;if(steps)opt.steps=steps;if(minstep)opt.minstep=minstep;var b=bins(opt);function update(d){var v=get(d);v=v==null?null:b.start+b.step*~~((v-b.start)/b.step);Tuple.set(d,output,v)}input.add.forEach(update);input.mod.forEach(update);input.rem.forEach(update);input.fields[output]=1;return input};module.exports=Bin},{"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],119:[function(require,module,exports){var df=require("vega-dataflow"),Tuple=df.Tuple,log=require("vega-logging"),Transform=require("./Transform");function CountPattern(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{field:{type:"field","default":"data"},pattern:{type:"value","default":"[\\w']+"},"case":{type:"value","default":"lower"},stopwords:{type:"value","default":""}});this._output={text:"text",count:"count"};return this.router(true).produces(true)}var prototype=CountPattern.prototype=Object.create(Transform.prototype);prototype.constructor=CountPattern;prototype.transform=function(input,reset){log.debug(input,["countpattern"]);var get=this.param("field").accessor,pattern=this.param("pattern"),stop=this.param("stopwords"),rem=false;if(this._stop!==stop){this._stop=stop;this._stop_re=new RegExp("^"+stop+"$","i");reset=true}if(this._pattern!==pattern){this._pattern=pattern;this._match=new RegExp(this._pattern,"g");reset=true}if(reset)this._counts={};function curr(t){return Tuple.prev_init(t),get(t)}function prev(t){return get(Tuple.prev(t))}this._add(input.add,curr);if(!reset)this._rem(input.rem,prev);if(reset||(rem=input.fields[get.field])){if(rem)this._rem(input.mod,prev);this._add(input.mod,curr)}return this._changeset(input)};prototype._changeset=function(input){var counts=this._counts,tuples=this._tuples||(this._tuples={}),change=df.ChangeSet.create(input),out=this._output,w,t,c;for(w in counts){t=tuples[w];c=counts[w]||0;if(!t&&c){tuples[w]=t=Tuple.ingest({});t[out.text]=w;t[out.count]=c;change.add.push(t)}else if(c===0){if(t)change.rem.push(t);delete counts[w];delete tuples[w]}else if(t[out.count]!==c){Tuple.set(t,out.count,c);change.mod.push(t)}}return change};prototype._tokenize=function(text){switch(this.param("case")){case"upper":text=text.toUpperCase();break;case"lower":text=text.toLowerCase();break}return text.match(this._match)};prototype._add=function(tuples,get){var counts=this._counts,stop=this._stop_re,tok,i,j,t;for(j=0;j<tuples.length;++j){tok=this._tokenize(get(tuples[j]));for(i=0;i<tok.length;++i){if(!stop.test(t=tok[i])){counts[t]=1+(counts[t]||0)}}}};prototype._rem=function(tuples,get){var counts=this._counts,stop=this._stop_re,tok,i,j,t;for(j=0;j<tuples.length;++j){tok=this._tokenize(get(tuples[j]));for(i=0;i<tok.length;++i){if(!stop.test(t=tok[i])){counts[t]-=1}}}};module.exports=CountPattern},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],120:[function(require,module,exports){var df=require("vega-dataflow"),ChangeSet=df.ChangeSet,Tuple=df.Tuple,SIGNALS=df.Dependencies.SIGNALS,log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");function Cross(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{"with":{type:"data"},diagonal:{type:"value","default":"true"},filter:{type:"expr"}});this._output={left:"a",right:"b"};this._lastRem=null;this._lastWith=null;this._ids={};this._cache={};return this.router(true).produces(true)}var prototype=Cross.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Cross;function cache(x,t){var c=this._cache[x._id]=this._cache[x._id]||{c:[],s:this._stamp};c.c.push(t)}function add(output,left,data,diag,test,x){var i=0,len=data.length,t={},y,id;for(;i<len;++i){y=data[i];id=left?x._id+"_"+y._id:y._id+"_"+x._id;if(this._ids[id])continue;if(x._id==y._id&&!diag)continue;t[this._output.left]=left?x:y;t[this._output.right]=left?y:x;if(!test||test(t)){output.add.push(t=Tuple.ingest(t));cache.call(this,x,t);cache.call(this,y,t);this._ids[id]=1;t={}}}}function mod(output,left,x){var cross=this,c=this._cache[x._id];if(this._lastRem>c.s){c.c=c.c.filter(function(y){var t=y[cross._output[left?"right":"left"]];return cross._cache[t._id]!==null});c.s=this._lastRem}output.mod.push.apply(output.mod,c.c)}function rem(output,x){output.rem.push.apply(output.rem,this._cache[x._id].c);this._cache[x._id]=null;this._lastRem=this._stamp}function upFields(input,output){if(input.add.length||input.rem.length){output.fields[this._output.left]=1;output.fields[this._output.right]=1}}prototype.batchTransform=function(input,data){log.debug(input,["crossing"]);var w=this.param("with"),f=this.param("filter"),diag=this.param("diagonal"),graph=this._graph,signals=graph.values(SIGNALS,this.dependency(SIGNALS)),test=f?function(x){return f(x,null,signals)}:null,selfCross=!w.name,woutput=selfCross?input:w.source.last(),wdata=selfCross?data:w.source.values(),output=ChangeSet.create(input),r=rem.bind(this,output);input.rem.forEach(r);input.add.forEach(add.bind(this,output,true,wdata,diag,test));if(!selfCross&&woutput.stamp>this._lastWith){woutput.rem.forEach(r);woutput.add.forEach(add.bind(this,output,false,data,diag,test));woutput.mod.forEach(mod.bind(this,output,false));upFields.call(this,woutput,output);this._lastWith=woutput.stamp}input.mod.forEach(mod.bind(this,output,true));upFields.call(this,input,output);return output};module.exports=Cross},{"./BatchTransform":117,"./Transform":135,"vega-dataflow":39,"vega-logging":45}],121:[function(require,module,exports){var Transform=require("./Transform"),Aggregate=require("./Aggregate");function Facet(graph){Transform.addParameters(this,{transform:{type:"custom",set:function(pipeline){return this._transform._pipeline=pipeline,this._transform},get:function(){var parse=require("../parse/transforms"),facet=this._transform;return facet._pipeline.map(function(t){return parse(facet._graph,t)})}}});this._pipeline=[];return Aggregate.call(this,graph)}var prototype=Facet.prototype=Object.create(Aggregate.prototype);prototype.constructor=Facet;prototype.aggr=function(){return Aggregate.prototype.aggr.call(this).facet(this)};module.exports=Facet},{"../parse/transforms":106,"./Aggregate":116,"./Transform":135}],122:[function(require,module,exports){var dl=require("datalib"),Aggregator=dl.Aggregator,Base=Aggregator.prototype,df=require("vega-dataflow"),Tuple=df.Tuple,log=require("vega-logging"),facetID=0;function Facetor(){Aggregator.call(this);this._facet=null;this._facetID=++facetID}var prototype=Facetor.prototype=Object.create(Base);prototype.constructor=Facetor;prototype.facet=function(f){return arguments.length?(this._facet=f,this):this._facet};prototype._ingest=function(t){return Tuple.ingest(t,null)};prototype._assign=Tuple.set;function disconnect_cell(facet){log.debug({},["disconnecting cell",this.tuple._id]);var pipeline=this.ds.pipeline();facet.removeListener(pipeline[0]);facet._graph.removeListener(pipeline[0]);facet._graph.disconnect(pipeline)}prototype._newcell=function(x,key){var cell=Base._newcell.call(this,x,key),facet=this._facet;if(facet){var graph=facet._graph,tuple=cell.tuple,pipeline=facet.param("transform");cell.ds=graph.data(tuple._facetID,pipeline,tuple);cell.disconnect=disconnect_cell;facet.addListener(pipeline[0])}return cell};prototype._newtuple=function(x,key){var t=Base._newtuple.call(this,x);if(this._facet){Tuple.set(t,"key",key);Tuple.set(t,"_facetID",this._facetID+"_"+key)}return t};prototype.clear=function(){if(this._facet){for(var k in this._cells){this._cells[k].disconnect(this._facet)}}return Base.clear.call(this)};prototype._on_add=function(x,cell){if(this._facet)cell.ds._input.add.push(x)};prototype._on_rem=function(x,cell){if(this._facet)cell.ds._input.rem.push(x)};prototype._on_mod=function(x,prev,cell0,cell1){if(this._facet){if(cell0===cell1){cell0.ds._input.mod.push(x)}else{cell0.ds._input.rem.push(x);cell1.ds._input.add.push(x)}}};prototype._on_drop=function(cell){if(this._facet)cell.disconnect(this._facet)};prototype._on_keep=function(cell){if(this._facet)df.ChangeSet.copy(this._input,cell.ds._input)};module.exports=Facetor},{datalib:24,"vega-dataflow":39,"vega-logging":45}],123:[function(require,module,exports){var df=require("vega-dataflow"),SIGNALS=df.Dependencies.SIGNALS,log=require("vega-logging"),Transform=require("./Transform");function Filter(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{test:{type:"expr"}});this._skip={};return this.router(true)}var prototype=Filter.prototype=Object.create(Transform.prototype);prototype.constructor=Filter;prototype.transform=function(input){log.debug(input,["filtering"]);var output=df.ChangeSet.create(input),graph=this._graph,skip=this._skip,test=this.param("test"),signals=graph.values(SIGNALS,this.dependency(SIGNALS));input.rem.forEach(function(x){if(skip[x._id]!==1)output.rem.push(x);else skip[x._id]=0});input.add.forEach(function(x){if(test(x,null,signals))output.add.push(x);else skip[x._id]=1});input.mod.forEach(function(x){var b=test(x,null,signals),s=skip[x._id]===1;if(b&&s){skip[x._id]=0;output.add.push(x)}else if(b&&!s){output.mod.push(x)}else if(!b&&s){}else{output.rem.push(x);skip[x._id]=1}});return output};module.exports=Filter},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],124:[function(require,module,exports){var df=require("vega-dataflow"),Tuple=df.Tuple,log=require("vega-logging"),Transform=require("./Transform");function Fold(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{fields:{type:"array<field>"}});this._output={key:"key",value:"value"};this._cache={};return this.router(true).produces(true)}var prototype=Fold.prototype=Object.create(Transform.prototype);prototype.constructor=Fold;prototype._reset=function(input,output){for(var id in this._cache){output.rem.push.apply(output.rem,this._cache[id])}this._cache={}};prototype._tuple=function(x,i,len){var list=this._cache[x._id]||(this._cache[x._id]=Array(len));return list[i]?Tuple.rederive(x,list[i]):list[i]=Tuple.derive(x)};prototype._fn=function(data,on,out){var i,j,n,m,d,t;for(i=0,n=data.length;i<n;++i){d=data[i];for(j=0,m=on.field.length;j<m;++j){t=this._tuple(d,j,m);Tuple.set(t,this._output.key,on.field[j]);Tuple.set(t,this._output.value,on.accessor[j](d));out.push(t)}}};prototype.transform=function(input,reset){log.debug(input,["folding"]);var fold=this,on=this.param("fields"),output=df.ChangeSet.create(input);if(reset)this._reset(input,output);this._fn(input.add,on,output.add);this._fn(input.mod,on,reset?output.add:output.mod);input.rem.forEach(function(x){output.rem.push.apply(output.rem,fold._cache[x._id]);fold._cache[x._id]=null});if(input.add.length||input.rem.length||on.field.some(function(f){return!!input.fields[f]})){output.fields[this._output.key]=1;output.fields[this._output.value]=1}return output};module.exports=Fold},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],125:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,df=require("vega-dataflow"),Tuple=df.Tuple,ChangeSet=df.ChangeSet,log=require("vega-logging"),Transform=require("./Transform");function Force(graph){Transform.prototype.init.call(this,graph);this._prev=null;this._interactive=false;this._setup=true;this._nodes=[];this._links=[];this._layout=d3.layout.force();Transform.addParameters(this,{size:{type:"array<value>","default":[500,500]},bound:{type:"value","default":true},links:{type:"data"},linkStrength:{type:"value","default":1},linkDistance:{type:"value","default":20},charge:{type:"value","default":-30},chargeDistance:{type:"value","default":Infinity},friction:{type:"value","default":.9},theta:{type:"value","default":.8},gravity:{type:"value","default":.1},alpha:{type:"value","default":.1},iterations:{type:"value","default":500},interactive:{type:"value","default":this._interactive},active:{type:"value","default":this._prev},fixed:{type:"data"}});this._output={x:"layout_x",y:"layout_y"};return this.mutates(true)}var prototype=Force.prototype=Object.create(Transform.prototype);prototype.constructor=Force;prototype.transform=function(nodeInput,reset){log.debug(nodeInput,["force"]);reset=reset-(nodeInput.signals.active?1:0);var interactive=this.param("interactive"),linkSource=this.param("links").source,linkInput=linkSource.last(),active=this.param("active"),output=this._output,layout=this._layout,nodes=this._nodes,links=this._links;if(linkInput.stamp<nodeInput.stamp)linkInput=null;this.configure(nodeInput,linkInput,interactive,reset);if(!interactive){var iterations=this.param("iterations");for(var i=0;i<iterations;++i)layout.tick();layout.stop()}this.update(active);if(reset||active!==this._prev&&active&&active.update){layout.alpha(this.param("alpha"))}if(active!==this._prev){this._prev=active}if(nodeInput.rem.length){layout.nodes(this._nodes=Tuple.idFilter(nodes,nodeInput.rem))}if(linkInput&&linkInput.rem.length){layout.links(this._links=Tuple.idFilter(links,linkInput.rem))}nodeInput.fields[output.x]=1;nodeInput.fields[output.y]=1;return nodeInput};prototype.configure=function(nodeInput,linkInput,interactive,reset){var layout=this._layout,update=this._setup||nodeInput.add.length||linkInput&&linkInput.add.length||interactive!==this._interactive||this.param("charge")!==layout.charge()||this.param("linkStrength")!==layout.linkStrength()||this.param("linkDistance")!==layout.linkDistance();if(update||reset){layout.size(this.param("size")).chargeDistance(this.param("chargeDistance")).theta(this.param("theta")).gravity(this.param("gravity")).friction(this.param("friction"))}if(!update)return;this._setup=false;this._interactive=interactive;var force=this,graph=this._graph,nodes=this._nodes,links=this._links,a,i;for(a=nodeInput.add,i=0;i<a.length;++i){nodes.push({tuple:a[i]})}if(linkInput)for(a=linkInput.add,i=0;i<a.length;++i){links.push({tuple:a[i],source:nodes[a[i].source],target:nodes[a[i].target]})}var tickHandler=!interactive?null:function(){graph.propagate(ChangeSet.create(null,true),force)};layout.linkStrength(this.param("linkStrength")).linkDistance(this.param("linkDistance")).charge(this.param("charge")).nodes(nodes).links(links).on("tick",tickHandler).start().alpha(this.param("alpha"))};prototype.update=function(active){var output=this._output,bound=this.param("bound"),fixed=this.param("fixed"),size=this.param("size"),nodes=this._nodes,lut={},id,i,n,t,x,y;if(fixed&&fixed.source){fixed=fixed.source.values();for(i=0,n=fixed.length;i<n;++i){lut[fixed[i].id]=1}}for(i=0;i<nodes.length;++i){n=nodes[i];t=n.tuple;id=t._id;if(active&&active.id===id){n.fixed=1;if(active.update){n.x=n.px=active.x;n.y=n.py=active.y}}else{n.fixed=lut[id]||0}x=bound?Math.max(0,Math.min(n.x,size[0])):n.x;y=bound?Math.max(0,Math.min(n.y,size[1])):n.y;Tuple.set(t,output.x,x);Tuple.set(t,output.y,y)}};module.exports=Force}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],126:[function(require,module,exports){var df=require("vega-dataflow"),Tuple=df.Tuple,SIGNALS=df.Dependencies.SIGNALS,log=require("vega-logging"),Transform=require("./Transform");function Formula(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{field:{type:"value"},expr:{type:"expr"}});return this.mutates(true)}var prototype=Formula.prototype=Object.create(Transform.prototype);prototype.constructor=Formula;prototype.transform=function(input){log.debug(input,["formulating"]);var g=this._graph,field=this.param("field"),expr=this.param("expr"),signals=g.values(SIGNALS,this.dependency(SIGNALS));function set(x){Tuple.set(x,field,expr(x,null,signals))}input.add.forEach(set);if(this.reevaluate(input)){input.mod.forEach(set)}input.fields[field]=1;return input};module.exports=Formula},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],127:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform");function Geo(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,Geo.Parameters);Transform.addParameters(this,{lon:{type:"field"},lat:{type:"field"}});this._output={x:"layout_x",y:"layout_y"};return this.mutates(true)}Geo.Parameters={projection:{type:"value","default":"mercator"},center:{type:"array<value>"},translate:{type:"array<value>"},rotate:{type:"array<value>"},scale:{type:"value"},precision:{type:"value"},clipAngle:{type:"value"},clipExtent:{type:"value"}};Geo.d3Projection=function(){var p=this.param("projection"),param=Geo.Parameters,proj,name,value;if(p!==this._mode){this._mode=p;this._projection=d3.geo[p]()}proj=this._projection;for(name in param){if(name==="projection"||!proj[name])continue;value=this.param(name);if(value===undefined||dl.isArray(value)&&value.length===0){continue}if(value!==proj[name]()){proj[name](value)}}return proj};var prototype=Geo.prototype=Object.create(Transform.prototype);prototype.constructor=Geo;prototype.transform=function(input){log.debug(input,["geo"]);var output=this._output,lon=this.param("lon").accessor,lat=this.param("lat").accessor,proj=Geo.d3Projection.call(this);function set(t){var ll=[lon(t),lat(t)];var xy=proj(ll)||[null,null];Tuple.set(t,output.x,xy[0]);Tuple.set(t,output.y,xy[1])}input.add.forEach(set);if(this.reevaluate(input)){input.mod.forEach(set);input.rem.forEach(set)}input.fields[output.x]=1;input.fields[output.y]=1;return input};module.exports=Geo}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],128:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Geo=require("./Geo"),Transform=require("./Transform");function GeoPath(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,Geo.Parameters);Transform.addParameters(this,{field:{type:"field","default":null}});this._output={path:"layout_path"};return this.mutates(true)}var prototype=GeoPath.prototype=Object.create(Transform.prototype);prototype.constructor=GeoPath;prototype.transform=function(input){log.debug(input,["geopath"]);var output=this._output,geojson=this.param("field").accessor||dl.identity,proj=Geo.d3Projection.call(this),path=d3.geo.path().projection(proj);function set(t){Tuple.set(t,output.path,path(geojson(t)))}input.add.forEach(set);if(this.reevaluate(input)){input.mod.forEach(set);input.rem.forEach(set)}input.fields[output.path]=1;return input};module.exports=GeoPath}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./Geo":127,"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],129:[function(require,module,exports){var Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform");function LinkPath(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{sourceX:{type:"field","default":"_source.layout_x"},sourceY:{type:"field","default":"_source.layout_y"},targetX:{type:"field","default":"_target.layout_x"},targetY:{type:"field","default":"_target.layout_y"},tension:{type:"value","default":.2},shape:{type:"value","default":"line"}});this._output={path:"layout_path"};return this.mutates(true)}var prototype=LinkPath.prototype=Object.create(Transform.prototype);prototype.constructor=LinkPath;function line(sx,sy,tx,ty){return"M"+sx+","+sy+"L"+tx+","+ty}function curve(sx,sy,tx,ty,tension){var dx=tx-sx,dy=ty-sy,ix=tension*(dx+dy),iy=tension*(dy-dx);return"M"+sx+","+sy+"C"+(sx+ix)+","+(sy+iy)+" "+(tx+iy)+","+(ty-ix)+" "+tx+","+ty}function diagonalX(sx,sy,tx,ty){var m=(sx+tx)/2;return"M"+sx+","+sy+"C"+m+","+sy+" "+m+","+ty+" "+tx+","+ty}function diagonalY(sx,sy,tx,ty){var m=(sy+ty)/2;return"M"+sx+","+sy+"C"+sx+","+m+" "+tx+","+m+" "+tx+","+ty}var shapes={line:line,curve:curve,diagonal:diagonalX,diagonalX:diagonalX,diagonalY:diagonalY};prototype.transform=function(input){log.debug(input,["linkpath"]);var output=this._output,shape=shapes[this.param("shape")]||shapes.line,sourceX=this.param("sourceX").accessor,sourceY=this.param("sourceY").accessor,targetX=this.param("targetX").accessor,targetY=this.param("targetY").accessor,tension=this.param("tension");function set(t){var path=shape(sourceX(t),sourceY(t),targetX(t),targetY(t),tension);Tuple.set(t,output.path,path)}input.add.forEach(set);if(this.reevaluate(input)){input.mod.forEach(set);input.rem.forEach(set)}input.fields[output.path]=1;return input};module.exports=LinkPath},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],130:[function(require,module,exports){var Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform");function Lookup(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{on:{type:"data"},onKey:{type:"field","default":null},as:{type:"array<value>"},keys:{type:"array<field>","default":["data"]},"default":{type:"value"}});return this.mutates(true)}var prototype=Lookup.prototype=Object.create(Transform.prototype);prototype.constructor=Lookup;prototype.transform=function(input,reset){log.debug(input,["lookup"]);var on=this.param("on"),onLast=on.source.last(),onData=on.source.values(),onKey=this.param("onKey"),onF=onKey.field,keys=this.param("keys"),get=keys.accessor,as=this.param("as"),defaultValue=this.param("default"),lut=this._lut,i,v;if(lut==null||this._on!==onF||onF&&onLast.fields[onF]||onLast.add.length||onLast.rem.length){if(onF){onKey=onKey.accessor;for(lut={},i=0;i<onData.length;++i){lut[onKey(v=onData[i])]=v}}else{lut=onData}this._lut=lut;this._on=onF;reset=true}function set(t){for(var i=0;i<get.length;++i){var v=lut[get[i](t)]||defaultValue;Tuple.set(t,as[i],v)}}input.add.forEach(set);var run=keys.field.some(function(f){return input.fields[f]});if(run||reset){input.mod.forEach(set);input.rem.forEach(set)}as.forEach(function(k){input.fields[k]=1
});return input};module.exports=Lookup},{"./Transform":135,"vega-dataflow":39,"vega-logging":45}],131:[function(require,module,exports){var dl=require("datalib"),Deps=require("vega-dataflow").Dependencies,expr=require("../parse/expr");var arrayType=/array/i,dataType=/data/i,fieldType=/field/i,exprType=/expr/i,valType=/value/i;function Parameter(name,type,transform){this._name=name;this._type=type;this._transform=transform;this._value=[];this._accessors=[];this._resolution=false;this._signals={}}var prototype=Parameter.prototype;function get(){var isArray=arrayType.test(this._type),isData=dataType.test(this._type),isField=fieldType.test(this._type);var val=isArray?this._value:this._value[0],acc=isArray?this._accessors:this._accessors[0];if(!dl.isValid(acc)&&valType.test(this._type)){return val}else{return isData?{name:val,source:acc}:isField?{field:val,accessor:acc}:val}}prototype.get=function(){var graph=this._transform._graph,isData=dataType.test(this._type),isField=fieldType.test(this._type),s,idx,val;if(!this._resolution)return get.call(this);if(isData){this._accessors=this._value.map(function(v){return graph.data(v)});return get.call(this)}for(s in this._signals){idx=this._signals[s];val=graph.signalRef(s);if(isField){this._accessors[idx]=this._value[idx]!=val?dl.accessor(val):this._accessors[idx]}this._value[idx]=val}return get.call(this)};prototype.set=function(value){var p=this,isExpr=exprType.test(this._type),isData=dataType.test(this._type),isField=fieldType.test(this._type);this._value=dl.array(value).map(function(v,i){if(dl.isString(v)){if(isExpr){var e=expr(v);p._transform.dependency(Deps.FIELDS,e.fields);p._transform.dependency(Deps.SIGNALS,e.globals);return e.fn}else if(isField){p._accessors[i]=dl.accessor(v);p._transform.dependency(Deps.FIELDS,dl.field(v))}else if(isData){p._resolution=true;p._transform.dependency(Deps.DATA,v)}return v}else if(v.value!==undefined){return v.value}else if(v.field!==undefined){p._accessors[i]=dl.accessor(v.field);p._transform.dependency(Deps.FIELDS,dl.field(v.field));return v.field}else if(v.signal!==undefined){p._resolution=true;p._signals[v.signal]=i;p._transform.dependency(Deps.SIGNALS,v.signal);return v.signal}return v});return p._transform};module.exports=Parameter},{"../parse/expr":94,datalib:24,"vega-dataflow":39}],132:[function(require,module,exports){var dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");function Pie(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{field:{type:"field","default":null},startAngle:{type:"value","default":0},endAngle:{type:"value","default":2*Math.PI},sort:{type:"value","default":false}});this._output={start:"layout_start",end:"layout_end",mid:"layout_mid"};return this.mutates(true)}var prototype=Pie.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Pie;function ones(){return 1}prototype.batchTransform=function(input,data){log.debug(input,["pie"]);var output=this._output,field=this.param("field").accessor||ones,start=this.param("startAngle"),stop=this.param("endAngle"),sort=this.param("sort");var values=data.map(field),a=start,k=(stop-start)/dl.sum(values),index=dl.range(data.length),i,t,v;if(sort){index.sort(function(a,b){return values[a]-values[b]})}for(i=0;i<index.length;++i){t=data[index[i]];v=values[index[i]];Tuple.set(t,output.start,a);Tuple.set(t,output.mid,a+.5*v*k);Tuple.set(t,output.end,a+=v*k)}input.fields[output.start]=1;input.fields[output.end]=1;input.fields[output.mid]=1;return input};module.exports=Pie},{"./BatchTransform":117,"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],133:[function(require,module,exports){var dl=require("datalib"),log=require("vega-logging"),Transform=require("./Transform");function Sort(graph){Transform.prototype.init.call(this,graph);Transform.addParameters(this,{by:{type:"array<field>"}});this.router(true)}var prototype=Sort.prototype=Object.create(Transform.prototype);prototype.constructor=Sort;prototype.transform=function(input){log.debug(input,["sorting"]);if(input.add.length||input.mod.length||input.rem.length){input.sort=dl.comparator(this.param("by").field)}return input};module.exports=Sort},{"./Transform":135,datalib:24,"vega-logging":45}],134:[function(require,module,exports){var dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");function Stack(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{groupby:{type:"array<field>"},sortby:{type:"array<field>"},field:{type:"field"},offset:{type:"value","default":"zero"}});this._output={start:"layout_start",end:"layout_end",mid:"layout_mid"};return this.mutates(true)}var prototype=Stack.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Stack;prototype.batchTransform=function(input,data){log.debug(input,["stacking"]);var groupby=this.param("groupby").accessor,sortby=dl.comparator(this.param("sortby").field),field=this.param("field").accessor,offset=this.param("offset"),output=this._output;var groups=partition(data,groupby,sortby,field);for(var i=0,max=groups.max;i<groups.length;++i){var group=groups[i],sum=group.sum,off=offset==="center"?(max-sum)/2:0,scale=offset==="normalize"?1/sum:1,j,x,a,b=off,v=0;for(j=0;j<group.length;++j){x=group[j];a=b;v+=field(x);b=scale*v+off;Tuple.set(x,output.start,a);Tuple.set(x,output.end,b);Tuple.set(x,output.mid,.5*(a+b))}}input.fields[output.start]=1;input.fields[output.end]=1;input.fields[output.mid]=1;return input};function partition(data,groupby,sortby,field){var groups=[],get=function(f){return f(x)},map,i,x,k,g,s,max;if(groupby==null){groups.push(data.slice())}else{for(map={},i=0;i<data.length;++i){x=data[i];k=groupby.map(get);g=map[k]||(groups.push(map[k]=[]),map[k]);g.push(x)}}for(k=0,max=0;k<groups.length;++k){g=groups[k];for(i=0,s=0;i<g.length;++i){s+=field(g[i])}g.sum=s;if(s>max)max=s;if(sortby!=null)g.sort(sortby)}groups.max=max;return groups}module.exports=Stack},{"./BatchTransform":117,"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],135:[function(require,module,exports){var df=require("vega-dataflow"),Base=df.Node.prototype,Deps=df.Dependencies,Parameter=require("./Parameter");function Transform(graph){if(graph)Base.init.call(this,graph)}Transform.addParameters=function(proto,params){proto._parameters=proto._parameters||{};for(var name in params){var p=params[name],param=new Parameter(name,p.type,proto);proto._parameters[name]=param;if(p.type==="custom"){if(p.set)param.set=p.set.bind(param);if(p.get)param.get=p.get.bind(param)}if(p.hasOwnProperty("default"))param.set(p.default)}};var prototype=Transform.prototype=Object.create(Base);prototype.constructor=Transform;prototype.param=function(name,value){var param=this._parameters[name];return param===undefined?this:arguments.length===1?param.get():param.set(value)};prototype.transform=function(input){return input};prototype.evaluate=function(input){var reset=this._stamp<input.stamp&&this.dependency(Deps.SIGNALS).reduce(function(c,s){return c+=input.signals[s]?1:0},0);return this.transform(input,reset)};prototype.output=function(map){for(var key in this._output){if(map[key]!==undefined){this._output[key]=map[key]}}return this};module.exports=Transform},{"./Parameter":131,"vega-dataflow":39}],136:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,dl=require("datalib"),Tuple=require("vega-dataflow").Tuple,log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");var defaultRatio=.5*(1+Math.sqrt(5));function Treemap(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{sort:{type:"array<field>","default":["-value"]},children:{type:"field","default":"children"},field:{type:"field","default":"value"},size:{type:"array<value>","default":[500,500]},round:{type:"value","default":true},sticky:{type:"value","default":false},ratio:{type:"value","default":defaultRatio},padding:{type:"value","default":null},mode:{type:"value","default":"squarify"}});this._layout=d3.layout.treemap();this._output={x:"layout_x",y:"layout_y",width:"layout_width",height:"layout_height",depth:"layout_depth"};return this.mutates(true)}var prototype=Treemap.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Treemap;prototype.batchTransform=function(input,data){log.debug(input,["treemap"]);var layout=this._layout,output=this._output;layout.sort(dl.comparator(this.param("sort").field)).children(this.param("children").accessor).value(this.param("field").accessor).size(this.param("size")).round(this.param("round")).sticky(this.param("sticky")).ratio(this.param("ratio")).padding(this.param("padding")).mode(this.param("mode")).nodes(data[0]);data.forEach(function(n){Tuple.set(n,output.x,n.x);Tuple.set(n,output.y,n.y);Tuple.set(n,output.width,n.dx);Tuple.set(n,output.height,n.dy);Tuple.set(n,output.depth,n.depth)});input.fields[output.x]=1;input.fields[output.y]=1;input.fields[output.width]=1;input.fields[output.height]=1;return input};module.exports=Treemap}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./BatchTransform":117,"./Transform":135,datalib:24,"vega-dataflow":39,"vega-logging":45}],137:[function(require,module,exports){(function(global){var d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,Tuple=require("vega-dataflow/src/Tuple"),log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");function Voronoi(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{clipExtent:{type:"array<value>","default":[[-1e5,-1e5],[1e5,1e5]]},x:{type:"field","default":"layout_x"},y:{type:"field","default":"layout_y"}});this._layout=d3.geom.voronoi();this._output={path:"layout_path"};return this.mutates(true)}var prototype=Voronoi.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Voronoi;prototype.batchTransform=function(input,data){log.debug(input,["voronoi"]);var pathname=this._output.path;var polygons=this._layout.clipExtent(this.param("clipExtent")).x(this.param("x").accessor).y(this.param("y").accessor)(data);for(var i=0;i<data.length;++i){Tuple.set(data[i],pathname,"M"+polygons[i].join("L")+"Z")}input.fields[pathname]=1;return input};module.exports=Voronoi}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./BatchTransform":117,"./Transform":135,"vega-dataflow/src/Tuple":38,"vega-logging":45}],138:[function(require,module,exports){(function(global){var dl=require("datalib"),d3=typeof window!=="undefined"?window["d3"]:typeof global!=="undefined"?global["d3"]:null,d3_cloud=typeof window!=="undefined"?window["d3"]["layout"]["cloud"]:typeof global!=="undefined"?global["d3"]["layout"]["cloud"]:null,Tuple=require("vega-dataflow/src/Tuple"),log=require("vega-logging"),Transform=require("./Transform"),BatchTransform=require("./BatchTransform");function Wordcloud(graph){BatchTransform.prototype.init.call(this,graph);Transform.addParameters(this,{size:{type:"array<value>","default":[900,500]},text:{type:"field","default":"data"},rotate:{type:"field|value","default":0},font:{type:"field|value","default":{value:"sans-serif"}},fontSize:{type:"field|value","default":14},fontStyle:{type:"field|value","default":{value:"normal"}},fontWeight:{type:"field|value","default":{value:"normal"}},fontScale:{type:"array<value>","default":[10,50]},padding:{type:"value","default":1},spiral:{type:"value","default":"archimedean"}});this._layout=d3_cloud();this._output={x:"layout_x",y:"layout_y",font:"layout_font",fontSize:"layout_fontSize",fontStyle:"layout_fontStyle",fontWeight:"layout_fontWeight",rotate:"layout_rotate"};return this.mutates(true)}var prototype=Wordcloud.prototype=Object.create(BatchTransform.prototype);prototype.constructor=Wordcloud;function get(p){return p&&p.accessor||p}function wrap(tuple){var x=Object.create(tuple);x._tuple=tuple;return x}prototype.batchTransform=function(input,data){log.debug(input,["wordcloud"]);var layout=this._layout,output=this._output,fontSize=this.param("fontSize"),range=fontSize.accessor&&this.param("fontScale"),size,scale;fontSize=fontSize.accessor||d3.functor(fontSize);if(range.length){scale=d3.scale.sqrt().domain(dl.extent(data,size=fontSize)).range(range);fontSize=function(x){return scale(size(x))}}layout.size(this.param("size")).text(get(this.param("text"))).padding(this.param("padding")).spiral(this.param("spiral")).rotate(get(this.param("rotate"))).font(get(this.param("font"))).fontStyle(get(this.param("fontStyle"))).fontWeight(get(this.param("fontWeight"))).fontSize(fontSize).words(data.map(wrap)).on("end",function(words){var size=layout.size(),dx=size[0]>>1,dy=size[1]>>1,w,t,i,len;for(i=0,len=words.length;i<len;++i){w=words[i];t=w._tuple;Tuple.set(t,output.x,w.x+dx);Tuple.set(t,output.y,w.y+dy);Tuple.set(t,output.font,w.font);Tuple.set(t,output.fontSize,w.size);Tuple.set(t,output.fontStyle,w.style);Tuple.set(t,output.fontWeight,w.weight);Tuple.set(t,output.rotate,w.rotate)}}).start();for(var key in output)input.fields[output[key]]=1;return input};module.exports=Wordcloud}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./BatchTransform":117,"./Transform":135,datalib:24,"vega-dataflow/src/Tuple":38,"vega-logging":45}],139:[function(require,module,exports){module.exports={aggregate:require("./Aggregate"),bin:require("./Bin"),cross:require("./Cross"),countpattern:require("./CountPattern"),linkpath:require("./LinkPath"),facet:require("./Facet"),filter:require("./Filter"),fold:require("./Fold"),force:require("./Force"),formula:require("./Formula"),geo:require("./Geo"),geopath:require("./GeoPath"),lookup:require("./Lookup"),pie:require("./Pie"),sort:require("./Sort"),stack:require("./Stack"),treemap:require("./Treemap"),voronoi:require("./Voronoi"),wordcloud:require("./Wordcloud")}},{"./Aggregate":116,"./Bin":118,"./CountPattern":119,"./Cross":120,"./Facet":121,"./Filter":123,"./Fold":124,"./Force":125,"./Formula":126,"./Geo":127,"./GeoPath":128,"./LinkPath":129,"./Lookup":130,"./Pie":132,"./Sort":133,"./Stack":134,"./Treemap":136,"./Voronoi":137,"./Wordcloud":138}]},{},[1])(1)});